aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2012-02-22 02:10:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-27 14:06:34 -0500
commitc0ac53fa5725aa9e571386d3e7249c1be50eca10 (patch)
tree77a2ac188d9a24b887ff41434d2a733631e68eb6 /drivers/net/wireless/ath
parent56ca0dba9d5fbc2948ed0c3a4fffc51cd875abb9 (diff)
ath9k: Calculate ampdu limit using a helper
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/gpio.c14
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c19
3 files changed, 24 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index acf537288946..23145ce9ea3f 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -461,6 +461,7 @@ void ath9k_stop_btcoex(struct ath_softc *sc);
461void ath9k_btcoex_timer_resume(struct ath_softc *sc); 461void ath9k_btcoex_timer_resume(struct ath_softc *sc);
462void ath9k_btcoex_timer_pause(struct ath_softc *sc); 462void ath9k_btcoex_timer_pause(struct ath_softc *sc);
463void ath9k_btcoex_handle_interrupt(struct ath_softc *sc, u32 status); 463void ath9k_btcoex_handle_interrupt(struct ath_softc *sc, u32 status);
464u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc, u32 max_4ms_framelen);
464 465
465/********************/ 466/********************/
466/* LED Control */ 467/* LED Control */
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
index a24aa679c699..e870251cdd1b 100644
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -318,6 +318,20 @@ void ath9k_btcoex_timer_pause(struct ath_softc *sc)
318 btcoex->hw_timer_enabled = false; 318 btcoex->hw_timer_enabled = false;
319} 319}
320 320
321u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc, u32 max_4ms_framelen)
322{
323 struct ath_mci_profile *mci = &sc->btcoex.mci;
324 u16 aggr_limit = 0;
325
326 if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_MCI) && mci->aggr_limit)
327 aggr_limit = (max_4ms_framelen * mci->aggr_limit) >> 4;
328 else if (sc->sc_flags & SC_OP_BT_PRIORITY_DETECTED)
329 aggr_limit = min((max_4ms_framelen * 3) / 8,
330 (u32)ATH_AMPDU_LIMIT_MAX);
331
332 return aggr_limit;
333}
334
321void ath9k_btcoex_handle_interrupt(struct ath_softc *sc, u32 status) 335void ath9k_btcoex_handle_interrupt(struct ath_softc *sc, u32 status)
322{ 336{
323 struct ath_hw *ah = sc->sc_ah; 337 struct ath_hw *ah = sc->sc_ah;
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 3182408ffe35..5dd27d2712fc 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -647,9 +647,8 @@ static u32 ath_lookup_rate(struct ath_softc *sc, struct ath_buf *bf,
647 struct sk_buff *skb; 647 struct sk_buff *skb;
648 struct ieee80211_tx_info *tx_info; 648 struct ieee80211_tx_info *tx_info;
649 struct ieee80211_tx_rate *rates; 649 struct ieee80211_tx_rate *rates;
650 struct ath_mci_profile *mci = &sc->btcoex.mci;
651 u32 max_4ms_framelen, frmlen; 650 u32 max_4ms_framelen, frmlen;
652 u16 aggr_limit, legacy = 0; 651 u16 aggr_limit, bt_aggr_limit, legacy = 0;
653 int i; 652 int i;
654 653
655 skb = bf->bf_mpdu; 654 skb = bf->bf_mpdu;
@@ -694,14 +693,14 @@ static u32 ath_lookup_rate(struct ath_softc *sc, struct ath_buf *bf,
694 if (tx_info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE || legacy) 693 if (tx_info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE || legacy)
695 return 0; 694 return 0;
696 695
697 if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_MCI) && mci->aggr_limit) 696 aggr_limit = min(max_4ms_framelen, (u32)ATH_AMPDU_LIMIT_MAX);
698 aggr_limit = (max_4ms_framelen * mci->aggr_limit) >> 4; 697
699 else if (sc->sc_flags & SC_OP_BT_PRIORITY_DETECTED) 698 /*
700 aggr_limit = min((max_4ms_framelen * 3) / 8, 699 * Override the default aggregation limit for BTCOEX.
701 (u32)ATH_AMPDU_LIMIT_MAX); 700 */
702 else 701 bt_aggr_limit = ath9k_btcoex_aggr_limit(sc, max_4ms_framelen);
703 aggr_limit = min(max_4ms_framelen, 702 if (bt_aggr_limit)
704 (u32)ATH_AMPDU_LIMIT_MAX); 703 aggr_limit = bt_aggr_limit;
705 704
706 /* 705 /*
707 * h/w can accept aggregates up to 16 bit lengths (65535). 706 * h/w can accept aggregates up to 16 bit lengths (65535).