Add trivial net device statistics (TX and RX packet count), reported

via UNDI API and also by ifstat command; may be useful for debugging.
This commit is contained in:
Michael Brown
2007-07-03 00:15:53 +01:00
parent 071356d976
commit 4968caab82
4 changed files with 38 additions and 10 deletions

View File

@@ -128,6 +128,17 @@ struct ll_protocol {
const uint8_t *ll_broadcast;
};
/**
* Network device statistics
*
*/
struct net_device_stats {
/** Count of successfully completed transmissions */
unsigned int tx_count;
/** Count of successfully received packets */
unsigned int rx_count;
};
/**
* A network device
*
@@ -215,6 +226,8 @@ struct net_device {
struct list_head tx_queue;
/** RX packet queue */
struct list_head rx_queue;
/** Device statistics */
struct net_device_stats stats;
/** Driver private data */
void *priv;