git-svn-id: svn://kolibrios.org@4470 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2014-01-17 15:07:07 +00:00
parent f514bd90e1
commit b21956c356
14 changed files with 123 additions and 123 deletions

View File

@ -403,16 +403,16 @@ align 4
proc service_proc stdcall, ioctl:dword
mov edx, [ioctl]
mov eax, [IOCTL.io_code]
mov eax, [edx + IOCTL.io_code]
;------------------------------------------------------
cmp eax, 0 ;SRV_GETVERSION
jne @F
cmp [IOCTL.out_size], 4
cmp [edx + IOCTL.out_size], 4
jb .fail
mov eax, [IOCTL.output]
mov eax, [edx + IOCTL.output]
mov [eax], dword API_VERSION
xor eax, eax
@ -423,10 +423,10 @@ proc service_proc stdcall, ioctl:dword
cmp eax, 1 ;SRV_HOOK
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jb .fail
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
jne .fail ; other types of this hardware dont exist
@ -437,7 +437,7 @@ proc service_proc stdcall, ioctl:dword
jz .maybeboomerang
mov esi, VORTEX_LIST
mov eax, [IOCTL.input] ; get the pci bus and device numbers
mov eax, [edx + IOCTL.input] ; get the pci bus and device numbers
mov ax , [eax+1] ;
.nextdevice:
mov ebx, [esi]
@ -456,8 +456,8 @@ proc service_proc stdcall, ioctl:dword
jz .firstdevice
mov esi, BOOMERANG_LIST
mov eax, [IOCTL.input] ; get the pci bus and device numbers
mov ax , [eax+1] ;
mov eax, [edx + IOCTL.input] ; get the pci bus and device numbers
mov ax, [eax+1] ;
.nextdevice2:
mov ebx, [esi]
cmp al, byte[device.pci_bus]
@ -487,7 +487,7 @@ proc service_proc stdcall, ioctl:dword
; save the pci bus and device numbers
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
movzx ecx, byte[eax+1]
mov [device.pci_bus], ecx
movzx ecx, byte[eax+2]

View File

@ -260,16 +260,16 @@ align 4
proc service_proc stdcall, ioctl:dword
mov edx, [ioctl]
mov eax, [IOCTL.io_code]
mov eax, [edx + IOCTL.io_code]
;------------------------------------------------------
cmp eax, 0 ;SRV_GETVERSION
jne @F
cmp [IOCTL.out_size], 4
cmp [edx + IOCTL.out_size], 4
jb .fail
mov eax, [IOCTL.output]
mov eax, [edx + IOCTL.output]
mov [eax], dword API_VERSION
xor eax, eax
@ -280,10 +280,10 @@ proc service_proc stdcall, ioctl:dword
cmp eax, 1 ;SRV_HOOK
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jb .fail
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
jne .fail ; other types arent supported for this card yet
@ -294,7 +294,7 @@ proc service_proc stdcall, ioctl:dword
test ecx, ecx
jz .firstdevice
; mov eax, [IOCTL.input] ; get the pci bus and device numbers
; mov eax, [edx + IOCTL.input] ; get the pci bus and device numbers
mov ax , [eax+1] ;
.nextdevice:
mov ebx, [esi]
@ -323,7 +323,7 @@ proc service_proc stdcall, ioctl:dword
; save the pci bus and device numbers
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
movzx ecx, byte[eax+1]
mov [device.pci_bus], ecx
movzx ecx, byte[eax+2]

View File

@ -192,16 +192,16 @@ align 4
proc service_proc stdcall, ioctl:dword
mov edx, [ioctl]
mov eax, [IOCTL.io_code]
mov eax, [edx + IOCTL.io_code]
;------------------------------------------------------
;---------------
cmp eax, 0 ;SRV_GETVERSION
jne @F ;---------------
cmp [IOCTL.out_size], 4
cmp [edx + IOCTL.out_size], 4
jb .fail
mov eax, [IOCTL.output]
mov eax, [edx + IOCTL.output]
mov [eax], dword API_VERSION
xor eax, eax
@ -214,14 +214,14 @@ proc service_proc stdcall, ioctl:dword
DEBUGF 1, "Checking if device is already listed..\n"
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
cmp [IOCTL.inp_size], 3
cmp [edx + IOCTL.inp_size], 3
jb .fail
cmp byte [eax], 1
je .pci
cmp [IOCTL.inp_size], 4
cmp [edx + IOCTL.inp_size], 4
jb .fail
cmp byte [eax], 0
je .isa
@ -251,7 +251,7 @@ proc service_proc stdcall, ioctl:dword
.firstdevice_pci:
call create_new_struct
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
movzx ecx, byte[eax+1]
mov [device.pci_bus], ecx
movzx ecx, byte[eax+2]
@ -290,7 +290,7 @@ proc service_proc stdcall, ioctl:dword
.firstdevice_isa:
call create_new_struct
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
movzx ecx, word [eax+1]
mov [device.io_addr], ecx
mov cl, [eax+3]

