master/master.h
changeset 241 cd90a22cab28
parent 239 07bca2b018ed
child 246 0bf7c769de06
equal deleted inserted replaced
240:e55b0572933c 241:cd90a22cab28
    76    Manages slaves, domains and IO.
    76    Manages slaves, domains and IO.
    77 */
    77 */
    78 
    78 
    79 struct ec_master
    79 struct ec_master
    80 {
    80 {
    81     struct list_head list; /**< list item */
    81     struct list_head list; /**< list item for module's master list */
       
    82     unsigned int reserved; /**< non-zero, if the master is reserved for RT */
       
    83     unsigned int index; /**< master index */
       
    84 
    82     struct kobject kobj; /**< kobject */
    85     struct kobject kobj; /**< kobject */
    83     unsigned int index; /**< master index */
    86 
    84     struct list_head slaves; /**< list of slaves on the bus */
    87     struct list_head slaves; /**< list of slaves on the bus */
    85     unsigned int slave_count; /**< number of slaves on the bus */
    88     unsigned int slave_count; /**< number of slaves on the bus */
       
    89 
    86     ec_device_t *device; /**< EtherCAT device */
    90     ec_device_t *device; /**< EtherCAT device */
       
    91 
    87     struct list_head command_queue; /**< command queue */
    92     struct list_head command_queue; /**< command queue */
    88     uint8_t command_index; /**< current command index */
    93     uint8_t command_index; /**< current command index */
       
    94 
    89     struct list_head domains; /**< list of domains */
    95     struct list_head domains; /**< list of domains */
       
    96 
    90     ec_command_t simple_command; /**< command structure for initialization */
    97     ec_command_t simple_command; /**< command structure for initialization */
       
    98     unsigned int timeout; /**< timeout in synchronous IO */
       
    99 
    91     int debug_level; /**< master debug level */
   100     int debug_level; /**< master debug level */
    92     ec_stats_t stats; /**< cyclic statistics */
   101     ec_stats_t stats; /**< cyclic statistics */
    93     unsigned int timeout; /**< timeout in synchronous IO */
   102 
    94     struct list_head eoe_slaves; /**< Ethernet-over-EtherCAT slaves */
       
    95     unsigned int reserved; /**< true, if the master is reserved for RT */
       
    96     struct workqueue_struct *workqueue; /**< master workqueue */
   103     struct workqueue_struct *workqueue; /**< master workqueue */
    97     struct work_struct freerun_work; /**< free run work object */
   104     struct work_struct freerun_work; /**< free run work object */
    98     ec_fsm_t fsm; /**< master state machine */
   105     ec_fsm_t fsm; /**< master state machine */
    99     ec_master_mode_t mode; /**< master mode */
   106     ec_master_mode_t mode; /**< master mode */
       
   107 
       
   108     struct timer_list eoe_timer; /** EoE timer object */
       
   109     struct list_head eoe_slaves; /**< Ethernet-over-EtherCAT slaves */
   100     int (*request_cb)(void *); /**< lock request callback */
   110     int (*request_cb)(void *); /**< lock request callback */
   101     void (*release_cb)(void *); /**< lock release callback */
   111     void (*release_cb)(void *); /**< lock release callback */
   102     void *cb_data; /**< data parameter of locking callbacks */
   112     void *cb_data; /**< data parameter of locking callbacks */
   103     struct timer_list eoe_timer; /** EoE timer object */
       
   104 };
   113 };
   105 
   114 
   106 /*****************************************************************************/
   115 /*****************************************************************************/
   107 
   116 
   108 // master creation and deletion
   117 // master creation and deletion