aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlegacy/common.c')
-rw-r--r--drivers/net/wireless/iwlegacy/common.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 0d1a643d8b91..f343f27e50af 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -4126,12 +4126,12 @@ il_irq_handle_error(struct il_priv *il)
4126EXPORT_SYMBOL(il_irq_handle_error); 4126EXPORT_SYMBOL(il_irq_handle_error);
4127 4127
4128static int 4128static int
4129il_apm_stop_master(struct il_priv *il) 4129_il_apm_stop_master(struct il_priv *il)
4130{ 4130{
4131 int ret = 0; 4131 int ret = 0;
4132 4132
4133 /* stop device's busmaster DMA activity */ 4133 /* stop device's busmaster DMA activity */
4134 il_set_bit(il, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER); 4134 _il_set_bit(il, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER);
4135 4135
4136 ret = 4136 ret =
4137 _il_poll_bit(il, CSR_RESET, CSR_RESET_REG_FLAG_MASTER_DISABLED, 4137 _il_poll_bit(il, CSR_RESET, CSR_RESET_REG_FLAG_MASTER_DISABLED,
@@ -4145,15 +4145,17 @@ il_apm_stop_master(struct il_priv *il)
4145} 4145}
4146 4146
4147void 4147void
4148il_apm_stop(struct il_priv *il) 4148_il_apm_stop(struct il_priv *il)
4149{ 4149{
4150 lockdep_assert_held(&il->reg_lock);
4151
4150 D_INFO("Stop card, put in low power state\n"); 4152 D_INFO("Stop card, put in low power state\n");
4151 4153
4152 /* Stop device's DMA activity */ 4154 /* Stop device's DMA activity */
4153 il_apm_stop_master(il); 4155 _il_apm_stop_master(il);
4154 4156
4155 /* Reset the entire device */ 4157 /* Reset the entire device */
4156 il_set_bit(il, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET); 4158 _il_set_bit(il, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
4157 4159
4158 udelay(10); 4160 udelay(10);
4159 4161
@@ -4161,7 +4163,18 @@ il_apm_stop(struct il_priv *il)
4161 * Clear "initialization complete" bit to move adapter from 4163 * Clear "initialization complete" bit to move adapter from
4162 * D0A* (powered-up Active) --> D0U* (Uninitialized) state. 4164 * D0A* (powered-up Active) --> D0U* (Uninitialized) state.
4163 */ 4165 */
4164 il_clear_bit(il, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); 4166 _il_clear_bit(il, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
4167}
4168EXPORT_SYMBOL(_il_apm_stop);
4169
4170void
4171il_apm_stop(struct il_priv *il)
4172{
4173 unsigned long flags;
4174
4175 spin_lock_irqsave(&il->reg_lock, flags);
4176 _il_apm_stop(il);
4177 spin_unlock_irqrestore(&il->reg_lock, flags);
4165} 4178}
4166EXPORT_SYMBOL(il_apm_stop); 4179EXPORT_SYMBOL(il_apm_stop);
4167 4180