Rev 6713 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6713 | Rev 9149 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2021. 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 | ;; Realtek 8139 driver for KolibriOS ;; |
6 | ;; Realtek 8139 driver for KolibriOS ;; |
7 | ;; ;; |
7 | ;; ;; |
8 | ;; based on RTL8139.asm driver for menuetos ;; |
8 | ;; based on RTL8139.asm driver for menuetos ;; |
Line 1020... | Line 1020... | ||
1020 | in ax, dx |
1020 | in ax, dx |
Line 1021... | Line 1021... | ||
1021 | 1021 | ||
1022 | test al, 1 shl 2 ; 0 = link ok 1 = link fail |
1022 | test al, 1 shl 2 ; 0 = link ok 1 = link fail |
Line 1023... | Line 1023... | ||
1023 | jnz .notconnected |
1023 | jnz .notconnected |
1024 | 1024 | ||
1025 | mov ecx, ETH_LINK_10M |
1025 | mov ecx, ETH_LINK_SPEED_10M |
1026 | test al, 1 shl 3 ; 0 = 100 Mbps 1 = 10 Mbps |
1026 | test al, 1 shl 3 ; 0 = 100 Mbps 1 = 10 Mbps |
1027 | jnz @f |
1027 | jnz @f |
Line 1028... | Line 1028... | ||
1028 | mov ecx, ETH_LINK_100M |
1028 | mov ecx, ETH_LINK_SPEED_100M |
1029 | @@: |
1029 | @@: |
1030 | 1030 | ||
1031 | set_io [ebx + device.io_addr], REG_BMCR |
1031 | set_io [ebx + device.io_addr], REG_BMCR |
1032 | in ax, dx |
1032 | in ax, dx |
1033 | test ax, 1 shl 8 ; Duplex mode |
1033 | test ax, 1 shl 8 ; Duplex mode |
Line 1034... | Line 1034... | ||
1034 | jz @f |
1034 | jz @f |
1035 | or ecx, ETH_LINK_FD |
1035 | or ecx, ETH_LINK_FULL_DUPLEX |
1036 | @@: |
1036 | @@: |