master/master.h
changeset 1500 ed1a733efbc5
parent 1489 f77a1182b6f4
child 1513 60ca68d853b8
equal deleted inserted replaced
1499:5461fce4a2ea 1500:ed1a733efbc5
   143                                       slave configuration. */
   143                                       slave configuration. */
   144 
   144 
   145     struct list_head datagram_queue; /**< Datagram queue. */
   145     struct list_head datagram_queue; /**< Datagram queue. */
   146     uint8_t datagram_index; /**< Current datagram index. */
   146     uint8_t datagram_index; /**< Current datagram index. */
   147 
   147 
       
   148     struct list_head ext_datagram_queue; /**< Queue for non-application
       
   149                                            datagrams. */
       
   150     struct semaphore ext_queue_sem; /**< Semaphore protecting the \a
       
   151                                       ext_datagram_queue. */
       
   152 
   148     struct list_head domains; /**< List of domains. */
   153     struct list_head domains; /**< List of domains. */
   149 
   154 
   150     unsigned int debug_level; /**< Master debug level. */
   155     unsigned int debug_level; /**< Master debug level. */
   151     ec_stats_t stats; /**< Cyclic statistics. */
   156     ec_stats_t stats; /**< Cyclic statistics. */
   152     unsigned int frames_timed_out; /**< There were frame timeouts in the last
   157     unsigned int frames_timed_out; /**< There were frame timeouts in the last
   158     struct task_struct *eoe_thread; /**< EoE thread. */
   163     struct task_struct *eoe_thread; /**< EoE thread. */
   159     struct list_head eoe_handlers; /**< Ethernet over EtherCAT handlers. */
   164     struct list_head eoe_handlers; /**< Ethernet over EtherCAT handlers. */
   160 #endif
   165 #endif
   161 
   166 
   162     struct semaphore io_sem; /**< Semaphore used in \a IDLE phase. */
   167     struct semaphore io_sem; /**< Semaphore used in \a IDLE phase. */
   163     int (*request_cb)(void *); /**< Lock request callback. */
   168 
   164     void (*release_cb)(void *); /**< Lock release callback. */
   169     void (*send_cb)(ec_master_t *); /**< Current send datagrams callback. */
   165     void *cb_data; /**< Data parameter of locking callbacks. */
   170     void (*receive_cb)(ec_master_t *); /**< Current receive datagrams callback. */
   166     int (*ext_request_cb)(void *); /**< External lock request callback. */
   171     void (*app_send_cb)(ec_master_t *); /**< Application's send datagrams
   167     void (*ext_release_cb)(void *); /**< External lock release callback. */
   172                                           callback. */
   168     void *ext_cb_data; /**< Data parameter of external locking callbacks. */
   173     void (*app_receive_cb)(ec_master_t *); /**< Application's receive datagrams
       
   174                                       callback. */
   169 
   175 
   170     struct list_head sii_requests; /**< SII write requests. */
   176     struct list_head sii_requests; /**< SII write requests. */
   171     wait_queue_head_t sii_queue; /**< Wait queue for SII
   177     wait_queue_head_t sii_queue; /**< Wait queue for SII
   172                                       write requests from user space. */
   178                                       write requests from user space. */
   173 
   179 
   206 #endif
   212 #endif
   207 
   213 
   208 // datagram IO
   214 // datagram IO
   209 void ec_master_receive_datagrams(ec_master_t *, const uint8_t *, size_t);
   215 void ec_master_receive_datagrams(ec_master_t *, const uint8_t *, size_t);
   210 void ec_master_queue_datagram(ec_master_t *, ec_datagram_t *);
   216 void ec_master_queue_datagram(ec_master_t *, ec_datagram_t *);
       
   217 void ec_master_queue_datagram_ext(ec_master_t *, ec_datagram_t *);
   211 
   218 
   212 // misc.
   219 // misc.
   213 void ec_master_attach_slave_configs(ec_master_t *);
   220 void ec_master_attach_slave_configs(ec_master_t *);
   214 ec_slave_t *ec_master_find_slave(ec_master_t *, uint16_t, uint16_t);
   221 ec_slave_t *ec_master_find_slave(ec_master_t *, uint16_t, uint16_t);
   215 const ec_slave_t *ec_master_find_slave_const(const ec_master_t *, uint16_t,
   222 const ec_slave_t *ec_master_find_slave_const(const ec_master_t *, uint16_t,
   238 ec_slave_config_t *ecrt_master_slave_config_err(ec_master_t *, uint16_t,
   245 ec_slave_config_t *ecrt_master_slave_config_err(ec_master_t *, uint16_t,
   239         uint16_t, uint32_t, uint32_t);
   246         uint16_t, uint32_t, uint32_t);
   240 
   247 
   241 void ec_master_calc_dc(ec_master_t *);
   248 void ec_master_calc_dc(ec_master_t *);
   242 
   249 
   243 /*****************************************************************************/
   250 void ec_master_internal_send_cb(ec_master_t *);
   244 
   251 void ec_master_internal_receive_cb(ec_master_t *);
   245 #endif
   252 
       
   253 /*****************************************************************************/
       
   254 
       
   255 #endif