Lines Matching refs:priv

97 		   struct cw1200_common *priv)
137 static int cw1200_resume_work(struct cw1200_common *priv,
144 return queue_delayed_work(priv->workqueue, work, tmo);
147 int cw1200_can_suspend(struct cw1200_common *priv)
149 if (atomic_read(&priv->bh_rx)) {
150 wiphy_dbg(priv->hw->wiphy, "Suspend interrupted.\n");
159 struct cw1200_common *priv = hw->priv;
160 struct cw1200_pm_state *pm_state = &priv->pm_state;
171 if (priv->tx_queue_stats.num_queued)
175 if (!mutex_trylock(&priv->conf_mutex))
182 if (priv->channel_switch_in_progress)
186 if (priv->join_pending)
190 if (down_trylock(&priv->scan.lock))
194 wsm_lock_tx_async(priv);
199 if (wait_event_timeout(priv->bh_evt_wq,
200 !priv->hw_bufs_used, HZ / 10) <= 0)
204 wsm_set_udp_port_filter(priv, &cw1200_udp_port_filter_on.hdr);
207 wsm_set_ether_type_filter(priv, &cw1200_ether_type_filter_on.hdr);
215 if (!priv->vif->p2p &&
216 priv->join_status == CW1200_JOIN_STATUS_STA &&
217 priv->powersave_mode.mode != WSM_PSM_PS) {
218 state->prev_ps_mode = priv->powersave_mode.mode;
219 priv->powersave_mode.mode = WSM_PSM_PS;
220 cw1200_set_pm(priv, &priv->powersave_mode);
221 if (wait_event_interruptible_timeout(priv->ps_mode_switch_done,
222 !priv->ps_mode_switch_in_progress, 1*HZ) <= 0) {
229 cw1200_suspend_work(&priv->bss_loss_work);
231 cw1200_suspend_work(&priv->join_timeout);
233 cw1200_suspend_work(&priv->scan.probe_work);
235 cw1200_suspend_work(&priv->link_id_gc_work);
237 cancel_delayed_work_sync(&priv->clear_recent_scan_work);
238 atomic_set(&priv->recent_scan, 0);
241 if (priv->join_status == CW1200_JOIN_STATUS_STA &&
242 priv->join_dtim_period &&
243 !priv->has_multicast_subscription) {
245 wsm_set_beacon_wakeup_period(priv,
246 priv->join_dtim_period,
247 CW1200_BEACON_SKIPPING_MULTIPLIER * priv->join_dtim_period);
251 if (cw1200_bh_suspend(priv))
254 ret = timer_pending(&priv->mcast_timeout);
262 ret = priv->hwbus_ops->power_mgmt(priv->hwbus_priv, true);
264 wiphy_err(priv->hw->wiphy,
271 if (atomic_read(&priv->bh_rx)) {
279 WARN_ON(cw1200_bh_resume(priv));
281 cw1200_resume_work(priv, &priv->bss_loss_work,
283 cw1200_resume_work(priv, &priv->join_timeout,
285 cw1200_resume_work(priv, &priv->scan.probe_work,
287 cw1200_resume_work(priv, &priv->link_id_gc_work,
292 wsm_set_udp_port_filter(priv, &cw1200_udp_port_filter_off);
293 wsm_set_ether_type_filter(priv, &cw1200_ether_type_filter_off);
295 wsm_unlock_tx(priv);
296 up(&priv->scan.lock);
298 mutex_unlock(&priv->conf_mutex);
304 struct cw1200_common *priv = hw->priv;
305 struct cw1200_pm_state *pm_state = &priv->pm_state;
312 priv->hwbus_ops->power_mgmt(priv->hwbus_priv, false);
318 up(&priv->scan.lock);
321 WARN_ON(cw1200_bh_resume(priv));
324 if (!priv->vif->p2p && priv->join_status == CW1200_JOIN_STATUS_STA) {
325 priv->powersave_mode.mode = state->prev_ps_mode;
326 cw1200_set_pm(priv, &priv->powersave_mode);
330 wsm_set_beacon_wakeup_period(priv, priv->beacon_int *
331 priv->join_dtim_period >
333 priv->join_dtim_period, 0);
338 cw1200_resume_work(priv, &priv->bss_loss_work,
340 cw1200_resume_work(priv, &priv->join_timeout,
342 cw1200_resume_work(priv, &priv->scan.probe_work,
344 cw1200_resume_work(priv, &priv->link_id_gc_work,
348 wsm_set_udp_port_filter(priv, &cw1200_udp_port_filter_off);
351 wsm_set_ether_type_filter(priv, &cw1200_ether_type_filter_off);
354 wsm_unlock_tx(priv);
357 mutex_unlock(&priv->conf_mutex);