summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2015-06-12 09:30:06 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2015-06-12 09:30:06 +0000
commitf317ef8b497c6b651169b85e357ee7a93618a276 (patch)
tree627b9e27d21a3b2f2aed44f804e729910782ff41 /sys/dev
parent4973521c345f79b783299822fca9ac949bebb342 (diff)
Fix rtwn(4) wifi LED support. Tested with rtwn(4) device in Thinkpad X220.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_rtwn.c10
-rw-r--r--sys/dev/pci/if_rtwnreg.h6
2 files changed, 11 insertions, 5 deletions
diff --git a/sys/dev/pci/if_rtwn.c b/sys/dev/pci/if_rtwn.c
index 19ce5f84bc0..6cea7c3d4db 100644
--- a/sys/dev/pci/if_rtwn.c
+++ b/sys/dev/pci/if_rtwn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rtwn.c,v 1.2 2015/06/10 15:34:17 mpi Exp $ */
+/* $OpenBSD: if_rtwn.c,v 1.3 2015/06/12 09:30:05 stsp Exp $ */
/*-
* Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -1091,10 +1091,12 @@ rtwn_set_led(struct rtwn_softc *sc, int led, int on)
uint8_t reg;
if (led == RTWN_LED_LINK) {
- reg = rtwn_read_1(sc, R92C_LEDCFG0) & 0x70;
+ reg = rtwn_read_1(sc, R92C_LEDCFG2) & 0xf0;
if (!on)
- reg |= R92C_LEDCFG0_DIS;
- rtwn_write_1(sc, R92C_LEDCFG0, reg);
+ reg |= R92C_LEDCFG2_DIS;
+ else
+ reg |= R92C_LEDCFG2_EN;
+ rtwn_write_1(sc, R92C_LEDCFG2, reg);
sc->ledlink = on; /* Save LED state. */
}
}
diff --git a/sys/dev/pci/if_rtwnreg.h b/sys/dev/pci/if_rtwnreg.h
index 62be0d8a912..adeb9093f5b 100644
--- a/sys/dev/pci/if_rtwnreg.h
+++ b/sys/dev/pci/if_rtwnreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rtwnreg.h,v 1.1 2015/06/04 21:08:40 stsp Exp $ */
+/* $OpenBSD: if_rtwnreg.h,v 1.2 2015/06/12 09:30:05 stsp Exp $ */
/*-
* Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -337,6 +337,10 @@
/* Bits for R92C_LEDCFG0. */
#define R92C_LEDCFG0_DIS 0x08
+/* Bits for R92C_LEDCFG2. */
+#define R92C_LEDCFG2_EN 0x60
+#define R92C_LEDCFG2_DIS 0x68
+
/* Bits for R92C_MCUFWDL. */
#define R92C_MCUFWDL_EN 0x00000001
#define R92C_MCUFWDL_RDY 0x00000002