equal
deleted
inserted
replaced
1 /****************************************************************************** |
1 /****************************************************************************** |
2 * |
2 * |
3 * $Id$ |
3 * $Id$ |
4 * |
4 * |
5 * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH |
5 * Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH |
6 * |
6 * |
7 * This file is part of the IgH EtherCAT Master. |
7 * This file is part of the IgH EtherCAT Master. |
8 * |
8 * |
9 * The IgH EtherCAT Master is free software; you can redistribute it and/or |
9 * The IgH EtherCAT Master is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU General Public License version 2, as |
10 * modify it under the terms of the GNU General Public License version 2, as |
94 |
94 |
95 // Application interface |
95 // Application interface |
96 #define EC_IOCTL_REQUEST EC_IO(0x1e) |
96 #define EC_IOCTL_REQUEST EC_IO(0x1e) |
97 #define EC_IOCTL_CREATE_DOMAIN EC_IO(0x1f) |
97 #define EC_IOCTL_CREATE_DOMAIN EC_IO(0x1f) |
98 #define EC_IOCTL_CREATE_SLAVE_CONFIG EC_IOWR(0x20, ec_ioctl_config_t) |
98 #define EC_IOCTL_CREATE_SLAVE_CONFIG EC_IOWR(0x20, ec_ioctl_config_t) |
99 #define EC_IOCTL_ACTIVATE EC_IOR(0x21, size_t) |
99 #define EC_IOCTL_ACTIVATE EC_IOR(0x21, ec_ioctl_master_activate_t) |
100 #define EC_IOCTL_DEACTIVATE EC_IO(0x22) |
100 #define EC_IOCTL_DEACTIVATE EC_IO(0x22) |
101 #define EC_IOCTL_SEND EC_IO(0x23) |
101 #define EC_IOCTL_SEND EC_IO(0x23) |
102 #define EC_IOCTL_RECEIVE EC_IO(0x24) |
102 #define EC_IOCTL_RECEIVE EC_IO(0x24) |
103 #define EC_IOCTL_MASTER_STATE EC_IOR(0x25, ec_master_state_t) |
103 #define EC_IOCTL_MASTER_STATE EC_IOR(0x25, ec_master_state_t) |
104 #define EC_IOCTL_MASTER_LINK_STATE EC_IOWR(0x26, ec_ioctl_link_state_t) |
104 #define EC_IOCTL_MASTER_LINK_STATE EC_IOWR(0x26, ec_ioctl_link_state_t) |
572 #endif |
572 #endif |
573 |
573 |
574 /*****************************************************************************/ |
574 /*****************************************************************************/ |
575 |
575 |
576 typedef struct { |
576 typedef struct { |
|
577 // outputs |
|
578 void *process_data; |
|
579 size_t process_data_size; |
|
580 } ec_ioctl_master_activate_t; |
|
581 |
|
582 /*****************************************************************************/ |
|
583 |
|
584 typedef struct { |
577 // inputs |
585 // inputs |
578 uint32_t config_index; |
586 uint32_t config_index; |
579 uint16_t pdo_index; |
587 uint16_t pdo_index; |
580 uint16_t entry_index; |
588 uint16_t entry_index; |
581 uint8_t entry_subindex; |
589 uint8_t entry_subindex; |
687 uint64_t app_time; |
695 uint64_t app_time; |
688 } ec_ioctl_app_time_t; |
696 } ec_ioctl_app_time_t; |
689 |
697 |
690 /*****************************************************************************/ |
698 /*****************************************************************************/ |
691 |
699 |
|
700 #ifdef __KERNEL__ |
|
701 |
|
702 /** Context data structure for file handles. |
|
703 */ |
|
704 typedef struct { |
|
705 unsigned int writable; /**< Device was opened with write permission. */ |
|
706 unsigned int requested; /**< Master was requested via this file handle. */ |
|
707 uint8_t *process_data; /**< Total process data area. */ |
|
708 size_t process_data_size; /**< Size of the \a process_data. */ |
|
709 } ec_ioctl_context_t; |
|
710 |
|
711 long ec_ioctl(ec_master_t *, ec_ioctl_context_t *, unsigned int, |
|
712 void __user *); |
|
713 |
|
714 #ifdef EC_RTDM |
|
715 |
|
716 long ec_ioctl_rtdm(ec_master_t *, ec_ioctl_context_t *, unsigned int, |
|
717 void __user *); |
|
718 int ec_rtdm_mmap(ec_ioctl_context_t *, void **); |
|
719 |
|
720 #endif |
|
721 |
|
722 #endif |
|
723 |
|
724 /*****************************************************************************/ |
|
725 |
692 /** \endcond */ |
726 /** \endcond */ |
693 |
727 |
694 #endif |
728 #endif |