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 *); |