net branch: Fixed previously broken ne2000/rtl8029 driver

git-svn-id: svn://kolibrios.org@1527 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2010-07-26 19:06:33 +00:00
parent ed3624b9f1
commit c6d66896a5

View File

@ -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