114 struct work_struct freerun_work; /**< free run work object */ |
114 struct work_struct freerun_work; /**< free run work object */ |
115 ec_fsm_t fsm; /**< master state machine */ |
115 ec_fsm_t fsm; /**< master state machine */ |
116 ec_master_mode_t mode; /**< master mode */ |
116 ec_master_mode_t mode; /**< master mode */ |
117 |
117 |
118 struct timer_list eoe_timer; /** EoE timer object */ |
118 struct timer_list eoe_timer; /** EoE timer object */ |
119 struct list_head eoe_slaves; /**< Ethernet-over-EtherCAT slaves */ |
119 unsigned int eoe_running; /**< non-zero, if EoE processing is active. */ |
|
120 struct list_head eoe_handlers; /**< Ethernet-over-EtherCAT handlers */ |
|
121 spinlock_t internal_lock; /**< spinlock used in freerun mode */ |
120 int (*request_cb)(void *); /**< lock request callback */ |
122 int (*request_cb)(void *); /**< lock request callback */ |
121 void (*release_cb)(void *); /**< lock release callback */ |
123 void (*release_cb)(void *); /**< lock release callback */ |
122 void *cb_data; /**< data parameter of locking callbacks */ |
124 void *cb_data; /**< data parameter of locking callbacks */ |
123 }; |
125 }; |
124 |
126 |
125 /*****************************************************************************/ |
127 /*****************************************************************************/ |
126 |
128 |
127 // master creation and deletion |
129 // master creation and deletion |
128 int ec_master_init(ec_master_t *, unsigned int); |
130 int ec_master_init(ec_master_t *, unsigned int, unsigned int); |
129 void ec_master_clear(struct kobject *); |
131 void ec_master_clear(struct kobject *); |
130 void ec_master_reset(ec_master_t *); |
132 void ec_master_reset(ec_master_t *); |
131 |
133 |
132 // free run |
134 // free run |
133 void ec_master_freerun_start(ec_master_t *); |
135 void ec_master_freerun_start(ec_master_t *); |
134 void ec_master_freerun_stop(ec_master_t *); |
136 void ec_master_freerun_stop(ec_master_t *); |
|
137 |
|
138 // EoE |
|
139 void ec_master_eoe_start(ec_master_t *); |
|
140 void ec_master_eoe_stop(ec_master_t *); |
135 |
141 |
136 // IO |
142 // IO |
137 void ec_master_receive(ec_master_t *, const uint8_t *, size_t); |
143 void ec_master_receive(ec_master_t *, const uint8_t *, size_t); |
138 void ec_master_queue_command(ec_master_t *, ec_command_t *); |
144 void ec_master_queue_command(ec_master_t *, ec_command_t *); |
139 int ec_master_simple_io(ec_master_t *, ec_command_t *); |
145 int ec_master_simple_io(ec_master_t *, ec_command_t *); |
141 // slave management |
147 // slave management |
142 int ec_master_bus_scan(ec_master_t *); |
148 int ec_master_bus_scan(ec_master_t *); |
143 |
149 |
144 // misc. |
150 // misc. |
145 void ec_master_clear_slaves(ec_master_t *); |
151 void ec_master_clear_slaves(ec_master_t *); |
|
152 void ec_sync_config(const ec_sync_t *, uint8_t *); |
|
153 void ec_eeprom_sync_config(const ec_eeprom_sync_t *, uint8_t *); |
|
154 void ec_fmmu_config(const ec_fmmu_t *, uint8_t *); |
146 void ec_master_output_stats(ec_master_t *); |
155 void ec_master_output_stats(ec_master_t *); |
147 |
156 |
148 /*****************************************************************************/ |
157 /*****************************************************************************/ |
149 |
158 |
150 #endif |
159 #endif |