aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/base.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c47
1 files changed, 18 insertions, 29 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 02207fa62675..178a4dd10316 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -725,21 +725,24 @@ ath5k_txbuf_setup(struct ath5k_hw *ah, struct ath5k_buf *bf,
725 if (ret) 725 if (ret)
726 goto err_unmap; 726 goto err_unmap;
727 727
728 memset(mrr_rate, 0, sizeof(mrr_rate)); 728 /* Set up MRR descriptor */
729 memset(mrr_tries, 0, sizeof(mrr_tries)); 729 if (ah->ah_capabilities.cap_has_mrr_support) {
730 for (i = 0; i < 3; i++) { 730 memset(mrr_rate, 0, sizeof(mrr_rate));
731 rate = ieee80211_get_alt_retry_rate(ah->hw, info, i); 731 memset(mrr_tries, 0, sizeof(mrr_tries));
732 if (!rate) 732 for (i = 0; i < 3; i++) {
733 break; 733 rate = ieee80211_get_alt_retry_rate(ah->hw, info, i);
734 if (!rate)
735 break;
734 736
735 mrr_rate[i] = rate->hw_value; 737 mrr_rate[i] = rate->hw_value;
736 mrr_tries[i] = info->control.rates[i + 1].count; 738 mrr_tries[i] = info->control.rates[i + 1].count;
737 } 739 }
738 740
739 ath5k_hw_setup_mrr_tx_desc(ah, ds, 741 ath5k_hw_setup_mrr_tx_desc(ah, ds,
740 mrr_rate[0], mrr_tries[0], 742 mrr_rate[0], mrr_tries[0],
741 mrr_rate[1], mrr_tries[1], 743 mrr_rate[1], mrr_tries[1],
742 mrr_rate[2], mrr_tries[2]); 744 mrr_rate[2], mrr_tries[2]);
745 }
743 746
744 ds->ds_link = 0; 747 ds->ds_link = 0;
745 ds->ds_data = bf->skbaddr; 748 ds->ds_data = bf->skbaddr;
@@ -2489,8 +2492,8 @@ ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops)
2489 if (ret) 2492 if (ret)
2490 goto err_irq; 2493 goto err_irq;
2491 2494
2492 /* set up multi-rate retry capabilities */ 2495 /* Set up multi-rate retry capabilities */
2493 if (ah->ah_version == AR5K_AR5212) { 2496 if (ah->ah_capabilities.cap_has_mrr_support) {
2494 hw->max_rates = 4; 2497 hw->max_rates = 4;
2495 hw->max_rate_tries = max(AR5K_INIT_RETRY_SHORT, 2498 hw->max_rate_tries = max(AR5K_INIT_RETRY_SHORT,
2496 AR5K_INIT_RETRY_LONG); 2499 AR5K_INIT_RETRY_LONG);
@@ -2849,20 +2852,6 @@ ath5k_init(struct ieee80211_hw *hw)
2849 2852
2850 2853
2851 /* 2854 /*
2852 * Check if the MAC has multi-rate retry support.
2853 * We do this by trying to setup a fake extended
2854 * descriptor. MACs that don't have support will
2855 * return false w/o doing anything. MACs that do
2856 * support it will return true w/o doing anything.
2857 */
2858 ret = ath5k_hw_setup_mrr_tx_desc(ah, NULL, 0, 0, 0, 0, 0, 0);
2859
2860 if (ret < 0)
2861 goto err;
2862 if (ret > 0)
2863 __set_bit(ATH_STAT_MRRETRY, ah->status);
2864
2865 /*
2866 * Collect the channel list. The 802.11 layer 2855 * Collect the channel list. The 802.11 layer
2867 * is responsible for filtering this list based 2856 * is responsible for filtering this list based
2868 * on settings like the phy mode and regulatory 2857 * on settings like the phy mode and regulatory