RTL8139: fixed deadlock on startup

git-svn-id: svn://kolibrios.org@3685 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2013-06-19 09:27:02 +00:00
parent a889feeb25
commit 23eb44e17c

View File

@ -356,6 +356,10 @@ proc service_proc stdcall, ioctl:dword
mov [device_list+4*eax], ebx ; (IRQ handler uses this list to find device) mov [device_list+4*eax], ebx ; (IRQ handler uses this list to find device)
inc [devices] ; inc [devices] ;
call reset
test eax, eax
jnz .destroy
mov [device.type], NET_TYPE_ETH mov [device.type], NET_TYPE_ETH
call NetRegDev call NetRegDev
@ -377,6 +381,7 @@ proc service_proc stdcall, ioctl:dword
; If an error occured, remove all allocated data and exit (returning -1 in eax) ; If an error occured, remove all allocated data and exit (returning -1 in eax)
.destroy: .destroy:
; todo: unregister device from device_list
; todo: reset device into virgin state ; todo: reset device into virgin state
.err: .err:
@ -495,6 +500,10 @@ probe:
out dx, al out dx, al
DEBUGF 2, "done!\n" DEBUGF 2, "done!\n"
xor eax, eax
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
@ -596,9 +605,9 @@ reset:
; set RxBuffer address, init RX buffer offset ; set RxBuffer address, init RX buffer offset
mov eax, [device.rx_buffer] mov eax, [device.rx_buffer]
mov dword[eax], 0 ; clear receive flags for first packet (really needed??) mov dword[eax], 0 ; clear receive flags for first packet (really needed??)
DEBUGF 2, "RX buffer virtual addr=0x%x\n", eax DEBUGF 1, "RX buffer virtual addr=0x%x\n", eax
GetRealAddr GetRealAddr
DEBUGF 2, "RX buffer real addr=0x%x\n", eax DEBUGF 1, "RX buffer real addr=0x%x\n", eax
set_io REG_RBSTART set_io REG_RBSTART
out dx, eax out dx, eax