From 23eb44e17c03a488be4d93604c60e61244ede32c Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Wed, 19 Jun 2013 09:27:02 +0000 Subject: [PATCH] RTL8139: fixed deadlock on startup git-svn-id: svn://kolibrios.org@3685 a494cfbc-eb01-0410-851d-a64ba20cac60 --- drivers/ethernet/RTL8139.asm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/ethernet/RTL8139.asm b/drivers/ethernet/RTL8139.asm index df1cb5637f..c0434db893 100644 --- a/drivers/ethernet/RTL8139.asm +++ b/drivers/ethernet/RTL8139.asm @@ -356,6 +356,10 @@ proc service_proc stdcall, ioctl:dword mov [device_list+4*eax], ebx ; (IRQ handler uses this list to find device) inc [devices] ; + call reset + test eax, eax + jnz .destroy + mov [device.type], NET_TYPE_ETH 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) .destroy: + ; todo: unregister device from device_list ; todo: reset device into virgin state .err: @@ -495,6 +500,10 @@ probe: out dx, al DEBUGF 2, "done!\n" + xor eax, eax + + ret + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @@ -596,9 +605,9 @@ reset: ; set RxBuffer address, init RX buffer offset mov eax, [device.rx_buffer] 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 - DEBUGF 2, "RX buffer real addr=0x%x\n", eax + DEBUGF 1, "RX buffer real addr=0x%x\n", eax set_io REG_RBSTART out dx, eax