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.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index b4a31a43a62c..c8a4558f79ba 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -93,8 +93,6 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp,
93 antenna = ((sc->beacon.ast_be_xmit / sc->nbcnvifs) & 1 ? 2 : 1); 93 antenna = ((sc->beacon.ast_be_xmit / sc->nbcnvifs) & 1 ? 2 : 1);
94 } 94 }
95 95
96 ds->ds_data = bf->bf_buf_addr;
97
98 sband = &sc->sbands[common->hw->conf.channel->band]; 96 sband = &sc->sbands[common->hw->conf.channel->band];
99 rate = sband->bitrates[rateidx].hw_value; 97 rate = sband->bitrates[rateidx].hw_value;
100 if (sc->sc_flags & SC_OP_PREAMBLE_SHORT) 98 if (sc->sc_flags & SC_OP_PREAMBLE_SHORT)
@@ -109,7 +107,8 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp,
109 107
110 /* NB: beacon's BufLen must be a multiple of 4 bytes */ 108 /* NB: beacon's BufLen must be a multiple of 4 bytes */
111 ath9k_hw_filltxdesc(ah, ds, roundup(skb->len, 4), 109 ath9k_hw_filltxdesc(ah, ds, roundup(skb->len, 4),
112 true, true, ds); 110 true, true, ds, bf->bf_buf_addr,
111 sc->beacon.beaconq);
113 112
114 memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4); 113 memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4);
115 series[0].Tries = 1; 114 series[0].Tries = 1;
@@ -524,6 +523,7 @@ static void ath9k_beacon_init(struct ath_softc *sc,
524static void ath_beacon_config_ap(struct ath_softc *sc, 523static void ath_beacon_config_ap(struct ath_softc *sc,
525 struct ath_beacon_config *conf) 524 struct ath_beacon_config *conf)
526{ 525{
526 struct ath_hw *ah = sc->sc_ah;
527 u32 nexttbtt, intval; 527 u32 nexttbtt, intval;
528 528
529 /* NB: the beacon interval is kept internally in TU's */ 529 /* NB: the beacon interval is kept internally in TU's */
@@ -539,15 +539,15 @@ static void ath_beacon_config_ap(struct ath_softc *sc,
539 * prepare beacon frames. 539 * prepare beacon frames.
540 */ 540 */
541 intval |= ATH9K_BEACON_ENA; 541 intval |= ATH9K_BEACON_ENA;
542 sc->imask |= ATH9K_INT_SWBA; 542 ah->imask |= ATH9K_INT_SWBA;
543 ath_beaconq_config(sc); 543 ath_beaconq_config(sc);
544 544
545 /* Set the computed AP beacon timers */ 545 /* Set the computed AP beacon timers */
546 546
547 ath9k_hw_set_interrupts(sc->sc_ah, 0); 547 ath9k_hw_set_interrupts(ah, 0);
548 ath9k_beacon_init(sc, nexttbtt, intval); 548 ath9k_beacon_init(sc, nexttbtt, intval);
549 sc->beacon.bmisscnt = 0; 549 sc->beacon.bmisscnt = 0;
550 ath9k_hw_set_interrupts(sc->sc_ah, sc->imask); 550 ath9k_hw_set_interrupts(ah, ah->imask);
551 551
552 /* Clear the reset TSF flag, so that subsequent beacon updation 552 /* Clear the reset TSF flag, so that subsequent beacon updation
553 will not reset the HW TSF. */ 553 will not reset the HW TSF. */
@@ -566,7 +566,8 @@ static void ath_beacon_config_ap(struct ath_softc *sc,
566static void ath_beacon_config_sta(struct ath_softc *sc, 566static void ath_beacon_config_sta(struct ath_softc *sc,
567 struct ath_beacon_config *conf) 567 struct ath_beacon_config *conf)
568{ 568{
569 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 569 struct ath_hw *ah = sc->sc_ah;
570 struct ath_common *common = ath9k_hw_common(ah);
570 struct ath9k_beacon_state bs; 571 struct ath9k_beacon_state bs;
571 int dtimperiod, dtimcount, sleepduration; 572 int dtimperiod, dtimcount, sleepduration;
572 int cfpperiod, cfpcount; 573 int cfpperiod, cfpcount;
@@ -605,7 +606,7 @@ static void ath_beacon_config_sta(struct ath_softc *sc,
605 * Pull nexttbtt forward to reflect the current 606 * Pull nexttbtt forward to reflect the current
606 * TSF and calculate dtim+cfp state for the result. 607 * TSF and calculate dtim+cfp state for the result.
607 */ 608 */
608 tsf = ath9k_hw_gettsf64(sc->sc_ah); 609 tsf = ath9k_hw_gettsf64(ah);
609 tsftu = TSF_TO_TU(tsf>>32, tsf) + FUDGE; 610 tsftu = TSF_TO_TU(tsf>>32, tsf) + FUDGE;
610 611
611 num_beacons = tsftu / intval + 1; 612 num_beacons = tsftu / intval + 1;
@@ -678,17 +679,18 @@ static void ath_beacon_config_sta(struct ath_softc *sc,
678 679
679 /* Set the computed STA beacon timers */ 680 /* Set the computed STA beacon timers */
680 681
681 ath9k_hw_set_interrupts(sc->sc_ah, 0); 682 ath9k_hw_set_interrupts(ah, 0);
682 ath9k_hw_set_sta_beacon_timers(sc->sc_ah, &bs); 683 ath9k_hw_set_sta_beacon_timers(ah, &bs);
683 sc->imask |= ATH9K_INT_BMISS; 684 ah->imask |= ATH9K_INT_BMISS;
684 ath9k_hw_set_interrupts(sc->sc_ah, sc->imask); 685 ath9k_hw_set_interrupts(ah, ah->imask);
685} 686}
686 687
687static void ath_beacon_config_adhoc(struct ath_softc *sc, 688static void ath_beacon_config_adhoc(struct ath_softc *sc,
688 struct ath_beacon_config *conf, 689 struct ath_beacon_config *conf,
689 struct ieee80211_vif *vif) 690 struct ieee80211_vif *vif)
690{ 691{
691 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 692 struct ath_hw *ah = sc->sc_ah;
693 struct ath_common *common = ath9k_hw_common(ah);
692 u64 tsf; 694 u64 tsf;
693 u32 tsftu, intval, nexttbtt; 695 u32 tsftu, intval, nexttbtt;
694 696
@@ -703,7 +705,7 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc,
703 else if (intval) 705 else if (intval)
704 nexttbtt = roundup(nexttbtt, intval); 706 nexttbtt = roundup(nexttbtt, intval);
705 707
706 tsf = ath9k_hw_gettsf64(sc->sc_ah); 708 tsf = ath9k_hw_gettsf64(ah);
707 tsftu = TSF_TO_TU((u32)(tsf>>32), (u32)tsf) + FUDGE; 709 tsftu = TSF_TO_TU((u32)(tsf>>32), (u32)tsf) + FUDGE;
708 do { 710 do {
709 nexttbtt += intval; 711 nexttbtt += intval;
@@ -719,20 +721,20 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc,
719 * self-linked tx descriptor and let the hardware deal with things. 721 * self-linked tx descriptor and let the hardware deal with things.
720 */ 722 */
721 intval |= ATH9K_BEACON_ENA; 723 intval |= ATH9K_BEACON_ENA;
722 if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_VEOL)) 724 if (!(ah->caps.hw_caps & ATH9K_HW_CAP_VEOL))
723 sc->imask |= ATH9K_INT_SWBA; 725 ah->imask |= ATH9K_INT_SWBA;
724 726
725 ath_beaconq_config(sc); 727 ath_beaconq_config(sc);
726 728
727 /* Set the computed ADHOC beacon timers */ 729 /* Set the computed ADHOC beacon timers */
728 730
729 ath9k_hw_set_interrupts(sc->sc_ah, 0); 731 ath9k_hw_set_interrupts(ah, 0);
730 ath9k_beacon_init(sc, nexttbtt, intval); 732 ath9k_beacon_init(sc, nexttbtt, intval);
731 sc->beacon.bmisscnt = 0; 733 sc->beacon.bmisscnt = 0;
732 ath9k_hw_set_interrupts(sc->sc_ah, sc->imask); 734 ath9k_hw_set_interrupts(ah, ah->imask);
733 735
734 /* FIXME: Handle properly when vif is NULL */ 736 /* FIXME: Handle properly when vif is NULL */
735 if (vif && sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_VEOL) 737 if (vif && ah->caps.hw_caps & ATH9K_HW_CAP_VEOL)
736 ath_beacon_start_adhoc(sc, vif); 738 ath_beacon_start_adhoc(sc, vif);
737} 739}
738 740