diff options
author | Nick Kossifidis <mickflemm@gmail.com> | 2008-02-28 14:49:05 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-07 16:02:58 -0500 |
commit | 0af2256319959aaca95959a493ed2282edaaae3e (patch) | |
tree | 5d8b18ace662565b3fc2fd7a59ddfec528f40383 /drivers/net/wireless/ath5k | |
parent | f714dd6d452af8fda700d67dc67163c6ad9d4569 (diff) |
ath5k: Identify RF2413 and deal with PHY_SPENDING
* Attach RF2413.
* Propertly handle different AR5K_PHY_SPENDING settings for each RF
chip by adding a field in ath5k_hw. This way we won't have to check
inside hw_reset (see next patch).
Changes-licensed-under: ISC
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k')
-rw-r--r-- | drivers/net/wireless/ath5k/ath5k.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath5k/hw.c | 27 | ||||
-rw-r--r-- | drivers/net/wireless/ath5k/reg.h | 4 |
3 files changed, 29 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath5k/ath5k.h b/drivers/net/wireless/ath5k/ath5k.h index 25c8e989d700..c0b65961f55f 100644 --- a/drivers/net/wireless/ath5k/ath5k.h +++ b/drivers/net/wireless/ath5k/ath5k.h | |||
@@ -966,6 +966,7 @@ struct ath5k_hw { | |||
966 | u16 ah_phy_revision; | 966 | u16 ah_phy_revision; |
967 | u16 ah_radio_5ghz_revision; | 967 | u16 ah_radio_5ghz_revision; |
968 | u16 ah_radio_2ghz_revision; | 968 | u16 ah_radio_2ghz_revision; |
969 | u32 ah_phy_spending; | ||
969 | 970 | ||
970 | enum ath5k_version ah_version; | 971 | enum ath5k_version ah_version; |
971 | enum ath5k_radio ah_radio; | 972 | enum ath5k_radio ah_radio; |
diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c index eec2b806a0de..f4d383e956a0 100644 --- a/drivers/net/wireless/ath5k/hw.c +++ b/drivers/net/wireless/ath5k/hw.c | |||
@@ -208,7 +208,7 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version) | |||
208 | 208 | ||
209 | /* Identify single chip solutions */ | 209 | /* Identify single chip solutions */ |
210 | if((srev <= AR5K_SREV_VER_AR5414) && | 210 | if((srev <= AR5K_SREV_VER_AR5414) && |
211 | (srev >= AR5K_SREV_VER_AR2424)) { | 211 | (srev >= AR5K_SREV_VER_AR2413)) { |
212 | ah->ah_single_chip = true; | 212 | ah->ah_single_chip = true; |
213 | } else { | 213 | } else { |
214 | ah->ah_single_chip = false; | 214 | ah->ah_single_chip = false; |
@@ -223,10 +223,33 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version) | |||
223 | ah->ah_radio = AR5K_RF5110; | 223 | ah->ah_radio = AR5K_RF5110; |
224 | } else if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_5112) { | 224 | } else if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_5112) { |
225 | ah->ah_radio = AR5K_RF5111; | 225 | ah->ah_radio = AR5K_RF5111; |
226 | } else if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_SC1) { | 226 | ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5111; |
227 | } else if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_SC0) { | ||
228 | |||
227 | ah->ah_radio = AR5K_RF5112; | 229 | ah->ah_radio = AR5K_RF5112; |
230 | |||
231 | if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_5112A) { | ||
232 | ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5112; | ||
233 | } else { | ||
234 | ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5112A; | ||
235 | } | ||
236 | |||
237 | } else if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_SC1) { | ||
238 | ah->ah_radio = AR5K_RF2413; | ||
239 | ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5112A; | ||
228 | } else { | 240 | } else { |
241 | |||
229 | ah->ah_radio = AR5K_RF5413; | 242 | ah->ah_radio = AR5K_RF5413; |
243 | |||
244 | if (ah->ah_mac_srev <= AR5K_SREV_VER_AR5424 && | ||
245 | ah->ah_mac_srev >= AR5K_SREV_VER_AR2424) | ||
246 | ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5424; | ||
247 | else if (ah->ah_mac_srev >= AR5K_SREV_VER_AR2425) | ||
248 | ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5112; | ||
249 | else | ||
250 | ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5112A; | ||
251 | |||
252 | |||
230 | } | 253 | } |
231 | 254 | ||
232 | ah->ah_phy = AR5K_PHY(0); | 255 | ah->ah_phy = AR5K_PHY(0); |
diff --git a/drivers/net/wireless/ath5k/reg.h b/drivers/net/wireless/ath5k/reg.h index 2f41c8398602..30629b3e37c2 100644 --- a/drivers/net/wireless/ath5k/reg.h +++ b/drivers/net/wireless/ath5k/reg.h | |||
@@ -1923,7 +1923,9 @@ after DFS is enabled */ | |||
1923 | #define AR5K_PHY_SDELAY_32MHZ 0x000000ff | 1923 | #define AR5K_PHY_SDELAY_32MHZ 0x000000ff |
1924 | #define AR5K_PHY_SPENDING 0x99f8 | 1924 | #define AR5K_PHY_SPENDING 0x99f8 |
1925 | #define AR5K_PHY_SPENDING_RF5111 0x00000018 | 1925 | #define AR5K_PHY_SPENDING_RF5111 0x00000018 |
1926 | #define AR5K_PHY_SPENDING_RF5112 0x00000014 | 1926 | #define AR5K_PHY_SPENDING_RF5112 0x00000014 /* <- i 've only seen this on 2425 dumps ! */ |
1927 | #define AR5K_PHY_SPENDING_RF5112A 0x0000000e /* but since i only have 5112A-based chips */ | ||
1928 | #define AR5K_PHY_SPENDING_RF5424 0x00000012 /* to test it might be also for old 5112. */ | ||
1927 | 1929 | ||
1928 | /* | 1930 | /* |
1929 | * Misc PHY/radio registers [5110 - 5111] | 1931 | * Misc PHY/radio registers [5110 - 5111] |