aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/beacon.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/beacon.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/beacon.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index ab8c05cf62f3..87ba44c06692 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -112,8 +112,7 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp,
112 112
113static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb) 113static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb)
114{ 114{
115 struct ath_wiphy *aphy = hw->priv; 115 struct ath_softc *sc = hw->priv;
116 struct ath_softc *sc = aphy->sc;
117 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 116 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
118 struct ath_tx_control txctl; 117 struct ath_tx_control txctl;
119 118
@@ -132,8 +131,7 @@ static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb)
132static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw, 131static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
133 struct ieee80211_vif *vif) 132 struct ieee80211_vif *vif)
134{ 133{
135 struct ath_wiphy *aphy = hw->priv; 134 struct ath_softc *sc = hw->priv;
136 struct ath_softc *sc = aphy->sc;
137 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 135 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
138 struct ath_buf *bf; 136 struct ath_buf *bf;
139 struct ath_vif *avp; 137 struct ath_vif *avp;
@@ -142,9 +140,6 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
142 struct ieee80211_tx_info *info; 140 struct ieee80211_tx_info *info;
143 int cabq_depth; 141 int cabq_depth;
144 142
145 if (aphy->state != ATH_WIPHY_ACTIVE)
146 return NULL;
147
148 avp = (void *)vif->drv_priv; 143 avp = (void *)vif->drv_priv;
149 cabq = sc->beacon.cabq; 144 cabq = sc->beacon.cabq;
150 145
@@ -225,9 +220,8 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
225 return bf; 220 return bf;
226} 221}
227 222
228int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif) 223int ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_vif *vif)
229{ 224{
230 struct ath_softc *sc = aphy->sc;
231 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 225 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
232 struct ath_vif *avp; 226 struct ath_vif *avp;
233 struct ath_buf *bf; 227 struct ath_buf *bf;
@@ -261,7 +255,6 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif)
261 } 255 }
262 BUG_ON(sc->beacon.bslot[avp->av_bslot] != NULL); 256 BUG_ON(sc->beacon.bslot[avp->av_bslot] != NULL);
263 sc->beacon.bslot[avp->av_bslot] = vif; 257 sc->beacon.bslot[avp->av_bslot] = vif;
264 sc->beacon.bslot_aphy[avp->av_bslot] = aphy;
265 sc->nbcnvifs++; 258 sc->nbcnvifs++;
266 } 259 }
267 } 260 }
@@ -332,7 +325,6 @@ void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp)
332 325
333 if (avp->av_bslot != -1) { 326 if (avp->av_bslot != -1) {
334 sc->beacon.bslot[avp->av_bslot] = NULL; 327 sc->beacon.bslot[avp->av_bslot] = NULL;
335 sc->beacon.bslot_aphy[avp->av_bslot] = NULL;
336 sc->nbcnvifs--; 328 sc->nbcnvifs--;
337 } 329 }
338 330
@@ -358,7 +350,6 @@ void ath_beacon_tasklet(unsigned long data)
358 struct ath_common *common = ath9k_hw_common(ah); 350 struct ath_common *common = ath9k_hw_common(ah);
359 struct ath_buf *bf = NULL; 351 struct ath_buf *bf = NULL;
360 struct ieee80211_vif *vif; 352 struct ieee80211_vif *vif;
361 struct ath_wiphy *aphy;
362 int slot; 353 int slot;
363 u32 bfaddr, bc = 0, tsftu; 354 u32 bfaddr, bc = 0, tsftu;
364 u64 tsf; 355 u64 tsf;
@@ -416,7 +407,6 @@ void ath_beacon_tasklet(unsigned long data)
416 */ 407 */
417 slot = ATH_BCBUF - slot - 1; 408 slot = ATH_BCBUF - slot - 1;
418 vif = sc->beacon.bslot[slot]; 409 vif = sc->beacon.bslot[slot];
419 aphy = sc->beacon.bslot_aphy[slot];
420 410
421 ath_dbg(common, ATH_DBG_BEACON, 411 ath_dbg(common, ATH_DBG_BEACON,
422 "slot %d [tsf %llu tsftu %u intval %u] vif %p\n", 412 "slot %d [tsf %llu tsftu %u intval %u] vif %p\n",
@@ -424,7 +414,7 @@ void ath_beacon_tasklet(unsigned long data)
424 414
425 bfaddr = 0; 415 bfaddr = 0;
426 if (vif) { 416 if (vif) {
427 bf = ath_beacon_generate(aphy->hw, vif); 417 bf = ath_beacon_generate(sc->hw, vif);
428 if (bf != NULL) { 418 if (bf != NULL) {
429 bfaddr = bf->bf_daddr; 419 bfaddr = bf->bf_daddr;
430 bc = 1; 420 bc = 1;