276,8 → 276,8 |
.rx_desc rb NUM_RX_DESC*mtd_desc.size |
|
.io_addr dd ? |
.pci_bus db ? |
.pci_dev db ? |
.pci_bus dd ? |
.pci_dev dd ? |
.irq_line db ? |
.dev_id dw ? |
|
386,8 → 386,11 |
mov ax , [eax+1] ; |
.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 |
|
411,18 → 414,18 |
; 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]:8 |
513,11 → 516,9 |
|
DEBUGF 2,"Probing mtd80x device\n" |
|
make_bus_master [device.pci_bus], [device.pci_dev] |
PCI_make_bus_master |
|
movzx eax, [device.pci_bus] |
movzx ecx, [device.pci_dev] |
stdcall PciRead32, eax ,ecx ,0 |
stdcall PciRead32, [device.pci_bus], [device.pci_dev], 0 |
|
cmp ax , 0x1516 |
jne .notfound |