fixes in RTL8029 driver (now it works in qemu)

git-svn-id: svn://kolibrios.org@1177 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
CleverMouse 2009-09-25 10:52:09 +00:00
parent 66bf88987d
commit 740caf3d0d
2 changed files with 17 additions and 10 deletions

View File

@ -193,7 +193,7 @@ macro set_io addr {
if addr = 0 if addr = 0
mov dx, [ebp + device.io_addr] mov dx, [ebp + device.io_addr]
else else
add dx, addr - LAST_IO add edx, addr - LAST_IO
end if end if
LAST_IO = addr LAST_IO = addr
@ -234,10 +234,11 @@ endp
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
align 4 align 4
proc service_proc stdcall, ioctl:dword proc service_proc ;stdcall, ioctl:dword
push ebp
mov edx, [ioctl] mov edx, [esp+8];[ioctl]
mov eax, [ebx+IOCTL.io_code] mov eax, [edx+IOCTL.io_code]
;------------------------------------------------------ ;------------------------------------------------------
;--------------- ;---------------
@ -250,7 +251,8 @@ proc service_proc stdcall, ioctl:dword
mov [eax], dword API_VERSION mov [eax], dword API_VERSION
xor eax, eax xor eax, eax
ret pop ebp
ret 4
;------------------------------------------------------ ;------------------------------------------------------
@@: ;--------- @@: ;---------
@ -374,7 +376,11 @@ proc service_proc stdcall, ioctl:dword
mov [ne2000_LIST+4*eax], ebx mov [ne2000_LIST+4*eax], ebx
inc [ne2000_DEV] inc [ne2000_DEV]
jmp EthRegDev ; Register the device to kernel (ebx points to device struct) call EthRegDev ; Register the device to kernel (ebx points to device struct)
cmp eax, -1
jz .err
pop ebp
ret 4
.err: .err:
stdcall KernelFree, ebx stdcall KernelFree, ebx
@ -385,7 +391,8 @@ proc service_proc stdcall, ioctl:dword
@@: @@:
.fail: .fail:
or eax, -1 or eax, -1
ret pop ebp
ret 4
;------------------------------------------------------ ;------------------------------------------------------
endp endp
@ -462,7 +469,7 @@ probe:
or [ebp + device.flags], FLAG_16BIT or FLAG_PIO or [ebp + device.flags], FLAG_16BIT or FLAG_PIO
mov [ebp + device.memsize], MEM_32768 mov [ebp + device.memsize], MEM_32768
mov [ebp + device.tx_start], 64 mov [ebp + device.tx_start], 64
add [ebp + device.rx_start], TXBUF_SIZE + 64 mov [ebp + device.rx_start], TXBUF_SIZE + 64
set_io 0 set_io 0
set_io P0_DCR set_io P0_DCR

View File

@ -1193,9 +1193,9 @@ read_mac:
mov edx, [ebx + device.io_addr] mov edx, [ebx + device.io_addr]
lea edi, [ebx + device.mac] lea edi, [ebx + device.mac]
in eax, edx in eax, dx
stosd stosd
add dx, 4 add edx, 4
in ax, dx in ax, dx
stosw stosw