35 #include <linux/sysfs.h> |
35 #include <linux/sysfs.h> |
36 #include <linux/timer.h> |
36 #include <linux/timer.h> |
37 |
37 |
38 #include "device.h" |
38 #include "device.h" |
39 #include "domain.h" |
39 #include "domain.h" |
|
40 #include "fsm.h" |
40 |
41 |
41 /*****************************************************************************/ |
42 /*****************************************************************************/ |
42 |
43 |
43 // Uncomment this to do EoE within a kernel timer. Otherwise, it will be |
44 // Uncomment this to do EoE within a kernel timer. Otherwise, it will be |
44 // done in a working queue. |
45 // done in a working queue. |
92 ec_device_t *device; /**< EtherCAT device */ |
93 ec_device_t *device; /**< EtherCAT device */ |
93 struct list_head command_queue; /**< command queue */ |
94 struct list_head command_queue; /**< command queue */ |
94 uint8_t command_index; /**< current command index */ |
95 uint8_t command_index; /**< current command index */ |
95 struct list_head domains; /**< list of domains */ |
96 struct list_head domains; /**< list of domains */ |
96 ec_command_t simple_command; /**< command structure for initialization */ |
97 ec_command_t simple_command; /**< command structure for initialization */ |
97 ec_command_t watch_command; /**< command for watching the slaves */ |
|
98 unsigned int slaves_responding; /**< number of responding slaves */ |
|
99 ec_slave_state_t slave_states; /**< states of the responding slaves */ |
|
100 int debug_level; /**< master debug level */ |
98 int debug_level; /**< master debug level */ |
101 ec_stats_t stats; /**< cyclic statistics */ |
99 ec_stats_t stats; /**< cyclic statistics */ |
102 unsigned int timeout; /**< timeout in synchronous IO */ |
100 unsigned int timeout; /**< timeout in synchronous IO */ |
103 struct list_head eoe_slaves; /**< Ethernet-over-EtherCAT slaves */ |
101 struct list_head eoe_slaves; /**< Ethernet-over-EtherCAT slaves */ |
104 unsigned int reserved; /**< true, if the master is reserved for RT */ |
102 unsigned int reserved; /**< true, if the master is reserved for RT */ |
105 struct workqueue_struct *workqueue; /**< master workqueue */ |
103 struct workqueue_struct *workqueue; /**< master workqueue */ |
106 struct work_struct freerun_work; /**< free run work object */ |
104 struct work_struct freerun_work; /**< free run work object */ |
107 void (*freerun_state)(ec_master_t *); /**< freerun state function */ |
105 ec_fsm_t fsm; /**< master state machine */ |
108 ec_slave_t *freerun_slave; /**< current slave in bus scan */ |
|
109 ec_master_mode_t mode; /**< master mode */ |
106 ec_master_mode_t mode; /**< master mode */ |
110 int (*request_cb)(void *); /**< lock request callback */ |
107 int (*request_cb)(void *); /**< lock request callback */ |
111 void (*release_cb)(void *); /**< lock release callback */ |
108 void (*release_cb)(void *); /**< lock release callback */ |
112 void *cb_data; /**< data parameter of locking callbacks */ |
109 void *cb_data; /**< data parameter of locking callbacks */ |
113 #ifdef EOE_TIMER |
110 #ifdef EOE_TIMER |