106 struct semaphore device_sem; /**< Device semaphore. */ |
106 struct semaphore device_sem; /**< Device semaphore. */ |
107 |
107 |
108 ec_fsm_master_t fsm; /**< Master state machine. */ |
108 ec_fsm_master_t fsm; /**< Master state machine. */ |
109 ec_datagram_t fsm_datagram; /**< Datagram used for state machines. */ |
109 ec_datagram_t fsm_datagram; /**< Datagram used for state machines. */ |
110 ec_master_phase_t phase; /**< Master phase. */ |
110 ec_master_phase_t phase; /**< Master phase. */ |
|
111 unsigned int active; /**< Master has been activated. */ |
111 unsigned int injection_seq_fsm; /**< Datagram injection sequence number |
112 unsigned int injection_seq_fsm; /**< Datagram injection sequence number |
112 for the FSM side. */ |
113 for the FSM side. */ |
113 unsigned int injection_seq_rt; /**< Datagram injection sequence number |
114 unsigned int injection_seq_rt; /**< Datagram injection sequence number |
114 for the realtime side. */ |
115 for the realtime side. */ |
115 |
116 |
123 u8 has_start_time; /**< Start time already taken. */ |
124 u8 has_start_time; /**< Start time already taken. */ |
124 ec_datagram_t ref_sync_datagram; /**< Datagram used for synchronizing the |
125 ec_datagram_t ref_sync_datagram; /**< Datagram used for synchronizing the |
125 reference clock to the master clock. */ |
126 reference clock to the master clock. */ |
126 ec_datagram_t sync_datagram; /**< Datagram used for DC drift |
127 ec_datagram_t sync_datagram; /**< Datagram used for DC drift |
127 compensation. */ |
128 compensation. */ |
|
129 ec_datagram_t sync_mon_datagram; /**< Datagram used for DC synchronisation |
|
130 monitoring. */ |
128 ec_slave_t *dc_ref_clock; /**< DC reference clock slave. */ |
131 ec_slave_t *dc_ref_clock; /**< DC reference clock slave. */ |
129 |
132 |
130 unsigned int scan_busy; /**< Current scan state. */ |
133 unsigned int scan_busy; /**< Current scan state. */ |
131 unsigned int allow_scan; /**< \a True, if slave scanning is allowed. */ |
134 unsigned int allow_scan; /**< \a True, if slave scanning is allowed. */ |
132 struct semaphore scan_sem; /**< Semaphore protecting the \a scan_busy |
135 struct semaphore scan_sem; /**< Semaphore protecting the \a scan_busy |
164 struct list_head eoe_handlers; /**< Ethernet over EtherCAT handlers. */ |
167 struct list_head eoe_handlers; /**< Ethernet over EtherCAT handlers. */ |
165 #endif |
168 #endif |
166 |
169 |
167 struct semaphore io_sem; /**< Semaphore used in \a IDLE phase. */ |
170 struct semaphore io_sem; /**< Semaphore used in \a IDLE phase. */ |
168 |
171 |
169 void (*send_cb)(ec_master_t *); /**< Current send datagrams callback. */ |
172 void (*send_cb)(void *); /**< Current send datagrams callback. */ |
170 void (*receive_cb)(ec_master_t *); /**< Current receive datagrams callback. */ |
173 void (*receive_cb)(void *); /**< Current receive datagrams callback. */ |
171 void (*app_send_cb)(ec_master_t *); /**< Application's send datagrams |
174 void *cb_data; /**< Current callback data. */ |
|
175 void (*app_send_cb)(void *); /**< Application's send datagrams |
172 callback. */ |
176 callback. */ |
173 void (*app_receive_cb)(ec_master_t *); /**< Application's receive datagrams |
177 void (*app_receive_cb)(void *); /**< Application's receive datagrams |
174 callback. */ |
178 callback. */ |
|
179 void *app_cb_data; /**< Application callback data. */ |
175 |
180 |
176 struct list_head sii_requests; /**< SII write requests. */ |
181 struct list_head sii_requests; /**< SII write requests. */ |
177 wait_queue_head_t sii_queue; /**< Wait queue for SII |
182 wait_queue_head_t sii_queue; /**< Wait queue for SII |
178 write requests from user space. */ |
183 write requests from user space. */ |
179 |
184 |
234 const ec_master_t *, unsigned int); |
239 const ec_master_t *, unsigned int); |
235 unsigned int ec_master_domain_count(const ec_master_t *); |
240 unsigned int ec_master_domain_count(const ec_master_t *); |
236 ec_domain_t *ec_master_find_domain(ec_master_t *, unsigned int); |
241 ec_domain_t *ec_master_find_domain(ec_master_t *, unsigned int); |
237 const ec_domain_t *ec_master_find_domain_const(const ec_master_t *, |
242 const ec_domain_t *ec_master_find_domain_const(const ec_master_t *, |
238 unsigned int); |
243 unsigned int); |
|
244 #ifdef EC_EOE |
239 uint16_t ec_master_eoe_handler_count(const ec_master_t *); |
245 uint16_t ec_master_eoe_handler_count(const ec_master_t *); |
240 const ec_eoe_t *ec_master_get_eoe_handler_const(const ec_master_t *, uint16_t); |
246 const ec_eoe_t *ec_master_get_eoe_handler_const(const ec_master_t *, uint16_t); |
|
247 #endif |
241 |
248 |
242 int ec_master_debug_level(ec_master_t *, unsigned int); |
249 int ec_master_debug_level(ec_master_t *, unsigned int); |
243 |
250 |
244 ec_domain_t *ecrt_master_create_domain_err(ec_master_t *); |
251 ec_domain_t *ecrt_master_create_domain_err(ec_master_t *); |
245 ec_slave_config_t *ecrt_master_slave_config_err(ec_master_t *, uint16_t, |
252 ec_slave_config_t *ecrt_master_slave_config_err(ec_master_t *, uint16_t, |
246 uint16_t, uint32_t, uint32_t); |
253 uint16_t, uint32_t, uint32_t); |
247 |
254 |
248 void ec_master_calc_dc(ec_master_t *); |
255 void ec_master_calc_dc(ec_master_t *); |
249 |
256 |
250 void ec_master_internal_send_cb(ec_master_t *); |
257 void ec_master_internal_send_cb(void *); |
251 void ec_master_internal_receive_cb(ec_master_t *); |
258 void ec_master_internal_receive_cb(void *); |
252 |
259 |
253 /*****************************************************************************/ |
260 /*****************************************************************************/ |
254 |
261 |
255 #endif |
262 #endif |