ath9k: Move beacon config to channel context
authorRajkumar Manoharan <rmanohar@qti.qualcomm.com>
Wed, 11 Jun 2014 10:48:02 +0000 (16:18 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 19 Jun 2014 19:49:18 +0000 (15:49 -0400)
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/ath9k.h
drivers/net/wireless/ath/ath9k/beacon.c
drivers/net/wireless/ath/ath9k/channel.c
drivers/net/wireless/ath/ath9k/init.c
drivers/net/wireless/ath/ath9k/link.c
drivers/net/wireless/ath/ath9k/recv.c
drivers/net/wireless/ath/ath9k/xmit.c

index 4df412b716802a8f3929af057fedc43b4897131c..d632f8f2a72c479e8a3eb6965463ce4a9db2d199 100644 (file)
@@ -328,6 +328,7 @@ struct ath_chanctx {
        struct list_head vifs;
        struct list_head acq[IEEE80211_NUM_ACS];
 
+       struct ath_beacon_config beacon;
        struct ath9k_hw_cal_data caldata;
        struct timespec tsf_ts;
        u64 tsf_val;
@@ -828,7 +829,6 @@ struct ath_softc {
 #ifdef CONFIG_ATH9K_DEBUGFS
        struct ath9k_debug debug;
 #endif
-       struct ath_beacon_config cur_beacon_conf;
        struct delayed_work tx_complete_work;
        struct delayed_work hw_pll_work;
        struct timer_list sleep_timer;
index eae8f686f12527ff39fa96c92d1f8e54b28170a6..c0ff01599ed3c14c669c6927bf245f61de401156 100644 (file)
@@ -249,7 +249,7 @@ void ath9k_beacon_remove_slot(struct ath_softc *sc, struct ieee80211_vif *vif)
 static int ath9k_beacon_choose_slot(struct ath_softc *sc)
 {
        struct ath_common *common = ath9k_hw_common(sc->sc_ah);
-       struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
+       struct ath_beacon_config *cur_conf = &sc->cur_chan->beacon;
        u16 intval;
        u32 tsftu;
        u64 tsf;
@@ -277,7 +277,7 @@ static int ath9k_beacon_choose_slot(struct ath_softc *sc)
 static void ath9k_set_tsfadjust(struct ath_softc *sc, struct ieee80211_vif *vif)
 {
        struct ath_common *common = ath9k_hw_common(sc->sc_ah);
-       struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
+       struct ath_beacon_config *cur_conf = &sc->cur_chan->beacon;
        struct ath_vif *avp = (void *)vif->drv_priv;
        u32 tsfadjust;
 
@@ -528,7 +528,7 @@ static void ath9k_cache_beacon_config(struct ath_softc *sc,
                                      struct ieee80211_bss_conf *bss_conf)
 {
        struct ath_common *common = ath9k_hw_common(sc->sc_ah);
-       struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
+       struct ath_beacon_config *cur_conf = &sc->cur_chan->beacon;
 
        ath_dbg(common, BEACON,
                "Caching beacon data for BSS: %pM\n", bss_conf->bssid);
@@ -564,7 +564,7 @@ void ath9k_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif,
                         u32 changed)
 {
        struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
-       struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
+       struct ath_beacon_config *cur_conf = &sc->cur_chan->beacon;
         struct ath_hw *ah = sc->sc_ah;
         struct ath_common *common = ath9k_hw_common(ah);
        unsigned long flags;
@@ -631,7 +631,7 @@ void ath9k_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif,
 void ath9k_set_beacon(struct ath_softc *sc)
 {
        struct ath_common *common = ath9k_hw_common(sc->sc_ah);
-       struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
+       struct ath_beacon_config *cur_conf = &sc->cur_chan->beacon;
 
        switch (sc->sc_ah->opmode) {
        case NL80211_IFTYPE_AP:
index 4a7691eecdb4636b3a0b939a34201abef3ecc135..156625318d04f456836a2b52d58761553224feb8 100644 (file)
@@ -271,7 +271,6 @@ void ath_chanctx_init(struct ath_softc *sc)
                for (j = 0; j < ARRAY_SIZE(ctx->acq); j++)
                        INIT_LIST_HEAD(&ctx->acq[j]);
        }
-       sc->cur_chan = &sc->chanctx[0];
        ctx = &sc->offchannel.chan;
        cfg80211_chandef_create(&ctx->chandef, chan, NL80211_CHAN_HT20);
        INIT_LIST_HEAD(&ctx->vifs);
index 45f198ff6e0e2b27915e78fcc6051dd9020976e3..1ff1a75f4fed9c91adde95a0b6d8fd253dbf1a68 100644 (file)
@@ -510,6 +510,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
        sc->dfs_detector = dfs_pattern_detector_init(common, NL80211_DFS_UNSET);
        sc->tx99_power = MAX_RATE_POWER + 1;
        init_waitqueue_head(&sc->tx_wait);
+       sc->cur_chan = &sc->chanctx[0];
 
        if (!pdata || pdata->use_eeprom) {
                ah->ah_flags |= AH_USE_EEPROM;
index d9c01d563cc267a8f438dac8c118570151903792..2343f56e64987730bcb3ad1cb5542c41dcd94310 100644 (file)
@@ -440,7 +440,7 @@ void ath_check_ani(struct ath_softc *sc)
 {
        struct ath_hw *ah = sc->sc_ah;
        struct ath_common *common = ath9k_hw_common(sc->sc_ah);
-       struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
+       struct ath_beacon_config *cur_conf = &sc->cur_chan->beacon;
 
        /*
         * Check for the various conditions in which ANI has to
index fec9e0b42f5df0a9210bf3821566f634ea0e654f..7b9c7e53caaa31741a1c9167b41f28669f4a84fb 100644 (file)
@@ -545,7 +545,7 @@ static void ath_rx_ps_beacon(struct ath_softc *sc, struct sk_buff *skb)
                sc->ps_flags &= ~PS_BEACON_SYNC;
                ath_dbg(common, PS,
                        "Reconfigure beacon timers based on synchronized timestamp\n");
-               if (!(WARN_ON_ONCE(sc->cur_beacon_conf.beacon_interval == 0)))
+               if (!(WARN_ON_ONCE(sc->cur_chan->beacon.beacon_interval == 0)))
                        ath9k_set_beacon(sc);
                if (sc->p2p_ps_vif)
                        ath9k_update_p2p_ps(sc, sc->p2p_ps_vif->vif);
index 22460a1e033ca5e461c73f509699c47aae42acf2..7dd6187761c1325de8cc38539115b5f56812b9d1 100644 (file)
@@ -1694,7 +1694,7 @@ int ath_txq_update(struct ath_softc *sc, int qnum,
 int ath_cabq_update(struct ath_softc *sc)
 {
        struct ath9k_tx_queue_info qi;
-       struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
+       struct ath_beacon_config *cur_conf = &sc->cur_chan->beacon;
        int qnum = sc->beacon.cabq->axq_qnum;
 
        ath9k_hw_get_txq_props(sc->sc_ah, qnum, &qi);
@@ -2301,8 +2301,8 @@ void ath_tx_cabq(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
        int max_duration;
 
        max_duration =
-               sc->cur_beacon_conf.beacon_interval * 1000 *
-               sc->cur_beacon_conf.dtim_period / ATH_BCBUF;
+               sc->cur_chan->beacon.beacon_interval * 1000 *
+               sc->cur_chan->beacon.dtim_period / ATH_BCBUF;
 
        do {
                struct ath_frame_info *fi = get_frame_info(skb);