beacon.c (7e66eaf14e19c032433be7c4df3c892fa2a5282f) beacon.c (82b2d334314c387ebd857b88a3d889c9a2cfec4a)
1/*
2 * Copyright (c) 2008-2011 Atheros Communications Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 93 unchanged lines hidden (view full) ---

102 ath9k_hw_filltxdesc(ah, ds, roundup(skb->len, 4),
103 true, true, ds, bf->bf_buf_addr,
104 sc->beacon.beaconq);
105
106 memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4);
107 series[0].Tries = 1;
108 series[0].Rate = rate;
109 series[0].ChSel = ath_txchainmask_reduction(sc,
1/*
2 * Copyright (c) 2008-2011 Atheros Communications Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 93 unchanged lines hidden (view full) ---

102 ath9k_hw_filltxdesc(ah, ds, roundup(skb->len, 4),
103 true, true, ds, bf->bf_buf_addr,
104 sc->beacon.beaconq);
105
106 memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4);
107 series[0].Tries = 1;
108 series[0].Rate = rate;
109 series[0].ChSel = ath_txchainmask_reduction(sc,
110 common->tx_chainmask, series[0].Rate);
110 ah->txchainmask, series[0].Rate);
111 series[0].RateFlags = (ctsrate) ? ATH9K_RATESERIES_RTS_CTS : 0;
112 ath9k_hw_set11n_ratescenario(ah, ds, ds, 0, ctsrate, ctsduration,
113 series, 4, 0);
114}
115
116static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb)
117{
118 struct ath_softc *sc = hw->priv;

--- 398 unchanged lines hidden (view full) ---

517 ath_beaconq_config(sc);
518
519 /* Set the computed AP beacon timers */
520
521 ath9k_hw_disable_interrupts(ah);
522 ath9k_beacon_init(sc, nexttbtt, intval);
523 sc->beacon.bmisscnt = 0;
524 ath9k_hw_set_interrupts(ah, ah->imask);
111 series[0].RateFlags = (ctsrate) ? ATH9K_RATESERIES_RTS_CTS : 0;
112 ath9k_hw_set11n_ratescenario(ah, ds, ds, 0, ctsrate, ctsduration,
113 series, 4, 0);
114}
115
116static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb)
117{
118 struct ath_softc *sc = hw->priv;

--- 398 unchanged lines hidden (view full) ---

517 ath_beaconq_config(sc);
518
519 /* Set the computed AP beacon timers */
520
521 ath9k_hw_disable_interrupts(ah);
522 ath9k_beacon_init(sc, nexttbtt, intval);
523 sc->beacon.bmisscnt = 0;
524 ath9k_hw_set_interrupts(ah, ah->imask);
525 ath9k_hw_enable_interrupts(ah);
525}
526
527/*
528 * This sets up the beacon timers according to the timestamp of the last
529 * received beacon and the current TSF, configures PCF and DTIM
530 * handling, programs the sleep registers so the hardware will wakeup in
531 * time to receive beacons, and configures the beacon miss handling so
532 * we'll receive a BMISS interrupt when we stop seeing beacons from the AP

--- 110 unchanged lines hidden (view full) ---

643 bs.bs_cfpperiod, bs.bs_cfpmaxduration, bs.bs_cfpnext);
644
645 /* Set the computed STA beacon timers */
646
647 ath9k_hw_disable_interrupts(ah);
648 ath9k_hw_set_sta_beacon_timers(ah, &bs);
649 ah->imask |= ATH9K_INT_BMISS;
650
526}
527
528/*
529 * This sets up the beacon timers according to the timestamp of the last
530 * received beacon and the current TSF, configures PCF and DTIM
531 * handling, programs the sleep registers so the hardware will wakeup in
532 * time to receive beacons, and configures the beacon miss handling so
533 * we'll receive a BMISS interrupt when we stop seeing beacons from the AP

--- 110 unchanged lines hidden (view full) ---

644 bs.bs_cfpperiod, bs.bs_cfpmaxduration, bs.bs_cfpnext);
645
646 /* Set the computed STA beacon timers */
647
648 ath9k_hw_disable_interrupts(ah);
649 ath9k_hw_set_sta_beacon_timers(ah, &bs);
650 ah->imask |= ATH9K_INT_BMISS;
651
651 /*
652 * If the beacon config is called beacause of TSFOOR,
653 * Interrupts will be enabled back at the end of ath9k_tasklet
654 */
655 if (!(sc->ps_flags & PS_TSFOOR_SYNC))
656 ath9k_hw_set_interrupts(ah, ah->imask);
652 ath9k_hw_set_interrupts(ah, ah->imask);
653 ath9k_hw_enable_interrupts(ah);
657}
658
659static void ath_beacon_config_adhoc(struct ath_softc *sc,
660 struct ath_beacon_config *conf)
661{
662 struct ath_hw *ah = sc->sc_ah;
663 struct ath_common *common = ath9k_hw_common(ah);
664 u32 tsf, intval, nexttbtt;

--- 17 unchanged lines hidden (view full) ---

682
683 ath_beaconq_config(sc);
684
685 /* Set the computed ADHOC beacon timers */
686
687 ath9k_hw_disable_interrupts(ah);
688 ath9k_beacon_init(sc, nexttbtt, intval);
689 sc->beacon.bmisscnt = 0;
654}
655
656static void ath_beacon_config_adhoc(struct ath_softc *sc,
657 struct ath_beacon_config *conf)
658{
659 struct ath_hw *ah = sc->sc_ah;
660 struct ath_common *common = ath9k_hw_common(ah);
661 u32 tsf, intval, nexttbtt;

--- 17 unchanged lines hidden (view full) ---

679
680 ath_beaconq_config(sc);
681
682 /* Set the computed ADHOC beacon timers */
683
684 ath9k_hw_disable_interrupts(ah);
685 ath9k_beacon_init(sc, nexttbtt, intval);
686 sc->beacon.bmisscnt = 0;
690 /*
691 * If the beacon config is called beacause of TSFOOR,
692 * Interrupts will be enabled back at the end of ath9k_tasklet
693 */
694 if (!(sc->ps_flags & PS_TSFOOR_SYNC))
695 ath9k_hw_set_interrupts(ah, ah->imask);
687
688 ath9k_hw_set_interrupts(ah, ah->imask);
689 ath9k_hw_enable_interrupts(ah);
696}
697
698static bool ath9k_allow_beacon_config(struct ath_softc *sc,
699 struct ieee80211_vif *vif)
700{
701 struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
702 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
703 struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;

--- 142 unchanged lines hidden ---
690}
691
692static bool ath9k_allow_beacon_config(struct ath_softc *sc,
693 struct ieee80211_vif *vif)
694{
695 struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
696 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
697 struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;

--- 142 unchanged lines hidden ---