Rev 3158 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3158 | Rev 3205 | ||
---|---|---|---|
Line 38... | Line 38... | ||
38 | 38 | ||
Line 39... | Line 39... | ||
39 | ETH_DEVICE |
39 | ETH_DEVICE |
40 | 40 | ||
41 | .io_addr dd ? |
41 | .io_addr dd ? |
42 | .irq_line db ? |
42 | .irq_line db ? |
Line 43... | Line 43... | ||
43 | .pci_bus db ? |
43 | .pci_bus dd ? |
44 | .pci_dev db ? |
44 | .pci_dev dd ? |
Line 45... | Line 45... | ||
45 | 45 | ||
Line 236... | Line 236... | ||
236 | jz .firstdevice_pci |
236 | jz .firstdevice_pci |
Line 237... | Line 237... | ||
237 | 237 | ||
238 | mov ax, [eax+1] ; get the pci bus and device numbers |
238 | mov ax, [eax+1] ; get the pci bus and device numbers |
239 | .nextdevice: |
239 | .nextdevice: |
240 | mov ebx, [esi] |
240 | mov ebx, [esi] |
- | 241 | cmp al, byte[device.pci_bus] |
|
- | 242 | jne @f |
|
241 | cmp ax, word [device.pci_bus] ; compare with pci and device num in device list (notice the usage of word instead of byte) |
243 | cmp ah, byte[device.pci_dev] |
- | 244 | je .find_devicenum ; Device is already loaded, let's find it's device number |
|
242 | je .find_devicenum ; Device is already loaded, let's find it's device number |
245 | @@: |
243 | add esi, 4 |
246 | add esi, 4 |
Line 244... | Line 247... | ||
244 | loop .nextdevice |
247 | loop .nextdevice |
245 | 248 | ||
Line 246... | Line 249... | ||
246 | .firstdevice_pci: |
249 | .firstdevice_pci: |
247 | call create_new_struct |
250 | call create_new_struct |
248 | 251 | ||
249 | mov eax, [IOCTL.input] |
252 | mov eax, [IOCTL.input] |
250 | mov cl, [eax+1] |
253 | movzx ecx, byte[eax+1] |
Line 251... | Line 254... | ||
251 | mov [device.pci_bus], cl |
254 | mov [device.pci_bus], ecx |
Line 252... | Line 255... | ||
252 | mov cl, [eax+2] |
255 | movzx ecx, byte[eax+2] |
Line 253... | Line 256... | ||
253 | mov [device.pci_dev], cl |
256 | mov [device.pci_dev], ecx |
Line 254... | Line 257... | ||
254 | 257 | ||
Line 255... | Line 258... | ||
255 | ; Now, it's time to find the base io addres of the PCI device |
258 | ; Now, it's time to find the base io addres of the PCI device |
Line 256... | Line 259... | ||
256 | 259 |