102 struct list_head datagram_queue; /**< datagram queue */ |
102 struct list_head datagram_queue; /**< datagram queue */ |
103 uint8_t datagram_index; /**< current datagram index */ |
103 uint8_t datagram_index; /**< current datagram index */ |
104 |
104 |
105 struct list_head domains; /**< list of domains */ |
105 struct list_head domains; /**< list of domains */ |
106 |
106 |
107 ec_datagram_t simple_datagram; /**< datagram structure for initialization */ |
|
108 unsigned int timeout; /**< timeout in synchronous IO */ |
|
109 |
|
110 int debug_level; /**< master debug level */ |
107 int debug_level; /**< master debug level */ |
111 ec_stats_t stats; /**< cyclic statistics */ |
108 ec_stats_t stats; /**< cyclic statistics */ |
112 |
109 |
113 struct workqueue_struct *workqueue; /**< master workqueue */ |
110 struct workqueue_struct *workqueue; /**< master workqueue */ |
114 struct work_struct freerun_work; /**< free run work object */ |
111 struct work_struct idle_work; /**< free run work object */ |
115 ec_fsm_t fsm; /**< master state machine */ |
112 ec_fsm_t fsm; /**< master state machine */ |
116 ec_master_mode_t mode; /**< master mode */ |
113 ec_master_mode_t mode; /**< master mode */ |
117 |
114 |
118 struct timer_list eoe_timer; /**< EoE timer object */ |
115 struct timer_list eoe_timer; /**< EoE timer object */ |
119 unsigned int eoe_running; /**< non-zero, if EoE processing is active. */ |
116 unsigned int eoe_running; /**< non-zero, if EoE processing is active. */ |
120 struct list_head eoe_handlers; /**< Ethernet-over-EtherCAT handlers */ |
117 struct list_head eoe_handlers; /**< Ethernet-over-EtherCAT handlers */ |
121 spinlock_t internal_lock; /**< spinlock used in freerun mode */ |
118 spinlock_t internal_lock; /**< spinlock used in idle mode */ |
122 int (*request_cb)(void *); /**< lock request callback */ |
119 int (*request_cb)(void *); /**< lock request callback */ |
123 void (*release_cb)(void *); /**< lock release callback */ |
120 void (*release_cb)(void *); /**< lock release callback */ |
124 void *cb_data; /**< data parameter of locking callbacks */ |
121 void *cb_data; /**< data parameter of locking callbacks */ |
125 |
122 |
126 uint8_t eeprom_write_enable; /**< allow write operations to EEPROMs */ |
123 uint8_t eeprom_write_enable; /**< allow write operations to EEPROMs */ |
132 int ec_master_init(ec_master_t *, unsigned int, unsigned int); |
129 int ec_master_init(ec_master_t *, unsigned int, unsigned int); |
133 void ec_master_clear(struct kobject *); |
130 void ec_master_clear(struct kobject *); |
134 void ec_master_reset(ec_master_t *); |
131 void ec_master_reset(ec_master_t *); |
135 |
132 |
136 // free run |
133 // free run |
137 void ec_master_freerun_start(ec_master_t *); |
134 void ec_master_idle_start(ec_master_t *); |
138 void ec_master_freerun_stop(ec_master_t *); |
135 void ec_master_idle_stop(ec_master_t *); |
139 |
136 |
140 // EoE |
137 // EoE |
141 void ec_master_eoe_start(ec_master_t *); |
138 void ec_master_eoe_start(ec_master_t *); |
142 void ec_master_eoe_stop(ec_master_t *); |
139 void ec_master_eoe_stop(ec_master_t *); |
143 |
140 |
144 // IO |
141 // IO |
145 void ec_master_receive(ec_master_t *, const uint8_t *, size_t); |
142 void ec_master_receive(ec_master_t *, const uint8_t *, size_t); |
146 void ec_master_queue_datagram(ec_master_t *, ec_datagram_t *); |
143 void ec_master_queue_datagram(ec_master_t *, ec_datagram_t *); |
147 int ec_master_simple_io(ec_master_t *, ec_datagram_t *); |
|
148 |
144 |
149 // slave management |
145 // slave management |
150 int ec_master_bus_scan(ec_master_t *); |
146 int ec_master_bus_scan(ec_master_t *); |
151 |
147 |
152 // misc. |
148 // misc. |
|
149 void ec_master_output_stats(ec_master_t *); |
153 void ec_master_clear_slaves(ec_master_t *); |
150 void ec_master_clear_slaves(ec_master_t *); |
154 void ec_sync_config(const ec_sync_t *, const ec_slave_t *, uint8_t *); |
151 |
155 void ec_eeprom_sync_config(const ec_eeprom_sync_t *, uint8_t *); |
152 // other methods |
|
153 void ec_sync_config(const ec_sii_sync_t *, const ec_slave_t *, uint8_t *); |
156 void ec_fmmu_config(const ec_fmmu_t *, const ec_slave_t *, uint8_t *); |
154 void ec_fmmu_config(const ec_fmmu_t *, const ec_slave_t *, uint8_t *); |
157 void ec_master_output_stats(ec_master_t *); |
155 void ec_master_calc_addressing(ec_master_t *); |
158 |
156 |
159 /*****************************************************************************/ |
157 /*****************************************************************************/ |
160 |
158 |
161 #endif |
159 #endif |