View File

@ -267,16 +267,16 @@ align 4
proc service_proc stdcall, ioctl:dword
mov edx, [ioctl]
mov eax, [IOCTL.io_code]
mov eax, [edx + IOCTL.io_code]
;------------------------------------------------------
cmp eax, 0 ;SRV_GETVERSION
jne @F
cmp [IOCTL.out_size], 4
cmp [edx + IOCTL.out_size], 4
jb .fail
mov eax, [IOCTL.output]
mov eax, [edx + IOCTL.output]
mov [eax], dword API_VERSION
xor eax, eax
@ -287,10 +287,10 @@ proc service_proc stdcall, ioctl:dword
cmp eax, 1 ;SRV_HOOK
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jb .fail
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
jne .fail ; other types arent supported for this card yet
@ -329,7 +329,7 @@ proc service_proc stdcall, ioctl:dword
; save the pci bus and device numbers
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
movzx ecx, byte[eax+1]
mov [device.pci_bus], ecx
movzx ecx, byte[eax+2]

View File

@ -406,16 +406,16 @@ align 4
proc service_proc stdcall, ioctl:dword
mov edx, [ioctl]
mov eax, [IOCTL.io_code]
mov eax, [edx + IOCTL.io_code]
;------------------------------------------------------
cmp eax, 0 ;SRV_GETVERSION
jne @F
cmp [IOCTL.out_size], 4
cmp [edx + IOCTL.out_size], 4
jb .fail
mov eax, [IOCTL.output]
mov eax, [edx + IOCTL.output]
mov [eax], dword API_VERSION
xor eax, eax
@ -426,10 +426,10 @@ proc service_proc stdcall, ioctl:dword
cmp eax, 1 ;SRV_HOOK
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jb .fail
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
jne .fail ; other types arent supported for this card yet
@ -440,8 +440,8 @@ proc service_proc stdcall, ioctl:dword
test ecx, ecx
jz .firstdevice
; mov eax, [IOCTL.input] ; get the pci bus and device numbers
mov ax , [eax+1] ;
; mov eax, [edx + IOCTL.input] ; get the pci bus and device numbers
mov ax, [eax+1] ;
.nextdevice:
mov ebx, [esi]
cmp al, byte[device.pci_bus]
@ -469,7 +469,7 @@ proc service_proc stdcall, ioctl:dword
; save the pci bus and device numbers
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
movzx ecx, byte[eax+1]
mov [device.pci_bus], ecx
movzx ecx, byte[eax+2]

View File

@ -79,7 +79,7 @@ proc START stdcall, state:dword
.entry:
DEBUGF 2,"Loading %s driver\n", my_service
DEBUGF 2,"Loading driver\n"
stdcall RegService, my_service, service_proc
ret
@ -104,16 +104,16 @@ align 4
proc service_proc stdcall, ioctl:dword
mov edx, [ioctl]
mov eax, [IOCTL.io_code]
mov eax, [edx + IOCTL.io_code]
;------------------------------------------------------
cmp eax, 0 ;SRV_GETVERSION
jne @F
cmp [IOCTL.out_size], 4
cmp [edx + IOCTL.out_size], 4
jb .fail
mov eax, [IOCTL.output]
mov eax, [edx + IOCTL.output]
mov [eax], dword API_VERSION
xor eax, eax
@ -124,10 +124,10 @@ proc service_proc stdcall, ioctl:dword
cmp eax, 1 ;SRV_HOOK
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jb .fail
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
jne .fail ; other types arent supported for this card yet
@ -138,7 +138,7 @@ proc service_proc stdcall, ioctl:dword
test ecx, ecx
jz .firstdevice
; mov eax, [IOCTL.input] ; get the pci bus and device numbers
; mov eax, [edx + IOCTL.input] ; get the pci bus and device numbers
mov ax, [eax+1] ;
.nextdevice:
mov ebx, [esi]
@ -167,7 +167,7 @@ proc service_proc stdcall, ioctl:dword
; save the pci bus and device numbers
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
movzx ecx, byte [eax+1]
mov [device.pci_bus], ecx
movzx ecx, byte [eax+2]

