ath9k: Handle IBSS status changes in BSS_CHANGED_IBSS
Configure ibss node's bss_changes under BSS_CHANGED_IBSS. And also start/stop ani timer only if the station join/leave the group. Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
f29f5c0882
commit
2e5ef4599a
@@ -1405,7 +1405,7 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
|
|||||||
ath9k_hw_set_interrupts(ah, ah->imask);
|
ath9k_hw_set_interrupts(ah, ah->imask);
|
||||||
|
|
||||||
/* Set up ANI */
|
/* Set up ANI */
|
||||||
if ((iter_data.naps + iter_data.nadhocs) > 0) {
|
if (iter_data.naps > 0) {
|
||||||
sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
|
sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
|
||||||
sc->sc_flags |= SC_OP_ANI_RUN;
|
sc->sc_flags |= SC_OP_ANI_RUN;
|
||||||
ath_start_ani(common);
|
ath_start_ani(common);
|
||||||
@@ -1945,23 +1945,12 @@ static void ath9k_bss_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
|
|||||||
struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
|
struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
|
||||||
struct ath_vif *avp = (void *)vif->drv_priv;
|
struct ath_vif *avp = (void *)vif->drv_priv;
|
||||||
|
|
||||||
switch (sc->sc_ah->opmode) {
|
|
||||||
case NL80211_IFTYPE_ADHOC:
|
|
||||||
/* There can be only one vif available */
|
|
||||||
memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN);
|
|
||||||
common->curaid = bss_conf->aid;
|
|
||||||
ath9k_hw_write_associd(sc->sc_ah);
|
|
||||||
/* configure beacon */
|
|
||||||
if (bss_conf->enable_beacon)
|
|
||||||
ath_beacon_config(sc, vif);
|
|
||||||
break;
|
|
||||||
case NL80211_IFTYPE_STATION:
|
|
||||||
/*
|
/*
|
||||||
* Skip iteration if primary station vif's bss info
|
* Skip iteration if primary station vif's bss info
|
||||||
* was not changed
|
* was not changed
|
||||||
*/
|
*/
|
||||||
if (sc->sc_flags & SC_OP_PRIM_STA_VIF)
|
if (sc->sc_flags & SC_OP_PRIM_STA_VIF)
|
||||||
break;
|
return;
|
||||||
|
|
||||||
if (bss_conf->assoc) {
|
if (bss_conf->assoc) {
|
||||||
sc->sc_flags |= SC_OP_PRIM_STA_VIF;
|
sc->sc_flags |= SC_OP_PRIM_STA_VIF;
|
||||||
@@ -1986,10 +1975,6 @@ static void ath9k_bss_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
|
|||||||
sc->sc_flags |= SC_OP_ANI_RUN;
|
sc->sc_flags |= SC_OP_ANI_RUN;
|
||||||
ath_start_ani(common);
|
ath_start_ani(common);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ath9k_config_bss(struct ath_softc *sc, struct ieee80211_vif *vif)
|
static void ath9k_config_bss(struct ath_softc *sc, struct ieee80211_vif *vif)
|
||||||
@@ -1998,6 +1983,9 @@ static void ath9k_config_bss(struct ath_softc *sc, struct ieee80211_vif *vif)
|
|||||||
struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
|
struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
|
||||||
struct ath_vif *avp = (void *)vif->drv_priv;
|
struct ath_vif *avp = (void *)vif->drv_priv;
|
||||||
|
|
||||||
|
if (sc->sc_ah->opmode != NL80211_IFTYPE_STATION)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Reconfigure bss info */
|
/* Reconfigure bss info */
|
||||||
if (avp->primary_sta_vif && !bss_conf->assoc) {
|
if (avp->primary_sta_vif && !bss_conf->assoc) {
|
||||||
ath_dbg(common, ATH_DBG_CONFIG,
|
ath_dbg(common, ATH_DBG_CONFIG,
|
||||||
@@ -2016,8 +2004,7 @@ static void ath9k_config_bss(struct ath_softc *sc, struct ieee80211_vif *vif)
|
|||||||
* None of station vifs are associated.
|
* None of station vifs are associated.
|
||||||
* Clear bssid & aid
|
* Clear bssid & aid
|
||||||
*/
|
*/
|
||||||
if ((sc->sc_ah->opmode == NL80211_IFTYPE_STATION) &&
|
if (!(sc->sc_flags & SC_OP_PRIM_STA_VIF)) {
|
||||||
!(sc->sc_flags & SC_OP_PRIM_STA_VIF)) {
|
|
||||||
ath9k_hw_write_associd(sc->sc_ah);
|
ath9k_hw_write_associd(sc->sc_ah);
|
||||||
/* Stop ANI */
|
/* Stop ANI */
|
||||||
sc->sc_flags &= ~SC_OP_ANI_RUN;
|
sc->sc_flags &= ~SC_OP_ANI_RUN;
|
||||||
@@ -2047,6 +2034,22 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
|
|||||||
common->curbssid, common->curaid);
|
common->curbssid, common->curaid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (changed & BSS_CHANGED_IBSS) {
|
||||||
|
/* There can be only one vif available */
|
||||||
|
memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN);
|
||||||
|
common->curaid = bss_conf->aid;
|
||||||
|
ath9k_hw_write_associd(sc->sc_ah);
|
||||||
|
|
||||||
|
if (bss_conf->ibss_joined) {
|
||||||
|
sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
|
||||||
|
sc->sc_flags |= SC_OP_ANI_RUN;
|
||||||
|
ath_start_ani(common);
|
||||||
|
} else {
|
||||||
|
sc->sc_flags &= ~SC_OP_ANI_RUN;
|
||||||
|
del_timer_sync(&common->ani.timer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Enable transmission of beacons (AP, IBSS, MESH) */
|
/* Enable transmission of beacons (AP, IBSS, MESH) */
|
||||||
if ((changed & BSS_CHANGED_BEACON) ||
|
if ((changed & BSS_CHANGED_BEACON) ||
|
||||||
((changed & BSS_CHANGED_BEACON_ENABLED) && bss_conf->enable_beacon)) {
|
((changed & BSS_CHANGED_BEACON_ENABLED) && bss_conf->enable_beacon)) {
|
||||||
|
Reference in New Issue
Block a user