Fixed bugs in SIS900 RX:

-Receiver MUST be re-enabled by the driver.
-Driver MUST check for multiple packets at once.

git-svn-id: svn://kolibrios.org@2913 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2012-08-08 10:21:59 +00:00
parent 940c0c5fa6
commit a9f1828898

View File

@ -1065,10 +1065,12 @@ int_handler:
DEBUGF 1,"IRQ! status=%x\n", ax DEBUGF 1,"IRQ! status=%x\n", ax
test ax, RxOK test ax, RxOK
jz .no_rx jz .no_rx_
push ax push ax
.rx_loop:
;----------- ;-----------
; Get Status ; Get Status
movzx eax, [device.cur_rx] ; find current descriptor movzx eax, [device.cur_rx] ; find current descriptor
@ -1078,12 +1080,10 @@ int_handler:
;------------------------------------------- ;-------------------------------------------
; Check RX_Status to see if packet is waiting ; Check RX_Status to see if packet is waiting
test ecx, 0x80000000 test ecx, 0x80000000
jnz .is_packet jz .no_rx
ret
;---------------------------------------------- ;----------------------------------------------
; There is a packet waiting check it for errors ; There is a packet waiting check it for errors
.is_packet:
test ecx, 0x67C0000 ; see if there are any errors test ecx, 0x67C0000 ; see if there are any errors
jnz .error_status jnz .error_status
@ -1119,12 +1119,21 @@ int_handler:
mov dword [ecx + 8], eax mov dword [ecx + 8], eax
mov dword [ecx + 4], RX_BUFF_SZ mov dword [ecx + 4], RX_BUFF_SZ
inc [device.cur_rx] ; get next descriptor inc [device.cur_rx] ; get next descriptor
and [device.cur_rx], NUM_RX_DESC-1 ; only 4 descriptors 0-3 and [device.cur_rx], NUM_RX_DESC-1 ; only 4 descriptors 0-3
jmp .rx_loop
.no_rx:
set_io 0
set_io cr
in eax, dx
or eax, RxENA ; Re-Enable the Receive state machine
out dx, eax
pop ax pop ax
.no_rx: .no_rx_:
test ax, TxOK test ax, TxOK
jz .no_tx jz .no_tx