Subject: kern/22682: bge(4) may confuse BCM5704C NIC card LEDs
To: None <gnats-bugs@gnats.netbsd.org>
From: None <njoly@pasteur.fr>
List: netbsd-bugs
Date: 09/04/2003 18:23:00
>Number:         22682
>Category:       kern
>Synopsis:       bge(4) may confuse BCM5704C NIC card LEDs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 04 16:24:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Nicolas Joly
>Release:        NetBSD 1.6Y (-current 20030904)
>Organization:
	Pasteur Institute, Paris.
>Environment:
System: NetBSD calimero.bis.pasteur.fr 1.6Y NetBSD 1.6Y (GENERIC.MP) #15: Thu Sep 4 16:17:43 CEST 2003 njoly@calimero.bis.pasteur.fr:/local/src/NetBSD/objs/local/src/NetBSD/src/sys/arch/amd64/compile/GENERIC.MP amd64
Architecture: x86_64
Machine: amd64
>Description:
bge(4) driver does not handle NIC LEDs gracefully on my BCM5704C (A3) Gigabit
Ethernet card.

According to the docs : Green LED = 10Mb, Yellow LED = 100Mb and
Both LED = Gigabit.

But The LED remains yellow, even if the link is forced to 10Mb.

bge0 at pci2 dev 9 function 0: Broadcom BCM5704C Dual Gigabit Ethernet
bge0: interrupting at apic 3 int 0 (irq 15)
bge0: ASIC BCM5704 A3, Ethernet address 00:e0:81:51:dd:69
brgphy0 at bge0 phy 1: BCM5704 1000BASE-T media interface, rev. 0
brgphy0: using BCM5704 DSP patch
brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, autot pci2 dev 9 function 1: Broadcom BCM5704C Dual Gigabit Ethernet
bge1: interrupting at apic 3 int 1 (irq 10)
bge1: ASIC BCM5704 A3, Ethernet address 00:e0:81:51:dd:6a
brgphy1 at bge1 phy 1: BCM5704 1000BASE-T media interface, rev. 0
brgphy1: using BCM5704 DSP patch
brgphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto

>How-To-Repeat:
	Watch the LEDs ... And check the link speed (ifconfig).
>Fix:

Remove LEDs register init from driver (this was made in FreeBSD driver r1.40).

Index: pci/if_bge.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_bge.c,v
retrieving revision 1.49
diff -u -r1.49 if_bge.c
--- pci/if_bge.c	2003/08/27 23:13:50	1.49
+++ pci/if_bge.c	2003/09/04 11:23:22
@@ -1654,9 +1654,6 @@
 	CSR_WRITE_4(sc, BGE_SDI_STATS_CTL,
 	    BGE_SDISTATSCTL_ENABLE|BGE_SDISTATSCTL_FASTER);
 
-	/* init LED register */
-	CSR_WRITE_4(sc, BGE_MAC_LED_CTL, 0x00000000);
-
 	/* ack/clear link change events */
 	CSR_WRITE_4(sc, BGE_MAC_STS, BGE_MACSTAT_SYNC_CHANGED|
 	    BGE_MACSTAT_CFG_CHANGED);
>Release-Note:
>Audit-Trail:
>Unformatted: