aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/beacon.c
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2008-10-29 00:46:06 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-11-10 15:14:57 -0500
commit5640b08ef7e88b606c740e746cb77bc97d78508e (patch)
tree355d8e4d2315e8b88b01521c8a79be52fd5d5429 /drivers/net/wireless/ath9k/beacon.c
parenta37c2c79404940dfc5e88c851c3de5328975b1a9 (diff)
ath9k: Revamp VAP management
Remove the internal VAP management routines and embed ath_vap in mac80211's driver private area provided in ieee80211_vif. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/beacon.c')
-rw-r--r--drivers/net/wireless/ath9k/beacon.c40
1 files changed, 27 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath9k/beacon.c b/drivers/net/wireless/ath9k/beacon.c
index b36d3fb2ecc7..d186cd41c235 100644
--- a/drivers/net/wireless/ath9k/beacon.c
+++ b/drivers/net/wireless/ath9k/beacon.c
@@ -152,12 +152,14 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id)
152 struct ath_vap *avp; 152 struct ath_vap *avp;
153 struct sk_buff *skb; 153 struct sk_buff *skb;
154 struct ath_txq *cabq; 154 struct ath_txq *cabq;
155 struct ieee80211_vif *vif;
155 struct ieee80211_tx_info *info; 156 struct ieee80211_tx_info *info;
156 int cabq_depth; 157 int cabq_depth;
157 158
158 avp = sc->sc_vaps[if_id]; 159 vif = sc->sc_vaps[if_id];
159 ASSERT(avp); 160 ASSERT(vif);
160 161
162 avp = (void *)vif->drv_priv;
161 cabq = sc->sc_cabq; 163 cabq = sc->sc_cabq;
162 164
163 if (avp->av_bcbuf == NULL) { 165 if (avp->av_bcbuf == NULL) {
@@ -174,7 +176,7 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id)
174 PCI_DMA_TODEVICE); 176 PCI_DMA_TODEVICE);
175 } 177 }
176 178
177 skb = ieee80211_beacon_get(sc->hw, avp->av_if_data); 179 skb = ieee80211_beacon_get(sc->hw, vif);
178 bf->bf_mpdu = skb; 180 bf->bf_mpdu = skb;
179 if (skb == NULL) 181 if (skb == NULL)
180 return NULL; 182 return NULL;
@@ -196,7 +198,7 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id)
196 skb_end_pointer(skb) - skb->head, 198 skb_end_pointer(skb) - skb->head,
197 PCI_DMA_TODEVICE); 199 PCI_DMA_TODEVICE);
198 200
199 skb = ieee80211_get_buffered_bc(sc->hw, avp->av_if_data); 201 skb = ieee80211_get_buffered_bc(sc->hw, vif);
200 202
201 /* 203 /*
202 * if the CABQ traffic from previous DTIM is pending and the current 204 * if the CABQ traffic from previous DTIM is pending and the current
@@ -232,7 +234,7 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id)
232 */ 234 */
233 while (skb) { 235 while (skb) {
234 ath_tx_cabq(sc, skb); 236 ath_tx_cabq(sc, skb);
235 skb = ieee80211_get_buffered_bc(sc->hw, avp->av_if_data); 237 skb = ieee80211_get_buffered_bc(sc->hw, vif);
236 } 238 }
237 239
238 return bf; 240 return bf;
@@ -244,13 +246,16 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id)
244*/ 246*/
245static void ath_beacon_start_adhoc(struct ath_softc *sc, int if_id) 247static void ath_beacon_start_adhoc(struct ath_softc *sc, int if_id)
246{ 248{
249 struct ieee80211_vif *vif;
247 struct ath_hal *ah = sc->sc_ah; 250 struct ath_hal *ah = sc->sc_ah;
248 struct ath_buf *bf; 251 struct ath_buf *bf;
249 struct ath_vap *avp; 252 struct ath_vap *avp;
250 struct sk_buff *skb; 253 struct sk_buff *skb;
251 254
252 avp = sc->sc_vaps[if_id]; 255 vif = sc->sc_vaps[if_id];
253 ASSERT(avp); 256 ASSERT(vif);
257
258 avp = (void *)vif->drv_priv;
254 259
255 if (avp->av_bcbuf == NULL) { 260 if (avp->av_bcbuf == NULL) {
256 DPRINTF(sc, ATH_DBG_BEACON, "%s: avp=%p av_bcbuf=%p\n", 261 DPRINTF(sc, ATH_DBG_BEACON, "%s: avp=%p av_bcbuf=%p\n",
@@ -300,14 +305,17 @@ int ath_beaconq_setup(struct ath_hal *ah)
300*/ 305*/
301int ath_beacon_alloc(struct ath_softc *sc, int if_id) 306int ath_beacon_alloc(struct ath_softc *sc, int if_id)
302{ 307{
308 struct ieee80211_vif *vif;
303 struct ath_vap *avp; 309 struct ath_vap *avp;
304 struct ieee80211_hdr *hdr; 310 struct ieee80211_hdr *hdr;
305 struct ath_buf *bf; 311 struct ath_buf *bf;
306 struct sk_buff *skb; 312 struct sk_buff *skb;
307 __le64 tstamp; 313 __le64 tstamp;
308 314
309 avp = sc->sc_vaps[if_id]; 315 vif = sc->sc_vaps[if_id];
310 ASSERT(avp); 316 ASSERT(vif);
317
318 avp = (void *)vif->drv_priv;
311 319
312 /* Allocate a beacon descriptor if we haven't done so. */ 320 /* Allocate a beacon descriptor if we haven't done so. */
313 if (!avp->av_bcbuf) { 321 if (!avp->av_bcbuf) {
@@ -363,7 +371,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id)
363 * FIXME: Fill avp->av_btxctl.txpower and 371 * FIXME: Fill avp->av_btxctl.txpower and
364 * avp->av_btxctl.shortPreamble 372 * avp->av_btxctl.shortPreamble
365 */ 373 */
366 skb = ieee80211_beacon_get(sc->hw, avp->av_if_data); 374 skb = ieee80211_beacon_get(sc->hw, vif);
367 if (skb == NULL) { 375 if (skb == NULL) {
368 DPRINTF(sc, ATH_DBG_BEACON, "%s: cannot get skb\n", 376 DPRINTF(sc, ATH_DBG_BEACON, "%s: cannot get skb\n",
369 __func__); 377 __func__);
@@ -652,15 +660,21 @@ void ath_bstuck_process(struct ath_softc *sc)
652 */ 660 */
653void ath_beacon_config(struct ath_softc *sc, int if_id) 661void ath_beacon_config(struct ath_softc *sc, int if_id)
654{ 662{
663 struct ieee80211_vif *vif;
655 struct ath_hal *ah = sc->sc_ah; 664 struct ath_hal *ah = sc->sc_ah;
656 struct ath_beacon_config conf; 665 struct ath_beacon_config conf;
666 struct ath_vap *avp;
657 enum ath9k_opmode av_opmode; 667 enum ath9k_opmode av_opmode;
658 u32 nexttbtt, intval; 668 u32 nexttbtt, intval;
659 669
660 if (if_id != ATH_IF_ID_ANY) 670 if (if_id != ATH_IF_ID_ANY) {
661 av_opmode = sc->sc_vaps[if_id]->av_opmode; 671 vif = sc->sc_vaps[if_id];
662 else 672 ASSERT(vif);
673 avp = (void *)vif->drv_priv;
674 av_opmode = avp->av_opmode;
675 } else {
663 av_opmode = sc->sc_ah->ah_opmode; 676 av_opmode = sc->sc_ah->ah_opmode;
677 }
664 678
665 memset(&conf, 0, sizeof(struct ath_beacon_config)); 679 memset(&conf, 0, sizeof(struct ath_beacon_config));
666 680