From 648231728caf863127a96fd9dcca42ed27468f44 Mon Sep 17 00:00:00 2001 From: Sujith Manoharan Date: Mon, 21 Jul 2008 21:26:41 -0800 Subject: [PATCH] call ath_vap_join() to set the bssid 'flags' is not used in ath_vap_join(), remove it. VAP should be brought up _after_ association, ath9k_config_interface was the wrong place to call it. Instead, call ath_vap_join() to set the bssid. Signed-off-by: Sujith --- drivers/net/wireless/ath9k/core.c | 9 +++------ drivers/net/wireless/ath9k/core.h | 3 +-- drivers/net/wireless/ath9k/main.c | 38 +++++++++++++++----------------------- 3 files changed, 19 insertions(+), 31 deletions(-) diff --git a/drivers/net/wireless/ath9k/core.c b/drivers/net/wireless/ath9k/core.c index 1eadb1f..81d4319 100644 --- a/drivers/net/wireless/ath9k/core.c +++ b/drivers/net/wireless/ath9k/core.c @@ -649,7 +649,7 @@ int ath_vap_listen(struct ath_softc *sc, int if_id) } int ath_vap_join(struct ath_softc *sc, int if_id, - const u_int8_t bssid[ETH_ALEN], u_int flags) + const u_int8_t bssid[ETH_ALEN]) { struct ath_hal *ah = sc->sc_ah; struct ath_vap *avp; @@ -791,11 +791,8 @@ int ath_vap_up(struct ath_softc *sc, default: break; } - /* Moved beacon_config after dfs_wait check - * so that ath_beacon_config won't be called duing dfswait - * period - this will fix the beacon stuck afer DFS - * CAC period issue - * Configure the beacon and sleep timers. */ + + /* Configure the beacon. */ if (!sc->sc_beacons && !(flags & ATH_IF_BEACON_SYNC)) { ath_beacon_config(sc, if_id); diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h index d6d1b4f..3daefa4 100644 --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h @@ -890,8 +890,7 @@ int ath_vap_down(struct ath_softc *sc, int if_id, u_int flags); int ath_vap_listen(struct ath_softc *sc, int if_id); int ath_vap_join(struct ath_softc *sc, int if_id, - const u_int8_t bssid[ETH_ALEN], - u_int flags); + const u_int8_t bssid[ETH_ALEN]); int ath_vap_up(struct ath_softc *sc, int if_id, const u_int8_t bssid[ETH_ALEN], diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 30f83c9..94ce3fc 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c @@ -481,30 +481,13 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, struct ieee80211_if_conf *conf) { struct ath_softc *sc = hw->priv; - int error = 0, flags = 0; struct sk_buff *beacon; - if (!conf->bssid) - return 0; - switch (vif->type) { case IEEE80211_IF_TYPE_STA: - /* XXX: Handle (conf->changed & IEEE80211_IFCC_SSID) */ - flags |= ATH_IF_HW_ON; - /* sync with next received beacon */ - flags |= ATH_IF_BEACON_SYNC; - - DPRINTF(sc, ATH_DEBUG_CONFIG, "%s: Bring up VAP: %d\n", - __func__, 0); - - error = ath_vap_up(sc, 0, conf->bssid, 0, flags); - if (error) { - DPRINTF(sc, ATH_DEBUG_FATAL, - "%s: Unable to bring up VAP: %d, error: %d\n", - __func__, 0, error); - return -1; - } - + if ((conf->changed & IEEE80211_IFCC_BSSID) && + !is_zero_ether_addr(conf->bssid)) + ath_vap_join(sc, 0, conf->bssid); break; case IEEE80211_IF_TYPE_IBSS: if (!(conf->changed & IEEE80211_IFCC_BEACON)) @@ -699,14 +682,23 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc, struct ieee80211_hw *hw = sc->hw; struct ieee80211_channel *curchan = hw->conf.channel; struct hal_channel hchan; + int flags = 0; if (bss_conf->assoc) { - /* FIXME : Do we need any other info - * which is part of association */ DPRINTF(sc, ATH_DEBUG_CONFIG, "%s: Bss Info ASSOC %d\n", __func__, bss_conf->aid); - sc->sc_curaid = bss_conf->aid; + + flags |= ATH_IF_HW_ON; + if (bss_conf->assoc_ht) + flags |= ATH_IF_HT; + + if (ath_vap_up(sc, 0, + sc->sc_curbssid, bss_conf->aid, flags) < 0) { + DPRINTF(sc, ATH_DEBUG_FATAL, + "%s: Unable to bring up VAP\n", __func__); + return; + } DPRINTF(sc, ATH_DEBUG_CONFIG, "%s: Set channel: %d MHz\n", __func__, -- 1.5.4.3