aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/pcie/6000.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-05-21 05:55:54 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-06-06 07:24:19 -0400
commit26a7ca9a71a3f7e1826de96b1a1e907123e11b07 (patch)
tree7ab52c58fdd876bacf112c1bfceeac865f196704 /drivers/net/wireless/iwlwifi/pcie/6000.c
parent08838cdeca65e754af5c755a05f6cdb1c632eda8 (diff)
iwlwifi: refactor EEPROM reading/parsing
The EEPROM reading/parsing code is all mixed in the driver today, and the EEPROM is parsed only when we access data from it. This is problematic because the NVM needs to be parsed and that is independent of reading it. Also, the NVM format for new devices will be different and probably require a new parser. Therefore refactor the reading and parsing and create two independent components. Reading the EEPROM requires direct hardware accesses and therefore access to the transport, but parsing is independent and can be done on an NVM blob. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/pcie/6000.c')
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/6000.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/6000.c b/drivers/net/wireless/iwlwifi/pcie/6000.c
index 7b9c02cc67e5..8dd8a6fe61e8 100644
--- a/drivers/net/wireless/iwlwifi/pcie/6000.c
+++ b/drivers/net/wireless/iwlwifi/pcie/6000.c
@@ -136,6 +136,19 @@ static const struct iwl_bt_params iwl6000_bt_params = {
136 .bt_sco_disable = true, 136 .bt_sco_disable = true,
137}; 137};
138 138
139static const struct iwl_eeprom_params iwl6000_eeprom_params = {
140 .regulatory_bands = {
141 EEPROM_REG_BAND_1_CHANNELS,
142 EEPROM_REG_BAND_2_CHANNELS,
143 EEPROM_REG_BAND_3_CHANNELS,
144 EEPROM_REG_BAND_4_CHANNELS,
145 EEPROM_REG_BAND_5_CHANNELS,
146 EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
147 EEPROM_REG_BAND_52_HT40_CHANNELS
148 },
149 .enhanced_txpower = true,
150};
151
139#define IWL_DEVICE_6005 \ 152#define IWL_DEVICE_6005 \
140 .fw_name_pre = IWL6005_FW_PRE, \ 153 .fw_name_pre = IWL6005_FW_PRE, \
141 .ucode_api_max = IWL6000G2_UCODE_API_MAX, \ 154 .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
@@ -147,6 +160,7 @@ static const struct iwl_bt_params iwl6000_bt_params = {
147 .eeprom_ver = EEPROM_6005_EEPROM_VERSION, \ 160 .eeprom_ver = EEPROM_6005_EEPROM_VERSION, \
148 .eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION, \ 161 .eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION, \
149 .base_params = &iwl6000_g2_base_params, \ 162 .base_params = &iwl6000_g2_base_params, \
163 .eeprom_params = &iwl6000_eeprom_params, \
150 .need_temp_offset_calib = true, \ 164 .need_temp_offset_calib = true, \
151 .led_mode = IWL_LED_RF_STATE 165 .led_mode = IWL_LED_RF_STATE
152 166
@@ -202,6 +216,7 @@ const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
202 .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION, \ 216 .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
203 .base_params = &iwl6000_g2_base_params, \ 217 .base_params = &iwl6000_g2_base_params, \
204 .bt_params = &iwl6000_bt_params, \ 218 .bt_params = &iwl6000_bt_params, \
219 .eeprom_params = &iwl6000_eeprom_params, \
205 .need_temp_offset_calib = true, \ 220 .need_temp_offset_calib = true, \
206 .led_mode = IWL_LED_RF_STATE, \ 221 .led_mode = IWL_LED_RF_STATE, \
207 .adv_pm = true \ 222 .adv_pm = true \
@@ -274,6 +289,7 @@ const struct iwl_cfg iwl130_bg_cfg = {
274 .eeprom_ver = EEPROM_6000_EEPROM_VERSION, \ 289 .eeprom_ver = EEPROM_6000_EEPROM_VERSION, \
275 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION, \ 290 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
276 .base_params = &iwl6000_base_params, \ 291 .base_params = &iwl6000_base_params, \
292 .eeprom_params = &iwl6000_eeprom_params, \
277 .led_mode = IWL_LED_BLINK 293 .led_mode = IWL_LED_BLINK
278 294
279const struct iwl_cfg iwl6000i_2agn_cfg = { 295const struct iwl_cfg iwl6000i_2agn_cfg = {
@@ -304,6 +320,7 @@ const struct iwl_cfg iwl6000i_2bg_cfg = {
304 .eeprom_ver = EEPROM_6050_EEPROM_VERSION, \ 320 .eeprom_ver = EEPROM_6050_EEPROM_VERSION, \
305 .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION, \ 321 .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
306 .base_params = &iwl6050_base_params, \ 322 .base_params = &iwl6050_base_params, \
323 .eeprom_params = &iwl6000_eeprom_params, \
307 .led_mode = IWL_LED_BLINK, \ 324 .led_mode = IWL_LED_BLINK, \
308 .internal_wimax_coex = true 325 .internal_wimax_coex = true
309 326
@@ -328,6 +345,7 @@ const struct iwl_cfg iwl6050_2abg_cfg = {
328 .eeprom_ver = EEPROM_6150_EEPROM_VERSION, \ 345 .eeprom_ver = EEPROM_6150_EEPROM_VERSION, \
329 .eeprom_calib_ver = EEPROM_6150_TX_POWER_VERSION, \ 346 .eeprom_calib_ver = EEPROM_6150_TX_POWER_VERSION, \
330 .base_params = &iwl6050_base_params, \ 347 .base_params = &iwl6050_base_params, \
348 .eeprom_params = &iwl6000_eeprom_params, \
331 .led_mode = IWL_LED_BLINK, \ 349 .led_mode = IWL_LED_BLINK, \
332 .internal_wimax_coex = true 350 .internal_wimax_coex = true
333 351
@@ -354,6 +372,7 @@ const struct iwl_cfg iwl6000_3agn_cfg = {
354 .eeprom_ver = EEPROM_6000_EEPROM_VERSION, 372 .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
355 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION, 373 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
356 .base_params = &iwl6000_base_params, 374 .base_params = &iwl6000_base_params,
375 .eeprom_params = &iwl6000_eeprom_params,
357 .ht_params = &iwl6000_ht_params, 376 .ht_params = &iwl6000_ht_params,
358 .led_mode = IWL_LED_BLINK, 377 .led_mode = IWL_LED_BLINK,
359}; 378};