Cleanup
git-svn-id: svn://kolibrios.org@9149 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
55487f48ed
commit
fed8d22166
@ -1,6 +1,6 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; Realtek 8139 driver for KolibriOS ;;
|
||||
@ -1022,17 +1022,17 @@ link:
|
||||
test al, 1 shl 2 ; 0 = link ok 1 = link fail
|
||||
jnz .notconnected
|
||||
|
||||
mov ecx, ETH_LINK_10M
|
||||
mov ecx, ETH_LINK_SPEED_10M
|
||||
test al, 1 shl 3 ; 0 = 100 Mbps 1 = 10 Mbps
|
||||
jnz @f
|
||||
mov ecx, ETH_LINK_100M
|
||||
mov ecx, ETH_LINK_SPEED_100M
|
||||
@@:
|
||||
|
||||
set_io [ebx + device.io_addr], REG_BMCR
|
||||
in ax, dx
|
||||
test ax, 1 shl 8 ; Duplex mode
|
||||
jz @f
|
||||
or ecx, ETH_LINK_FD
|
||||
or ecx, ETH_LINK_FULL_DUPLEX
|
||||
@@:
|
||||
|
||||
mov [ebx + device.state], ecx
|
||||
|
@ -1340,19 +1340,19 @@ detect_link:
|
||||
xor ecx, ecx
|
||||
test al, PHYS_10bps
|
||||
jz @f
|
||||
or cl, ETH_LINK_10M
|
||||
or cl, ETH_LINK_SPEED_10M
|
||||
@@:
|
||||
test al, PHYS_100bps
|
||||
jz @f
|
||||
or cl, ETH_LINK_100M
|
||||
or cl, ETH_LINK_SPEED_100M
|
||||
@@:
|
||||
test al, PHYS_1000bpsF
|
||||
jz @f
|
||||
or cl, ETH_LINK_1G ;or ETH_LINK_FD
|
||||
or cl, ETH_LINK_SPEED_1G ;or ETH_LINK_FULL_DUPLEX
|
||||
@@:
|
||||
test al, PHYS_FullDup
|
||||
jz @f
|
||||
or cl, ETH_LINK_FD
|
||||
or cl, ETH_LINK_FULL_DUPLEX
|
||||
@@:
|
||||
mov [ebx + device.state], ecx
|
||||
invoke NetLinkChanged
|
||||
|
@ -1,6 +1,6 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2018. All rights reserved. ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; FORCEDETH.INC ;;
|
||||
@ -1606,7 +1606,7 @@ update_linkspeed:
|
||||
jz .no_gigabit
|
||||
|
||||
DEBUGF 1,"update_linkspeed: GBit ethernet detected.\n"
|
||||
mov [ebx + device.state], ETH_LINK_1G
|
||||
mov [ebx + device.state], ETH_LINK_SPEED_1G
|
||||
mov ecx, (LINKSPEED_FORCE or LINKSPEED_1000)
|
||||
xor eax, eax
|
||||
inc eax
|
||||
@ -1631,7 +1631,7 @@ update_linkspeed:
|
||||
test eax, LPA_100FULL
|
||||
jz @f
|
||||
DEBUGF 1,"update_linkspeed: 100 mbit full duplex\n"
|
||||
mov [ebx + device.state], ETH_LINK_100M + ETH_LINK_FD
|
||||
mov [ebx + device.state], ETH_LINK_SPEED_100M + ETH_LINK_FULL_DUPLEX
|
||||
mov ecx, (LINKSPEED_FORCE or LINKSPEED_100)
|
||||
xor eax, eax
|
||||
inc eax
|
||||
@ -1641,7 +1641,7 @@ update_linkspeed:
|
||||
test eax, LPA_100HALF
|
||||
jz @f
|
||||
DEBUGF 1,"update_linkspeed: 100 mbit half duplex\n"
|
||||
mov [ebx + device.state], ETH_LINK_100M
|
||||
mov [ebx + device.state], ETH_LINK_SPEED_100M
|
||||
mov ecx, (LINKSPEED_FORCE or LINKSPEED_100)
|
||||
xor eax, eax
|
||||
jmp set_speed
|
||||
@ -1650,7 +1650,7 @@ update_linkspeed:
|
||||
test eax, LPA_10FULL
|
||||
jz @f
|
||||
DEBUGF 1,"update_linkspeed: 10 mbit full duplex\n"
|
||||
mov [ebx + device.state], ETH_LINK_10M + ETH_LINK_FD
|
||||
mov [ebx + device.state], ETH_LINK_SPEED_10M + ETH_LINK_FULL_DUPLEX
|
||||
mov ecx, (LINKSPEED_FORCE or LINKSPEED_10)
|
||||
xor eax, eax
|
||||
inc eax
|
||||
@ -1659,7 +1659,7 @@ update_linkspeed:
|
||||
|
||||
.10mbit_hd:
|
||||
DEBUGF 1,"update_linkspeed: 10 mbit half duplex\n"
|
||||
mov [ebx + device.state], ETH_LINK_10M
|
||||
mov [ebx + device.state], ETH_LINK_SPEED_10M
|
||||
mov ecx, (LINKSPEED_FORCE or LINKSPEED_10)
|
||||
xor eax, eax
|
||||
jmp set_speed
|
||||
|
@ -718,21 +718,21 @@ link_status:
|
||||
|
||||
test eax, STATUS_FD
|
||||
jz @f
|
||||
or cl, ETH_LINK_FD
|
||||
or cl, ETH_LINK_FULL_DUPLEX
|
||||
@@:
|
||||
shr eax, STATUS_SPEED_SHIFT
|
||||
and al, 3
|
||||
test al, al
|
||||
jnz @f
|
||||
or cl, ETH_LINK_10M
|
||||
or cl, ETH_LINK_SPEED_10M
|
||||
jmp .ok
|
||||
@@:
|
||||
cmp al, 1
|
||||
jne @f
|
||||
or cl, ETH_LINK_100M
|
||||
or cl, ETH_LINK_SPEED_100M
|
||||
jmp .ok
|
||||
@@:
|
||||
or cl, ETH_LINK_1G
|
||||
or cl, ETH_LINK_SPEED_1G
|
||||
; jmp .ok
|
||||
|
||||
.ok:
|
||||
|
@ -1,6 +1,6 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; MTD80x driver for KolibriOS ;;
|
||||
@ -824,16 +824,16 @@ getlinktype:
|
||||
test eax, FD
|
||||
jz @f
|
||||
DEBUGF 1,"full duplex\n"
|
||||
or [ebx + device.state], ETH_LINK_FD
|
||||
or [ebx + device.state], ETH_LINK_FULL_DUPLEX
|
||||
@@:
|
||||
test eax, PS10
|
||||
jnz @f
|
||||
DEBUGF 1,"100mbit\n"
|
||||
or [ebx + device.state], ETH_LINK_100M
|
||||
DEBUGF 1,"100Mbit\n"
|
||||
or [ebx + device.state], ETH_LINK_SPEED_100M
|
||||
ret
|
||||
@@:
|
||||
DEBUGF 1,"10mbit\n"
|
||||
or [ebx + device.state], ETH_LINK_10M
|
||||
DEBUGF 1,"10Mbit\n"
|
||||
or [ebx + device.state], ETH_LINK_SPEED_10M
|
||||
ret
|
||||
|
||||
.no_myson_phy:
|
||||
|
@ -1618,25 +1618,25 @@ proc check_media_mii stdcall dev:dword
|
||||
|
||||
test eax, LPA_100FULL
|
||||
jz @f
|
||||
mov eax, ETH_LINK_100M or ETH_LINK_FD
|
||||
mov eax, ETH_LINK_SPEED_100M or ETH_LINK_FULL_DUPLEX
|
||||
jmp .update
|
||||
@@:
|
||||
|
||||
test eax, LPA_100HALF
|
||||
jz @f
|
||||
mov eax, ETH_LINK_100M
|
||||
mov eax, ETH_LINK_SPEED_100M
|
||||
jmp .update
|
||||
@@:
|
||||
|
||||
test eax, LPA_10FULL
|
||||
jz @f
|
||||
mov eax, ETH_LINK_10M or ETH_LINK_FD
|
||||
mov eax, ETH_LINK_SPEED_10M or ETH_LINK_FULL_DUPLEX
|
||||
jmp .update
|
||||
@@:
|
||||
|
||||
test eax, LPA_10HALF
|
||||
jz @f
|
||||
mov eax, ETH_LINK_10M
|
||||
mov eax, ETH_LINK_SPEED_10M
|
||||
jmp .update
|
||||
@@:
|
||||
|
||||
|
@ -43,12 +43,6 @@ include 'mii.inc'
|
||||
|
||||
ETH_LINK_SPEED_MASK = 1100b
|
||||
|
||||
; Deprecated naming - dont use
|
||||
ETH_LINK_FD = 10b ; full duplex flag
|
||||
ETH_LINK_10M = 100b ; 10 mbit
|
||||
ETH_LINK_100M = 1000b ; 100 mbit
|
||||
ETH_LINK_1G = 1100b ; gigabit
|
||||
|
||||
; Macro to easily set i/o addresses to access device.
|
||||
; In the beginning of a procedure (or ofter edx may have been destroyed),
|
||||
; always use set_io with offset 0 to reset the variables.
|
||||
|
Loading…
Reference in New Issue
Block a user