diff options
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 40 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 2 |
3 files changed, 50 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index bc988c3b6782..9e6f3e33ab66 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -470,6 +470,27 @@ static void iwl4965_kw_free(struct iwl_priv *priv) | |||
470 | } | 470 | } |
471 | } | 471 | } |
472 | 472 | ||
473 | static int iwl4965_disable_tx_fifo(struct iwl_priv *priv) | ||
474 | { | ||
475 | unsigned long flags; | ||
476 | int ret; | ||
477 | |||
478 | spin_lock_irqsave(&priv->lock, flags); | ||
479 | |||
480 | ret = iwl_grab_nic_access(priv); | ||
481 | if (unlikely(ret)) { | ||
482 | IWL_ERROR("Tx fifo reset failed"); | ||
483 | spin_unlock_irqrestore(&priv->lock, flags); | ||
484 | return ret; | ||
485 | } | ||
486 | |||
487 | iwl_write_prph(priv, IWL49_SCD_TXFACT, 0); | ||
488 | iwl_release_nic_access(priv); | ||
489 | spin_unlock_irqrestore(&priv->lock, flags); | ||
490 | |||
491 | return 0; | ||
492 | } | ||
493 | |||
473 | /** | 494 | /** |
474 | * iwl4965_txq_ctx_reset - Reset TX queue context | 495 | * iwl4965_txq_ctx_reset - Reset TX queue context |
475 | * Destroys all DMA structures and initialise them again | 496 | * Destroys all DMA structures and initialise them again |
@@ -481,7 +502,6 @@ static int iwl4965_txq_ctx_reset(struct iwl_priv *priv) | |||
481 | { | 502 | { |
482 | int rc = 0; | 503 | int rc = 0; |
483 | int txq_id, slots_num; | 504 | int txq_id, slots_num; |
484 | unsigned long flags; | ||
485 | 505 | ||
486 | iwl4965_kw_free(priv); | 506 | iwl4965_kw_free(priv); |
487 | 507 | ||
@@ -495,19 +515,10 @@ static int iwl4965_txq_ctx_reset(struct iwl_priv *priv) | |||
495 | goto error_kw; | 515 | goto error_kw; |
496 | } | 516 | } |
497 | 517 | ||
498 | spin_lock_irqsave(&priv->lock, flags); | 518 | /* Turn off all Tx DMA fifos */ |
499 | 519 | rc = priv->cfg->ops->lib->disable_tx_fifo(priv); | |
500 | rc = iwl_grab_nic_access(priv); | 520 | if (unlikely(rc)) |
501 | if (unlikely(rc)) { | ||
502 | IWL_ERROR("TX reset failed"); | ||
503 | spin_unlock_irqrestore(&priv->lock, flags); | ||
504 | goto error_reset; | 521 | goto error_reset; |
505 | } | ||
506 | |||
507 | /* Turn off all Tx DMA channels */ | ||
508 | iwl_write_prph(priv, IWL49_SCD_TXFACT, 0); | ||
509 | iwl_release_nic_access(priv); | ||
510 | spin_unlock_irqrestore(&priv->lock, flags); | ||
511 | 522 | ||
512 | /* Tell 4965 where to find the keep-warm buffer */ | 523 | /* Tell 4965 where to find the keep-warm buffer */ |
513 | rc = iwl4965_kw_init(priv); | 524 | rc = iwl4965_kw_init(priv); |
@@ -538,6 +549,7 @@ static int iwl4965_txq_ctx_reset(struct iwl_priv *priv) | |||
538 | error_kw: | 549 | error_kw: |
539 | return rc; | 550 | return rc; |
540 | } | 551 | } |
552 | |||
541 | static int iwl4965_apm_init(struct iwl_priv *priv) | 553 | static int iwl4965_apm_init(struct iwl_priv *priv) |
542 | { | 554 | { |
543 | unsigned long flags; | 555 | unsigned long flags; |
@@ -621,7 +633,6 @@ static void iwl4965_nic_config(struct iwl_priv *priv) | |||
621 | spin_unlock_irqrestore(&priv->lock, flags); | 633 | spin_unlock_irqrestore(&priv->lock, flags); |
622 | } | 634 | } |
623 | 635 | ||
624 | |||
625 | int iwl4965_hw_nic_init(struct iwl_priv *priv) | 636 | int iwl4965_hw_nic_init(struct iwl_priv *priv) |
626 | { | 637 | { |
627 | unsigned long flags; | 638 | unsigned long flags; |
@@ -4044,6 +4055,7 @@ static struct iwl_lib_ops iwl4965_lib = { | |||
4044 | .free_shared_mem = iwl4965_free_shared_mem, | 4055 | .free_shared_mem = iwl4965_free_shared_mem, |
4045 | .txq_update_byte_cnt_tbl = iwl4965_txq_update_byte_cnt_tbl, | 4056 | .txq_update_byte_cnt_tbl = iwl4965_txq_update_byte_cnt_tbl, |
4046 | .hw_nic_init = iwl4965_hw_nic_init, | 4057 | .hw_nic_init = iwl4965_hw_nic_init, |
4058 | .disable_tx_fifo = iwl4965_disable_tx_fifo, | ||
4047 | .rx_handler_setup = iwl4965_rx_handler_setup, | 4059 | .rx_handler_setup = iwl4965_rx_handler_setup, |
4048 | .is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr, | 4060 | .is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr, |
4049 | .alive_notify = iwl4965_alive_notify, | 4061 | .alive_notify = iwl4965_alive_notify, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index f9c227413086..feffcafe1495 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -430,6 +430,27 @@ static u16 iwl5000_build_addsta_hcmd(const struct iwl_addsta_cmd *cmd, u8 *data) | |||
430 | } | 430 | } |
431 | 431 | ||
432 | 432 | ||
433 | static int iwl5000_disable_tx_fifo(struct iwl_priv *priv) | ||
434 | { | ||
435 | unsigned long flags; | ||
436 | int ret; | ||
437 | |||
438 | spin_lock_irqsave(&priv->lock, flags); | ||
439 | |||
440 | ret = iwl_grab_nic_access(priv); | ||
441 | if (unlikely(ret)) { | ||
442 | IWL_ERROR("Tx fifo reset failed"); | ||
443 | spin_unlock_irqrestore(&priv->lock, flags); | ||
444 | return ret; | ||
445 | } | ||
446 | |||
447 | iwl_write_prph(priv, IWL50_SCD_TXFACT, 0); | ||
448 | iwl_release_nic_access(priv); | ||
449 | spin_unlock_irqrestore(&priv->lock, flags); | ||
450 | |||
451 | return 0; | ||
452 | } | ||
453 | |||
433 | static struct iwl_hcmd_ops iwl5000_hcmd = { | 454 | static struct iwl_hcmd_ops iwl5000_hcmd = { |
434 | }; | 455 | }; |
435 | 456 | ||
@@ -446,6 +467,7 @@ static struct iwl_lib_ops iwl5000_lib = { | |||
446 | .alloc_shared_mem = iwl5000_alloc_shared_mem, | 467 | .alloc_shared_mem = iwl5000_alloc_shared_mem, |
447 | .free_shared_mem = iwl5000_free_shared_mem, | 468 | .free_shared_mem = iwl5000_free_shared_mem, |
448 | .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl, | 469 | .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl, |
470 | .disable_tx_fifo = iwl5000_disable_tx_fifo, | ||
449 | .apm_ops = { | 471 | .apm_ops = { |
450 | .init = iwl5000_apm_init, | 472 | .init = iwl5000_apm_init, |
451 | .config = iwl5000_nic_config, | 473 | .config = iwl5000_nic_config, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 12418061ab7f..c29f8b347129 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -110,6 +110,8 @@ struct iwl_lib_ops { | |||
110 | void (*rx_handler_setup)(struct iwl_priv *priv); | 110 | void (*rx_handler_setup)(struct iwl_priv *priv); |
111 | /* nic init */ | 111 | /* nic init */ |
112 | int (*hw_nic_init)(struct iwl_priv *priv); | 112 | int (*hw_nic_init)(struct iwl_priv *priv); |
113 | /* nic Tx fifo handling */ | ||
114 | int (*disable_tx_fifo)(struct iwl_priv *priv); | ||
113 | /* alive notification */ | 115 | /* alive notification */ |
114 | int (*alive_notify)(struct iwl_priv *priv); | 116 | int (*alive_notify)(struct iwl_priv *priv); |
115 | /* check validity of rtc data address */ | 117 | /* check validity of rtc data address */ |