summaryrefslogtreecommitdiffstats
path: root/src/interface/pxe
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/interface/pxe
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/interface/pxe')
-rw-r--r--src/interface/pxe/pxe_undi.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/interface/pxe/pxe_undi.c b/src/interface/pxe/pxe_undi.c
index f456a0b1c..4e7529a31 100644
--- a/src/interface/pxe/pxe_undi.c
+++ b/src/interface/pxe/pxe_undi.c
@@ -343,28 +343,33 @@ PXENV_EXIT_t pxenv_undi_get_information ( struct s_PXENV_UNDI_GET_INFORMATION
/* PXENV_UNDI_GET_STATISTICS
*
- * Status: won't implement (would require driver API changes for no
- * real benefit)
+ * Status: working
*/
PXENV_EXIT_t pxenv_undi_get_statistics ( struct s_PXENV_UNDI_GET_STATISTICS
*undi_get_statistics ) {
DBG ( "PXENV_UNDI_GET_STATISTICS" );
- undi_get_statistics->Status = PXENV_STATUS_UNSUPPORTED;
- return PXENV_EXIT_FAILURE;
+ undi_get_statistics->XmtGoodFrames = pxe_netdev->stats.tx_count;
+ undi_get_statistics->RcvGoodFrames = pxe_netdev->stats.rx_count;
+ undi_get_statistics->RcvCRCErrors = 0;
+ undi_get_statistics->RcvResourceErrors = 0;
+
+ undi_get_statistics->Status = PXENV_STATUS_SUCCESS;
+ return PXENV_EXIT_SUCCESS;
}
/* PXENV_UNDI_CLEAR_STATISTICS
*
- * Status: won't implement (would require driver API changes for no
- * real benefit)
+ * Status: working
*/
PXENV_EXIT_t pxenv_undi_clear_statistics ( struct s_PXENV_UNDI_CLEAR_STATISTICS
*undi_clear_statistics ) {
DBG ( "PXENV_UNDI_CLEAR_STATISTICS" );
- undi_clear_statistics->Status = PXENV_STATUS_UNSUPPORTED;
- return PXENV_EXIT_FAILURE;
+ memset ( &pxe_netdev->stats, 0, sizeof ( pxe_netdev->stats ) );
+
+ undi_clear_statistics->Status = PXENV_STATUS_SUCCESS;
+ return PXENV_EXIT_SUCCESS;
}
/* PXENV_UNDI_INITIATE_DIAGS