Updated PCI macros for network drivers.

git-svn-id: svn://kolibrios.org@3205 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr
2013-01-31 13:10:10 +00:00
parent 44f2d6661d
commit c4c2da3caa
12 changed files with 182 additions and 184 deletions

View File

@@ -208,8 +208,8 @@ virtual at ebx
.io_addr dd ?
.curr_tx_desc db ?
.pci_bus db ?
.pci_dev db ?
.pci_bus dd ?
.pci_dev dd ?
.irq_line db ?
.hw_ver_id db ?
@@ -298,8 +298,11 @@ proc service_proc stdcall, ioctl:dword
mov ax , [eax+1] ; get the pci bus and device numbers
.nextdevice:
mov ebx, [esi]
cmp ax , word [device.pci_bus] ; compare with pci and device num in device list (notice the usage of word instead of byte)
cmp al, byte[device.pci_bus]
jne @f
cmp ah, byte[device.pci_dev]
je .find_devicenum ; Device is already loaded, let's find it's device number
@@:
add esi, 4
loop .nextdevice
@@ -323,18 +326,18 @@ proc service_proc stdcall, ioctl:dword
; save the pci bus and device numbers
mov eax, [IOCTL.input]
mov cl, [eax+1]
mov [device.pci_bus], cl
mov cl, [eax+2]
mov [device.pci_dev], cl
movzx ecx, byte[eax+1]
mov [device.pci_bus], ecx
movzx ecx, byte[eax+2]
mov [device.pci_dev], ecx
; Now, it's time to find the base io addres of the PCI device
find_io [device.pci_bus], [device.pci_dev], [device.io_addr]
PCI_find_io
; We've found the io address, find IRQ now
find_irq [device.pci_bus], [device.pci_dev], [device.irq_line]
PCI_find_irq
DEBUGF 2, "Hooking into device, dev:%x, bus:%x, irq:%x, addr:%x\n",\
[device.pci_dev]:1,[device.pci_bus]:1,[device.irq_line]:1,[device.io_addr]:4
@@ -422,7 +425,7 @@ align 4
probe:
DEBUGF 2, "Probing %s device\n", my_service
make_bus_master [device.pci_bus], [device.pci_dev]
PCI_make_bus_master
; get chip version