diff options
author | Nick Kossifidis <mick@madwifi-project.org> | 2009-04-30 15:55:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-06 15:14:55 -0400 |
commit | 1889ba0a48688b639c2b2e9e1b0fd8f84e2c37d1 (patch) | |
tree | ede50116b40855f40110c3c64f38df869fb7cdf6 /drivers/net/wireless/ath | |
parent | cd417519086b223562b50c364d7beab12ef4c62c (diff) |
ath5k: Put remaining EEPROM data on ee struct
* Put remaining EEPROM information on ee struct and remove is_hb63
function.
Now we also have rfkill stuff available.
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/eeprom.c | 24 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/eeprom.h | 15 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/reset.c | 5 |
3 files changed, 24 insertions, 20 deletions
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c index 587c5b8ddc2..8c9dd019d76 100644 --- a/drivers/net/wireless/ath/ath5k/eeprom.c +++ b/drivers/net/wireless/ath/ath5k/eeprom.c | |||
@@ -156,6 +156,17 @@ ath5k_eeprom_init_header(struct ath5k_hw *ah) | |||
156 | ee->ee_db[AR5K_EEPROM_MODE_11G][0] = (val >> 3) & 0x7; | 156 | ee->ee_db[AR5K_EEPROM_MODE_11G][0] = (val >> 3) & 0x7; |
157 | } | 157 | } |
158 | 158 | ||
159 | AR5K_EEPROM_READ(AR5K_EEPROM_IS_HB63, val); | ||
160 | |||
161 | if ((ah->ah_mac_version == (AR5K_SREV_AR2425 >> 4)) && val) | ||
162 | ee->ee_is_hb63 = true; | ||
163 | else | ||
164 | ee->ee_is_hb63 = false; | ||
165 | |||
166 | AR5K_EEPROM_READ(AR5K_EEPROM_RFKILL, val); | ||
167 | ee->ee_rfkill_pin = (u8) AR5K_REG_MS(val, AR5K_EEPROM_RFKILL_GPIO_SEL); | ||
168 | ee->ee_rfkill_pol = val & AR5K_EEPROM_RFKILL_POLARITY ? true : false; | ||
169 | |||
159 | return 0; | 170 | return 0; |
160 | } | 171 | } |
161 | 172 | ||
@@ -1789,16 +1800,3 @@ int ath5k_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac) | |||
1789 | 1800 | ||
1790 | return 0; | 1801 | return 0; |
1791 | } | 1802 | } |
1792 | |||
1793 | bool ath5k_eeprom_is_hb63(struct ath5k_hw *ah) | ||
1794 | { | ||
1795 | u16 data; | ||
1796 | |||
1797 | ath5k_hw_eeprom_read(ah, AR5K_EEPROM_IS_HB63, &data); | ||
1798 | |||
1799 | if ((ah->ah_mac_version == (AR5K_SREV_AR2425 >> 4)) && data) | ||
1800 | return true; | ||
1801 | else | ||
1802 | return false; | ||
1803 | } | ||
1804 | |||
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.h b/drivers/net/wireless/ath/ath5k/eeprom.h index df9ffa044ea..46e4d22591f 100644 --- a/drivers/net/wireless/ath/ath5k/eeprom.h +++ b/drivers/net/wireless/ath/ath5k/eeprom.h | |||
@@ -26,6 +26,13 @@ | |||
26 | #define AR5K_EEPROM_MAGIC_5210 0x0000145a /* 5210 */ | 26 | #define AR5K_EEPROM_MAGIC_5210 0x0000145a /* 5210 */ |
27 | 27 | ||
28 | #define AR5K_EEPROM_IS_HB63 0x000b /* Talon detect */ | 28 | #define AR5K_EEPROM_IS_HB63 0x000b /* Talon detect */ |
29 | |||
30 | #define AR5K_EEPROM_RFKILL 0x0f | ||
31 | #define AR5K_EEPROM_RFKILL_GPIO_SEL 0x0000001c | ||
32 | #define AR5K_EEPROM_RFKILL_GPIO_SEL_S 2 | ||
33 | #define AR5K_EEPROM_RFKILL_POLARITY 0x00000002 | ||
34 | #define AR5K_EEPROM_RFKILL_POLARITY_S 1 | ||
35 | |||
29 | #define AR5K_EEPROM_REG_DOMAIN 0x00bf /* EEPROM regdom */ | 36 | #define AR5K_EEPROM_REG_DOMAIN 0x00bf /* EEPROM regdom */ |
30 | #define AR5K_EEPROM_CHECKSUM 0x00c0 /* EEPROM checksum */ | 37 | #define AR5K_EEPROM_CHECKSUM 0x00c0 /* EEPROM checksum */ |
31 | #define AR5K_EEPROM_INFO_BASE 0x00c0 /* EEPROM header */ | 38 | #define AR5K_EEPROM_INFO_BASE 0x00c0 /* EEPROM header */ |
@@ -66,11 +73,6 @@ | |||
66 | #define AR5K_EEPROM_HDR_RFKILL(_v) (((_v) >> 14) & 0x1) /* Device has RFKill support */ | 73 | #define AR5K_EEPROM_HDR_RFKILL(_v) (((_v) >> 14) & 0x1) /* Device has RFKill support */ |
67 | #define AR5K_EEPROM_HDR_T_5GHZ_DIS(_v) (((_v) >> 15) & 0x1) /* Disable turbo for 5Ghz */ | 74 | #define AR5K_EEPROM_HDR_T_5GHZ_DIS(_v) (((_v) >> 15) & 0x1) /* Disable turbo for 5Ghz */ |
68 | 75 | ||
69 | #define AR5K_EEPROM_RFKILL_GPIO_SEL 0x0000001c | ||
70 | #define AR5K_EEPROM_RFKILL_GPIO_SEL_S 2 | ||
71 | #define AR5K_EEPROM_RFKILL_POLARITY 0x00000002 | ||
72 | #define AR5K_EEPROM_RFKILL_POLARITY_S 1 | ||
73 | |||
74 | /* Newer EEPROMs are using a different offset */ | 76 | /* Newer EEPROMs are using a different offset */ |
75 | #define AR5K_EEPROM_OFF(_v, _v3_0, _v3_3) \ | 77 | #define AR5K_EEPROM_OFF(_v, _v3_0, _v3_3) \ |
76 | (((_v) >= AR5K_EEPROM_VERSION_3_3) ? _v3_3 : _v3_0) | 78 | (((_v) >= AR5K_EEPROM_VERSION_3_3) ? _v3_3 : _v3_0) |
@@ -386,6 +388,9 @@ struct ath5k_eeprom_info { | |||
386 | u16 ee_version; | 388 | u16 ee_version; |
387 | u16 ee_header; | 389 | u16 ee_header; |
388 | u16 ee_ant_gain; | 390 | u16 ee_ant_gain; |
391 | u8 ee_rfkill_pin; | ||
392 | bool ee_rfkill_pol; | ||
393 | bool ee_is_hb63; | ||
389 | u16 ee_misc0; | 394 | u16 ee_misc0; |
390 | u16 ee_misc1; | 395 | u16 ee_misc1; |
391 | u16 ee_misc2; | 396 | u16 ee_misc2; |
diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c index cb8a9a1398c..d419c6a3ded 100644 --- a/drivers/net/wireless/ath/ath5k/reset.c +++ b/drivers/net/wireless/ath/ath5k/reset.c | |||
@@ -507,7 +507,7 @@ static void ath5k_hw_set_sleep_clock(struct ath5k_hw *ah, bool enable) | |||
507 | 507 | ||
508 | if (ah->ah_mac_version == (AR5K_SREV_AR2417 >> 4)) | 508 | if (ah->ah_mac_version == (AR5K_SREV_AR2417 >> 4)) |
509 | scal = AR5K_PHY_SCAL_32MHZ_2417; | 509 | scal = AR5K_PHY_SCAL_32MHZ_2417; |
510 | else if (ath5k_eeprom_is_hb63(ah)) | 510 | else if (ee->ee_is_hb63) |
511 | scal = AR5K_PHY_SCAL_32MHZ_HB63; | 511 | scal = AR5K_PHY_SCAL_32MHZ_HB63; |
512 | else | 512 | else |
513 | scal = AR5K_PHY_SCAL_32MHZ; | 513 | scal = AR5K_PHY_SCAL_32MHZ; |
@@ -598,9 +598,10 @@ static void ath5k_hw_tweak_initval_settings(struct ath5k_hw *ah, | |||
598 | /* Set DAC/ADC delays */ | 598 | /* Set DAC/ADC delays */ |
599 | if (ah->ah_version == AR5K_AR5212) { | 599 | if (ah->ah_version == AR5K_AR5212) { |
600 | u32 scal; | 600 | u32 scal; |
601 | struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; | ||
601 | if (ah->ah_mac_version == (AR5K_SREV_AR2417 >> 4)) | 602 | if (ah->ah_mac_version == (AR5K_SREV_AR2417 >> 4)) |
602 | scal = AR5K_PHY_SCAL_32MHZ_2417; | 603 | scal = AR5K_PHY_SCAL_32MHZ_2417; |
603 | else if (ath5k_eeprom_is_hb63(ah)) | 604 | else if (ee->ee_is_hb63) |
604 | scal = AR5K_PHY_SCAL_32MHZ_HB63; | 605 | scal = AR5K_PHY_SCAL_32MHZ_HB63; |
605 | else | 606 | else |
606 | scal = AR5K_PHY_SCAL_32MHZ; | 607 | scal = AR5K_PHY_SCAL_32MHZ; |