View File

@ -348,16 +348,16 @@ align 4
proc service_proc stdcall, ioctl:dword
mov edx, [ioctl]
mov eax, [IOCTL.io_code]
mov eax, [edx + IOCTL.io_code]
;------------------------------------------------------
cmp eax, 0 ;SRV_GETVERSION
jne @F
cmp [IOCTL.out_size], 4
cmp [edx + IOCTL.out_size], 4
jb .fail
mov eax, [IOCTL.output]
mov eax, [edx + IOCTL.output]
mov [eax], dword API_VERSION
xor eax, eax
@ -368,10 +368,10 @@ proc service_proc stdcall, ioctl:dword
cmp eax, 1 ;SRV_HOOK
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jb .fail
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
jne .fail ; other types arent supported for this card yet
@ -382,8 +382,8 @@ proc service_proc stdcall, ioctl:dword
test ecx, ecx
jz .firstdevice
; mov eax, [IOCTL.input] ; get the pci bus and device numbers
mov ax , [eax+1] ;
; mov eax, [edx + IOCTL.input] ; get the pci bus and device numbers
mov ax, [eax+1] ;
.nextdevice:
mov ebx, [esi]
cmp al, byte[device.pci_bus]
@ -416,7 +416,7 @@ proc service_proc stdcall, ioctl:dword
; save the pci bus and device numbers
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
movzx ecx, byte[eax+1]
mov [device.pci_bus], ecx
movzx ecx, byte[eax+2]

View File

@ -456,7 +456,7 @@ proc START stdcall, state:dword
cmp [state], 1
jne .exit
DEBUGF 2,"Loading %s driver\n", my_service
DEBUGF 2,"Loading driver\n"
stdcall RegService, my_service, service_proc
ret
@ -478,16 +478,16 @@ align 4
proc service_proc stdcall, ioctl:dword
mov edx, [ioctl]
mov eax, [IOCTL.io_code]
mov eax, [edx + IOCTL.io_code]
;------------------------------------------------------
cmp eax, 0 ;SRV_GETVERSION
jne @F
cmp [IOCTL.out_size], 4
cmp [edx + IOCTL.out_size], 4
jb .fail
mov eax, [IOCTL.output]
mov eax, [edx + IOCTL.output]
mov [eax], dword API_VERSION
xor eax, eax
@ -498,10 +498,10 @@ proc service_proc stdcall, ioctl:dword
cmp eax, 1 ;SRV_HOOK
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jb .fail
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
jne .fail ; other types arent supported for this card yet
@ -512,7 +512,7 @@ proc service_proc stdcall, ioctl:dword
test ecx, ecx
jz .firstdevice
; mov eax, [IOCTL.input] ; get the pci bus and device numbers
; mov eax, [edx + IOCTL.input] ; get the pci bus and device numbers
mov ax, [eax+1]
.nextdevice:
mov ebx, [esi]
@ -541,7 +541,7 @@ proc service_proc stdcall, ioctl:dword
; save the pci bus and device numbers
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
movzx ecx, byte [eax+1]
mov [device.pci_bus], ecx
movzx ecx, byte [eax+2]
@ -1798,7 +1798,7 @@ read_mac:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
align 4
transmit:
DEBUGF 2,"\nTransmitting packet, buffer:%x, size:%u\n", [esp+4], [esp+8]
DEBUGF 2,"Transmitting packet, buffer:%x, size:%u\n", [esp+4], [esp+8]
mov eax, [esp+4]
DEBUGF 2,"To: %x-%x-%x-%x-%x-%x From: %x-%x-%x-%x-%x-%x Type:%x%x\n",\
[eax+00]:2,[eax+01]:2,[eax+02]:2,[eax+03]:2,[eax+04]:2,[eax+05]:2,\
@ -1859,7 +1859,7 @@ int_handler:
push ebx esi edi
DEBUGF 2,"\n%s INT\n", my_service
DEBUGF 2,"INT\n"
;-------------------------------------------
; Find pointer of device wich made IRQ occur

