Rev 9188 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9188 | Rev 10054 | ||
---|---|---|---|
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 | ;; 3Com network driver for KolibriOS ;; |
6 | ;; 3Com network driver for KolibriOS ;; |
7 | ;; ;; |
7 | ;; ;; |
8 | ;; Ported to KolibriOS net-branch by hidnplayr ;; |
8 | ;; Ported to KolibriOS net-branch by hidnplayr ;; |
Line 92... | Line 92... | ||
92 | 92 | ||
Line 93... | Line 93... | ||
93 | ; configureable area |
93 | ; configureable area |
Line 94... | Line 94... | ||
94 | 94 | ||
Line 95... | Line 95... | ||
95 | MAX_DEVICES = 16 ; Maximum number of devices this driver may handle |
95 | MAX_DEVICES = 16 ; Maximum number of devices this driver may handle |
96 | 96 | ||
Line 97... | Line 97... | ||
97 | FORCE_FD = 0 ; forcing full duplex mode makes sense at some cards and link types |
97 | FORCE_FD = 0 ; Forcing full duplex mode makes sense for some cards and link types |
Line 173... | Line 173... | ||
173 | REG_BAD_SSD = 0xc |
173 | REG_BAD_SSD = 0xc |
174 | REG_MEDIA_STATUS = 0xa |
174 | REG_MEDIA_STATUS = 0xa |
175 | REG_PHYSICAL_MGMT = 0x8 |
175 | REG_PHYSICAL_MGMT = 0x8 |
176 | REG_NETWORK_DIAGNOSTIC = 0x6 |
176 | REG_NETWORK_DIAGNOSTIC = 0x6 |
177 | REG_FIFO_DIAGNOSTIC = 0x4 |
177 | REG_FIFO_DIAGNOSTIC = 0x4 |
178 | REG_VCO_DIAGNOSTIC = 0x2 ; may not supported |
178 | REG_VCO_DIAGNOSTIC = 0x2 ; may not be supported |
Line 179... | Line 179... | ||
179 | 179 | ||
180 | ; Bits in register window 4 |
180 | ; Bits in register window 4 |
Line 181... | Line 181... | ||
181 | BIT_AUTOSELECT = 24 |
181 | BIT_AUTOSELECT = 24 |
Line 344... | Line 344... | ||
344 | ver_id db ? |
344 | ver_id db ? |
345 | full_bus_master db ? |
345 | full_bus_master db ? |
346 | has_hwcksm db ? |
346 | has_hwcksm db ? |
347 | preamble db ? |
347 | preamble db ? |
348 | dn_list_ptr_cleared db ? |
348 | dn_list_ptr_cleared db ? |
349 | internal_link dd ? ; link state (to be used only internally by driver) |
349 | internal_link dd ? ; link state (only used internally by the driver) |
Line 350... | Line 350... | ||
350 | 350 | ||
351 | rb 0x100 - ($ and 0xff) ; align 256 |
351 | rb 0x100 - ($ and 0xff) ; align 256 |
352 | tx_desc_buffer rd (sizeof.tx_desc*NUM_TX_DESC)/4 |
352 | tx_desc_buffer rd (sizeof.tx_desc*NUM_TX_DESC)/4 |
Line 412... | Line 412... | ||
412 | cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
412 | cmp [edx + IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
413 | jb .fail |
413 | jb .fail |
Line 414... | Line 414... | ||
414 | 414 | ||
415 | mov eax, [edx + IOCTL.input] |
415 | mov eax, [edx + IOCTL.input] |
416 | cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given |
416 | cmp byte [eax], 1 ; 1 means device number and bus number (pci) are given |
Line 417... | Line 417... | ||
417 | jne .fail ; other types of this hardware dont exist |
417 | jne .fail ; other types of this hardware don't exist |
Line 418... | Line 418... | ||
418 | 418 | ||
419 | ; check if the device is already listed |
419 | ; check if the device is already listed |
Line 433... | Line 433... | ||
433 | je .find_devicenum ; Device is already loaded, let's find it's device number |
433 | je .find_devicenum ; Device is already loaded, let's find it's device number |
434 | @@: |
434 | @@: |
435 | add esi, 4 |
435 | add esi, 4 |
436 | loop .nextdevice |
436 | loop .nextdevice |
Line 437... | Line 437... | ||
437 | 437 | ||
438 | ; This device doesnt have its own eth_device structure yet, lets create one |
438 | ; This device doesn't have its own eth_device structure yet, lets create one |
439 | .firstdevice: |
439 | .firstdevice: |
440 | cmp [devices], MAX_DEVICES ; First check if the driver can handle one more card |
440 | cmp [devices], MAX_DEVICES ; First check if the driver can handle one more card |
Line 441... | Line 441... | ||
441 | jae .fail |
441 | jae .fail |
Line 2732... | Line 2732... | ||
2732 | ; issue upUnStall command |
2732 | ; issue upUnStall command |
2733 | set_io [ebx + device.io_addr], REG_COMMAND |
2733 | set_io [ebx + device.io_addr], REG_COMMAND |
2734 | mov ax, ((11b shl 12)+1) ; upUnStall |
2734 | mov ax, ((11b shl 12)+1) ; upUnStall |
2735 | out dx, ax |
2735 | out dx, ax |
Line 2736... | Line 2736... | ||
2736 | 2736 | ||
Line 2737... | Line 2737... | ||
2737 | ;;;; FIXME: make upunstall work |
2737 | ;;;; FIXME: make upUnStall work |
2738 | 2738 | ||
2739 | .noUpUnStall: |
2739 | .noUpUnStall: |
2740 | .noRX: |
2740 | .noRX: |
Line 2903... | Line 2903... | ||
2903 | dw 0x1202, IS_TORNADO or HAS_HWCKSM or HAS_NWAY ; 3c982 Hydra Dual Port B |
2903 | dw 0x1202, IS_TORNADO or HAS_HWCKSM or HAS_NWAY ; 3c982 Hydra Dual Port B |
2904 | dw 0x9056, IS_CYCLONE or HAS_NWAY or HAS_HWCKSM or EXTRA_PREAMBLE ; 3c905B-T4 |
2904 | dw 0x9056, IS_CYCLONE or HAS_NWAY or HAS_HWCKSM or EXTRA_PREAMBLE ; 3c905B-T4 |
2905 | dw 0x9210, IS_TORNADO or HAS_NWAY or HAS_HWCKSM ; 3c920B-EMB-WNM Tornado |
2905 | dw 0x9210, IS_TORNADO or HAS_NWAY or HAS_HWCKSM ; 3c920B-EMB-WNM Tornado |
2906 | HW_VERSIONS_SIZE = $ - hw_versions |
2906 | HW_VERSIONS_SIZE = $ - hw_versions |
Line 2907... | Line 2907... | ||
2907 | 2907 | ||
Line 2908... | Line 2908... | ||
2908 | include_debug_strings ; All data wich FDO uses will be included here |
2908 | include_debug_strings ; All data which FDO uses will be included here |
2909 | 2909 | ||
2910 | align 4 |
2910 | align 4 |