master/master.h
changeset 238 b4960499098f
parent 236 34d7ce41e9db
child 239 07bca2b018ed
equal deleted inserted replaced
237:7b3126cf6dab 238:b4960499098f
    35 #include <linux/sysfs.h>
    35 #include <linux/sysfs.h>
    36 #include <linux/timer.h>
    36 #include <linux/timer.h>
    37 
    37 
    38 #include "device.h"
    38 #include "device.h"
    39 #include "domain.h"
    39 #include "domain.h"
       
    40 #include "fsm.h"
    40 
    41 
    41 /*****************************************************************************/
    42 /*****************************************************************************/
    42 
    43 
    43 // Uncomment this to do EoE within a kernel timer. Otherwise, it will be
    44 // Uncomment this to do EoE within a kernel timer. Otherwise, it will be
    44 // done in a working queue.
    45 // done in a working queue.
    92     ec_device_t *device; /**< EtherCAT device */
    93     ec_device_t *device; /**< EtherCAT device */
    93     struct list_head command_queue; /**< command queue */
    94     struct list_head command_queue; /**< command queue */
    94     uint8_t command_index; /**< current command index */
    95     uint8_t command_index; /**< current command index */
    95     struct list_head domains; /**< list of domains */
    96     struct list_head domains; /**< list of domains */
    96     ec_command_t simple_command; /**< command structure for initialization */
    97     ec_command_t simple_command; /**< command structure for initialization */
    97     ec_command_t watch_command; /**< command for watching the slaves */
       
    98     unsigned int slaves_responding; /**< number of responding slaves */
       
    99     ec_slave_state_t slave_states; /**< states of the responding slaves */
       
   100     int debug_level; /**< master debug level */
    98     int debug_level; /**< master debug level */
   101     ec_stats_t stats; /**< cyclic statistics */
    99     ec_stats_t stats; /**< cyclic statistics */
   102     unsigned int timeout; /**< timeout in synchronous IO */
   100     unsigned int timeout; /**< timeout in synchronous IO */
   103     struct list_head eoe_slaves; /**< Ethernet-over-EtherCAT slaves */
   101     struct list_head eoe_slaves; /**< Ethernet-over-EtherCAT slaves */
   104     unsigned int reserved; /**< true, if the master is reserved for RT */
   102     unsigned int reserved; /**< true, if the master is reserved for RT */
   105     struct workqueue_struct *workqueue; /**< master workqueue */
   103     struct workqueue_struct *workqueue; /**< master workqueue */
   106     struct work_struct freerun_work; /**< free run work object */
   104     struct work_struct freerun_work; /**< free run work object */
   107     void (*freerun_state)(ec_master_t *); /**< freerun state function */
   105     ec_fsm_t fsm; /**< master state machine */
   108     ec_slave_t *freerun_slave; /**< current slave in bus scan */
       
   109     ec_master_mode_t mode; /**< master mode */
   106     ec_master_mode_t mode; /**< master mode */
   110     int (*request_cb)(void *); /**< lock request callback */
   107     int (*request_cb)(void *); /**< lock request callback */
   111     void (*release_cb)(void *); /**< lock release callback */
   108     void (*release_cb)(void *); /**< lock release callback */
   112     void *cb_data; /**< data parameter of locking callbacks */
   109     void *cb_data; /**< data parameter of locking callbacks */
   113 #ifdef EOE_TIMER
   110 #ifdef EOE_TIMER
   135 
   132 
   136 // slave management
   133 // slave management
   137 int ec_master_bus_scan(ec_master_t *);
   134 int ec_master_bus_scan(ec_master_t *);
   138 
   135 
   139 // misc.
   136 // misc.
       
   137 void ec_master_clear_slaves(ec_master_t *);
   140 void ec_master_output_stats(ec_master_t *);
   138 void ec_master_output_stats(ec_master_t *);
   141 
   139 
   142 /*****************************************************************************/
   140 /*****************************************************************************/
   143 
   141 
   144 #endif
   142 #endif