View File

@ -316,16 +316,16 @@ align 4
proc service_proc stdcall, ioctl:dword
mov edx, [ioctl]
mov eax, [IOCTL.io_code]
mov eax, [edx + IOCTL.io_code]
;------------------------------------------------------
cmp eax, 0 ;SRV_GETVERSION
jne @F
cmp [IOCTL.out_size], 4
cmp [edx + IOCTL.out_size], 4
jb .fail
mov eax, [IOCTL.output]
mov eax, [edx + IOCTL.output]
mov [eax], dword API_VERSION
xor eax, eax
@ -336,10 +336,10 @@ proc service_proc stdcall, ioctl:dword
cmp eax, 1 ;SRV_HOOK
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jb .fail
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
jne .fail ; other types arent supported for this card yet
@ -350,7 +350,7 @@ proc service_proc stdcall, ioctl:dword
test ecx, ecx
jz .firstdevice
; mov eax, [IOCTL.input] ; get the pci bus and device numbers
; mov eax, [edx + IOCTL.input] ; get the pci bus and device numbers
mov ax, [eax+1] ;
.nextdevice:
mov ebx, [esi]
@ -379,7 +379,7 @@ proc service_proc stdcall, ioctl:dword
; save the pci bus and device numbers
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
movzx ecx, byte [eax+1]
mov [device.pci_bus], ecx
movzx ecx, byte [eax+2]

View File

@ -219,16 +219,16 @@ align 4
proc service_proc stdcall, ioctl:dword
mov edx, [ioctl]
mov eax, [IOCTL.io_code]
mov eax, [edx + IOCTL.io_code]
;------------------------------------------------------
cmp eax, 0 ;SRV_GETVERSION
jne @F
cmp [IOCTL.out_size], 4
cmp [edx + IOCTL.out_size], 4
jb .fail
mov eax, [IOCTL.output]
mov eax, [edx + IOCTL.output]
mov [eax], dword API_VERSION
xor eax, eax
@ -239,10 +239,10 @@ proc service_proc stdcall, ioctl:dword
cmp eax, 1 ;SRV_HOOK
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jb .fail
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
jne .fail ; other types arent supported for this card yet
@ -253,7 +253,7 @@ proc service_proc stdcall, ioctl:dword
test ecx, ecx
jz .firstdevice
; mov eax, [IOCTL.input] ; get the pci bus and device numbers
; mov eax, [edx + IOCTL.input] ; get the pci bus and device numbers
mov ax , [eax+1] ;
.nextdevice:
mov ebx, [esi]
@ -282,7 +282,7 @@ proc service_proc stdcall, ioctl:dword
; save the pci bus and device numbers
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
movzx ecx, byte[eax+1]
mov [device.pci_bus], ecx
movzx ecx, byte[eax+2]

View File

