summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authoreh146360 <none@none>2008-01-14 19:13:22 -0800
committereh146360 <none@none>2008-01-14 19:13:22 -0800
commit9e2cd38c103ae52a41b09823a11c9b5c059555f0 (patch)
tree08d8df8fedd8de77469cd96980e147408e082866 /usr/src
parent9ac35488880927260db6ad8111329c1f70dd4627 (diff)
downloadillumos-joyent-9e2cd38c103ae52a41b09823a11c9b5c059555f0.tar.gz
6594624 wireless drivers find access points when wireless switch set to off
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/io/ipw/ipw2100.c29
-rw-r--r--usr/src/uts/common/io/iwi/ipw2200.c29
2 files changed, 55 insertions, 3 deletions
diff --git a/usr/src/uts/common/io/ipw/ipw2100.c b/usr/src/uts/common/io/ipw/ipw2100.c
index 2373fc7ad0..34fcc32a6e 100644
--- a/usr/src/uts/common/io/ipw/ipw2100.c
+++ b/usr/src/uts/common/io/ipw/ipw2100.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -2286,6 +2286,28 @@ ipw2100_getset(struct ipw2100_softc *sc, mblk_t *m, uint32_t cmd,
* case WL_SCAN:
* case WL_LOAD_DEFAULTS:
*/
+
+ /*
+ * When radio is off, need to ignore all ioctl. What need to
+ * do is to check radio status firstly. If radio is ON, pass
+ * it to net80211, otherwise, return to upper layer directly.
+ *
+ * Considering the WL_SUCCESS also means WL_CONNECTED for
+ * checking linkstatus, one exception for WL_LINKSTATUS is to
+ * let net80211 handle it.
+ */
+ if ((ipw2100_get_radio(sc) == 0) &&
+ (id != WL_LINKSTATUS)) {
+
+ IPW2100_REPORT((sc->sc_dip, CE_WARN,
+ "ipw: RADIO is OFF\n"));
+
+ outfp->wldp_length = WIFI_BUF_OFFSET;
+ outfp->wldp_result = WL_SUCCESS;
+ ret = 0;
+ break;
+ }
+
*need_net80211 = B_TRUE; /* let net80211 do the rest */
return (0);
}
@@ -2545,6 +2567,11 @@ ipw2100_intr(caddr_t arg)
ieee80211_new_state(ic,
IEEE80211_S_INIT, -1);
break;
+ /*
+ * When radio is OFF, need a better
+ * scan approach to ensure scan
+ * result correct.
+ */
case IPW2100_STATE_RADIO_DISABLED:
IPW2100_REPORT((sc->sc_dip,
CE_WARN,
diff --git a/usr/src/uts/common/io/iwi/ipw2200.c b/usr/src/uts/common/io/iwi/ipw2200.c
index 2db9acb11b..3883e0a0e4 100644
--- a/usr/src/uts/common/io/iwi/ipw2200.c
+++ b/usr/src/uts/common/io/iwi/ipw2200.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -2388,6 +2388,28 @@ ipw2200_getset(struct ipw2200_softc *sc, mblk_t *m, uint32_t cmd,
* case WL_LOAD_DEFAULTS:
* case WL_DISASSOCIATE:
*/
+
+ /*
+ * When radio is off, need to ignore all ioctl. What need to
+ * do is to check radio status firstly. If radio is ON, pass
+ * it to net80211, otherwise, return to upper layer directly.
+ *
+ * Considering the WL_SUCCESS also means WL_CONNECTED for
+ * checking linkstatus, one exception for WL_LINKSTATUS is to
+ * let net80211 handle it.
+ */
+ if ((ipw2200_radio_status(sc) == 0) &&
+ (id != WL_LINKSTATUS)) {
+
+ IPW2200_REPORT((sc->sc_dip, CE_CONT,
+ "iwi: radio is OFF\n"));
+
+ outfp->wldp_length = WIFI_BUF_OFFSET;
+ outfp->wldp_result = WL_SUCCESS;
+ ret = 0;
+ break;
+ }
+
*need_net80211 = B_TRUE; /* let net80211 do the rest */
return (0);
}
@@ -2673,8 +2695,11 @@ ipw2200_intr(caddr_t arg)
if (ireg & IPW2200_INTR_RADIO_OFF) {
IPW2200_REPORT((sc->sc_dip, CE_CONT,
"ipw2200_intr(): radio is OFF\n"));
+
/*
- * Stop hardware, will notify LINK is down
+ * Stop hardware, will notify LINK is down.
+ * Need a better scan solution to ensure
+ * table has right value.
*/
ipw2200_stop(sc);
}