99 |
99 |
100 // Frame statistics |
100 // Frame statistics |
101 u64 tx_count; /**< Number of frames sent. */ |
101 u64 tx_count; /**< Number of frames sent. */ |
102 u64 last_tx_count; /**< Number of frames sent of last statistics cycle. */ |
102 u64 last_tx_count; /**< Number of frames sent of last statistics cycle. */ |
103 u64 rx_count; /**< Number of frames received. */ |
103 u64 rx_count; /**< Number of frames received. */ |
104 u64 tx_bytes; /**< Number of frames sent. */ |
104 u64 last_rx_count; /**< Number of frames received of last statistics |
|
105 cycle. */ |
|
106 u64 tx_bytes; /**< Number of bytes sent. */ |
105 u64 last_tx_bytes; /**< Number of bytes sent of last statistics cycle. */ |
107 u64 last_tx_bytes; /**< Number of bytes sent of last statistics cycle. */ |
|
108 u64 rx_bytes; /**< Number of bytes received. */ |
|
109 u64 last_rx_bytes; /**< Number of bytes received of last statistics cycle. |
|
110 */ |
106 u64 tx_errors; /**< Number of transmit errors. */ |
111 u64 tx_errors; /**< Number of transmit errors. */ |
107 u64 last_loss; /**< Tx/Rx difference of last statistics cycle. */ |
112 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 |
113 different statistics cycle periods. |
109 frames/s for different |
114 */ |
110 statistics cycle periods. */ |
115 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 |
116 different statistics cycle periods. |
112 for different statistics |
117 */ |
113 cycle periods. */ |
118 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 |
119 different statistics cycle periods. */ |
115 statistics cycle periods. */ |
120 s32 rx_byte_rates[EC_RATE_COUNT]; /**< Receive rates in byte/s for |
116 unsigned long stats_jiffies; /**< Jiffies of last statistic cycle. */ |
121 different statistics cycle periods. */ |
117 |
122 |
118 #ifdef EC_DEBUG_IF |
123 #ifdef EC_DEBUG_IF |
119 ec_debug_t dbg; /**< debug device */ |
124 ec_debug_t dbg; /**< debug device */ |
120 #endif |
125 #endif |
121 #ifdef EC_DEBUG_RING |
126 #ifdef EC_DEBUG_RING |
139 |
144 |
140 void ec_device_poll(ec_device_t *); |
145 void ec_device_poll(ec_device_t *); |
141 uint8_t *ec_device_tx_data(ec_device_t *); |
146 uint8_t *ec_device_tx_data(ec_device_t *); |
142 void ec_device_send(ec_device_t *, size_t); |
147 void ec_device_send(ec_device_t *, size_t); |
143 void ec_device_clear_stats(ec_device_t *); |
148 void ec_device_clear_stats(ec_device_t *); |
|
149 void ec_device_update_stats(ec_device_t *); |
144 |
150 |
145 #ifdef EC_DEBUG_RING |
151 #ifdef EC_DEBUG_RING |
146 void ec_device_debug_ring_append(ec_device_t *, ec_debug_frame_dir_t, |
152 void ec_device_debug_ring_append(ec_device_t *, ec_debug_frame_dir_t, |
147 const void *, size_t); |
153 const void *, size_t); |
148 void ec_device_debug_ring_print(const ec_device_t *); |
154 void ec_device_debug_ring_print(const ec_device_t *); |