master/device.h
changeset 2589 2b9c78543663
parent 1863 8ea4a79dfe84
child 2630 a380cce7d6f0
equal deleted inserted replaced
2415:af21f0bdc7c9 2589:2b9c78543663
    62 } ec_debug_frame_dir_t;
    62 } ec_debug_frame_dir_t;
    63 
    63 
    64 typedef struct {
    64 typedef struct {
    65     ec_debug_frame_dir_t dir;
    65     ec_debug_frame_dir_t dir;
    66     struct timeval t;
    66     struct timeval t;
    67     unsigned int addr;
       
    68     uint8_t data[EC_MAX_DATA_SIZE];
    67     uint8_t data[EC_MAX_DATA_SIZE];
    69     unsigned int data_size;
    68     unsigned int data_size;
    70 } ec_debug_frame_t;
    69 } ec_debug_frame_t;
    71 
    70 
    72 #endif
    71 #endif
    99 
    98 
   100     // Frame statistics
    99     // Frame statistics
   101     u64 tx_count; /**< Number of frames sent. */
   100     u64 tx_count; /**< Number of frames sent. */
   102     u64 last_tx_count; /**< Number of frames sent of last statistics cycle. */
   101     u64 last_tx_count; /**< Number of frames sent of last statistics cycle. */
   103     u64 rx_count; /**< Number of frames received. */
   102     u64 rx_count; /**< Number of frames received. */
   104     u64 tx_bytes; /**< Number of frames sent. */
   103     u64 last_rx_count; /**< Number of frames received of last statistics
       
   104                          cycle. */
       
   105     u64 tx_bytes; /**< Number of bytes sent. */
   105     u64 last_tx_bytes; /**< Number of bytes sent of last statistics cycle. */
   106     u64 last_tx_bytes; /**< Number of bytes sent of last statistics cycle. */
       
   107     u64 rx_bytes; /**< Number of bytes received. */
       
   108     u64 last_rx_bytes; /**< Number of bytes received of last statistics cycle.
       
   109                         */
   106     u64 tx_errors; /**< Number of transmit errors. */
   110     u64 tx_errors; /**< Number of transmit errors. */
   107     u64 last_loss; /**< Tx/Rx difference of last statistics cycle. */
   111     s32 tx_frame_rates[EC_RATE_COUNT]; /**< Transmit rates in frames/s for
   108     unsigned int tx_frame_rates[EC_RATE_COUNT]; /**< Transmit rates in
   112                                          different statistics cycle periods.
   109                                                   frames/s for different
   113                                         */
   110                                                   statistics cycle periods. */
   114     s32 rx_frame_rates[EC_RATE_COUNT]; /**< Receive rates in frames/s for
   111     unsigned int tx_byte_rates[EC_RATE_COUNT]; /**< Transmit rates in byte/s
   115                                          different statistics cycle periods.
   112                                                  for different statistics
   116                                         */
   113                                                  cycle periods. */
   117     s32 tx_byte_rates[EC_RATE_COUNT]; /**< Transmit rates in byte/s for
   114     int loss_rates[EC_RATE_COUNT]; /**< Frame loss rates for different
   118                                         different statistics cycle periods. */
   115                                      statistics cycle periods. */
   119     s32 rx_byte_rates[EC_RATE_COUNT]; /**< Receive rates in byte/s for
   116     unsigned long stats_jiffies; /**< Jiffies of last statistic cycle. */
   120                                         different statistics cycle periods. */
   117 
   121 
   118 #ifdef EC_DEBUG_IF
   122 #ifdef EC_DEBUG_IF
   119     ec_debug_t dbg; /**< debug device */
   123     ec_debug_t dbg; /**< debug device */
   120 #endif
   124 #endif
   121 #ifdef EC_DEBUG_RING
   125 #ifdef EC_DEBUG_RING
   139 
   143 
   140 void ec_device_poll(ec_device_t *);
   144 void ec_device_poll(ec_device_t *);
   141 uint8_t *ec_device_tx_data(ec_device_t *);
   145 uint8_t *ec_device_tx_data(ec_device_t *);
   142 void ec_device_send(ec_device_t *, size_t);
   146 void ec_device_send(ec_device_t *, size_t);
   143 void ec_device_clear_stats(ec_device_t *);
   147 void ec_device_clear_stats(ec_device_t *);
       
   148 void ec_device_update_stats(ec_device_t *);
   144 
   149 
   145 #ifdef EC_DEBUG_RING
   150 #ifdef EC_DEBUG_RING
   146 void ec_device_debug_ring_append(ec_device_t *, ec_debug_frame_dir_t,
   151 void ec_device_debug_ring_append(ec_device_t *, ec_debug_frame_dir_t,
   147         const void *, size_t);
   152         const void *, size_t);
   148 void ec_device_debug_ring_print(const ec_device_t *);
   153 void ec_device_debug_ring_print(const ec_device_t *);