Rev 7809 | Rev 9147 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7809 | Rev 7827 | ||
---|---|---|---|
Line 7... | Line 7... | ||
7 | ;; ;; |
7 | ;; ;; |
8 | ;; based on alx driver from TI-OpenLink ;; |
8 | ;; based on alx driver from TI-OpenLink ;; |
9 | ;; ;; |
9 | ;; ;; |
10 | ;; Written by hidnplayr (hidnplayr@gmail.com) ;; |
10 | ;; Written by hidnplayr (hidnplayr@gmail.com) ;; |
11 | ;; ;; |
11 | ;; ;; |
- | 12 | ;; Thanks to: floppy121 for kindly providing me with the hardware ;; |
|
- | 13 | ;; that made the development of this driver possible. ;; |
|
- | 14 | ;; ;; |
|
12 | ;; GNU GENERAL PUBLIC LICENSE ;; |
15 | ;; GNU GENERAL PUBLIC LICENSE ;; |
13 | ;; Version 2, June 1991 ;; |
16 | ;; Version 2, June 1991 ;; |
14 | ;; ;; |
17 | ;; ;; |
15 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
18 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 75... | Line 78... | ||
75 | struct device ETH_DEVICE |
78 | struct device ETH_DEVICE |
Line 76... | Line 79... | ||
76 | 79 | ||
77 | io_addr dd ? |
80 | io_addr dd ? |
78 | pci_bus dd ? |
81 | pci_bus dd ? |
- | 82 | pci_dev dd ? |
|
- | 83 | pci_vid dw ? ; Vendor ID |
|
79 | pci_dev dd ? |
84 | pci_did dw ? ; Device ID |
80 | irq_line dd ? |
85 | irq_line dd ? |
81 | pci_rev dd ? |
86 | pci_rev dd ? |
82 | chip_rev dd ? |
87 | chip_rev dd ? |
Line 309... | Line 314... | ||
309 | invoke PciRead16, [ebx + device.pci_bus], [ebx + device.pci_dev], PCI_header00.command |
314 | invoke PciRead16, [ebx + device.pci_bus], [ebx + device.pci_dev], PCI_header00.command |
310 | or al, PCI_CMD_MASTER + PCI_CMD_MMIO + PCI_CMD_PIO |
315 | or al, PCI_CMD_MASTER + PCI_CMD_MMIO + PCI_CMD_PIO |
311 | and ax, not(PCI_CMD_INTX_DISABLE) |
316 | and ax, not(PCI_CMD_INTX_DISABLE) |
312 | invoke PciWrite16, [ebx + device.pci_bus], [ebx + device.pci_dev], PCI_header00.command, eax |
317 | invoke PciWrite16, [ebx + device.pci_bus], [ebx + device.pci_dev], PCI_header00.command, eax |
Line -... | Line 318... | ||
- | 318 | ||
- | 319 | ; get device id |
|
- | 320 | invoke PciRead16, [ebx + device.pci_bus], [ebx + device.pci_dev], PCI_header00.device_id |
|
- | 321 | mov [ebx + device.pci_did], ax |
|
- | 322 | ||
- | 323 | mov esi, chiplist |
|
- | 324 | .loop: |
|
- | 325 | cmp word[esi+2], ax |
|
- | 326 | je .got_it |
|
- | 327 | add esi, 8 |
|
- | 328 | cmp esi, chiplist + 6*8 |
|
- | 329 | jbe .loop |
|
- | 330 | DEBUGF 2, "Unknown chip: 0x%x, continuing anyway\n", ax |
|
- | 331 | jmp .done |
|
- | 332 | .got_it: |
|
- | 333 | mov eax, dword[esi+4] |
|
- | 334 | mov [ebx + device.name], eax |
|
- | 335 | DEBUGF 1, "Chip type = %s\n", eax |
|
- | 336 | .done: |
|
313 | 337 | ||
314 | ; get revision id. |
338 | ; get revision id. |
315 | invoke PciRead8, [ebx + device.pci_bus], [ebx + device.pci_dev], PCI_header00.revision_id |
339 | invoke PciRead8, [ebx + device.pci_bus], [ebx + device.pci_dev], PCI_header00.revision_id |
316 | and eax, 0xff |
340 | and eax, 0xff |
317 | mov [ebx + device.pci_rev], eax |
341 | mov [ebx + device.pci_rev], eax |
318 | shr al, ALX_PCI_REVID_SHIFT |
342 | shr al, ALX_PCI_REVID_SHIFT |
Line 319... | Line 343... | ||
319 | mov [ebx + device.chip_rev], eax |
343 | mov [ebx + device.chip_rev], eax |
Line 320... | Line 344... | ||
320 | 344 | ||
Line 321... | Line 345... | ||
321 | DEBUGF 1,"revision: %u\n", al |
345 | DEBUGF 1,"Revision: %u\n", al |
322 | 346 | ||
Line 543... | Line 567... | ||
543 | @@: |
567 | @@: |
544 | xor eax, eax |
568 | xor eax, eax |
545 | ret |
569 | ret |
Line 546... | Line 570... | ||
546 | 570 | ||
- | 571 | .einval: |
|
- | 572 | DEBUGF 1, "Invalid revision 0x%x\n", [ebx + device.chip_rev] |
|
547 | .einval: |
573 | |
548 | xor eax, eax |
574 | xor eax, eax |
549 | dec eax |
575 | dec eax |
Line 921... | Line 947... | ||
921 | ; TODO: check if it's not a multicast |
947 | ; TODO: check if it's not a multicast |
922 | xor eax, eax |
948 | xor eax, eax |
923 | ret |
949 | ret |
Line 924... | Line 950... | ||
924 | 950 | ||
- | 951 | .invalid: |
|
925 | .invalid: |
952 | DEBUGF 1, "Invalid MAC!\n" |
926 | xor eax, eax |
953 | xor eax, eax |
927 | inc eax |
954 | inc eax |
Line 1404... | Line 1431... | ||
1404 | mov eax, (ALX_RXQ0_NUM_RFD_PREF_DEF shl ALX_RXQ0_NUM_RFD_PREF_SHIFT) \ |
1431 | mov eax, (ALX_RXQ0_NUM_RFD_PREF_DEF shl ALX_RXQ0_NUM_RFD_PREF_SHIFT) \ |
1405 | or (ALX_RXQ0_RSS_MODE_DIS shl ALX_RXQ0_RSS_MODE_SHIFT) \ |
1432 | or (ALX_RXQ0_RSS_MODE_DIS shl ALX_RXQ0_RSS_MODE_SHIFT) \ |
1406 | or (ALX_RXQ0_IDT_TBL_SIZE_DEF shl ALX_RXQ0_IDT_TBL_SIZE_SHIFT) \ |
1433 | or (ALX_RXQ0_IDT_TBL_SIZE_DEF shl ALX_RXQ0_IDT_TBL_SIZE_SHIFT) \ |
1407 | or ALX_RXQ0_RSS_HSTYP_ALL or ALX_RXQ0_RSS_HASH_EN or ALX_RXQ0_IPV6_PARSE_EN |
1434 | or ALX_RXQ0_RSS_HSTYP_ALL or ALX_RXQ0_RSS_HASH_EN or ALX_RXQ0_IPV6_PARSE_EN |
Line 1408... | Line 1435... | ||
1408 | 1435 | ||
1409 | test [ebx + device.pci_dev], 1 ;;; FIXME: is gigabit device? |
1436 | test [ebx + device.pci_did], 1 ;;; FIXME: is gigabit device? |
1410 | jz @f |
1437 | jz @f |
1411 | or eax, ALX_RXQ0_ASPM_THRESH_100M shl ALX_RXQ0_ASPM_THRESH_SHIFT |
1438 | or eax, ALX_RXQ0_ASPM_THRESH_100M shl ALX_RXQ0_ASPM_THRESH_SHIFT |
1412 | @@: |
1439 | @@: |
Line 1744... | Line 1771... | ||
1744 | 1771 | ||
Line 1745... | Line 1772... | ||
1745 | include '../peimport.inc' |
1772 | include '../peimport.inc' |
Line -... | Line 1773... | ||
- | 1773 | ||
- | 1774 | my_service db 'AR81XX',0 ; max 16 chars include zero |
|
- | 1775 | ||
- | 1776 | ||
- | 1777 | chiplist: |
|
- | 1778 | dd (ALX_DEV_ID_AR8131 shl 16) or ALX_VEN_ID, ar8131_sz |
|
- | 1779 | dd (ALX_DEV_ID_AR8161 shl 16) or ALX_VEN_ID, ar8161_sz |
|
- | 1780 | dd (ALX_DEV_ID_AR8162 shl 16) or ALX_VEN_ID, ar8162_sz |
|
- | 1781 | dd (ALX_DEV_ID_AR8171 shl 16) or ALX_VEN_ID, ar8171_sz |
|
- | 1782 | dd (ALX_DEV_ID_AR8172 shl 16) or ALX_VEN_ID, ar8172_sz |
|
- | 1783 | dd (ALX_DEV_ID_E2200 shl 16) or ALX_VEN_ID, e2200_sz |
|
- | 1784 | dd (ALX_DEV_ID_E2400 shl 16) or ALX_VEN_ID, e2400_sz |
|
- | 1785 | dd (ALX_DEV_ID_E2500 shl 16) or ALX_VEN_ID, e2500_sz |
|
- | 1786 | dd 0 |
|
- | 1787 | ||
- | 1788 | ar8131_sz db "AR8131", 0 |
|
- | 1789 | ar8161_sz db "AR8161", 0 |
|
- | 1790 | ar8162_sz db "AR8162", 0 |
|
- | 1791 | ar8171_sz db "QCA8171", 0 |
|
- | 1792 | ar8172_sz db "QCA8172", 0 |
|
- | 1793 | e2200_sz db "Killer E2200", 0 |
|
1746 | 1794 | e2400_sz db "Killer E2400", 0 |
|
Line 1747... | Line 1795... | ||
1747 | my_service db 'AR81XX',0 ; max 16 chars include zero |
1795 | e2500_sz db "Killer E2500", 0 |
1748 | 1796 | ||
1749 | include_debug_strings |
1797 | include_debug_strings |