@ -327,7 +327,7 @@ proc START stdcall, state:dword
.entry:
DEBUGF 2,"Loading %s driver\n", my_service
DEBUGF 2,"Loading driver\n"
stdcall RegService, my_service, service_proc
ret
@ -350,16 +350,16 @@ align 4
proc service_proc stdcall, ioctl:dword
mov edx, [ioctl]
mov eax, [IOCTL.io_code]
mov eax, [edx + IOCTL.io_code]
;------------------------------------------------------
cmp eax, 0 ;SRV_GETVERSION
jne @F
cmp [IOCTL.out_size], 4
cmp [edx + IOCTL.out_size], 4
jb .fail
mov eax, [IOCTL.output]
mov eax, [edx + IOCTL.output]
mov [eax], dword API_VERSION
xor eax, eax
@ -370,10 +370,10 @@ proc service_proc stdcall, ioctl:dword
cmp eax, 1 ;SRV_HOOK
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jb .fail
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
jne .fail ; other types arent supported for this card yet
@ -384,8 +384,8 @@ proc service_proc stdcall, ioctl:dword
test ecx, ecx
jz .firstdevice
; mov eax, [IOCTL.input] ; get the pci bus and device numbers
mov ax , [eax+1] ;
; mov eax, [edx + IOCTL.input] ; get the pci bus and device numbers
mov ax, [eax+1] ;
.nextdevice:
mov ebx, [esi]
cmp al, byte[device.pci_bus]
@ -413,7 +413,7 @@ proc service_proc stdcall, ioctl:dword
; save the pci bus and device numbers
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
movzx ecx, byte[eax+1]
mov [device.pci_bus], ecx
movzx ecx, byte[eax+2]
@ -514,7 +514,7 @@ ret
align 4
probe:
DEBUGF 2,"Probing mtd80x device\n"
DEBUGF 2,"Probing device\n"
PCI_make_bus_master
@ -635,7 +635,7 @@ probe:
align 4
reset:
DEBUGF 1,"Resetting mtd80x\n"
DEBUGF 1,"Resetting\n"
;--------------------------------
; insert irq handler on given irq
@ -645,7 +645,7 @@ reset:
stdcall AttachIntHandler, eax, int_handler, dword 0
test eax, eax
jnz @f
DEBUGF 1,"\nCould not attach int handler!\n"
DEBUGF 1,"Could not attach int handler!\n"
; or eax, -1
; ret
@@:
@ -1105,7 +1105,7 @@ int_handler:
push ebx esi edi
DEBUGF 1,"\n%s int\n", my_service
DEBUGF 1,"int\n"
; find pointer of device wich made IRQ occur
@ -1134,7 +1134,7 @@ int_handler:
.got_it:
DEBUGF 1,"Device: %x Status: %x ", ebx, ax
DEBUGF 1,"Device: %x Status: %x\n", ebx, ax
test ax, RI ; receive interrupt
jz .no_rx

View File

@ -396,16 +396,16 @@ align 4
proc service_proc stdcall, ioctl:dword
mov edx, [ioctl]
mov eax, [IOCTL.io_code]
mov eax, [edx + IOCTL.io_code]
;------------------------------------------------------
cmp eax, 0 ;SRV_GETVERSION
jne @F
cmp [IOCTL.out_size], 4
cmp [edx + IOCTL.out_size], 4
jb .fail
mov eax, [IOCTL.output]
mov eax, [edx + IOCTL.output]
mov [eax], dword API_VERSION
xor eax, eax
@ -416,10 +416,10 @@ proc service_proc stdcall, ioctl:dword
cmp eax, 1 ;SRV_HOOK
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jb .fail
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
jne .fail ; other types arent supported for this card yet
@ -430,8 +430,8 @@ proc service_proc stdcall, ioctl:dword
jz .firstdevice
mov esi, device_list
; mov eax, [IOCTL.input] ; get the pci bus and device numbers
mov ax , [eax+1] ;
; mov eax, [edx + IOCTL.input] ; get the pci bus and device numbers
mov ax, [eax+1] ;
.nextdevice:
mov ebx, [esi]
cmp al, byte[device.pci_bus]
@ -459,7 +459,7 @@ proc service_proc stdcall, ioctl:dword
; save the pci bus and device numbers
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
movzx ecx, byte[eax+1]
mov [device.pci_bus], ecx
movzx ecx, byte[eax+2]

View File

