summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe/netdevice.h
diff options
context:
space:
mode:
authorMichael Brown2007-07-03 01:15:53 +0200
committerMichael Brown2007-07-03 01:15:53 +0200
commit4968caab8288664d4fd21417f312f3c5a05df155 (patch)
tree6c5ecf09777ba61dc056e9253df17ea309885a7d /src/include/gpxe/netdevice.h
parentEnsure that pxe_netdev is set before starting up PXE NBP. (diff)
downloadipxe-4968caab8288664d4fd21417f312f3c5a05df155.tar.gz
ipxe-4968caab8288664d4fd21417f312f3c5a05df155.tar.xz
ipxe-4968caab8288664d4fd21417f312f3c5a05df155.zip
Add trivial net device statistics (TX and RX packet count), reported
via UNDI API and also by ifstat command; may be useful for debugging.
Diffstat (limited to 'src/include/gpxe/netdevice.h')
-rw-r--r--src/include/gpxe/netdevice.h13
1 files changed, 13 insertions, 0 deletions
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
@@ -129,6 +129,17 @@ struct ll_protocol {
};
/**
+ * 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
*
* This structure represents a piece of networking hardware. It has
@@ -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;