aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2011-07-07 11:33:01 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-07-16 10:37:28 -0400
commit90c300cbd89e76789dbff101a1cb1ec226af277f (patch)
tree2b25a09768aab208765fc28795bdd7c1874a9199 /drivers
parente505c433d35900d98870a2e266759166a03030dc (diff)
iwlagn: remove dual-indirect call to simply the code
After driver split, no need to make the code so complex Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-1000.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-2000.c24
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c14
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c38
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c20
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-eeprom.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c6
9 files changed, 41 insertions, 89 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index 2f56b343e869..e21f71855166 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -186,10 +186,6 @@ static struct iwl_lib_ops iwl1000_lib = {
186 .temperature = iwlagn_temperature, 186 .temperature = iwlagn_temperature,
187}; 187};
188 188
189static const struct iwl_ops iwl1000_ops = {
190 .lib = &iwl1000_lib,
191};
192
193static struct iwl_base_params iwl1000_base_params = { 189static struct iwl_base_params iwl1000_base_params = {
194 .num_of_queues = IWLAGN_NUM_QUEUES, 190 .num_of_queues = IWLAGN_NUM_QUEUES,
195 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, 191 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
@@ -217,7 +213,7 @@ static struct iwl_ht_params iwl1000_ht_params = {
217 .ucode_api_min = IWL1000_UCODE_API_MIN, \ 213 .ucode_api_min = IWL1000_UCODE_API_MIN, \
218 .eeprom_ver = EEPROM_1000_EEPROM_VERSION, \ 214 .eeprom_ver = EEPROM_1000_EEPROM_VERSION, \
219 .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, \ 215 .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, \
220 .ops = &iwl1000_ops, \ 216 .lib = &iwl1000_lib, \
221 .base_params = &iwl1000_base_params, \ 217 .base_params = &iwl1000_base_params, \
222 .led_mode = IWL_LED_BLINK 218 .led_mode = IWL_LED_BLINK
223 219
@@ -238,7 +234,7 @@ struct iwl_cfg iwl1000_bg_cfg = {
238 .ucode_api_min = IWL100_UCODE_API_MIN, \ 234 .ucode_api_min = IWL100_UCODE_API_MIN, \
239 .eeprom_ver = EEPROM_1000_EEPROM_VERSION, \ 235 .eeprom_ver = EEPROM_1000_EEPROM_VERSION, \
240 .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, \ 236 .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, \
241 .ops = &iwl1000_ops, \ 237 .lib = &iwl1000_lib, \
242 .base_params = &iwl1000_base_params, \ 238 .base_params = &iwl1000_base_params, \
243 .led_mode = IWL_LED_RF_STATE, \ 239 .led_mode = IWL_LED_RF_STATE, \
244 .rx_with_siso_diversity = true 240 .rx_with_siso_diversity = true
diff --git a/drivers/net/wireless/iwlwifi/iwl-2000.c b/drivers/net/wireless/iwlwifi/iwl-2000.c
index 32ac8654b79a..f72f619dfc11 100644
--- a/drivers/net/wireless/iwlwifi/iwl-2000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-2000.c
@@ -208,22 +208,6 @@ static struct iwl_lib_ops iwl2030_lib = {
208 .temperature = iwlagn_temperature, 208 .temperature = iwlagn_temperature,
209}; 209};
210 210
211static const struct iwl_ops iwl2000_ops = {
212 .lib = &iwl2000_lib,
213};
214
215static const struct iwl_ops iwl2030_ops = {
216 .lib = &iwl2030_lib,
217};
218
219static const struct iwl_ops iwl105_ops = {
220 .lib = &iwl2000_lib,
221};
222
223static const struct iwl_ops iwl135_ops = {
224 .lib = &iwl2030_lib,
225};
226
227static struct iwl_base_params iwl2000_base_params = { 211static struct iwl_base_params iwl2000_base_params = {
228 .eeprom_size = OTP_LOW_IMAGE_SIZE, 212 .eeprom_size = OTP_LOW_IMAGE_SIZE,
229 .num_of_queues = IWLAGN_NUM_QUEUES, 213 .num_of_queues = IWLAGN_NUM_QUEUES,
@@ -282,7 +266,7 @@ static struct iwl_bt_params iwl2030_bt_params = {
282 .ucode_api_min = IWL2000_UCODE_API_MIN, \ 266 .ucode_api_min = IWL2000_UCODE_API_MIN, \
283 .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \ 267 .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
284 .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ 268 .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
285 .ops = &iwl2000_ops, \ 269 .lib = &iwl2000_lib, \
286 .base_params = &iwl2000_base_params, \ 270 .base_params = &iwl2000_base_params, \
287 .need_dc_calib = true, \ 271 .need_dc_calib = true, \
288 .need_temp_offset_calib = true, \ 272 .need_temp_offset_calib = true, \
@@ -307,7 +291,7 @@ struct iwl_cfg iwl2000_2bg_cfg = {
307 .ucode_api_min = IWL2030_UCODE_API_MIN, \ 291 .ucode_api_min = IWL2030_UCODE_API_MIN, \
308 .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \ 292 .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
309 .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ 293 .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
310 .ops = &iwl2030_ops, \ 294 .lib = &iwl2030_lib, \
311 .base_params = &iwl2030_base_params, \ 295 .base_params = &iwl2030_base_params, \
312 .bt_params = &iwl2030_bt_params, \ 296 .bt_params = &iwl2030_bt_params, \
313 .need_dc_calib = true, \ 297 .need_dc_calib = true, \
@@ -333,7 +317,7 @@ struct iwl_cfg iwl2030_2bg_cfg = {
333 .ucode_api_min = IWL105_UCODE_API_MIN, \ 317 .ucode_api_min = IWL105_UCODE_API_MIN, \
334 .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \ 318 .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
335 .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ 319 .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
336 .ops = &iwl105_ops, \ 320 .lib = &iwl2000_lib, \
337 .base_params = &iwl2000_base_params, \ 321 .base_params = &iwl2000_base_params, \
338 .need_dc_calib = true, \ 322 .need_dc_calib = true, \
339 .need_temp_offset_calib = true, \ 323 .need_temp_offset_calib = true, \
@@ -358,7 +342,7 @@ struct iwl_cfg iwl105_bgn_cfg = {
358 .ucode_api_min = IWL135_UCODE_API_MIN, \ 342 .ucode_api_min = IWL135_UCODE_API_MIN, \
359 .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \ 343 .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
360 .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ 344 .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
361 .ops = &iwl135_ops, \ 345 .lib = &iwl2030_lib, \
362 .base_params = &iwl2030_base_params, \ 346 .base_params = &iwl2030_base_params, \
363 .bt_params = &iwl2030_bt_params, \ 347 .bt_params = &iwl2030_bt_params, \
364 .need_dc_calib = true, \ 348 .need_dc_calib = true, \
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 556489302da3..33b383cb676b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -360,14 +360,6 @@ static struct iwl_lib_ops iwl5150_lib = {
360 .temperature = iwl5150_temperature, 360 .temperature = iwl5150_temperature,
361}; 361};
362 362
363static const struct iwl_ops iwl5000_ops = {
364 .lib = &iwl5000_lib,
365};
366
367static const struct iwl_ops iwl5150_ops = {
368 .lib = &iwl5150_lib,
369};
370
371static struct iwl_base_params iwl5000_base_params = { 363static struct iwl_base_params iwl5000_base_params = {
372 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE, 364 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
373 .num_of_queues = IWLAGN_NUM_QUEUES, 365 .num_of_queues = IWLAGN_NUM_QUEUES,
@@ -390,7 +382,7 @@ static struct iwl_ht_params iwl5000_ht_params = {
390 .ucode_api_min = IWL5000_UCODE_API_MIN, \ 382 .ucode_api_min = IWL5000_UCODE_API_MIN, \
391 .eeprom_ver = EEPROM_5000_EEPROM_VERSION, \ 383 .eeprom_ver = EEPROM_5000_EEPROM_VERSION, \
392 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, \ 384 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, \
393 .ops = &iwl5000_ops, \ 385 .lib = &iwl5000_lib, \
394 .base_params = &iwl5000_base_params, \ 386 .base_params = &iwl5000_base_params, \
395 .led_mode = IWL_LED_BLINK 387 .led_mode = IWL_LED_BLINK
396 388
@@ -433,7 +425,7 @@ struct iwl_cfg iwl5350_agn_cfg = {
433 .ucode_api_min = IWL5000_UCODE_API_MIN, 425 .ucode_api_min = IWL5000_UCODE_API_MIN,
434 .eeprom_ver = EEPROM_5050_EEPROM_VERSION, 426 .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
435 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, 427 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
436 .ops = &iwl5000_ops, 428 .lib = &iwl5000_lib,
437 .base_params = &iwl5000_base_params, 429 .base_params = &iwl5000_base_params,
438 .ht_params = &iwl5000_ht_params, 430 .ht_params = &iwl5000_ht_params,
439 .led_mode = IWL_LED_BLINK, 431 .led_mode = IWL_LED_BLINK,
@@ -446,7 +438,7 @@ struct iwl_cfg iwl5350_agn_cfg = {
446 .ucode_api_min = IWL5150_UCODE_API_MIN, \ 438 .ucode_api_min = IWL5150_UCODE_API_MIN, \
447 .eeprom_ver = EEPROM_5050_EEPROM_VERSION, \ 439 .eeprom_ver = EEPROM_5050_EEPROM_VERSION, \
448 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, \ 440 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, \
449 .ops = &iwl5150_ops, \ 441 .lib = &iwl5150_lib, \
450 .base_params = &iwl5000_base_params, \ 442 .base_params = &iwl5000_base_params, \
451 .need_dc_calib = true, \ 443 .need_dc_calib = true, \
452 .led_mode = IWL_LED_BLINK, \ 444 .led_mode = IWL_LED_BLINK, \
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 80f1ef61a3d5..f6b309da6ebb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -106,9 +106,9 @@ static void iwl6000_nic_config(struct iwl_priv *priv)
106 CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA); 106 CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA);
107 } 107 }
108 /* do additional nic configuration if needed */ 108 /* do additional nic configuration if needed */
109 if (priv->cfg->ops->nic && 109 if (priv->cfg->nic &&
110 priv->cfg->ops->nic->additional_nic_config) { 110 priv->cfg->nic->additional_nic_config) {
111 priv->cfg->ops->nic->additional_nic_config(priv); 111 priv->cfg->nic->additional_nic_config(priv);
112 } 112 }
113} 113}
114 114
@@ -311,24 +311,6 @@ static struct iwl_nic_ops iwl6150_nic_ops = {
311 .additional_nic_config = &iwl6150_additional_nic_config, 311 .additional_nic_config = &iwl6150_additional_nic_config,
312}; 312};
313 313
314static const struct iwl_ops iwl6000_ops = {
315 .lib = &iwl6000_lib,
316};
317
318static const struct iwl_ops iwl6050_ops = {
319 .lib = &iwl6000_lib,
320 .nic = &iwl6050_nic_ops,
321};
322
323static const struct iwl_ops iwl6150_ops = {
324 .lib = &iwl6000_lib,
325 .nic = &iwl6150_nic_ops,
326};
327
328static const struct iwl_ops iwl6030_ops = {
329 .lib = &iwl6030_lib,
330};
331
332static struct iwl_base_params iwl6000_base_params = { 314static struct iwl_base_params iwl6000_base_params = {
333 .eeprom_size = OTP_LOW_IMAGE_SIZE, 315 .eeprom_size = OTP_LOW_IMAGE_SIZE,
334 .num_of_queues = IWLAGN_NUM_QUEUES, 316 .num_of_queues = IWLAGN_NUM_QUEUES,
@@ -402,7 +384,7 @@ static struct iwl_bt_params iwl6000_bt_params = {
402 .ucode_api_min = IWL6000G2_UCODE_API_MIN, \ 384 .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
403 .eeprom_ver = EEPROM_6005_EEPROM_VERSION, \ 385 .eeprom_ver = EEPROM_6005_EEPROM_VERSION, \
404 .eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION, \ 386 .eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION, \
405 .ops = &iwl6000_ops, \ 387 .lib = &iwl6000_lib, \
406 .base_params = &iwl6000_g2_base_params, \ 388 .base_params = &iwl6000_g2_base_params, \
407 .need_dc_calib = true, \ 389 .need_dc_calib = true, \
408 .need_temp_offset_calib = true, \ 390 .need_temp_offset_calib = true, \
@@ -430,7 +412,7 @@ struct iwl_cfg iwl6005_2bg_cfg = {
430 .ucode_api_min = IWL6000G2_UCODE_API_MIN, \ 412 .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
431 .eeprom_ver = EEPROM_6030_EEPROM_VERSION, \ 413 .eeprom_ver = EEPROM_6030_EEPROM_VERSION, \
432 .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION, \ 414 .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
433 .ops = &iwl6030_ops, \ 415 .lib = &iwl6030_lib, \
434 .base_params = &iwl6000_g2_base_params, \ 416 .base_params = &iwl6000_g2_base_params, \
435 .bt_params = &iwl6000_bt_params, \ 417 .bt_params = &iwl6000_bt_params, \
436 .need_dc_calib = true, \ 418 .need_dc_calib = true, \
@@ -511,7 +493,7 @@ struct iwl_cfg iwl130_bg_cfg = {
511 .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \ 493 .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \
512 .eeprom_ver = EEPROM_6000_EEPROM_VERSION, \ 494 .eeprom_ver = EEPROM_6000_EEPROM_VERSION, \
513 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION, \ 495 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
514 .ops = &iwl6000_ops, \ 496 .lib = &iwl6000_lib, \
515 .base_params = &iwl6000_base_params, \ 497 .base_params = &iwl6000_base_params, \
516 .pa_type = IWL_PA_INTERNAL, \ 498 .pa_type = IWL_PA_INTERNAL, \
517 .led_mode = IWL_LED_BLINK 499 .led_mode = IWL_LED_BLINK
@@ -538,7 +520,8 @@ struct iwl_cfg iwl6000i_2bg_cfg = {
538 .ucode_api_min = IWL6050_UCODE_API_MIN, \ 520 .ucode_api_min = IWL6050_UCODE_API_MIN, \
539 .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \ 521 .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \
540 .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \ 522 .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \
541 .ops = &iwl6050_ops, \ 523 .lib = &iwl6000_lib, \
524 .nic = &iwl6050_nic_ops, \
542 .eeprom_ver = EEPROM_6050_EEPROM_VERSION, \ 525 .eeprom_ver = EEPROM_6050_EEPROM_VERSION, \
543 .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION, \ 526 .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
544 .base_params = &iwl6050_base_params, \ 527 .base_params = &iwl6050_base_params, \
@@ -561,7 +544,8 @@ struct iwl_cfg iwl6050_2abg_cfg = {
561 .fw_name_pre = IWL6050_FW_PRE, \ 544 .fw_name_pre = IWL6050_FW_PRE, \
562 .ucode_api_max = IWL6050_UCODE_API_MAX, \ 545 .ucode_api_max = IWL6050_UCODE_API_MAX, \
563 .ucode_api_min = IWL6050_UCODE_API_MIN, \ 546 .ucode_api_min = IWL6050_UCODE_API_MIN, \
564 .ops = &iwl6150_ops, \ 547 .lib = &iwl6000_lib, \
548 .nic = &iwl6150_nic_ops, \
565 .eeprom_ver = EEPROM_6150_EEPROM_VERSION, \ 549 .eeprom_ver = EEPROM_6150_EEPROM_VERSION, \
566 .eeprom_calib_ver = EEPROM_6150_TX_POWER_VERSION, \ 550 .eeprom_calib_ver = EEPROM_6150_TX_POWER_VERSION, \
567 .base_params = &iwl6050_base_params, \ 551 .base_params = &iwl6050_base_params, \
@@ -587,7 +571,7 @@ struct iwl_cfg iwl6000_3agn_cfg = {
587 .ucode_api_min = IWL6000_UCODE_API_MIN, 571 .ucode_api_min = IWL6000_UCODE_API_MIN,
588 .eeprom_ver = EEPROM_6000_EEPROM_VERSION, 572 .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
589 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION, 573 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
590 .ops = &iwl6000_ops, 574 .lib = &iwl6000_lib,
591 .base_params = &iwl6000_base_params, 575 .base_params = &iwl6000_base_params,
592 .ht_params = &iwl6000_ht_params, 576 .ht_params = &iwl6000_ht_params,
593 .need_dc_calib = true, 577 .need_dc_calib = true,
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index b28219003121..d4a60105ab79 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -711,7 +711,7 @@ int iwlagn_hw_nic_init(struct iwl_priv *priv)
711 711
712 iwlagn_set_pwr_vmain(priv); 712 iwlagn_set_pwr_vmain(priv);
713 713
714 priv->cfg->ops->lib->nic_config(priv); 714 priv->cfg->lib->nic_config(priv);
715 715
716 /* Allocate the RX queue, or reset if it is already allocated */ 716 /* Allocate the RX queue, or reset if it is already allocated */
717 trans_rx_init(priv); 717 trans_rx_init(priv);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index dceb45063669..41c3e15104ad 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -375,7 +375,7 @@ static void iwl_continuous_event_trace(struct iwl_priv *priv)
375 u32 next_entry; /* index of next entry to be written by uCode */ 375 u32 next_entry; /* index of next entry to be written by uCode */
376 376
377 base = priv->device_pointers.error_event_table; 377 base = priv->device_pointers.error_event_table;
378 if (priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) { 378 if (priv->cfg->lib->is_valid_rtc_data_addr(base)) {
379 capacity = iwl_read_targ_mem(priv, base); 379 capacity = iwl_read_targ_mem(priv, base);
380 num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32))); 380 num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32)));
381 mode = iwl_read_targ_mem(priv, base + (1 * sizeof(u32))); 381 mode = iwl_read_targ_mem(priv, base + (1 * sizeof(u32)));
@@ -1614,7 +1614,7 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv)
1614 base = priv->_agn.inst_errlog_ptr; 1614 base = priv->_agn.inst_errlog_ptr;
1615 } 1615 }
1616 1616
1617 if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) { 1617 if (!priv->cfg->lib->is_valid_rtc_data_addr(base)) {
1618 IWL_ERR(priv, 1618 IWL_ERR(priv,
1619 "Not valid error log pointer 0x%08X for %s uCode\n", 1619 "Not valid error log pointer 0x%08X for %s uCode\n",
1620 base, 1620 base,
@@ -1805,7 +1805,7 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
1805 base = priv->_agn.inst_evtlog_ptr; 1805 base = priv->_agn.inst_evtlog_ptr;
1806 } 1806 }
1807 1807
1808 if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) { 1808 if (!priv->cfg->lib->is_valid_rtc_data_addr(base)) {
1809 IWL_ERR(priv, 1809 IWL_ERR(priv,
1810 "Invalid event log pointer 0x%08X for %s uCode\n", 1810 "Invalid event log pointer 0x%08X for %s uCode\n",
1811 base, 1811 base,
@@ -2939,7 +2939,7 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
2939 if (!iwl_is_associated_ctx(ctx)) 2939 if (!iwl_is_associated_ctx(ctx))
2940 goto out; 2940 goto out;
2941 2941
2942 if (!priv->cfg->ops->lib->set_channel_switch) 2942 if (!priv->cfg->lib->set_channel_switch)
2943 goto out; 2943 goto out;
2944 2944
2945 ch = channel->hw_value; 2945 ch = channel->hw_value;
@@ -2991,7 +2991,7 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
2991 */ 2991 */
2992 set_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status); 2992 set_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status);
2993 priv->switch_channel = cpu_to_le16(ch); 2993 priv->switch_channel = cpu_to_le16(ch);
2994 if (priv->cfg->ops->lib->set_channel_switch(priv, ch_switch)) { 2994 if (priv->cfg->lib->set_channel_switch(priv, ch_switch)) {
2995 clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status); 2995 clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status);
2996 priv->switch_channel = 0; 2996 priv->switch_channel = 0;
2997 ieee80211_chswitch_done(ctx->vif, false); 2997 ieee80211_chswitch_done(ctx->vif, false);
@@ -3198,8 +3198,8 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv)
3198 3198
3199 iwl_setup_scan_deferred_work(priv); 3199 iwl_setup_scan_deferred_work(priv);
3200 3200
3201 if (priv->cfg->ops->lib->setup_deferred_work) 3201 if (priv->cfg->lib->setup_deferred_work)
3202 priv->cfg->ops->lib->setup_deferred_work(priv); 3202 priv->cfg->lib->setup_deferred_work(priv);
3203 3203
3204 init_timer(&priv->statistics_periodic); 3204 init_timer(&priv->statistics_periodic);
3205 priv->statistics_periodic.data = (unsigned long)priv; 3205 priv->statistics_periodic.data = (unsigned long)priv;
@@ -3216,8 +3216,8 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv)
3216 3216
3217static void iwl_cancel_deferred_work(struct iwl_priv *priv) 3217static void iwl_cancel_deferred_work(struct iwl_priv *priv)
3218{ 3218{
3219 if (priv->cfg->ops->lib->cancel_deferred_work) 3219 if (priv->cfg->lib->cancel_deferred_work)
3220 priv->cfg->ops->lib->cancel_deferred_work(priv); 3220 priv->cfg->lib->cancel_deferred_work(priv);
3221 3221
3222 cancel_work_sync(&priv->run_time_calib_work); 3222 cancel_work_sync(&priv->run_time_calib_work);
3223 cancel_work_sync(&priv->beacon_update); 3223 cancel_work_sync(&priv->beacon_update);
@@ -3397,7 +3397,7 @@ static int iwl_set_hw_params(struct iwl_priv *priv)
3397 priv->cfg->sku &= ~EEPROM_SKU_CAP_11N_ENABLE; 3397 priv->cfg->sku &= ~EEPROM_SKU_CAP_11N_ENABLE;
3398 3398
3399 /* Device-specific setup */ 3399 /* Device-specific setup */
3400 return priv->cfg->ops->lib->set_hw_params(priv); 3400 return priv->cfg->lib->set_hw_params(priv);
3401} 3401}
3402 3402
3403static const u8 iwlagn_bss_ac_to_fifo[] = { 3403static const u8 iwlagn_bss_ac_to_fifo[] = {
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 692c30cb2fac..d6d2760c7c38 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -108,11 +108,6 @@ struct iwl_nic_ops {
108 void (*additional_nic_config)(struct iwl_priv *priv); 108 void (*additional_nic_config)(struct iwl_priv *priv);
109}; 109};
110 110
111struct iwl_ops {
112 const struct iwl_lib_ops *lib;
113 const struct iwl_nic_ops *nic;
114};
115
116struct iwl_mod_params { 111struct iwl_mod_params {
117 int sw_crypto; /* def: 0 = using hardware encryption */ 112 int sw_crypto; /* def: 0 = using hardware encryption */
118 int num_of_queues; /* def: HW dependent */ 113 int num_of_queues; /* def: HW dependent */
@@ -247,7 +242,8 @@ struct iwl_cfg {
247 u16 sku; 242 u16 sku;
248 u16 eeprom_ver; 243 u16 eeprom_ver;
249 u16 eeprom_calib_ver; 244 u16 eeprom_calib_ver;
250 const struct iwl_ops *ops; 245 const struct iwl_lib_ops *lib;
246 const struct iwl_nic_ops *nic;
251 /* params not likely to change within a device family */ 247 /* params not likely to change within a device family */
252 struct iwl_base_params *base_params; 248 struct iwl_base_params *base_params;
253 /* params likely to change within a device family */ 249 /* params likely to change within a device family */
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
index eee97bcf9802..19d31a5e32e5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
@@ -543,7 +543,7 @@ static void iwl_init_band_reference(const struct iwl_priv *priv,
543 const struct iwl_eeprom_channel **eeprom_ch_info, 543 const struct iwl_eeprom_channel **eeprom_ch_info,
544 const u8 **eeprom_ch_index) 544 const u8 **eeprom_ch_index)
545{ 545{
546 u32 offset = priv->cfg->ops->lib-> 546 u32 offset = priv->cfg->lib->
547 eeprom_ops.regulatory_bands[eep_band - 1]; 547 eeprom_ops.regulatory_bands[eep_band - 1];
548 switch (eep_band) { 548 switch (eep_band) {
549 case 1: /* 2.4GHz band */ 549 case 1: /* 2.4GHz band */
@@ -749,9 +749,9 @@ int iwl_init_channel_map(struct iwl_priv *priv)
749 } 749 }
750 750
751 /* Check if we do have HT40 channels */ 751 /* Check if we do have HT40 channels */
752 if (priv->cfg->ops->lib->eeprom_ops.regulatory_bands[5] == 752 if (priv->cfg->lib->eeprom_ops.regulatory_bands[5] ==
753 EEPROM_REGULATORY_BAND_NO_HT40 && 753 EEPROM_REGULATORY_BAND_NO_HT40 &&
754 priv->cfg->ops->lib->eeprom_ops.regulatory_bands[6] == 754 priv->cfg->lib->eeprom_ops.regulatory_bands[6] ==
755 EEPROM_REGULATORY_BAND_NO_HT40) 755 EEPROM_REGULATORY_BAND_NO_HT40)
756 return 0; 756 return 0;
757 757
@@ -787,8 +787,8 @@ int iwl_init_channel_map(struct iwl_priv *priv)
787 * driver need to process addition information 787 * driver need to process addition information
788 * to determine the max channel tx power limits 788 * to determine the max channel tx power limits
789 */ 789 */
790 if (priv->cfg->ops->lib->eeprom_ops.update_enhanced_txpower) 790 if (priv->cfg->lib->eeprom_ops.update_enhanced_txpower)
791 priv->cfg->ops->lib->eeprom_ops.update_enhanced_txpower(priv); 791 priv->cfg->lib->eeprom_ops.update_enhanced_txpower(priv);
792 792
793 return 0; 793 return 0;
794} 794}
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index c5eb379246ff..bd63b785f68c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -624,8 +624,8 @@ static void iwl_rx_statistics(struct iwl_priv *priv,
624 iwl_rx_calc_noise(priv); 624 iwl_rx_calc_noise(priv);
625 queue_work(priv->workqueue, &priv->run_time_calib_work); 625 queue_work(priv->workqueue, &priv->run_time_calib_work);
626 } 626 }
627 if (priv->cfg->ops->lib->temperature && change) 627 if (priv->cfg->lib->temperature && change)
628 priv->cfg->ops->lib->temperature(priv); 628 priv->cfg->lib->temperature(priv);
629} 629}
630 630
631static void iwl_rx_reply_statistics(struct iwl_priv *priv, 631static void iwl_rx_reply_statistics(struct iwl_priv *priv,
@@ -1103,7 +1103,7 @@ void iwl_setup_rx_handlers(struct iwl_priv *priv)
1103 handlers[REPLY_COMPRESSED_BA] = iwlagn_rx_reply_compressed_ba; 1103 handlers[REPLY_COMPRESSED_BA] = iwlagn_rx_reply_compressed_ba;
1104 1104
1105 /* Set up hardware specific Rx handlers */ 1105 /* Set up hardware specific Rx handlers */
1106 priv->cfg->ops->lib->rx_handler_setup(priv); 1106 priv->cfg->lib->rx_handler_setup(priv);
1107} 1107}
1108 1108
1109void iwl_rx_dispatch(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) 1109void iwl_rx_dispatch(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)