diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-5000.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 51 |
1 files changed, 46 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 0d8ef63f8713..b5e28b811796 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -86,7 +86,7 @@ static int iwl5000_apm_init(struct iwl_priv *priv) | |||
86 | return ret; | 86 | return ret; |
87 | } | 87 | } |
88 | 88 | ||
89 | static void iwl5000_nic_init(struct iwl_priv *priv) | 89 | static void iwl5000_nic_config(struct iwl_priv *priv) |
90 | { | 90 | { |
91 | unsigned long flags; | 91 | unsigned long flags; |
92 | u16 radio_cfg; | 92 | u16 radio_cfg; |
@@ -362,6 +362,8 @@ static int iwl5000_alloc_shared_mem(struct iwl_priv *priv) | |||
362 | 362 | ||
363 | memset(priv->shared_virt, 0, sizeof(struct iwl5000_shared)); | 363 | memset(priv->shared_virt, 0, sizeof(struct iwl5000_shared)); |
364 | 364 | ||
365 | priv->rb_closed_offset = offsetof(struct iwl5000_shared, rb_closed); | ||
366 | |||
365 | return 0; | 367 | return 0; |
366 | } | 368 | } |
367 | 369 | ||
@@ -374,11 +376,17 @@ static void iwl5000_free_shared_mem(struct iwl_priv *priv) | |||
374 | priv->shared_phys); | 376 | priv->shared_phys); |
375 | } | 377 | } |
376 | 378 | ||
379 | static int iwl5000_shared_mem_rx_idx(struct iwl_priv *priv) | ||
380 | { | ||
381 | struct iwl5000_shared *s = priv->shared_virt; | ||
382 | return le32_to_cpu(s->rb_closed) & 0xFFF; | ||
383 | } | ||
384 | |||
377 | /** | 385 | /** |
378 | * iwl5000_txq_update_byte_cnt_tbl - Set up entry in Tx byte-count array | 386 | * iwl5000_txq_update_byte_cnt_tbl - Set up entry in Tx byte-count array |
379 | */ | 387 | */ |
380 | static void iwl5000_txq_update_byte_cnt_tbl(struct iwl_priv *priv, | 388 | static void iwl5000_txq_update_byte_cnt_tbl(struct iwl_priv *priv, |
381 | struct iwl4965_tx_queue *txq, | 389 | struct iwl_tx_queue *txq, |
382 | u16 byte_cnt) | 390 | u16 byte_cnt) |
383 | { | 391 | { |
384 | struct iwl5000_shared *shared_data = priv->shared_virt; | 392 | struct iwl5000_shared *shared_data = priv->shared_virt; |
@@ -422,10 +430,40 @@ static void iwl5000_txq_update_byte_cnt_tbl(struct iwl_priv *priv, | |||
422 | } | 430 | } |
423 | } | 431 | } |
424 | 432 | ||
433 | static u16 iwl5000_build_addsta_hcmd(const struct iwl_addsta_cmd *cmd, u8 *data) | ||
434 | { | ||
435 | u16 size = (u16)sizeof(struct iwl_addsta_cmd); | ||
436 | memcpy(data, cmd, size); | ||
437 | return size; | ||
438 | } | ||
439 | |||
440 | |||
441 | static int iwl5000_disable_tx_fifo(struct iwl_priv *priv) | ||
442 | { | ||
443 | unsigned long flags; | ||
444 | int ret; | ||
445 | |||
446 | spin_lock_irqsave(&priv->lock, flags); | ||
447 | |||
448 | ret = iwl_grab_nic_access(priv); | ||
449 | if (unlikely(ret)) { | ||
450 | IWL_ERROR("Tx fifo reset failed"); | ||
451 | spin_unlock_irqrestore(&priv->lock, flags); | ||
452 | return ret; | ||
453 | } | ||
454 | |||
455 | iwl_write_prph(priv, IWL50_SCD_TXFACT, 0); | ||
456 | iwl_release_nic_access(priv); | ||
457 | spin_unlock_irqrestore(&priv->lock, flags); | ||
458 | |||
459 | return 0; | ||
460 | } | ||
461 | |||
425 | static struct iwl_hcmd_ops iwl5000_hcmd = { | 462 | static struct iwl_hcmd_ops iwl5000_hcmd = { |
426 | }; | 463 | }; |
427 | 464 | ||
428 | static struct iwl_hcmd_utils_ops iwl5000_hcmd_utils = { | 465 | static struct iwl_hcmd_utils_ops iwl5000_hcmd_utils = { |
466 | .build_addsta_hcmd = iwl5000_build_addsta_hcmd, | ||
429 | #ifdef CONFIG_IWL5000_RUN_TIME_CALIB | 467 | #ifdef CONFIG_IWL5000_RUN_TIME_CALIB |
430 | .gain_computation = iwl5000_gain_computation, | 468 | .gain_computation = iwl5000_gain_computation, |
431 | .chain_noise_reset = iwl5000_chain_noise_reset, | 469 | .chain_noise_reset = iwl5000_chain_noise_reset, |
@@ -436,10 +474,12 @@ static struct iwl_lib_ops iwl5000_lib = { | |||
436 | .set_hw_params = iwl5000_hw_set_hw_params, | 474 | .set_hw_params = iwl5000_hw_set_hw_params, |
437 | .alloc_shared_mem = iwl5000_alloc_shared_mem, | 475 | .alloc_shared_mem = iwl5000_alloc_shared_mem, |
438 | .free_shared_mem = iwl5000_free_shared_mem, | 476 | .free_shared_mem = iwl5000_free_shared_mem, |
477 | .shared_mem_rx_idx = iwl5000_shared_mem_rx_idx, | ||
439 | .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl, | 478 | .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl, |
479 | .disable_tx_fifo = iwl5000_disable_tx_fifo, | ||
440 | .apm_ops = { | 480 | .apm_ops = { |
441 | .init = iwl5000_apm_init, | 481 | .init = iwl5000_apm_init, |
442 | .config = iwl5000_nic_init, | 482 | .config = iwl5000_nic_config, |
443 | .set_pwr_src = iwl4965_set_pwr_src, | 483 | .set_pwr_src = iwl4965_set_pwr_src, |
444 | }, | 484 | }, |
445 | .eeprom_ops = { | 485 | .eeprom_ops = { |
@@ -470,6 +510,7 @@ static struct iwl_mod_params iwl50_mod_params = { | |||
470 | .num_of_queues = IWL50_NUM_QUEUES, | 510 | .num_of_queues = IWL50_NUM_QUEUES, |
471 | .enable_qos = 1, | 511 | .enable_qos = 1, |
472 | .amsdu_size_8K = 1, | 512 | .amsdu_size_8K = 1, |
513 | .restart_fw = 1, | ||
473 | /* the rest are 0 by default */ | 514 | /* the rest are 0 by default */ |
474 | }; | 515 | }; |
475 | 516 | ||
@@ -515,5 +556,5 @@ module_param_named(qos_enable50, iwl50_mod_params.enable_qos, int, 0444); | |||
515 | MODULE_PARM_DESC(qos_enable50, "enable all 50XX QoS functionality"); | 556 | MODULE_PARM_DESC(qos_enable50, "enable all 50XX QoS functionality"); |
516 | module_param_named(amsdu_size_8K50, iwl50_mod_params.amsdu_size_8K, int, 0444); | 557 | module_param_named(amsdu_size_8K50, iwl50_mod_params.amsdu_size_8K, int, 0444); |
517 | MODULE_PARM_DESC(amsdu_size_8K50, "enable 8K amsdu size in 50XX series"); | 558 | MODULE_PARM_DESC(amsdu_size_8K50, "enable 8K amsdu size in 50XX series"); |
518 | 559 | module_param_named(fw_restart50, iwl50_mod_params.restart_fw, int, 0444); | |
519 | 560 | MODULE_PARM_DESC(fw_restart50, "restart firmware in case of error"); | |