aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/caps.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/caps.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/caps.c57
1 files changed, 26 insertions, 31 deletions
diff --git a/drivers/net/wireless/ath/ath5k/caps.c b/drivers/net/wireless/ath/ath5k/caps.c
index beae519aa735..7dd88e1c3ff8 100644
--- a/drivers/net/wireless/ath/ath5k/caps.c
+++ b/drivers/net/wireless/ath/ath5k/caps.c
@@ -32,24 +32,24 @@
32 */ 32 */
33int ath5k_hw_set_capabilities(struct ath5k_hw *ah) 33int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
34{ 34{
35 struct ath5k_capabilities *caps = &ah->ah_capabilities;
35 u16 ee_header; 36 u16 ee_header;
36 37
37 /* Capabilities stored in the EEPROM */ 38 /* Capabilities stored in the EEPROM */
38 ee_header = ah->ah_capabilities.cap_eeprom.ee_header; 39 ee_header = caps->cap_eeprom.ee_header;
39 40
40 if (ah->ah_version == AR5K_AR5210) { 41 if (ah->ah_version == AR5K_AR5210) {
41 /* 42 /*
42 * Set radio capabilities 43 * Set radio capabilities
43 * (The AR5110 only supports the middle 5GHz band) 44 * (The AR5110 only supports the middle 5GHz band)
44 */ 45 */
45 ah->ah_capabilities.cap_range.range_5ghz_min = 5120; 46 caps->cap_range.range_5ghz_min = 5120;
46 ah->ah_capabilities.cap_range.range_5ghz_max = 5430; 47 caps->cap_range.range_5ghz_max = 5430;
47 ah->ah_capabilities.cap_range.range_2ghz_min = 0; 48 caps->cap_range.range_2ghz_min = 0;
48 ah->ah_capabilities.cap_range.range_2ghz_max = 0; 49 caps->cap_range.range_2ghz_max = 0;
49 50
50 /* Set supported modes */ 51 /* Set supported modes */
51 __set_bit(AR5K_MODE_11A, ah->ah_capabilities.cap_mode); 52 __set_bit(AR5K_MODE_11A, caps->cap_mode);
52 __set_bit(AR5K_MODE_11A_TURBO, ah->ah_capabilities.cap_mode);
53 } else { 53 } else {
54 /* 54 /*
55 * XXX The tranceiver supports frequencies from 4920 to 6100GHz 55 * XXX The tranceiver supports frequencies from 4920 to 6100GHz
@@ -57,9 +57,8 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
57 * XXX current ieee80211 implementation because the IEEE 57 * XXX current ieee80211 implementation because the IEEE
58 * XXX channel mapping does not support negative channel 58 * XXX channel mapping does not support negative channel
59 * XXX numbers (2312MHz is channel -19). Of course, this 59 * XXX numbers (2312MHz is channel -19). Of course, this
60 * XXX doesn't matter because these channels are out of range 60 * XXX doesn't matter because these channels are out of the
61 * XXX but some regulation domains like MKK (Japan) will 61 * XXX legal range.
62 * XXX support frequencies somewhere around 4.8GHz.
63 */ 62 */
64 63
65 /* 64 /*
@@ -67,18 +66,14 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
67 */ 66 */
68 67
69 if (AR5K_EEPROM_HDR_11A(ee_header)) { 68 if (AR5K_EEPROM_HDR_11A(ee_header)) {
70 /* 4920 */ 69 if (ath_is_49ghz_allowed(caps->cap_eeprom.ee_regdomain))
71 ah->ah_capabilities.cap_range.range_5ghz_min = 5005; 70 caps->cap_range.range_5ghz_min = 4920;
72 ah->ah_capabilities.cap_range.range_5ghz_max = 6100; 71 else
72 caps->cap_range.range_5ghz_min = 5005;
73 caps->cap_range.range_5ghz_max = 6100;
73 74
74 /* Set supported modes */ 75 /* Set supported modes */
75 __set_bit(AR5K_MODE_11A, 76 __set_bit(AR5K_MODE_11A, caps->cap_mode);
76 ah->ah_capabilities.cap_mode);
77 __set_bit(AR5K_MODE_11A_TURBO,
78 ah->ah_capabilities.cap_mode);
79 if (ah->ah_version == AR5K_AR5212)
80 __set_bit(AR5K_MODE_11G_TURBO,
81 ah->ah_capabilities.cap_mode);
82 } 77 }
83 78
84 /* Enable 802.11b if a 2GHz capable radio (2111/5112) is 79 /* Enable 802.11b if a 2GHz capable radio (2111/5112) is
@@ -87,32 +82,32 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
87 (AR5K_EEPROM_HDR_11G(ee_header) && 82 (AR5K_EEPROM_HDR_11G(ee_header) &&
88 ah->ah_version != AR5K_AR5211)) { 83 ah->ah_version != AR5K_AR5211)) {
89 /* 2312 */ 84 /* 2312 */
90 ah->ah_capabilities.cap_range.range_2ghz_min = 2412; 85 caps->cap_range.range_2ghz_min = 2412;
91 ah->ah_capabilities.cap_range.range_2ghz_max = 2732; 86 caps->cap_range.range_2ghz_max = 2732;
92 87
93 if (AR5K_EEPROM_HDR_11B(ee_header)) 88 if (AR5K_EEPROM_HDR_11B(ee_header))
94 __set_bit(AR5K_MODE_11B, 89 __set_bit(AR5K_MODE_11B, caps->cap_mode);
95 ah->ah_capabilities.cap_mode);
96 90
97 if (AR5K_EEPROM_HDR_11G(ee_header) && 91 if (AR5K_EEPROM_HDR_11G(ee_header) &&
98 ah->ah_version != AR5K_AR5211) 92 ah->ah_version != AR5K_AR5211)
99 __set_bit(AR5K_MODE_11G, 93 __set_bit(AR5K_MODE_11G, caps->cap_mode);
100 ah->ah_capabilities.cap_mode);
101 } 94 }
102 } 95 }
103 96
97 if ((ah->ah_radio_5ghz_revision & 0xf0) == AR5K_SREV_RAD_2112)
98 __clear_bit(AR5K_MODE_11A, caps->cap_mode);
99
104 /* Set number of supported TX queues */ 100 /* Set number of supported TX queues */
105 if (ah->ah_version == AR5K_AR5210) 101 if (ah->ah_version == AR5K_AR5210)
106 ah->ah_capabilities.cap_queues.q_tx_num = 102 caps->cap_queues.q_tx_num = AR5K_NUM_TX_QUEUES_NOQCU;
107 AR5K_NUM_TX_QUEUES_NOQCU;
108 else 103 else
109 ah->ah_capabilities.cap_queues.q_tx_num = AR5K_NUM_TX_QUEUES; 104 caps->cap_queues.q_tx_num = AR5K_NUM_TX_QUEUES;
110 105
111 /* newer hardware has PHY error counters */ 106 /* newer hardware has PHY error counters */
112 if (ah->ah_mac_srev >= AR5K_SREV_AR5213A) 107 if (ah->ah_mac_srev >= AR5K_SREV_AR5213A)
113 ah->ah_capabilities.cap_has_phyerr_counters = true; 108 caps->cap_has_phyerr_counters = true;
114 else 109 else
115 ah->ah_capabilities.cap_has_phyerr_counters = false; 110 caps->cap_has_phyerr_counters = false;
116 111
117 return 0; 112 return 0;
118} 113}