aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-5000.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-05-29 04:34:57 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-03 15:00:20 -0400
commit7f066108d15d06ec3534434333f0274c868fe798 (patch)
treec85d2e32a035a4aba4e3e43350120fcac44830b8 /drivers/net/wireless/iwlwifi/iwl-5000.c
parent8f0618914e02c62c5cf2482f8acc7eb8e9afb816 (diff)
iwlwifi: implement apm reset flow
This patch implements apm reset flow for 4965 and 5000. 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-5000.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index b1c50453a7e7..10054bdf3e4c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -100,6 +100,59 @@ static int iwl5000_apm_init(struct iwl_priv *priv)
100 return ret; 100 return ret;
101} 101}
102 102
103static int iwl5000_apm_reset(struct iwl_priv *priv)
104{
105 int ret = 0;
106 unsigned long flags;
107
108 iwl4965_hw_nic_stop_master(priv);
109
110 spin_lock_irqsave(&priv->lock, flags);
111
112 iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
113
114 udelay(10);
115
116
117 /* FIXME: put here L1A -L0S w/a */
118
119 iwl_set_bit(priv, CSR_ANA_PLL_CFG, CSR50_ANA_PLL_CFG_VAL);
120
121 /* set "initialization complete" bit to move adapter
122 * D0U* --> D0A* state */
123 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
124
125 /* wait for clock stabilization */
126 ret = iwl_poll_bit(priv, CSR_GP_CNTRL,
127 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
128 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
129 if (ret < 0) {
130 IWL_DEBUG_INFO("Failed to init the card\n");
131 goto out;
132 }
133
134 ret = iwl_grab_nic_access(priv);
135 if (ret)
136 goto out;
137
138 /* enable DMA */
139 iwl_write_prph(priv, APMG_CLK_EN_REG, APMG_CLK_VAL_DMA_CLK_RQT);
140
141 udelay(20);
142
143 /* disable L1-Active */
144 iwl_set_bits_prph(priv, APMG_PCIDEV_STT_REG,
145 APMG_PCIDEV_STT_VAL_L1_ACT_DIS);
146
147 iwl_release_nic_access(priv);
148
149out:
150 spin_unlock_irqrestore(&priv->lock, flags);
151
152 return ret;
153}
154
155
103static void iwl5000_nic_config(struct iwl_priv *priv) 156static void iwl5000_nic_config(struct iwl_priv *priv)
104{ 157{
105 unsigned long flags; 158 unsigned long flags;
@@ -805,6 +858,7 @@ static struct iwl_lib_ops iwl5000_lib = {
805 .alive_notify = iwl5000_alive_notify, 858 .alive_notify = iwl5000_alive_notify,
806 .apm_ops = { 859 .apm_ops = {
807 .init = iwl5000_apm_init, 860 .init = iwl5000_apm_init,
861 .reset = iwl5000_apm_reset,
808 .config = iwl5000_nic_config, 862 .config = iwl5000_nic_config,
809 .set_pwr_src = iwl4965_set_pwr_src, 863 .set_pwr_src = iwl4965_set_pwr_src,
810 }, 864 },