diff options
author | Ron Rindjunsky <ron.rindjunsky@intel.com> | 2008-05-04 22:22:42 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-14 16:29:45 -0400 |
commit | 5a676bbeaf9e534b75286f2294ec57a4c544f1d2 (patch) | |
tree | 9e3492448c2758d8bf18f816eac759ad57f26396 /drivers/net/wireless/iwlwifi/iwl-4965.c | |
parent | 47c5196e4a340667d8d92053380ecca24ed45a9b (diff) |
iwlwifi: create disable SCD Tx FIFOs handler
This patch moves disabeling Tx FIFOs in NIC SCD to seperate handlers
in 4965 and 5000 cards.
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 40 |
1 files changed, 26 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, |