diff --git a/master/device.c b/master/device.c index 18ce7808a68e548fbb5171345c1a03396ad8f0e8..25b9a3b0e5384b404655b656537a6d42a7b0eec3 100644 --- a/master/device.c +++ b/master/device.c @@ -310,12 +310,12 @@ void ec_device_send( // frame statistics if (unlikely(jiffies - device->stats_jiffies >= HZ)) { unsigned int i; - unsigned int tx_frame_rate = - (device->tx_count - device->last_tx_count) * 1000; - unsigned int tx_byte_rate = + u32 tx_frame_rate = + (u32) (device->tx_count - device->last_tx_count) * 1000; + u32 tx_byte_rate = (device->tx_bytes - device->last_tx_bytes) * 1000; - int loss = device->tx_count - device->rx_count; - int loss_rate = (loss - device->last_loss) * 1000; + u64 loss = device->tx_count - device->rx_count; + s32 loss_rate = (s32) (loss - device->last_loss) * 1000; for (i = 0; i < EC_RATE_COUNT; i++) { unsigned int n = rate_intervals[i]; device->tx_frame_rates[i] = diff --git a/master/device.h b/master/device.h index c242a831c770ee998290d458e783662e191c32de..b44cfeb537da9d5c741dc1553327e0f36fbd8cf1 100644 --- a/master/device.h +++ b/master/device.h @@ -98,21 +98,19 @@ struct ec_device unsigned long jiffies_poll; /**< jiffies of last poll */ // Frame statistics - unsigned int tx_count; /**< Number of frames sent. */ - unsigned int rx_count; /**< Number of frames received. */ - unsigned int tx_bytes; /**< Number of frames sent. */ - unsigned int tx_errors; /**< Number of transmit errors. */ + u64 tx_count; /**< Number of frames sent. */ + u64 last_tx_count; /**< Number of frames sent of last statistics cycle. */ + u64 rx_count; /**< Number of frames received. */ + u64 tx_bytes; /**< Number of frames sent. */ + u64 last_tx_bytes; /**< Number of bytes sent of last statistics cycle. */ + u64 tx_errors; /**< Number of transmit errors. */ + u64 last_loss; /**< Tx/Rx difference of last statistics cycle. */ unsigned int tx_frame_rates[EC_RATE_COUNT]; /**< Transmit rates in frames/s for different statistics cycle periods. */ unsigned int tx_byte_rates[EC_RATE_COUNT]; /**< Transmit rates in byte/s for different statistics cycle periods. */ - unsigned int last_tx_count; /**< Number of frames sent of last statistics - cycle. */ - unsigned int last_tx_bytes; /**< Number of bytes sent of last statistics - cycle. */ - int last_loss; /**< Tx/Rx difference of last statistics cycle. */ int loss_rates[EC_RATE_COUNT]; /**< Frame loss rates for different statistics cycle periods. */ unsigned long stats_jiffies; /**< Jiffies of last statistic cycle. */ diff --git a/master/ioctl.h b/master/ioctl.h index 2eae8d17b9d2d0df1b2f4835b131efc468f7249d..e0b621bbd7b07844b0d981a7cc06dc7a60161e01 100644 --- a/master/ioctl.h +++ b/master/ioctl.h @@ -162,10 +162,10 @@ typedef struct { uint8_t address[6]; uint8_t attached; uint8_t link_state; - uint32_t tx_count; - uint32_t rx_count; - uint32_t tx_bytes; - uint32_t tx_errors; + uint64_t tx_count; + uint64_t rx_count; + uint64_t tx_bytes; + uint64_t tx_errors; uint32_t tx_frame_rates[EC_RATE_COUNT]; uint32_t tx_byte_rates[EC_RATE_COUNT]; int32_t loss_rates[EC_RATE_COUNT];