From ce6a93da60f3231fcf60999a869d337d7d4d2437 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Fri, 13 Jul 2012 10:03:25 +0000 Subject: [PATCH] PCNet driver now keeps track of number of received/sent packets/bytes. git-svn-id: svn://kolibrios.org@2863 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/drivers/pcnet32.asm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kernel/branches/net/drivers/pcnet32.asm b/kernel/branches/net/drivers/pcnet32.asm index cb75033bc5..52279a320f 100644 --- a/kernel/branches/net/drivers/pcnet32.asm +++ b/kernel/branches/net/drivers/pcnet32.asm @@ -996,6 +996,12 @@ transmit: and [device.cur_tx], 3 DEBUGF 2," - Packet Sent! " +; Update stats + inc [device.packets_tx] + mov eax, [esp+8] + add dword [device.bytes_tx], eax + adc dword [device.bytes_tx + 4], 0 + .finish: DEBUGF 2," - Done!\n" stdcall KernelFree, [esp+4] @@ -1094,6 +1100,11 @@ int_handler: test eax, eax ; Test if we allocated succesfully jz .abort ; +; Update stats + add dword [device.bytes_rx], ecx + adc dword [device.bytes_rx + 4], 0 + inc dword [device.packets_rx] + push ebx push .receiver_test_loop ; push ecx ; for eth_receiver