master/master.h
changeset 715 f12ff7c08623
parent 664 18c48cb7de06
child 719 03d5b96632fb
equal deleted inserted replaced
714:898f87414af1 715:f12ff7c08623
   143     int thread_id; /**< master thread PID */
   143     int thread_id; /**< master thread PID */
   144     struct completion thread_exit; /**< thread completion object */
   144     struct completion thread_exit; /**< thread completion object */
   145     uint32_t idle_cycle_times[HZ]; /**< Idle cycle times ring */
   145     uint32_t idle_cycle_times[HZ]; /**< Idle cycle times ring */
   146     unsigned int idle_cycle_time_pos; /**< time ring buffer position */
   146     unsigned int idle_cycle_time_pos; /**< time ring buffer position */
   147 
   147 
       
   148 #ifdef EC_EOE
   148     struct timer_list eoe_timer; /**< EoE timer object */
   149     struct timer_list eoe_timer; /**< EoE timer object */
   149     unsigned int eoe_running; /**< non-zero, if EoE processing is active. */
   150     unsigned int eoe_running; /**< non-zero, if EoE processing is active. */
   150     struct list_head eoe_handlers; /**< Ethernet-over-EtherCAT handlers */
   151     struct list_head eoe_handlers; /**< Ethernet-over-EtherCAT handlers */
   151     uint32_t eoe_cycle_times[HZ]; /**< EoE cycle times ring */
   152     uint32_t eoe_cycle_times[HZ]; /**< EoE cycle times ring */
   152     unsigned int eoe_cycle_time_pos; /**< time ring buffer position */
   153     unsigned int eoe_cycle_time_pos; /**< time ring buffer position */
       
   154 #endif
   153 
   155 
   154     spinlock_t internal_lock; /**< spinlock used in idle mode */
   156     spinlock_t internal_lock; /**< spinlock used in idle mode */
   155     int (*request_cb)(void *); /**< lock request callback */
   157     int (*request_cb)(void *); /**< lock request callback */
   156     void (*release_cb)(void *); /**< lock release callback */
   158     void (*release_cb)(void *); /**< lock release callback */
   157     void *cb_data; /**< data parameter of locking callbacks */
   159     void *cb_data; /**< data parameter of locking callbacks */
   183 int ec_master_enter_idle_mode(ec_master_t *);
   185 int ec_master_enter_idle_mode(ec_master_t *);
   184 void ec_master_leave_idle_mode(ec_master_t *);
   186 void ec_master_leave_idle_mode(ec_master_t *);
   185 int ec_master_enter_operation_mode(ec_master_t *);
   187 int ec_master_enter_operation_mode(ec_master_t *);
   186 void ec_master_leave_operation_mode(ec_master_t *);
   188 void ec_master_leave_operation_mode(ec_master_t *);
   187 
   189 
       
   190 #ifdef EC_EOE
   188 // EoE
   191 // EoE
   189 void ec_master_eoe_start(ec_master_t *);
   192 void ec_master_eoe_start(ec_master_t *);
   190 void ec_master_eoe_stop(ec_master_t *);
   193 void ec_master_eoe_stop(ec_master_t *);
       
   194 #endif
   191 
   195 
   192 // datagram IO
   196 // datagram IO
   193 void ec_master_receive_datagrams(ec_master_t *, const uint8_t *, size_t);
   197 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 *);
   198 void ec_master_queue_datagram(ec_master_t *, ec_datagram_t *);
   195 
   199 
   196 // misc.
   200 // misc.
   197 void ec_master_output_stats(ec_master_t *);
   201 void ec_master_output_stats(ec_master_t *);
       
   202 #ifdef EC_EOE
   198 void ec_master_clear_eoe_handlers(ec_master_t *);
   203 void ec_master_clear_eoe_handlers(ec_master_t *);
       
   204 #endif
   199 void ec_master_destroy_slaves(ec_master_t *);
   205 void ec_master_destroy_slaves(ec_master_t *);
   200 
   206 
   201 /*****************************************************************************/
   207 /*****************************************************************************/
   202 
   208 
   203 #endif
   209 #endif