From 3b9814d429d2154fecad7b35334aedf6997e7d00 Mon Sep 17 00:00:00 2001 From: Sujith Manoharan Date: Mon, 21 Jul 2008 21:27:11 -0800 Subject: [PATCH] Add IBSS interface creation feature Remove ath_get_beacon() prototype. ath9k_beacon_update() is not needed anymore. Signed-off-by: Sujith --- drivers/net/wireless/ath9k/core.c | 21 +-------------------- drivers/net/wireless/ath9k/core.h | 4 ---- drivers/net/wireless/ath9k/main.c | 42 ++++++++++++++++++++++++------------------ 3 files changed, 25 insertions(+), 42 deletions(-) diff --git a/drivers/net/wireless/ath9k/core.c b/drivers/net/wireless/ath9k/core.c index 81d4319..1f5382f 100644 --- a/drivers/net/wireless/ath9k/core.c +++ b/drivers/net/wireless/ath9k/core.c @@ -753,25 +753,6 @@ int ath_vap_up(struct ath_softc *sc, switch (avp->av_opmode) { case HAL_M_HOSTAP: - case HAL_M_IBSS: - /* - * Allocate and setup the beacon frame. - * - * Stop any previous beacon DMA. This may be - * necessary, for example, when an ibss merge - * causes reconfiguration; there will be a state - * transition from RUN->RUN that means we may - * be called with beacon transmission active. - */ - ath9k_hw_stoptxdma(ah, sc->sc_bhalq); - - error = ath_beacon_alloc(sc, if_id); - if (error != 0) - goto bad; - - if (flags & ATH_IF_BEACON_ENABLE) - sc->sc_beacons = 0; - break; case HAL_M_STA: /* @@ -820,7 +801,7 @@ int ath_vap_up(struct ath_softc *sc, sc->sc_tx_chainmask = 1; sc->sc_rx_chainmask = 1; } -bad: + return error; } diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h index 3daefa4..6db37cd 100644 --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h @@ -822,10 +822,6 @@ void ath_update_beacon_info(struct ath_softc *sc, int avgbrssi); void ath_get_beaconconfig(struct ath_softc *sc, int if_id, struct ath_beacon_config *conf); -struct sk_buff *ath_get_beacon(struct ath_softc *sc, - int if_id, - struct ath_beacon_offset *bo, - struct ath_tx_control *txctl); int ath_update_beacon(struct ath_softc *sc, int if_id, struct ath_beacon_offset *bo, diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 1a7c4ef..92b67b8 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c @@ -371,16 +371,6 @@ static int ath9k_tx(struct ieee80211_hw *hw, return 0; } -static int ath9k_beacon_update(struct ieee80211_hw *hw, - struct sk_buff *skb) - -{ - struct ath_softc *sc = hw->priv; - - DPRINTF(sc, ATH_DEBUG_BEACON, "%s: Update Beacon\n", __func__); - return ath9k_tx(hw, skb); -} - static void ath9k_stop(struct ieee80211_hw *hw) { struct ath_softc *sc = hw->priv; @@ -410,6 +400,10 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, switch (conf->type) { case IEEE80211_IF_TYPE_STA: ic_opmode = HAL_M_STA; + break; + case IEEE80211_IF_TYPE_IBSS: + ic_opmode = HAL_M_IBSS; + break; default: break; } @@ -481,25 +475,37 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, struct ieee80211_if_conf *conf) { struct ath_softc *sc = hw->priv; - struct sk_buff *beacon; + int error; switch (vif->type) { case IEEE80211_IF_TYPE_STA: + case IEEE80211_IF_TYPE_IBSS: 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)) - break; - beacon = ieee80211_beacon_get(hw, vif); - if (!beacon) - return -ENOMEM; - ath9k_beacon_update(hw, beacon); default: break; } + if ((vif->type == IEEE80211_IF_TYPE_IBSS) && + (conf->changed & IEEE80211_IFCC_BEACON)) { + /* + * Allocate and setup the beacon frame. + * + * Stop any previous beacon DMA. This may be + * necessary, for example, when an ibss merge + * causes reconfiguration; we may be called + * with beacon transmission active. + */ + ath9k_hw_stoptxdma(sc->sc_ah, sc->sc_bhalq); + error = ath_beacon_alloc(sc, 0); + if (error != 0) + return error; + sc->sc_beacons = 0; + ath_beacon_sync(sc, 0); + } + return 0; } -- 1.5.4.3