From c6d66896a5755bedb1311e2c2c9484de1e8b8805 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Mon, 26 Jul 2010 19:06:33 +0000 Subject: [PATCH] net branch: Fixed previously broken ne2000/rtl8029 driver git-svn-id: svn://kolibrios.org@1527 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/drivers/RTL8029.asm | 27 +++++++------------------ 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/kernel/branches/net/drivers/RTL8029.asm b/kernel/branches/net/drivers/RTL8029.asm index c4ff4cda63..ea1ce01820 100644 --- a/kernel/branches/net/drivers/RTL8029.asm +++ b/kernel/branches/net/drivers/RTL8029.asm @@ -341,12 +341,7 @@ create_new_struct: cmp [devices], MAX_DEVICES jge .fail - push edx - stdcall KernelAlloc, device.size - pop edx - test eax, eax - jz .fail - mov ebx, eax + allocate_and_clear ebx, device.size, .fail ; Allocate the buffer for device structure mov [device.reset], reset mov [device.transmit], transmit @@ -357,8 +352,8 @@ create_new_struct: ret -.fail: - add esp, 4 + .fail: + add esp, 4 ; return to caller of 'hook' or eax, -1 ret @@ -678,8 +673,6 @@ nsr_002: ; buffer in [esp+4], size in [esp+8], pointer to device struct in ebx ;*************************************************************************** -; TODO: use a RING-buffer - align 4 transmit: @@ -727,17 +720,12 @@ transmit: add dword [device.bytes_tx], eax adc dword [device.bytes_tx + 4], 0 -.finish: - call Kernelfree - add esp, 4 - xor eax, eax - ret - .err: - call Kernelfree - add esp, 4 or eax, -1 - ret +.finish: + stdcall KernelFree, [esp+4] + ret 8 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -771,7 +759,6 @@ int_handler: ret - ; looks like we've found a device wich received a packet.. .rx: stdcall KernelAlloc, ETH_FRAME_LEN ; size doesnt really matter as packet size is smaller then kernel's page size