diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath5k')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/ahb.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/ath5k.h | 12 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/attach.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 47 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/caps.c | 27 |
5 files changed, 47 insertions, 48 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c index e5be7e701816..ee7ea572b065 100644 --- a/drivers/net/wireless/ath/ath5k/ahb.c +++ b/drivers/net/wireless/ath/ath5k/ahb.c | |||
@@ -166,7 +166,9 @@ static int ath_ahb_probe(struct platform_device *pdev) | |||
166 | if (to_platform_device(ah->dev)->id == 0 && | 166 | if (to_platform_device(ah->dev)->id == 0 && |
167 | (bcfg->config->flags & (BD_WLAN0 | BD_WLAN1)) == | 167 | (bcfg->config->flags & (BD_WLAN0 | BD_WLAN1)) == |
168 | (BD_WLAN1 | BD_WLAN0)) | 168 | (BD_WLAN1 | BD_WLAN0)) |
169 | __set_bit(ATH_STAT_2G_DISABLED, ah->status); | 169 | ah->ah_capabilities.cap_needs_2GHz_ovr = true; |
170 | else | ||
171 | ah->ah_capabilities.cap_needs_2GHz_ovr = false; | ||
170 | } | 172 | } |
171 | 173 | ||
172 | ret = ath5k_init_ah(ah, &ath_ahb_bus_ops); | 174 | ret = ath5k_init_ah(ah, &ath_ahb_bus_ops); |
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h index 819c4db5aab3..c3815f708382 100644 --- a/drivers/net/wireless/ath/ath5k/ath5k.h +++ b/drivers/net/wireless/ath/ath5k/ath5k.h | |||
@@ -1159,6 +1159,8 @@ struct ath5k_capabilities { | |||
1159 | } cap_queues; | 1159 | } cap_queues; |
1160 | 1160 | ||
1161 | bool cap_has_phyerr_counters; | 1161 | bool cap_has_phyerr_counters; |
1162 | bool cap_has_mrr_support; | ||
1163 | bool cap_needs_2GHz_ovr; | ||
1162 | }; | 1164 | }; |
1163 | 1165 | ||
1164 | /* size of noise floor history (keep it a power of two) */ | 1166 | /* size of noise floor history (keep it a power of two) */ |
@@ -1274,13 +1276,11 @@ struct ath5k_hw { | |||
1274 | dma_addr_t desc_daddr; /* DMA (physical) address */ | 1276 | dma_addr_t desc_daddr; /* DMA (physical) address */ |
1275 | size_t desc_len; /* size of TX/RX descriptors */ | 1277 | size_t desc_len; /* size of TX/RX descriptors */ |
1276 | 1278 | ||
1277 | DECLARE_BITMAP(status, 6); | 1279 | DECLARE_BITMAP(status, 4); |
1278 | #define ATH_STAT_INVALID 0 /* disable hardware accesses */ | 1280 | #define ATH_STAT_INVALID 0 /* disable hardware accesses */ |
1279 | #define ATH_STAT_MRRETRY 1 /* multi-rate retry support */ | 1281 | #define ATH_STAT_PROMISC 1 |
1280 | #define ATH_STAT_PROMISC 2 | 1282 | #define ATH_STAT_LEDSOFT 2 /* enable LED gpio status */ |
1281 | #define ATH_STAT_LEDSOFT 3 /* enable LED gpio status */ | 1283 | #define ATH_STAT_STARTED 3 /* opened & irqs enabled */ |
1282 | #define ATH_STAT_STARTED 4 /* opened & irqs enabled */ | ||
1283 | #define ATH_STAT_2G_DISABLED 5 /* multiband radio without 2G */ | ||
1284 | 1284 | ||
1285 | unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */ | 1285 | unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */ |
1286 | struct ieee80211_channel *curchan; /* current h/w channel */ | 1286 | struct ieee80211_channel *curchan; /* current h/w channel */ |
diff --git a/drivers/net/wireless/ath/ath5k/attach.c b/drivers/net/wireless/ath/ath5k/attach.c index b69e0570cf02..d7114c75fe9b 100644 --- a/drivers/net/wireless/ath/ath5k/attach.c +++ b/drivers/net/wireless/ath/ath5k/attach.c | |||
@@ -306,11 +306,6 @@ int ath5k_hw_init(struct ath5k_hw *ah) | |||
306 | goto err; | 306 | goto err; |
307 | } | 307 | } |
308 | 308 | ||
309 | if (test_bit(ATH_STAT_2G_DISABLED, ah->status)) { | ||
310 | __clear_bit(AR5K_MODE_11B, ah->ah_capabilities.cap_mode); | ||
311 | __clear_bit(AR5K_MODE_11G, ah->ah_capabilities.cap_mode); | ||
312 | } | ||
313 | |||
314 | /* Crypto settings */ | 309 | /* Crypto settings */ |
315 | common->keymax = (ah->ah_version == AR5K_AR5210 ? | 310 | common->keymax = (ah->ah_version == AR5K_AR5210 ? |
316 | AR5K_KEYTABLE_SIZE_5210 : AR5K_KEYTABLE_SIZE_5211); | 311 | AR5K_KEYTABLE_SIZE_5210 : AR5K_KEYTABLE_SIZE_5211); |
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 |
diff --git a/drivers/net/wireless/ath/ath5k/caps.c b/drivers/net/wireless/ath/ath5k/caps.c index 810fba96702b..994169ad39cb 100644 --- a/drivers/net/wireless/ath/ath5k/caps.c +++ b/drivers/net/wireless/ath/ath5k/caps.c | |||
@@ -85,12 +85,19 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah) | |||
85 | caps->cap_range.range_2ghz_min = 2412; | 85 | caps->cap_range.range_2ghz_min = 2412; |
86 | caps->cap_range.range_2ghz_max = 2732; | 86 | caps->cap_range.range_2ghz_max = 2732; |
87 | 87 | ||
88 | if (AR5K_EEPROM_HDR_11B(ee_header)) | 88 | /* Override 2GHz modes on SoCs that need it |
89 | __set_bit(AR5K_MODE_11B, caps->cap_mode); | 89 | * NOTE: cap_needs_2GHz_ovr gets set from |
90 | 90 | * ath_ahb_probe */ | |
91 | if (AR5K_EEPROM_HDR_11G(ee_header) && | 91 | if (!caps->cap_needs_2GHz_ovr) { |
92 | ah->ah_version != AR5K_AR5211) | 92 | if (AR5K_EEPROM_HDR_11B(ee_header)) |
93 | __set_bit(AR5K_MODE_11G, caps->cap_mode); | 93 | __set_bit(AR5K_MODE_11B, |
94 | caps->cap_mode); | ||
95 | |||
96 | if (AR5K_EEPROM_HDR_11G(ee_header) && | ||
97 | ah->ah_version != AR5K_AR5211) | ||
98 | __set_bit(AR5K_MODE_11G, | ||
99 | caps->cap_mode); | ||
100 | } | ||
94 | } | 101 | } |
95 | } | 102 | } |
96 | 103 | ||
@@ -103,12 +110,18 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah) | |||
103 | else | 110 | else |
104 | caps->cap_queues.q_tx_num = AR5K_NUM_TX_QUEUES; | 111 | caps->cap_queues.q_tx_num = AR5K_NUM_TX_QUEUES; |
105 | 112 | ||
106 | /* newer hardware has PHY error counters */ | 113 | /* Newer hardware has PHY error counters */ |
107 | if (ah->ah_mac_srev >= AR5K_SREV_AR5213A) | 114 | if (ah->ah_mac_srev >= AR5K_SREV_AR5213A) |
108 | caps->cap_has_phyerr_counters = true; | 115 | caps->cap_has_phyerr_counters = true; |
109 | else | 116 | else |
110 | caps->cap_has_phyerr_counters = false; | 117 | caps->cap_has_phyerr_counters = false; |
111 | 118 | ||
119 | /* MACs since AR5212 have MRR support */ | ||
120 | if (ah->ah_version == AR5K_AR5212) | ||
121 | caps->cap_has_mrr_support = true; | ||
122 | else | ||
123 | caps->cap_has_mrr_support = false; | ||
124 | |||
112 | return 0; | 125 | return 0; |
113 | } | 126 | } |
114 | 127 | ||