forked from KolibriOS/kolibrios
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:
parent
ed3624b9f1
commit
c6d66896a5
@ -341,12 +341,7 @@ create_new_struct:
|
|||||||
cmp [devices], MAX_DEVICES
|
cmp [devices], MAX_DEVICES
|
||||||
jge .fail
|
jge .fail
|
||||||
|
|
||||||
push edx
|
allocate_and_clear ebx, device.size, .fail ; Allocate the buffer for device structure
|
||||||
stdcall KernelAlloc, device.size
|
|
||||||
pop edx
|
|
||||||
test eax, eax
|
|
||||||
jz .fail
|
|
||||||
mov ebx, eax
|
|
||||||
|
|
||||||
mov [device.reset], reset
|
mov [device.reset], reset
|
||||||
mov [device.transmit], transmit
|
mov [device.transmit], transmit
|
||||||
@ -358,7 +353,7 @@ create_new_struct:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
.fail:
|
.fail:
|
||||||
add esp, 4
|
add esp, 4 ; return to caller of 'hook'
|
||||||
or eax, -1
|
or eax, -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@ -678,8 +673,6 @@ nsr_002:
|
|||||||
; buffer in [esp+4], size in [esp+8], pointer to device struct in ebx
|
; buffer in [esp+4], size in [esp+8], pointer to device struct in ebx
|
||||||
;***************************************************************************
|
;***************************************************************************
|
||||||
|
|
||||||
; TODO: use a RING-buffer
|
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
transmit:
|
transmit:
|
||||||
|
|
||||||
@ -727,17 +720,12 @@ transmit:
|
|||||||
add dword [device.bytes_tx], eax
|
add dword [device.bytes_tx], eax
|
||||||
adc dword [device.bytes_tx + 4], 0
|
adc dword [device.bytes_tx + 4], 0
|
||||||
|
|
||||||
.finish:
|
|
||||||
call Kernelfree
|
|
||||||
add esp, 4
|
|
||||||
xor eax, eax
|
|
||||||
ret
|
|
||||||
|
|
||||||
.err:
|
.err:
|
||||||
call Kernelfree
|
|
||||||
add esp, 4
|
|
||||||
or eax, -1
|
or eax, -1
|
||||||
ret
|
.finish:
|
||||||
|
stdcall KernelFree, [esp+4]
|
||||||
|
ret 8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
@ -771,7 +759,6 @@ int_handler:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; looks like we've found a device wich received a packet..
|
; looks like we've found a device wich received a packet..
|
||||||
.rx:
|
.rx:
|
||||||
stdcall KernelAlloc, ETH_FRAME_LEN ; size doesnt really matter as packet size is smaller then kernel's page size
|
stdcall KernelAlloc, ETH_FRAME_LEN ; size doesnt really matter as packet size is smaller then kernel's page size
|
||||||
|
Loading…
Reference in New Issue
Block a user