Subject: kern/30193: Activity LED on wm(4) does not blink.
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <umezawa@iij.ad.jp>
List: netbsd-bugs
Date: 05/11/2005 08:58:01
>Number:         30193
>Category:       kern
>Synopsis:       Activity LED on wm(4) does not blink.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 11 08:58:00 +0000 2005
>Originator:     UMEZAWA Takeshi
>Release:        1.6.2
>Organization:
Internet Initiative Japan
>Environment:
NetBSD idgw07.iij.ad.jp 1.6.2_STABLE NetBSD 1.6.2_STABLE (GENERIC) #0: Mon May  2 11:40:58 JST 2005     root@idgw07.iij.ad.jp:/usr/src/sys/arch/i386/compile/GENERIC i386
>Description:
Activity LEDs on all of my i8254x cards don't blink even though tx/rx occurs.
This is a driver's problem because they blink under FreeBSD.

I'm not sure whether there is no i8254x card which blinks its activity LED.
>How-To-Repeat:
always repeat. (see description)
>Fix:
A patch follows. It enables LED blinking in wm_init().

diff -u orig/if_wm.c new/if_wm.c
--- orig/if_wm.c	Wed May 11 17:36:19 2005
+++ new/if_wm.c	Wed May 11 17:34:23 2005
@@ -2162,6 +2162,11 @@
 	/* Set the receive filter. */
 	wm_set_filter(sc);
 
+	/* Enable activity LED. */
+	CSR_WRITE(sc, WMREG_LEDCTL,
+	    (CSR_READ(sc, WMREG_LEDCTL) & LEDCTL_ACTIVITY_MASK) |
+	    LEDCTL_ACTIVITY_ENABLE);
+
 	/* Start the one second link check clock. */
 	callout_reset(&sc->sc_tick_ch, hz, wm_tick, sc);
 
diff -u orig/if_wmreg.h new/if_wmreg.h
--- orig/if_wmreg.h	Wed May 11 17:36:19 2005
+++ new/if_wmreg.h	Wed May 11 17:34:23 2005
@@ -500,6 +500,10 @@
 #define	WM_MC_TABSIZE	128
 #define	WM_VLAN_TABSIZE	128
 
+#define	WMREG_LEDCTL	0x0e00	/* LED control */
+#define	LEDCTL_ACTIVITY_MASK 0xfffff0ff
+#define	LEDCTL_ACTIVITY_ENABLE 0x00000300
+
 #define	WMREG_PBA	0x1000	/* Packet Buffer Allocation */
 
 #define	WMREG_TXDMAC	0x3000	/* Transfer DMA Control */