Added error reporting to some of the network drivers in net branch

git-svn-id: svn://kolibrios.org@2387 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2012-02-23 21:18:16 +00:00
parent d0e0776223
commit 997d83d275
7 changed files with 5635 additions and 5619 deletions

View File

@ -2394,6 +2394,7 @@ boomerang_transmit:
.fail: .fail:
stdcall KernelFree, [esp+4] stdcall KernelFree, [esp+4]
or eax, -1
ret 8 ret 8

View File

@ -720,9 +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
stdcall KernelFree, [esp+4]
xor eax, eax
ret 8
.err: .err:
or eax, -1 or eax, -1
.finish:
stdcall KernelFree, [esp+4] stdcall KernelFree, [esp+4]
ret 8 ret 8

View File

@ -728,6 +728,7 @@ transmit:
.fail: .fail:
DEBUGF 1,"failed!\n" DEBUGF 1,"failed!\n"
stdcall KernelFree, [esp+4] stdcall KernelFree, [esp+4]
or eax, -1
ret 8 ret 8

View File

@ -1085,6 +1085,7 @@ 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
xor eax, eax
ret 8 ret 8
.fail: .fail:

View File

@ -595,9 +595,9 @@ transmit:
[eax+13]:2,[eax+12]:2 [eax+13]:2,[eax+12]:2
cmp dword [esp+8], 1500 cmp dword [esp+8], 1500
jg .finish ; packet is too long jg .error ; packet is too long
cmp dword [esp+8], 60 cmp dword [esp+8], 60
jl .finish ; packet is too short jl .error ; packet is too short
set_io 0 set_io 0
in ax, dx in ax, dx
@ -643,9 +643,13 @@ transmit:
in ax, dx in ax, dx
.finish: .finish:
xor eax, eax
ret 8 ret 8
.error:
stdcall KernelFree, [esp+4]
or eax, -1
ret 8
;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;

View File

@ -956,9 +956,9 @@ transmit:
[eax+13]:2,[eax+12]:2 [eax+13]:2,[eax+12]:2
cmp dword [esp+8], 1514 cmp dword [esp+8], 1514
jg .finish ; packet is too long jg .nospace ; packet is too long
cmp dword [esp+8], 60 cmp dword [esp+8], 60
jl .finish ; packet is too short jl .nospace ; packet is too short
; check descriptor ; check descriptor
movzx eax, [device.cur_tx] movzx eax, [device.cur_tx]
@ -1000,12 +1000,13 @@ transmit:
.finish: .finish:
DEBUGF 2," - Done!\n" DEBUGF 2," - Done!\n"
stdcall KernelFree, [esp+4] stdcall KernelFree, [esp+4]
xor eax, eax
ret 8 ret 8
.nospace: .nospace:
DEBUGF 1, 'ERROR: no free transmit descriptors\n' DEBUGF 1, 'ERROR: no free transmit descriptors\n'
; todo: maybe somehow notify the kernel about the error?
stdcall KernelFree, [esp+4] stdcall KernelFree, [esp+4]
or eax, -1
ret 8 ret 8

View File

@ -1258,10 +1258,10 @@ align 4
transmit: transmit:
cmp dword [esp+8], MAX_ETH_FRAME_SIZE cmp dword [esp+8], MAX_ETH_FRAME_SIZE
ja .finish ja .error
cmp dword [esp+8], 60 cmp dword [esp+8], 60
jb .finish jb .error
movzx ecx, [device.cur_tx] movzx ecx, [device.cur_tx]
shl ecx, 4 shl ecx, 4
@ -1286,7 +1286,12 @@ transmit:
adc dword [device.bytes_tx+4], 0 adc dword [device.bytes_tx+4], 0
.finish: .finish:
xor eax, eax
ret 8
.error:
stdcall KernelFree, [esp+4]
or eax, -1
ret 8 ret 8