Commit ca900ac9 authored by Rajkumar Manoharan's avatar Rajkumar Manoharan Committed by John W. Linville

ath9k: Move beacon config to channel context

Signed-off-by: default avatarRajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8d7e09dd
...@@ -328,6 +328,7 @@ struct ath_chanctx { ...@@ -328,6 +328,7 @@ struct ath_chanctx {
struct list_head vifs; struct list_head vifs;
struct list_head acq[IEEE80211_NUM_ACS]; struct list_head acq[IEEE80211_NUM_ACS];
struct ath_beacon_config beacon;
struct ath9k_hw_cal_data caldata; struct ath9k_hw_cal_data caldata;
struct timespec tsf_ts; struct timespec tsf_ts;
u64 tsf_val; u64 tsf_val;
...@@ -828,7 +829,6 @@ struct ath_softc { ...@@ -828,7 +829,6 @@ struct ath_softc {
#ifdef CONFIG_ATH9K_DEBUGFS #ifdef CONFIG_ATH9K_DEBUGFS
struct ath9k_debug debug; struct ath9k_debug debug;
#endif #endif
struct ath_beacon_config cur_beacon_conf;
struct delayed_work tx_complete_work; struct delayed_work tx_complete_work;
struct delayed_work hw_pll_work; struct delayed_work hw_pll_work;
struct timer_list sleep_timer; struct timer_list sleep_timer;
......
...@@ -249,7 +249,7 @@ void ath9k_beacon_remove_slot(struct ath_softc *sc, struct ieee80211_vif *vif) ...@@ -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) static int ath9k_beacon_choose_slot(struct ath_softc *sc)
{ {
struct ath_common *common = ath9k_hw_common(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;
u16 intval; u16 intval;
u32 tsftu; u32 tsftu;
u64 tsf; u64 tsf;
...@@ -277,7 +277,7 @@ static int ath9k_beacon_choose_slot(struct ath_softc *sc) ...@@ -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) 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_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; struct ath_vif *avp = (void *)vif->drv_priv;
u32 tsfadjust; u32 tsfadjust;
...@@ -528,7 +528,7 @@ static void ath9k_cache_beacon_config(struct ath_softc *sc, ...@@ -528,7 +528,7 @@ static void ath9k_cache_beacon_config(struct ath_softc *sc,
struct ieee80211_bss_conf *bss_conf) struct ieee80211_bss_conf *bss_conf)
{ {
struct ath_common *common = ath9k_hw_common(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;
ath_dbg(common, BEACON, ath_dbg(common, BEACON,
"Caching beacon data for BSS: %pM\n", bss_conf->bssid); "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, ...@@ -564,7 +564,7 @@ void ath9k_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif,
u32 changed) u32 changed)
{ {
struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; 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_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
unsigned long flags; unsigned long flags;
...@@ -631,7 +631,7 @@ void ath9k_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif, ...@@ -631,7 +631,7 @@ void ath9k_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif,
void ath9k_set_beacon(struct ath_softc *sc) void ath9k_set_beacon(struct ath_softc *sc)
{ {
struct ath_common *common = ath9k_hw_common(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;
switch (sc->sc_ah->opmode) { switch (sc->sc_ah->opmode) {
case NL80211_IFTYPE_AP: case NL80211_IFTYPE_AP:
......
...@@ -271,7 +271,6 @@ void ath_chanctx_init(struct ath_softc *sc) ...@@ -271,7 +271,6 @@ void ath_chanctx_init(struct ath_softc *sc)
for (j = 0; j < ARRAY_SIZE(ctx->acq); j++) for (j = 0; j < ARRAY_SIZE(ctx->acq); j++)
INIT_LIST_HEAD(&ctx->acq[j]); INIT_LIST_HEAD(&ctx->acq[j]);
} }
sc->cur_chan = &sc->chanctx[0];
ctx = &sc->offchannel.chan; ctx = &sc->offchannel.chan;
cfg80211_chandef_create(&ctx->chandef, chan, NL80211_CHAN_HT20); cfg80211_chandef_create(&ctx->chandef, chan, NL80211_CHAN_HT20);
INIT_LIST_HEAD(&ctx->vifs); INIT_LIST_HEAD(&ctx->vifs);
......
...@@ -510,6 +510,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, ...@@ -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->dfs_detector = dfs_pattern_detector_init(common, NL80211_DFS_UNSET);
sc->tx99_power = MAX_RATE_POWER + 1; sc->tx99_power = MAX_RATE_POWER + 1;
init_waitqueue_head(&sc->tx_wait); init_waitqueue_head(&sc->tx_wait);
sc->cur_chan = &sc->chanctx[0];
if (!pdata || pdata->use_eeprom) { if (!pdata || pdata->use_eeprom) {
ah->ah_flags |= AH_USE_EEPROM; ah->ah_flags |= AH_USE_EEPROM;
......
...@@ -440,7 +440,7 @@ void ath_check_ani(struct ath_softc *sc) ...@@ -440,7 +440,7 @@ void ath_check_ani(struct ath_softc *sc)
{ {
struct ath_hw *ah = sc->sc_ah; struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(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 * Check for the various conditions in which ANI has to
......
...@@ -545,7 +545,7 @@ static void ath_rx_ps_beacon(struct ath_softc *sc, struct sk_buff *skb) ...@@ -545,7 +545,7 @@ static void ath_rx_ps_beacon(struct ath_softc *sc, struct sk_buff *skb)
sc->ps_flags &= ~PS_BEACON_SYNC; sc->ps_flags &= ~PS_BEACON_SYNC;
ath_dbg(common, PS, ath_dbg(common, PS,
"Reconfigure beacon timers based on synchronized timestamp\n"); "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); ath9k_set_beacon(sc);
if (sc->p2p_ps_vif) if (sc->p2p_ps_vif)
ath9k_update_p2p_ps(sc, sc->p2p_ps_vif->vif); ath9k_update_p2p_ps(sc, sc->p2p_ps_vif->vif);
......
...@@ -1694,7 +1694,7 @@ int ath_txq_update(struct ath_softc *sc, int qnum, ...@@ -1694,7 +1694,7 @@ int ath_txq_update(struct ath_softc *sc, int qnum,
int ath_cabq_update(struct ath_softc *sc) int ath_cabq_update(struct ath_softc *sc)
{ {
struct ath9k_tx_queue_info qi; 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; int qnum = sc->beacon.cabq->axq_qnum;
ath9k_hw_get_txq_props(sc->sc_ah, qnum, &qi); 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, ...@@ -2301,8 +2301,8 @@ void ath_tx_cabq(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
int max_duration; int max_duration;
max_duration = max_duration =
sc->cur_beacon_conf.beacon_interval * 1000 * sc->cur_chan->beacon.beacon_interval * 1000 *
sc->cur_beacon_conf.dtim_period / ATH_BCBUF; sc->cur_chan->beacon.dtim_period / ATH_BCBUF;
do { do {
struct ath_frame_info *fi = get_frame_info(skb); struct ath_frame_info *fi = get_frame_info(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment