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