@ -555,7 +555,7 @@ proc START stdcall, state:dword
.entry:
DEBUGF 2,"Loading %s driver\n", my_service
DEBUGF 2,"Loading driver\n"
stdcall RegService, my_service, service_proc
ret
@ -578,16 +578,16 @@ align 4
proc service_proc stdcall, ioctl:dword
mov edx, [ioctl]
mov eax, [IOCTL.io_code]
mov eax, [edx + IOCTL.io_code]
;------------------------------------------------------
cmp eax, 0 ;SRV_GETVERSION
jne @F
cmp [IOCTL.out_size], 4
cmp [edx + IOCTL.out_size], 4
jb .fail
mov eax, [IOCTL.output]
mov eax, [edx + IOCTL.output]
mov [eax], dword API_VERSION
xor eax, eax
@ -598,10 +598,10 @@ proc service_proc stdcall, ioctl:dword
cmp eax, 1 ;SRV_HOOK
jne .fail
cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes
jb .fail
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given
jne .fail ; other types arent supported for this card yet
@ -612,8 +612,8 @@ proc service_proc stdcall, ioctl:dword
test ecx, ecx
jz .firstdevice
; mov eax, [IOCTL.input] ; get the pci bus and device numbers
mov ax , [eax+1] ;
; mov eax, [edx + IOCTL.input] ; get the pci bus and device numbers
mov ax, [eax+1] ;
.nextdevice:
mov ebx, [esi]
cmp al, byte[device.pci_bus]
@ -641,7 +641,7 @@ proc service_proc stdcall, ioctl:dword
; save the pci bus and device numbers
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
movzx ecx, byte[eax+1]
mov [device.pci_bus], ecx
movzx ecx, byte[eax+2]
@ -1381,8 +1381,6 @@ macro IOSYNC
align 4
read_mac:
DEBUGF 1, "Ethernet Address: "
lea edi, [device.mac]
set_io 0
set_io byPAR0
@ -1390,11 +1388,13 @@ read_mac:
.next:
in al, dx
stosb
DEBUGF 1, "-%x", al
inc edx
dec ecx
jnz .next
DEBUGF 1, "\n"
DEBUGF 1,"MAC = %x-%x-%x-%x-%x-%x\n", \
[device.mac+0]:2,[device.mac+1]:2,[device.mac+2]:2,[device.mac+3]:2,[device.mac+4]:2,[device.mac+5]:2
ret
@ -1410,7 +1410,7 @@ read_mac:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
align 4
transmit:
DEBUGF 1,"\nTransmitting packet, buffer:%x, size:%u\n", [esp+4], [esp+8]
DEBUGF 1,"Transmitting packet, buffer:%x, size:%u\n", [esp+4], [esp+8]
mov eax, [esp+4]
DEBUGF 1,"To: %x-%x-%x-%x-%x-%x From: %x-%x-%x-%x-%x-%x Type:%x%x\n",\
[eax+00]:2,[eax+01]:2,[eax+02]:2,[eax+03]:2,[eax+04]:2,[eax+05]:2,\
@ -1485,7 +1485,7 @@ int_handler:
push ebx esi edi
DEBUGF 1,"\n%s int ", my_service
DEBUGF 1,"INT\n"
; Find pointer of device wich made IRQ occur

View File

@ -267,15 +267,15 @@ service_proc:
; pointer to IOCTL structure.
mov edx, [esp+4] ; edx -> IOCTL
; 2. Get request code and select a handler for the code.
mov eax, [IOCTL.io_code]
mov eax, [edx + IOCTL.io_code]
test eax, eax ; check for SRV_GETVERSION
jnz @f
; 3. This is SRV_GETVERSION request, no input, 4 bytes output, API_VERSION.
; 3a. Output size must be at least 4 bytes.
cmp [IOCTL.out_size], 4
cmp [edx + IOCTL.out_size], 4
jb .fail
; 3b. Write result to the output buffer.
mov eax, [IOCTL.output]
mov eax, [edx + IOCTL.output]
mov [eax], dword API_VERSION
; 3c. Return success.
xor eax, eax
@ -286,10 +286,10 @@ service_proc:
; 4. This is SRV_HOOK request, input defines the device to hook, no output.
; 4a. The driver works only with PCI devices,
; so input must be at least 3 bytes long.
cmp [IOCTL.inp_size], 3
cmp [edx + IOCTL.inp_size], 3
jb .fail
; 4b. First byte of input is bus type, 1 stands for PCI.
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
cmp byte [eax], 1
jne .fail
; 4c. Second and third bytes of the input define the device: bus and dev.
@ -303,7 +303,7 @@ service_proc:
test ecx, ecx
jz .firstdevice
; mov eax, [IOCTL.input] ; get the pci bus and device numbers
; mov eax, [edx + IOCTL.input] ; get the pci bus and device numbers
mov ax, [eax+1] ;
.nextdevice:
mov ebx, [esi]
@ -323,7 +323,7 @@ service_proc:
; 4h. Zero the structure.
allocate_and_clear ebx, device.size, .fail
; 4i. Save PCI coordinates
mov eax, [IOCTL.input]
mov eax, [edx + IOCTL.input]
movzx ecx, byte[eax+1]
mov [device.pci_bus], ecx
movzx ecx, byte[eax+2]