From 3868bd567a05a57a6f9a6bcab4b4eb2b0536760f Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Sun, 20 Jun 2021 20:22:57 +0000 Subject: [PATCH] Add network packet error counters. git-svn-id: svn://kolibrios.org@8896 a494cfbc-eb01-0410-851d-a64ba20cac60 --- drivers/netdrv.inc | 16 ++++++++++++---- kernel/trunk/network/stack.inc | 22 +++++++++++++++------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/drivers/netdrv.inc b/drivers/netdrv.inc index f115d1ce67..052255b7d9 100644 --- a/drivers/netdrv.inc +++ b/drivers/netdrv.inc @@ -111,13 +111,21 @@ struct NET_DEVICE reset dd ? ; transmit dd ? ; + state dd ? ; link state (0 = no link) + hwacc dd ? ; bitmask stating enabled HW accelerations (offload engines) + bytes_tx dq ? ; Statistics, updated by the driver bytes_rx dq ? ; - packets_tx dd ? ; - packets_rx dd ? ; - state dd ? ; link state (0 = no link) - hwacc dd ? ; bitmask stating enabled HW accelerations + packets_tx dd ? ; + packets_tx_err dd ? ; CRC errors, too long or too short frames + packets_tx_drop dd ? ; + packets_tx_ovr dd ? ; FIFO overrun + + packets_rx dd ? ; + packets_rx_err dd ? ; CRC errors, too long or too short frames + packets_rx_drop dd ? ; + packets_rx_ovr dd ? ; FIFO overrun ends diff --git a/kernel/trunk/network/stack.inc b/kernel/trunk/network/stack.inc index 1d5094d88f..4e7f99a43c 100644 --- a/kernel/trunk/network/stack.inc +++ b/kernel/trunk/network/stack.inc @@ -178,14 +178,22 @@ struct NET_DEVICE reset dd ? ; transmit dd ? ; - bytes_tx dq ? ; Statistics, updated by the driver - bytes_rx dq ? ; - packets_tx dd ? ; - packets_rx dd ? ; - link_state dd ? ; link state (0 = no link) hwacc dd ? ; bitmask stating enabled HW accelerations (offload engines) + bytes_tx dq ? ; Statistics, updated by the driver + bytes_rx dq ? ; + + packets_tx dd ? ; + packets_tx_err dd ? ; CRC errors, too long or too short frames + packets_tx_drop dd ? ; + packets_tx_ovr dd ? ; FIFO overrun + + packets_rx dd ? ; + packets_rx_err dd ? ; CRC errors, too long or too short frames + packets_rx_drop dd ? ; + packets_rx_ovr dd ? ; FIFO overrun + ends struct NET_BUFF @@ -410,8 +418,8 @@ proc net_buff_free stdcall, buffer spin_lock_irqsave - sub [net_buffs_free.current], 4 - mov eax, [net_buffs_free.current] + sub [net_buffs_free.current], 4 ; move pointer backwards + mov eax, [net_buffs_free.current] ; place free'd buffer pointer on the list push [buffer] pop dword[eax]