From fed8d221665f3c5f9b15f8e8978a8d437aebec25 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Sun, 22 Aug 2021 21:14:54 +0000 Subject: [PATCH] Cleanup git-svn-id: svn://kolibrios.org@9149 a494cfbc-eb01-0410-851d-a64ba20cac60 --- drivers/ethernet/RTL8139.asm | 8 ++++---- drivers/ethernet/RTL8169.asm | 8 ++++---- drivers/ethernet/forcedeth.asm | 12 ++++++------ drivers/ethernet/i8254x.asm | 8 ++++---- drivers/ethernet/mtd80x.asm | 12 ++++++------ drivers/ethernet/pcnet32.asm | 8 ++++---- drivers/netdrv.inc | 6 ------ 7 files changed, 28 insertions(+), 34 deletions(-) diff --git a/drivers/ethernet/RTL8139.asm b/drivers/ethernet/RTL8139.asm index 11f40ba05..32b121baa 100644 --- a/drivers/ethernet/RTL8139.asm +++ b/drivers/ethernet/RTL8139.asm @@ -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 diff --git a/drivers/ethernet/RTL8169.asm b/drivers/ethernet/RTL8169.asm index 77883fc35..4f7353c7b 100644 --- a/drivers/ethernet/RTL8169.asm +++ b/drivers/ethernet/RTL8169.asm @@ -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 diff --git a/drivers/ethernet/forcedeth.asm b/drivers/ethernet/forcedeth.asm index e340a56f9..4478bd7e3 100644 --- a/drivers/ethernet/forcedeth.asm +++ b/drivers/ethernet/forcedeth.asm @@ -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 diff --git a/drivers/ethernet/i8254x.asm b/drivers/ethernet/i8254x.asm index b1380d488..9f7d3e4ab 100644 --- a/drivers/ethernet/i8254x.asm +++ b/drivers/ethernet/i8254x.asm @@ -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: diff --git a/drivers/ethernet/mtd80x.asm b/drivers/ethernet/mtd80x.asm index 391ccc937..562359fa2 100644 --- a/drivers/ethernet/mtd80x.asm +++ b/drivers/ethernet/mtd80x.asm @@ -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: diff --git a/drivers/ethernet/pcnet32.asm b/drivers/ethernet/pcnet32.asm index 6a0974f89..9f79f6db9 100644 --- a/drivers/ethernet/pcnet32.asm +++ b/drivers/ethernet/pcnet32.asm @@ -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 @@: diff --git a/drivers/netdrv.inc b/drivers/netdrv.inc index 1b18384ff..7f626363f 100644 --- a/drivers/netdrv.inc +++ b/drivers/netdrv.inc @@ -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.