diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-04-24 14:55:35 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-07 15:02:25 -0400 |
commit | f1f6941500602504fa9cd97294bfb3df7f22384f (patch) | |
tree | 92dc3c952c93d4ab61350edfc2329f9e1d8ef469 /drivers | |
parent | 7839fc03862704677902be2d63c0482fee3deae3 (diff) |
iwlwifi-5000: add eeprom check version handler
This patch adds implementation for eeprom check version
handler for 5000 HW
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 29 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-eeprom.h | 4 |
2 files changed, 33 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 1e63b497471d..d8e3dd70423a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -125,6 +125,33 @@ static u32 eeprom_indirect_address(const struct iwl_priv *priv, u32 address) | |||
125 | return (address & ADDRESS_MSK) + (offset << 1); | 125 | return (address & ADDRESS_MSK) + (offset << 1); |
126 | } | 126 | } |
127 | 127 | ||
128 | static int iwl5000_eeprom_check_version(struct iwl_priv *priv) | ||
129 | { | ||
130 | u16 eeprom_ver; | ||
131 | struct iwl_eeprom_calib_hdr { | ||
132 | u8 version; | ||
133 | u8 pa_type; | ||
134 | u16 voltage; | ||
135 | } *hdr; | ||
136 | |||
137 | eeprom_ver = iwl_eeprom_query16(priv, EEPROM_VERSION); | ||
138 | |||
139 | hdr = (struct iwl_eeprom_calib_hdr *)iwl_eeprom_query_addr(priv, | ||
140 | EEPROM_5000_CALIB_ALL); | ||
141 | |||
142 | if (eeprom_ver < EEPROM_5000_EEPROM_VERSION || | ||
143 | hdr->version < EEPROM_5000_TX_POWER_VERSION) | ||
144 | goto err; | ||
145 | |||
146 | return 0; | ||
147 | err: | ||
148 | IWL_ERROR("Unsuported EEPROM VER=0x%x < 0x%x CALIB=0x%x < 0x%x\n", | ||
149 | eeprom_ver, EEPROM_5000_EEPROM_VERSION, | ||
150 | hdr->version, EEPROM_5000_TX_POWER_VERSION); | ||
151 | return -EINVAL; | ||
152 | |||
153 | } | ||
154 | |||
128 | #ifdef CONFIG_IWL5000_RUN_TIME_CALIB | 155 | #ifdef CONFIG_IWL5000_RUN_TIME_CALIB |
129 | 156 | ||
130 | static void iwl5000_gain_computation(struct iwl_priv *priv, | 157 | static void iwl5000_gain_computation(struct iwl_priv *priv, |
@@ -179,6 +206,7 @@ static void iwl5000_gain_computation(struct iwl_priv *priv, | |||
179 | data->beacon_count = 0; | 206 | data->beacon_count = 0; |
180 | } | 207 | } |
181 | 208 | ||
209 | |||
182 | static void iwl5000_chain_noise_reset(struct iwl_priv *priv) | 210 | static void iwl5000_chain_noise_reset(struct iwl_priv *priv) |
183 | { | 211 | { |
184 | struct iwl_chain_noise_data *data = &priv->chain_noise_data; | 212 | struct iwl_chain_noise_data *data = &priv->chain_noise_data; |
@@ -394,6 +422,7 @@ static struct iwl_lib_ops iwl5000_lib = { | |||
394 | .verify_signature = iwlcore_eeprom_verify_signature, | 422 | .verify_signature = iwlcore_eeprom_verify_signature, |
395 | .acquire_semaphore = iwlcore_eeprom_acquire_semaphore, | 423 | .acquire_semaphore = iwlcore_eeprom_acquire_semaphore, |
396 | .release_semaphore = iwlcore_eeprom_release_semaphore, | 424 | .release_semaphore = iwlcore_eeprom_release_semaphore, |
425 | .check_version = iwl5000_eeprom_check_version, | ||
397 | .query_addr = iwl5000_eeprom_query_addr, | 426 | .query_addr = iwl5000_eeprom_query_addr, |
398 | }, | 427 | }, |
399 | }; | 428 | }; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.h b/drivers/net/wireless/iwlwifi/iwl-eeprom.h index 56e0a07b8183..06ed30044a4d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.h +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.h | |||
@@ -140,6 +140,10 @@ struct iwl_eeprom_channel { | |||
140 | #define EEPROM_4965_BOARD_REVISION (2*0x4F) /* 2 bytes */ | 140 | #define EEPROM_4965_BOARD_REVISION (2*0x4F) /* 2 bytes */ |
141 | #define EEPROM_4965_BOARD_PBA (2*0x56+1) /* 9 bytes */ | 141 | #define EEPROM_4965_BOARD_PBA (2*0x56+1) /* 9 bytes */ |
142 | 142 | ||
143 | /* 5000 Specific */ | ||
144 | #define EEPROM_5000_TX_POWER_VERSION (4) | ||
145 | #define EEPROM_5000_EEPROM_VERSION (0x11A) | ||
146 | |||
143 | /*5000 calibrations */ | 147 | /*5000 calibrations */ |
144 | #define EEPROM_5000_CALIB_ALL (INDIRECT_ADDRESS | INDIRECT_CALIBRATION) | 148 | #define EEPROM_5000_CALIB_ALL (INDIRECT_ADDRESS | INDIRECT_CALIBRATION) |
145 | 149 | ||