Rev 9158 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9158 | Rev 10065 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2024. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;; R6040 driver for KolibriOS ;; |
6 | ;; R6040 driver for KolibriOS ;; |
7 | ;; ;; |
7 | ;; ;; |
8 | ;; based on R6040.c from linux ;; |
8 | ;; based on R6040.c from linux ;; |
Line 267... | Line 267... | ||
267 | cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
267 | cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
268 | jb .fail |
268 | jb .fail |
Line 269... | Line 269... | ||
269 | 269 | ||
270 | mov eax, [edx + IOCTL.input] |
270 | mov eax, [edx + IOCTL.input] |
271 | cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given |
271 | cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given |
Line 272... | Line 272... | ||
272 | jne .fail ; other types arent supported for this card yet |
272 | jne .fail ; other types aren't supported for this card yet |
Line 273... | Line 273... | ||
273 | 273 | ||
274 | ; check if the device is already listed |
274 | ; check if the device is already listed |
Line 283... | Line 283... | ||
283 | .nextdevice: |
283 | .nextdevice: |
284 | mov ebx, [esi] |
284 | mov ebx, [esi] |
285 | cmp al, byte[ebx + device.pci_bus] |
285 | cmp al, byte[ebx + device.pci_bus] |
286 | jne @f |
286 | jne @f |
287 | cmp ah, byte[ebx + device.pci_dev] |
287 | cmp ah, byte[ebx + device.pci_dev] |
288 | je .find_devicenum ; Device is already loaded, let's find it's device number |
288 | je .find_devicenum ; Device is already loaded, let's find its device number |
289 | @@: |
289 | @@: |
290 | add esi, 4 |
290 | add esi, 4 |
291 | loop .nextdevice |
291 | loop .nextdevice |
Line 292... | Line 292... | ||
292 | 292 | ||
293 | 293 | ||
294 | ; This device doesnt have its own eth_device structure yet, lets create one |
294 | ; This device doesn't have its own eth_device structure yet, let's create one |
295 | .firstdevice: |
295 | .firstdevice: |
Line 296... | Line 296... | ||
296 | cmp [devices], MAX_DEVICES ; First check if the driver can handle one more card |
296 | cmp [devices], MAX_DEVICES ; First check if the driver can handle one more card |
Line 311... | Line 311... | ||
311 | movzx ecx, byte[eax+1] |
311 | movzx ecx, byte[eax+1] |
312 | mov [ebx + device.pci_bus], ecx |
312 | mov [ebx + device.pci_bus], ecx |
313 | movzx ecx, byte[eax+2] |
313 | movzx ecx, byte[eax+2] |
314 | mov [ebx + device.pci_dev], ecx |
314 | mov [ebx + device.pci_dev], ecx |
Line 315... | Line 315... | ||
315 | 315 | ||
Line 316... | Line 316... | ||
316 | ; Now, it's time to find the base io addres of the PCI device |
316 | ; Now, it's time to find the base io address of the PCI device |
317 | 317 | ||
Line 318... | Line 318... | ||
318 | stdcall PCI_find_io, [ebx + device.pci_bus], [ebx + device.pci_dev] |
318 | stdcall PCI_find_io, [ebx + device.pci_bus], [ebx + device.pci_dev] |