From 7aeabda91e6666b64f4eeb547f65a8f3d2d34954 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Fri, 13 Jul 2012 12:39:22 +0000 Subject: [PATCH] R6040 driver now keeps track of number of received/sent packets/bytes. git-svn-id: svn://kolibrios.org@2865 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/drivers/R6040.asm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kernel/branches/net/drivers/R6040.asm b/kernel/branches/net/drivers/R6040.asm index 1baf4299a2..11b68d45cf 100644 --- a/kernel/branches/net/drivers/R6040.asm +++ b/kernel/branches/net/drivers/R6040.asm @@ -792,6 +792,12 @@ transmit: and [device.cur_tx], TX_RING_SIZE - 1 xor eax, eax +; Update stats + inc [device.packets_tx] + mov eax, [esp+8] + add dword [device.bytes_tx], eax + adc dword [device.bytes_tx + 4], 0 + ret 8 .wait_to_send: @@ -897,6 +903,11 @@ int_handler: and ecx, 0xFFF sub ecx, 4 ; Do not count the CRC +; Update stats + add dword [device.bytes_rx], ecx + adc dword [device.bytes_rx + 4], 0 + inc dword [device.packets_rx] + ; Push packet size and pointer, kernel will need it.. push ebx