summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2010-04-06 16:49:09 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2010-04-06 16:49:09 +0000
commit21f830db35cc5c18d908f4e3cb801cd756ca7d5b (patch)
treecfe11f5ed156a4ad3d67199aa30027a8fd054815 /sys/dev/ic
parentb66b5e8e334073beee0ea60a7a5401bf8134868c (diff)
on devices that have a radio switch, check GPIO pin 2 and report
that the radio is disabled with the same message as in other drivers. let initialization continue for the moment until i'm sure it is correct.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/rt2860.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/dev/ic/rt2860.c b/sys/dev/ic/rt2860.c
index bb2b9ab3b4d..7f1d6dd2e2f 100644
--- a/sys/dev/ic/rt2860.c
+++ b/sys/dev/ic/rt2860.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2860.c,v 1.47 2010/04/06 16:41:54 damien Exp $ */
+/* $OpenBSD: rt2860.c,v 1.48 2010/04/06 16:49:08 damien Exp $ */
/*-
* Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -3159,6 +3159,18 @@ rt2860_init(struct ifnet *ifp)
rt2860_stop(ifp, 0);
+ if (sc->rfswitch) {
+ /* hardware has a radio switch on GPIO pin 2 */
+ if (!(RAL_READ(sc, RT2860_GPIO_CTRL) & (1 << 2))) {
+ printf("%s: radio is disabled by hardware switch\n",
+ sc->sc_dev.dv_xname);
+#ifdef notyet
+ rt2860_stop(ifp, 1);
+ return EPERM;
+#endif
+ }
+ }
+
tmp = RAL_READ(sc, RT2860_WPDMA_GLO_CFG);
tmp &= 0xff0;
RAL_WRITE(sc, RT2860_WPDMA_GLO_CFG, tmp);
@@ -3652,8 +3664,6 @@ rt2860_power(int why, void *arg)
struct ifnet *ifp = &sc->sc_ic.ic_if;
int s;
- DPRINTF(("%s: rt2860_power(%d)\n", sc->sc_dev.dv_xname, why));
-
s = splnet();
switch (why) {
case PWR_SUSPEND: