73 |
73 |
74 typedef struct |
74 typedef struct |
75 { |
75 { |
76 unsigned int timeouts; /**< datagram timeouts */ |
76 unsigned int timeouts; /**< datagram timeouts */ |
77 unsigned int corrupted; /**< corrupted frames */ |
77 unsigned int corrupted; /**< corrupted frames */ |
78 unsigned int skipped; /**< skipped datagrams (the ones that were |
|
79 requeued when not yet received) */ |
|
80 unsigned int unmatched; /**< unmatched datagrams (received, but not |
78 unsigned int unmatched; /**< unmatched datagrams (received, but not |
81 queued any longer) */ |
79 queued any longer) */ |
82 unsigned long output_jiffies; /**< time of last output */ |
80 unsigned long output_jiffies; /**< time of last output */ |
83 } |
81 } |
84 ec_stats_t; |
82 ec_stats_t; |
143 int thread_id; /**< master thread PID */ |
141 int thread_id; /**< master thread PID */ |
144 struct completion thread_exit; /**< thread completion object */ |
142 struct completion thread_exit; /**< thread completion object */ |
145 uint32_t idle_cycle_times[HZ]; /**< Idle cycle times ring */ |
143 uint32_t idle_cycle_times[HZ]; /**< Idle cycle times ring */ |
146 unsigned int idle_cycle_time_pos; /**< time ring buffer position */ |
144 unsigned int idle_cycle_time_pos; /**< time ring buffer position */ |
147 |
145 |
|
146 #ifdef EC_EOE |
148 struct timer_list eoe_timer; /**< EoE timer object */ |
147 struct timer_list eoe_timer; /**< EoE timer object */ |
149 unsigned int eoe_running; /**< non-zero, if EoE processing is active. */ |
148 unsigned int eoe_running; /**< non-zero, if EoE processing is active. */ |
150 struct list_head eoe_handlers; /**< Ethernet-over-EtherCAT handlers */ |
149 struct list_head eoe_handlers; /**< Ethernet-over-EtherCAT handlers */ |
151 uint32_t eoe_cycle_times[HZ]; /**< EoE cycle times ring */ |
150 uint32_t eoe_cycle_times[HZ]; /**< EoE cycle times ring */ |
152 unsigned int eoe_cycle_time_pos; /**< time ring buffer position */ |
151 unsigned int eoe_cycle_time_pos; /**< time ring buffer position */ |
|
152 #endif |
153 |
153 |
154 spinlock_t internal_lock; /**< spinlock used in idle mode */ |
154 spinlock_t internal_lock; /**< spinlock used in idle mode */ |
155 int (*request_cb)(void *); /**< lock request callback */ |
155 int (*request_cb)(void *); /**< lock request callback */ |
156 void (*release_cb)(void *); /**< lock release callback */ |
156 void (*release_cb)(void *); /**< lock release callback */ |
157 void *cb_data; /**< data parameter of locking callbacks */ |
157 void *cb_data; /**< data parameter of locking callbacks */ |
183 int ec_master_enter_idle_mode(ec_master_t *); |
183 int ec_master_enter_idle_mode(ec_master_t *); |
184 void ec_master_leave_idle_mode(ec_master_t *); |
184 void ec_master_leave_idle_mode(ec_master_t *); |
185 int ec_master_enter_operation_mode(ec_master_t *); |
185 int ec_master_enter_operation_mode(ec_master_t *); |
186 void ec_master_leave_operation_mode(ec_master_t *); |
186 void ec_master_leave_operation_mode(ec_master_t *); |
187 |
187 |
|
188 #ifdef EC_EOE |
188 // EoE |
189 // EoE |
189 void ec_master_eoe_start(ec_master_t *); |
190 void ec_master_eoe_start(ec_master_t *); |
190 void ec_master_eoe_stop(ec_master_t *); |
191 void ec_master_eoe_stop(ec_master_t *); |
|
192 #endif |
191 |
193 |
192 // datagram IO |
194 // datagram IO |
193 void ec_master_receive_datagrams(ec_master_t *, const uint8_t *, size_t); |
195 void ec_master_receive_datagrams(ec_master_t *, const uint8_t *, size_t); |
194 void ec_master_queue_datagram(ec_master_t *, ec_datagram_t *); |
196 void ec_master_queue_datagram(ec_master_t *, ec_datagram_t *); |
195 |
197 |
196 // misc. |
198 // misc. |
197 void ec_master_output_stats(ec_master_t *); |
199 void ec_master_output_stats(ec_master_t *); |
|
200 #ifdef EC_EOE |
198 void ec_master_clear_eoe_handlers(ec_master_t *); |
201 void ec_master_clear_eoe_handlers(ec_master_t *); |
|
202 #endif |
199 void ec_master_destroy_slaves(ec_master_t *); |
203 void ec_master_destroy_slaves(ec_master_t *); |
200 |
204 |
201 /*****************************************************************************/ |
205 /*****************************************************************************/ |
202 |
206 |
203 #endif |
207 #endif |