From 049d796e8168e4ead443e546f95e3d5a900f2e31 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Sun, 6 Jun 2010 19:04:46 +0000 Subject: [PATCH] Net-branch: Added statistics to 3c59x driver. Fixed mixed up DNS and Gateway of static settings for zeroconf git-svn-id: svn://kolibrios.org@1481 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../net/applications/zeroconf/zeroconf.asm | 4 ++-- kernel/branches/net/drivers/3c59x.asm | 19 ++++++++++++++++++- kernel/branches/net/drivers/netdrv.inc | 14 -------------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/kernel/branches/net/applications/zeroconf/zeroconf.asm b/kernel/branches/net/applications/zeroconf/zeroconf.asm index 26f314d627..23dcf54206 100644 --- a/kernel/branches/net/applications/zeroconf/zeroconf.asm +++ b/kernel/branches/net/applications/zeroconf/zeroconf.asm @@ -204,12 +204,12 @@ START: ; start of execution invoke ini.get_str, path, str_ipconfig, str_dns, inibuf, 16, 0 mov edx, inibuf call Ip2dword - mcall 75, 7, edx + mcall 75, 5, edx invoke ini.get_str, path, str_ipconfig, str_subnet, inibuf, 16, 0 mov edx, inibuf call Ip2dword - mcall 75, 5, edx + mcall 75, 7, edx mcall -1 diff --git a/kernel/branches/net/drivers/3c59x.asm b/kernel/branches/net/drivers/3c59x.asm index 73204c2319..24e55e1048 100644 --- a/kernel/branches/net/drivers/3c59x.asm +++ b/kernel/branches/net/drivers/3c59x.asm @@ -827,6 +827,11 @@ reset: out dx, ax xor eax, eax +; clear packet/byte counters + + lea edi, [device.bytes_tx] + mov ecx, 6 + rep stosd ret @@ -2308,9 +2313,15 @@ boomerang_transmit: DEBUGF 1,"Found place in TX buffer: %x\n", edi push edi ;<<<<<<<<<<<<<<<<<<<<<<<<<<<< +; update statistics + inc [device.packets_tx] + + mov ecx, [esp+8+8] + add dword [device.bytes_tx], ecx + adc dword [device.bytes_tx + 4], 0 + ; copy packet data mov esi, [esp+4+8] - mov ecx, [esp+8+8] DEBUGF 1,"Copying %u bytes from %x to %x\n", ecx, esi, edi shr cx , 1 jnc .nb @@ -2775,6 +2786,12 @@ int_boomerang: DEBUGF 1, " copying %u bytes from %x to %x\n", ecx, esi, edi +; update statistics + inc [device.packets_rx] + + add dword [device.bytes_rx], ecx + adc dword [device.bytes_rx + 4], 0 + ; copy packet data shr cx , 1 jnc .nb diff --git a/kernel/branches/net/drivers/netdrv.inc b/kernel/branches/net/drivers/netdrv.inc index 9892f8cba3..defb6ffb90 100644 --- a/kernel/branches/net/drivers/netdrv.inc +++ b/kernel/branches/net/drivers/netdrv.inc @@ -44,20 +44,6 @@ macro set_io addr { } -macro diff16 title,l1,l2 -{ - local s,d - s = l2-l1 - display title,': 0x' - repeat 16 - d = 48 + s shr ((16-%) shl 2) and $0F - if d > 57 - d = d + 65-57-1 - end if - display d - end repeat - display 13,10 -} macro allocate_and_clear dest, size, err {