aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index bf0bd4af10c8..646c589b8282 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -642,9 +642,9 @@ void iwl4965_hw_txq_ctx_stop(struct iwl_priv *priv)
642 iwl_hw_txq_ctx_free(priv); 642 iwl_hw_txq_ctx_free(priv);
643} 643}
644 644
645int iwl4965_hw_nic_reset(struct iwl_priv *priv) 645static int iwl4965_apm_reset(struct iwl_priv *priv)
646{ 646{
647 int rc = 0; 647 int ret = 0;
648 unsigned long flags; 648 unsigned long flags;
649 649
650 iwl4965_hw_nic_stop_master(priv); 650 iwl4965_hw_nic_stop_master(priv);
@@ -655,33 +655,40 @@ int iwl4965_hw_nic_reset(struct iwl_priv *priv)
655 655
656 udelay(10); 656 udelay(10);
657 657
658 /* FIXME: put here L1A -L0S w/a */
659
658 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); 660 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
659 rc = iwl_poll_bit(priv, CSR_RESET, 661 ret = iwl_poll_bit(priv, CSR_RESET,
660 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 662 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
661 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25); 663 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25);
662 664
665 if (ret)
666 goto out;
667
663 udelay(10); 668 udelay(10);
664 669
665 rc = iwl_grab_nic_access(priv); 670 ret = iwl_grab_nic_access(priv);
666 if (!rc) { 671 if (ret)
667 iwl_write_prph(priv, APMG_CLK_EN_REG, 672 goto out;
668 APMG_CLK_VAL_DMA_CLK_RQT | 673 /* Enable DMA and BSM Clock */
669 APMG_CLK_VAL_BSM_CLK_RQT); 674 iwl_write_prph(priv, APMG_CLK_EN_REG, APMG_CLK_VAL_DMA_CLK_RQT |
675 APMG_CLK_VAL_BSM_CLK_RQT);
670 676
671 udelay(10); 677 udelay(10);
672 678
673 iwl_set_bits_prph(priv, APMG_PCIDEV_STT_REG, 679 /* disable L1A */
674 APMG_PCIDEV_STT_VAL_L1_ACT_DIS); 680 iwl_set_bits_prph(priv, APMG_PCIDEV_STT_REG,
681 APMG_PCIDEV_STT_VAL_L1_ACT_DIS);
675 682
676 iwl_release_nic_access(priv); 683 iwl_release_nic_access(priv);
677 }
678 684
679 clear_bit(STATUS_HCMD_ACTIVE, &priv->status); 685 clear_bit(STATUS_HCMD_ACTIVE, &priv->status);
680 wake_up_interruptible(&priv->wait_command_queue); 686 wake_up_interruptible(&priv->wait_command_queue);
681 687
688out:
682 spin_unlock_irqrestore(&priv->lock, flags); 689 spin_unlock_irqrestore(&priv->lock, flags);
683 690
684 return rc; 691 return ret;
685 692
686} 693}
687 694
@@ -3617,6 +3624,7 @@ static struct iwl_lib_ops iwl4965_lib = {
3617 .load_ucode = iwl4965_load_bsm, 3624 .load_ucode = iwl4965_load_bsm,
3618 .apm_ops = { 3625 .apm_ops = {
3619 .init = iwl4965_apm_init, 3626 .init = iwl4965_apm_init,
3627 .reset = iwl4965_apm_reset,
3620 .config = iwl4965_nic_config, 3628 .config = iwl4965_nic_config,
3621 .set_pwr_src = iwl4965_set_pwr_src, 3629 .set_pwr_src = iwl4965_set_pwr_src,
3622 }, 3630 },