From 4968caab8288664d4fd21417f312f3c5a05df155 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 3 Jul 2007 00:15:53 +0100 Subject: Add trivial net device statistics (TX and RX packet count), reported via UNDI API and also by ifstat command; may be useful for debugging. --- src/include/gpxe/netdevice.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/include') diff --git a/src/include/gpxe/netdevice.h b/src/include/gpxe/netdevice.h index 0060e7d5..c0df7c96 100644 --- a/src/include/gpxe/netdevice.h +++ b/src/include/gpxe/netdevice.h @@ -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; -- cgit v1.2.3-55-g7522