diff options
author | Bruno Randolf <br1@einfach.org> | 2011-01-24 23:15:28 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-01-28 15:44:26 -0500 |
commit | 20a904904dc69d4b4de26c146af33eb00f05ab92 (patch) | |
tree | 3d6e963bdcbf5fa268026f43661d1d5474043b87 /drivers/net/wireless | |
parent | 5bec3e5ade813ee4bdbab03af1bb6f85859272ea (diff) |
ath5k: Use local variable for capabilities
Shorten some lines and make code more readable.
Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/caps.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/drivers/net/wireless/ath/ath5k/caps.c b/drivers/net/wireless/ath/ath5k/caps.c index 31cad80e9b01..39baee17d0da 100644 --- a/drivers/net/wireless/ath/ath5k/caps.c +++ b/drivers/net/wireless/ath/ath5k/caps.c | |||
@@ -32,23 +32,24 @@ | |||
32 | */ | 32 | */ |
33 | int ath5k_hw_set_capabilities(struct ath5k_hw *ah) | 33 | int 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 | } else { | 53 | } else { |
53 | /* | 54 | /* |
54 | * XXX The tranceiver supports frequencies from 4920 to 6100GHz | 55 | * XXX The tranceiver supports frequencies from 4920 to 6100GHz |
@@ -67,12 +68,11 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah) | |||
67 | 68 | ||
68 | if (AR5K_EEPROM_HDR_11A(ee_header)) { | 69 | if (AR5K_EEPROM_HDR_11A(ee_header)) { |
69 | /* 4920 */ | 70 | /* 4920 */ |
70 | ah->ah_capabilities.cap_range.range_5ghz_min = 5005; | 71 | caps->cap_range.range_5ghz_min = 5005; |
71 | ah->ah_capabilities.cap_range.range_5ghz_max = 6100; | 72 | caps->cap_range.range_5ghz_max = 6100; |
72 | 73 | ||
73 | /* Set supported modes */ | 74 | /* Set supported modes */ |
74 | __set_bit(AR5K_MODE_11A, | 75 | __set_bit(AR5K_MODE_11A, caps->cap_mode); |
75 | ah->ah_capabilities.cap_mode); | ||
76 | } | 76 | } |
77 | 77 | ||
78 | /* Enable 802.11b if a 2GHz capable radio (2111/5112) is | 78 | /* Enable 802.11b if a 2GHz capable radio (2111/5112) is |
@@ -81,32 +81,29 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah) | |||
81 | (AR5K_EEPROM_HDR_11G(ee_header) && | 81 | (AR5K_EEPROM_HDR_11G(ee_header) && |
82 | ah->ah_version != AR5K_AR5211)) { | 82 | ah->ah_version != AR5K_AR5211)) { |
83 | /* 2312 */ | 83 | /* 2312 */ |
84 | ah->ah_capabilities.cap_range.range_2ghz_min = 2412; | 84 | caps->cap_range.range_2ghz_min = 2412; |
85 | ah->ah_capabilities.cap_range.range_2ghz_max = 2732; | 85 | caps->cap_range.range_2ghz_max = 2732; |
86 | 86 | ||
87 | if (AR5K_EEPROM_HDR_11B(ee_header)) | 87 | if (AR5K_EEPROM_HDR_11B(ee_header)) |
88 | __set_bit(AR5K_MODE_11B, | 88 | __set_bit(AR5K_MODE_11B, caps->cap_mode); |
89 | ah->ah_capabilities.cap_mode); | ||
90 | 89 | ||
91 | if (AR5K_EEPROM_HDR_11G(ee_header) && | 90 | if (AR5K_EEPROM_HDR_11G(ee_header) && |
92 | ah->ah_version != AR5K_AR5211) | 91 | ah->ah_version != AR5K_AR5211) |
93 | __set_bit(AR5K_MODE_11G, | 92 | __set_bit(AR5K_MODE_11G, caps->cap_mode); |
94 | ah->ah_capabilities.cap_mode); | ||
95 | } | 93 | } |
96 | } | 94 | } |
97 | 95 | ||
98 | /* Set number of supported TX queues */ | 96 | /* Set number of supported TX queues */ |
99 | if (ah->ah_version == AR5K_AR5210) | 97 | if (ah->ah_version == AR5K_AR5210) |
100 | ah->ah_capabilities.cap_queues.q_tx_num = | 98 | caps->cap_queues.q_tx_num = AR5K_NUM_TX_QUEUES_NOQCU; |
101 | AR5K_NUM_TX_QUEUES_NOQCU; | ||
102 | else | 99 | else |
103 | ah->ah_capabilities.cap_queues.q_tx_num = AR5K_NUM_TX_QUEUES; | 100 | caps->cap_queues.q_tx_num = AR5K_NUM_TX_QUEUES; |
104 | 101 | ||
105 | /* newer hardware has PHY error counters */ | 102 | /* newer hardware has PHY error counters */ |
106 | if (ah->ah_mac_srev >= AR5K_SREV_AR5213A) | 103 | if (ah->ah_mac_srev >= AR5K_SREV_AR5213A) |
107 | ah->ah_capabilities.cap_has_phyerr_counters = true; | 104 | caps->cap_has_phyerr_counters = true; |
108 | else | 105 | else |
109 | ah->ah_capabilities.cap_has_phyerr_counters = false; | 106 | caps->cap_has_phyerr_counters = false; |
110 | 107 | ||
111 | return 0; | 108 | return 0; |
112 | } | 109 | } |