master/device.h
branchstable-1.2
changeset 1739 5fcbd29151d2
parent 1732 1cc865ba17c2
child 1744 7bc131b92039
equal deleted inserted replaced
1738:bc89e3fba1a5 1739:5fcbd29151d2
    63 {
    63 {
    64     ec_master_t *master; /**< EtherCAT master */
    64     ec_master_t *master; /**< EtherCAT master */
    65     struct net_device *dev; /**< pointer to the assigned net_device */
    65     struct net_device *dev; /**< pointer to the assigned net_device */
    66     uint8_t open; /**< true, if the net_device has been opened */
    66     uint8_t open; /**< true, if the net_device has been opened */
    67     struct sk_buff *tx_skb; /**< transmit socket buffer */
    67     struct sk_buff *tx_skb; /**< transmit socket buffer */
    68     ec_isr_t isr; /**< pointer to the device's interrupt service routine */
    68     ec_pollfunc_t poll; /**< pointer to the device's poll function */
    69     cycles_t cycles_isr; /**< cycles of last ISR call */
    69     cycles_t cycles_poll; /**< cycles of last poll */
    70     unsigned long jiffies_isr; /**< jiffies of last ISR call */
    70     unsigned long jiffies_poll; /**< jiffies of last poll */
    71     struct module *module; /**< pointer to the device's owning module */
    71     struct module *module; /**< pointer to the device's owning module */
    72     uint8_t link_state; /**< device link state */
    72     uint8_t link_state; /**< device link state */
       
    73     unsigned int tx_count; /**< number of frames sent */
       
    74     unsigned int rx_count; /**< number of frames received */
    73 #ifdef EC_DBG_IF
    75 #ifdef EC_DBG_IF
    74     ec_debug_t dbg; /**< debug device */
    76     ec_debug_t dbg; /**< debug device */
    75 #endif
    77 #endif
    76 };
    78 };
    77 
    79 
    78 /*****************************************************************************/
    80 /*****************************************************************************/
    79 
    81 
    80 int ec_device_init(ec_device_t *, ec_master_t *, struct net_device *,
    82 int ec_device_init(ec_device_t *, ec_master_t *, struct net_device *,
    81                    ec_isr_t, struct module *);
    83                    ec_pollfunc_t, struct module *);
    82 void ec_device_clear(ec_device_t *);
    84 void ec_device_clear(ec_device_t *);
    83 
    85 
    84 int ec_device_open(ec_device_t *);
    86 int ec_device_open(ec_device_t *);
    85 int ec_device_close(ec_device_t *);
    87 int ec_device_close(ec_device_t *);
    86 
    88 
    87 void ec_device_call_isr(ec_device_t *);
    89 void ec_device_poll(ec_device_t *);
    88 uint8_t *ec_device_tx_data(ec_device_t *);
    90 uint8_t *ec_device_tx_data(ec_device_t *);
    89 void ec_device_send(ec_device_t *, size_t);
    91 void ec_device_send(ec_device_t *, size_t);
    90 
    92 
    91 /*****************************************************************************/
    93 /*****************************************************************************/
    92 
    94