summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoravos <avos@FreeBSD.org>2016-06-01 14:57:53 +0000
committeravos <avos@FreeBSD.org>2016-06-01 14:57:53 +0000
commiteceefd8f8e662eaceca7e3fab00f9249dacbe609 (patch)
treed6a81039a7a8bde63c6676a25902b068074f77e4
parent8a629debd03ee798d0b4cc8ed16693c152bd8e72 (diff)
downloadFreeBSD-src-eceefd8f8e662eaceca7e3fab00f9249dacbe609.zip
FreeBSD-src-eceefd8f8e662eaceca7e3fab00f9249dacbe609.tar.gz
urtwn: fix non-ERP BSS detection in HOSTAP mode.
Receive all beacons in HOSTAP mode; they will give more information about present non-ERP / legacy BSSs (used to choose protection mode). Tested with RTL8188CUS (HOSTAP, urtwn) + RTL8821AU (HOSTAP, 11b mode).
-rw-r--r--sys/dev/urtwn/if_urtwn.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/sys/dev/urtwn/if_urtwn.c b/sys/dev/urtwn/if_urtwn.c
index d6ed4d7..655d611 100644
--- a/sys/dev/urtwn/if_urtwn.c
+++ b/sys/dev/urtwn/if_urtwn.c
@@ -2627,10 +2627,11 @@ urtwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
if (ic->ic_promisc == 0) {
reg = urtwn_read_4(sc, R92C_RCR);
- if (vap->iv_opmode != IEEE80211_M_HOSTAP)
+ if (vap->iv_opmode != IEEE80211_M_HOSTAP) {
reg |= R92C_RCR_CBSSID_DATA;
- if (vap->iv_opmode != IEEE80211_M_IBSS)
- reg |= R92C_RCR_CBSSID_BCN;
+ if (vap->iv_opmode != IEEE80211_M_IBSS)
+ reg |= R92C_RCR_CBSSID_BCN;
+ }
urtwn_write_4(sc, R92C_RCR, reg);
}
@@ -4723,7 +4724,8 @@ urtwn_scan_start(struct ieee80211com *ic)
URTWN_LOCK(sc);
/* Receive beacons / probe responses from any BSSID. */
- if (ic->ic_opmode != IEEE80211_M_IBSS)
+ if (ic->ic_opmode != IEEE80211_M_IBSS &&
+ ic->ic_opmode != IEEE80211_M_HOSTAP)
urtwn_set_rx_bssid_all(sc, 1);
/* Set gain for scanning. */
@@ -4738,7 +4740,9 @@ urtwn_scan_end(struct ieee80211com *ic)
URTWN_LOCK(sc);
/* Restore limitations. */
- if (ic->ic_promisc == 0 && ic->ic_opmode != IEEE80211_M_IBSS)
+ if (ic->ic_promisc == 0 &&
+ ic->ic_opmode != IEEE80211_M_IBSS &&
+ ic->ic_opmode != IEEE80211_M_HOSTAP)
urtwn_set_rx_bssid_all(sc, 0);
/* Set gain under link. */
@@ -4931,14 +4935,13 @@ urtwn_set_promisc(struct urtwn_softc *sc)
if (vap->iv_state == IEEE80211_S_RUN) {
switch (vap->iv_opmode) {
case IEEE80211_M_STA:
- mask2 |= R92C_RCR_CBSSID_DATA;
- /* FALLTHROUGH */
- case IEEE80211_M_HOSTAP:
mask2 |= R92C_RCR_CBSSID_BCN;
- break;
+ /* FALLTHROUGH */
case IEEE80211_M_IBSS:
mask2 |= R92C_RCR_CBSSID_DATA;
break;
+ case IEEE80211_M_HOSTAP:
+ break;
default:
device_printf(sc->sc_dev, "%s: undefined opmode %d\n",
__func__, vap->iv_opmode);
OpenPOWER on IntegriCloud