Lines Matching +full:hw +full:- +full:timeout +full:- +full:ms
25 struct ath_hw *ah = sc->sc_ah; in ath_set_channel()
27 struct ieee80211_hw *hw = sc->hw; in ath_set_channel() local
29 struct cfg80211_chan_def *chandef = &sc->cur_chan->chandef; in ath_set_channel()
30 struct ieee80211_channel *chan = chandef->chan; in ath_set_channel()
31 int pos = chan->hw_value; in ath_set_channel()
33 int old_pos = -1; in ath_set_channel()
36 if (test_bit(ATH_OP_INVALID, &common->op_flags)) in ath_set_channel()
37 return -EIO; in ath_set_channel()
39 if (ah->curchan) in ath_set_channel()
40 old_pos = ah->curchan - &ah->channels[0]; in ath_set_channel()
43 chan->center_freq, chandef->width); in ath_set_channel()
46 spin_lock_irqsave(&common->cc_lock, flags); in ath_set_channel()
48 spin_unlock_irqrestore(&common->cc_lock, flags); in ath_set_channel()
50 ath9k_cmn_get_channel(hw, ah, chandef); in ath_set_channel()
52 /* If the operating channel changes, change the survey in-use flags in ath_set_channel()
55 * back to the operating channel from an off-channel operation. in ath_set_channel()
57 if (!sc->cur_chan->offchannel && sc->cur_survey != &sc->survey[pos]) { in ath_set_channel()
58 if (sc->cur_survey) in ath_set_channel()
59 sc->cur_survey->filled &= ~SURVEY_INFO_IN_USE; in ath_set_channel()
61 sc->cur_survey = &sc->survey[pos]; in ath_set_channel()
63 memset(sc->cur_survey, 0, sizeof(struct survey_info)); in ath_set_channel()
64 sc->cur_survey->filled |= SURVEY_INFO_IN_USE; in ath_set_channel()
65 } else if (!(sc->survey[pos].filled & SURVEY_INFO_IN_USE)) { in ath_set_channel()
66 memset(&sc->survey[pos], 0, sizeof(struct survey_info)); in ath_set_channel()
69 hchan = &sc->sc_ah->channels[pos]; in ath_set_channel()
74 /* The most recent snapshot of channel->noisefloor for the old in ath_set_channel()
84 if (hw->conf.radar_enabled) { in ath_set_channel()
92 chan->center_freq); in ath_set_channel()
95 if (test_bit(ATH_OP_SCANNING, &common->op_flags) && in ath_set_channel()
96 sc->spec_priv.spectral_mode == SPECTRAL_CHANSCAN) in ath_set_channel()
97 ath9k_cmn_spectral_scan_trigger(common, &sc->spec_priv); in ath_set_channel()
106 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_chanctx_init()
111 sband = &common->sbands[NL80211_BAND_2GHZ]; in ath_chanctx_init()
112 if (!sband->n_channels) in ath_chanctx_init()
113 sband = &common->sbands[NL80211_BAND_5GHZ]; in ath_chanctx_init()
115 chan = &sband->channels[0]; in ath_chanctx_init()
117 ctx = &sc->chanctx[i]; in ath_chanctx_init()
118 cfg80211_chandef_create(&ctx->chandef, chan, NL80211_CHAN_HT20); in ath_chanctx_init()
119 INIT_LIST_HEAD(&ctx->vifs); in ath_chanctx_init()
120 ctx->txpower = ATH_TXPOWER_MAX; in ath_chanctx_init()
121 ctx->flush_timeout = HZ / 5; /* 200ms */ in ath_chanctx_init()
122 for (j = 0; j < ARRAY_SIZE(ctx->acq); j++) { in ath_chanctx_init()
123 INIT_LIST_HEAD(&ctx->acq[j].acq_new); in ath_chanctx_init()
124 INIT_LIST_HEAD(&ctx->acq[j].acq_old); in ath_chanctx_init()
125 spin_lock_init(&ctx->acq[j].lock); in ath_chanctx_init()
133 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_chanctx_set_channel()
136 spin_lock_bh(&sc->chan_lock); in ath_chanctx_set_channel()
138 memcpy(&ctx->chandef, chandef, sizeof(*chandef)); in ath_chanctx_set_channel()
139 cur_chan = sc->cur_chan == ctx; in ath_chanctx_set_channel()
140 spin_unlock_bh(&sc->chan_lock); in ath_chanctx_set_channel()
163 spin_lock_bh(&sc->chan_lock); in ath_is_go_chanctx_present()
166 if (!ctx->active) in ath_is_go_chanctx_present()
169 list_for_each_entry(avp, &ctx->vifs, list) { in ath_is_go_chanctx_present()
170 vif = avp->vif; in ath_is_go_chanctx_present()
173 spin_unlock_bh(&sc->chan_lock); in ath_is_go_chanctx_present()
179 spin_unlock_bh(&sc->chan_lock); in ath_is_go_chanctx_present()
236 s64 ms = ktime_ms_delta(ts, sc->last_event_time); in chanctx_event_delta() local
238 sc->last_event_time = ts; in chanctx_event_delta()
239 return ms; in chanctx_event_delta()
244 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_chanctx_check_active()
253 if (ctx == &sc->offchannel.chan) { in ath_chanctx_check_active()
254 spin_lock_bh(&sc->chan_lock); in ath_chanctx_check_active()
256 if (likely(sc->sched.channel_switch_time)) in ath_chanctx_check_active()
257 ctx->flush_timeout = in ath_chanctx_check_active()
258 usecs_to_jiffies(sc->sched.channel_switch_time); in ath_chanctx_check_active()
260 ctx->flush_timeout = in ath_chanctx_check_active()
263 spin_unlock_bh(&sc->chan_lock); in ath_chanctx_check_active()
275 list_for_each_entry(avp, &ctx->vifs, list) { in ath_chanctx_check_active()
276 struct ieee80211_vif *vif = avp->vif; in ath_chanctx_check_active()
278 switch (vif->type) { in ath_chanctx_check_active()
281 if (avp->assoc) in ath_chanctx_check_active()
289 ctx->active = active; in ath_chanctx_check_active()
292 if (!ctx->assigned || list_empty(&ctx->vifs)) in ath_chanctx_check_active()
297 spin_lock_bh(&sc->chan_lock); in ath_chanctx_check_active()
300 ictx->flush_timeout = HZ / 5; in ath_chanctx_check_active()
301 clear_bit(ATH_OP_MULTI_CHANNEL, &common->op_flags); in ath_chanctx_check_active()
302 spin_unlock_bh(&sc->chan_lock); in ath_chanctx_check_active()
306 ictx->flush_timeout = usecs_to_jiffies(sc->sched.channel_switch_time); in ath_chanctx_check_active()
308 if (test_and_set_bit(ATH_OP_MULTI_CHANNEL, &common->op_flags)) { in ath_chanctx_check_active()
309 spin_unlock_bh(&sc->chan_lock); in ath_chanctx_check_active()
313 spin_unlock_bh(&sc->chan_lock); in ath_chanctx_check_active()
324 int idx = ctx - &sc->chanctx[0]; in ath_chanctx_get_next()
326 return &sc->chanctx[!idx]; in ath_chanctx_get_next()
336 beacon_int = TU_TO_USEC(sc->cur_chan->beacon.beacon_interval); in ath_chanctx_adjust_tbtt_delta()
338 cur = sc->cur_chan; in ath_chanctx_adjust_tbtt_delta()
341 if (!prev->switch_after_beacon) in ath_chanctx_adjust_tbtt_delta()
345 cur_tsf = (u32) cur->tsf_val + in ath_chanctx_adjust_tbtt_delta()
346 ath9k_hw_get_tsf_offset(cur->tsf_ts, ts); in ath_chanctx_adjust_tbtt_delta()
348 prev_tsf = prev->last_beacon - (u32) prev->tsf_val + cur_tsf; in ath_chanctx_adjust_tbtt_delta()
349 prev_tsf -= ath9k_hw_get_tsf_offset(prev->tsf_ts, ts); in ath_chanctx_adjust_tbtt_delta()
354 offset = cur_tsf - prev_tsf; in ath_chanctx_adjust_tbtt_delta()
360 offset = beacon_int / 2 - (offset % beacon_int); in ath_chanctx_adjust_tbtt_delta()
361 prev->tsf_val += offset; in ath_chanctx_adjust_tbtt_delta()
370 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_chanctx_setup_timer()
371 struct ath_hw *ah = sc->sc_ah; in ath_chanctx_setup_timer()
372 unsigned long timeout; in ath_chanctx_setup_timer() local
374 ath9k_hw_gen_timer_start(ah, sc->p2p_ps_timer, tsf_time, 1000000); in ath_chanctx_setup_timer()
375 tsf_time -= ath9k_hw_gettsf32(ah); in ath_chanctx_setup_timer()
376 timeout = msecs_to_jiffies(tsf_time / 1000) + 1; in ath_chanctx_setup_timer()
377 mod_timer(&sc->sched.timer, jiffies + timeout); in ath_chanctx_setup_timer()
380 "Setup chanctx timer with timeout: %d (%d) ms\n", in ath_chanctx_setup_timer()
381 tsf_time / 1000, jiffies_to_msecs(timeout)); in ath_chanctx_setup_timer()
394 if (ctx->active && sc->sched.extend_absence) { in ath_chanctx_handle_bmiss()
395 avp->noa_duration = 0; in ath_chanctx_handle_bmiss()
396 sc->sched.extend_absence = false; in ath_chanctx_handle_bmiss()
403 if (ctx->active && sc->sched.beacon_miss >= 2) { in ath_chanctx_handle_bmiss()
404 avp->noa_duration = 0; in ath_chanctx_handle_bmiss()
405 sc->sched.extend_absence = true; in ath_chanctx_handle_bmiss()
414 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_chanctx_offchannel_noa()
416 avp->noa_index++; in ath_chanctx_offchannel_noa()
417 avp->offchannel_start = tsf_time; in ath_chanctx_offchannel_noa()
418 avp->offchannel_duration = sc->sched.offchannel_duration; in ath_chanctx_offchannel_noa()
422 avp->offchannel_duration, in ath_chanctx_offchannel_noa()
423 avp->offchannel_start, in ath_chanctx_offchannel_noa()
424 avp->noa_index); in ath_chanctx_offchannel_noa()
431 if (ctx->active && avp->noa_duration) in ath_chanctx_offchannel_noa()
432 avp->noa_duration = 0; in ath_chanctx_offchannel_noa()
441 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_chanctx_set_periodic_noa()
443 avp->noa_index++; in ath_chanctx_set_periodic_noa()
444 avp->noa_start = tsf_time; in ath_chanctx_set_periodic_noa()
446 if (sc->sched.extend_absence) in ath_chanctx_set_periodic_noa()
447 avp->noa_duration = (3 * beacon_int / 2) + in ath_chanctx_set_periodic_noa()
448 sc->sched.channel_switch_time; in ath_chanctx_set_periodic_noa()
450 avp->noa_duration = in ath_chanctx_set_periodic_noa()
451 TU_TO_USEC(cur_conf->beacon_interval) / 2 + in ath_chanctx_set_periodic_noa()
452 sc->sched.channel_switch_time; in ath_chanctx_set_periodic_noa()
454 if (test_bit(ATH_OP_SCANNING, &common->op_flags) || in ath_chanctx_set_periodic_noa()
455 sc->sched.extend_absence) in ath_chanctx_set_periodic_noa()
456 avp->periodic_noa = false; in ath_chanctx_set_periodic_noa()
458 avp->periodic_noa = true; in ath_chanctx_set_periodic_noa()
462 avp->noa_duration, in ath_chanctx_set_periodic_noa()
463 avp->noa_start, in ath_chanctx_set_periodic_noa()
464 avp->noa_index, in ath_chanctx_set_periodic_noa()
465 avp->periodic_noa); in ath_chanctx_set_periodic_noa()
473 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_chanctx_set_oneshot_noa()
475 avp->noa_index++; in ath_chanctx_set_oneshot_noa()
476 avp->noa_start = tsf_time; in ath_chanctx_set_oneshot_noa()
477 avp->periodic_noa = false; in ath_chanctx_set_oneshot_noa()
478 avp->oneshot_noa = true; in ath_chanctx_set_oneshot_noa()
479 avp->noa_duration = duration + sc->sched.channel_switch_time; in ath_chanctx_set_oneshot_noa()
483 avp->noa_duration, in ath_chanctx_set_oneshot_noa()
484 avp->noa_start, in ath_chanctx_set_oneshot_noa()
485 avp->noa_index, in ath_chanctx_set_oneshot_noa()
486 avp->periodic_noa); in ath_chanctx_set_oneshot_noa()
492 struct ath_hw *ah = sc->sc_ah; in ath_chanctx_event()
501 avp = (struct ath_vif *) vif->drv_priv; in ath_chanctx_event()
503 spin_lock_bh(&sc->chan_lock); in ath_chanctx_event()
505 ath_dbg(common, CHAN_CTX, "cur_chan: %d MHz, event: %s, state: %s, delta: %u ms\n", in ath_chanctx_event()
506 sc->cur_chan->chandef.center_freq1, in ath_chanctx_event()
508 chanctx_state_string(sc->sched.state), in ath_chanctx_event()
513 if (avp->offchannel_duration) in ath_chanctx_event()
514 avp->offchannel_duration = 0; in ath_chanctx_event()
516 if (avp->oneshot_noa) { in ath_chanctx_event()
517 avp->noa_duration = 0; in ath_chanctx_event()
518 avp->oneshot_noa = false; in ath_chanctx_event()
524 if (avp->chanctx != sc->cur_chan) { in ath_chanctx_event()
530 if (sc->sched.offchannel_pending && !sc->sched.wait_switch) { in ath_chanctx_event()
531 sc->sched.offchannel_pending = false; in ath_chanctx_event()
532 sc->next_chan = &sc->offchannel.chan; in ath_chanctx_event()
533 sc->sched.state = ATH_CHANCTX_STATE_WAIT_FOR_BEACON; in ath_chanctx_event()
538 ctx = ath_chanctx_get_next(sc, sc->cur_chan); in ath_chanctx_event()
539 if (ctx->active && sc->sched.state == ATH_CHANCTX_STATE_IDLE) { in ath_chanctx_event()
540 sc->next_chan = ctx; in ath_chanctx_event()
541 sc->sched.state = ATH_CHANCTX_STATE_WAIT_FOR_BEACON; in ath_chanctx_event()
547 if (sc->sched.state == ATH_CHANCTX_STATE_WAIT_FOR_TIMER) { in ath_chanctx_event()
548 sc->sched.state = ATH_CHANCTX_STATE_WAIT_FOR_BEACON; in ath_chanctx_event()
553 if (sc->sched.mgd_prepare_tx) in ath_chanctx_event()
554 sc->sched.state = ATH_CHANCTX_STATE_WAIT_FOR_BEACON; in ath_chanctx_event()
562 if (!ctx->active && avp->noa_duration && in ath_chanctx_event()
563 sc->sched.state != ATH_CHANCTX_STATE_WAIT_FOR_BEACON) { in ath_chanctx_event()
564 avp->noa_duration = 0; in ath_chanctx_event()
565 avp->periodic_noa = false; in ath_chanctx_event()
571 if (sc->sched.state != ATH_CHANCTX_STATE_WAIT_FOR_BEACON) in ath_chanctx_event()
574 ath_dbg(common, CHAN_CTX, "Preparing beacon for vif: %pM\n", vif->addr); in ath_chanctx_event()
576 sc->sched.beacon_pending = true; in ath_chanctx_event()
577 sc->sched.next_tbtt = REG_READ(ah, AR_NEXT_TBTT_TIMER); in ath_chanctx_event()
579 cur_conf = &sc->cur_chan->beacon; in ath_chanctx_event()
580 beacon_int = TU_TO_USEC(cur_conf->beacon_interval); in ath_chanctx_event()
583 tsf_time = sc->sched.next_tbtt + beacon_int / 4; in ath_chanctx_event()
584 sc->sched.switch_start_time = tsf_time; in ath_chanctx_event()
585 sc->cur_chan->last_beacon = sc->sched.next_tbtt; in ath_chanctx_event()
589 * a beacon transmission, update the NoA with one-shot in ath_chanctx_event()
592 if (sc->next_chan == &sc->offchannel.chan) { in ath_chanctx_event()
601 * a one-shot NoA needs to be sent. This can happen in ath_chanctx_event()
602 * with one or more active channel contexts - in both in ath_chanctx_event()
605 if (sc->sched.mgd_prepare_tx) { in ath_chanctx_event()
611 /* Prevent wrap-around issues */ in ath_chanctx_event()
612 if (avp->noa_duration && tsf_time - avp->noa_start > BIT(30)) in ath_chanctx_event()
613 avp->noa_duration = 0; in ath_chanctx_event()
620 if (ctx->active && in ath_chanctx_event()
621 (!avp->noa_duration || sc->sched.force_noa_update)) in ath_chanctx_event()
625 if (ctx->active && sc->sched.force_noa_update) in ath_chanctx_event()
626 sc->sched.force_noa_update = false; in ath_chanctx_event()
630 if (!sc->sched.beacon_pending) { in ath_chanctx_event()
636 sc->sched.beacon_pending = false; in ath_chanctx_event()
638 if (sc->sched.mgd_prepare_tx) { in ath_chanctx_event()
639 sc->sched.mgd_prepare_tx = false; in ath_chanctx_event()
640 complete(&sc->go_beacon); in ath_chanctx_event()
646 if (sc->sched.state != ATH_CHANCTX_STATE_WAIT_FOR_BEACON) in ath_chanctx_event()
652 sc->sched.state = ATH_CHANCTX_STATE_WAIT_FOR_TIMER; in ath_chanctx_event()
653 ath_chanctx_setup_timer(sc, sc->sched.switch_start_time); in ath_chanctx_event()
656 if (sc->sched.state != ATH_CHANCTX_STATE_WAIT_FOR_TIMER) in ath_chanctx_event()
659 if (!sc->cur_chan->switch_after_beacon && in ath_chanctx_event()
660 sc->sched.beacon_pending) in ath_chanctx_event()
661 sc->sched.beacon_miss++; in ath_chanctx_event()
666 sc->sched.state = ATH_CHANCTX_STATE_SWITCH; in ath_chanctx_event()
667 ieee80211_queue_work(sc->hw, &sc->chanctx_work); in ath_chanctx_event()
670 if (!test_bit(ATH_OP_MULTI_CHANNEL, &common->op_flags) || in ath_chanctx_event()
671 sc->cur_chan == &sc->offchannel.chan) in ath_chanctx_event()
674 sc->sched.beacon_pending = false; in ath_chanctx_event()
675 sc->sched.beacon_miss = 0; in ath_chanctx_event()
677 if (sc->sched.state == ATH_CHANCTX_STATE_FORCE_ACTIVE || in ath_chanctx_event()
678 !sc->sched.beacon_adjust || in ath_chanctx_event()
679 !sc->cur_chan->tsf_val) in ath_chanctx_event()
687 tsf_time = sc->sched.switch_start_time; in ath_chanctx_event()
688 tsf_time -= (u32) sc->cur_chan->tsf_val + in ath_chanctx_event()
689 ath9k_hw_get_tsf_offset(sc->cur_chan->tsf_ts, 0); in ath_chanctx_event()
692 sc->sched.beacon_adjust = false; in ath_chanctx_event()
696 if (sc->sched.state != ATH_CHANCTX_STATE_FORCE_ACTIVE || in ath_chanctx_event()
697 avp->chanctx != sc->cur_chan) in ath_chanctx_event()
703 sc->sched.state = ATH_CHANCTX_STATE_IDLE; in ath_chanctx_event()
706 if (!test_bit(ATH_OP_MULTI_CHANNEL, &common->op_flags) || in ath_chanctx_event()
707 sc->sched.state == ATH_CHANCTX_STATE_FORCE_ACTIVE || in ath_chanctx_event()
708 sc->cur_chan->switch_after_beacon || in ath_chanctx_event()
709 sc->cur_chan == &sc->offchannel.chan) in ath_chanctx_event()
715 sc->next_chan = ath_chanctx_get_next(sc, sc->cur_chan); in ath_chanctx_event()
716 cur_conf = &sc->cur_chan->beacon; in ath_chanctx_event()
721 sc->sched.state = ATH_CHANCTX_STATE_WAIT_FOR_TIMER; in ath_chanctx_event()
722 sc->sched.wait_switch = false; in ath_chanctx_event()
724 tsf_time = TU_TO_USEC(cur_conf->beacon_interval) / 2; in ath_chanctx_event()
726 if (sc->sched.extend_absence) { in ath_chanctx_event()
727 sc->sched.beacon_miss = 0; in ath_chanctx_event()
731 tsf_time -= sc->sched.channel_switch_time; in ath_chanctx_event()
732 tsf_time += ath9k_hw_gettsf32(sc->sc_ah); in ath_chanctx_event()
733 sc->sched.switch_start_time = tsf_time; in ath_chanctx_event()
736 sc->sched.beacon_pending = true; in ath_chanctx_event()
737 sc->sched.beacon_adjust = true; in ath_chanctx_event()
740 if (sc->cur_chan == &sc->offchannel.chan || in ath_chanctx_event()
741 sc->cur_chan->switch_after_beacon) in ath_chanctx_event()
744 sc->next_chan = ath_chanctx_get_next(sc, sc->cur_chan); in ath_chanctx_event()
745 ieee80211_queue_work(sc->hw, &sc->chanctx_work); in ath_chanctx_event()
748 if (sc->cur_chan->assigned) { in ath_chanctx_event()
749 if (sc->next_chan && !sc->next_chan->assigned && in ath_chanctx_event()
750 sc->next_chan != &sc->offchannel.chan) in ath_chanctx_event()
751 sc->sched.state = ATH_CHANCTX_STATE_IDLE; in ath_chanctx_event()
755 ctx = ath_chanctx_get_next(sc, sc->cur_chan); in ath_chanctx_event()
756 sc->sched.state = ATH_CHANCTX_STATE_IDLE; in ath_chanctx_event()
757 if (!ctx->assigned) in ath_chanctx_event()
760 sc->next_chan = ctx; in ath_chanctx_event()
761 ieee80211_queue_work(sc->hw, &sc->chanctx_work); in ath_chanctx_event()
769 spin_unlock_bh(&sc->chan_lock); in ath_chanctx_event()
775 if (sc->sched.beacon_pending) in ath_chanctx_beacon_sent_ev()
788 struct cfg80211_scan_request *req = sc->offchannel.scan_req; in ath_scan_channel_duration()
790 if (!req->n_ssids || (chan->flags & IEEE80211_CHAN_NO_IR)) in ath_scan_channel_duration()
791 return (HZ / 9); /* ~110 ms */ in ath_scan_channel_duration()
793 return (HZ / 16); /* ~60 ms */ in ath_scan_channel_duration()
799 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_chanctx_switch()
801 spin_lock_bh(&sc->chan_lock); in ath_chanctx_switch()
803 if (test_bit(ATH_OP_MULTI_CHANNEL, &common->op_flags) && in ath_chanctx_switch()
804 (sc->cur_chan != ctx) && (ctx == &sc->offchannel.chan)) { in ath_chanctx_switch()
806 ctx->chandef = *chandef; in ath_chanctx_switch()
808 sc->sched.offchannel_pending = true; in ath_chanctx_switch()
809 sc->sched.wait_switch = true; in ath_chanctx_switch()
810 sc->sched.offchannel_duration = in ath_chanctx_switch()
811 jiffies_to_usecs(sc->offchannel.duration) + in ath_chanctx_switch()
812 sc->sched.channel_switch_time; in ath_chanctx_switch()
814 spin_unlock_bh(&sc->chan_lock); in ath_chanctx_switch()
820 sc->next_chan = ctx; in ath_chanctx_switch()
822 ctx->chandef = *chandef; in ath_chanctx_switch()
824 "Assigned next_chan to %d MHz\n", chandef->center_freq1); in ath_chanctx_switch()
827 if (sc->next_chan == &sc->offchannel.chan) { in ath_chanctx_switch()
828 sc->sched.offchannel_duration = in ath_chanctx_switch()
829 jiffies_to_usecs(sc->offchannel.duration) + in ath_chanctx_switch()
830 sc->sched.channel_switch_time; in ath_chanctx_switch()
835 chandef->center_freq1, in ath_chanctx_switch()
836 sc->sched.offchannel_duration); in ath_chanctx_switch()
839 spin_unlock_bh(&sc->chan_lock); in ath_chanctx_switch()
840 ieee80211_queue_work(sc->hw, &sc->chanctx_work); in ath_chanctx_switch()
846 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_chanctx_offchan_switch()
853 ath_chanctx_switch(sc, &sc->offchannel.chan, &chandef); in ath_chanctx_offchan_switch()
862 if (!ctx->assigned || list_empty(&ctx->vifs)) in ath_chanctx_get_oper_chan()
864 if (active && !ctx->active) in ath_chanctx_get_oper_chan()
867 if (ctx->switch_after_beacon) in ath_chanctx_get_oper_chan()
871 return &sc->chanctx[0]; in ath_chanctx_get_oper_chan()
877 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_scan_next_channel()
878 struct cfg80211_scan_request *req = sc->offchannel.scan_req; in ath_scan_next_channel()
881 if (sc->offchannel.scan_idx >= req->n_channels) { in ath_scan_next_channel()
885 sc->offchannel.scan_idx, in ath_scan_next_channel()
886 req->n_channels); in ath_scan_next_channel()
888 sc->offchannel.state = ATH_OFFCHANNEL_IDLE; in ath_scan_next_channel()
896 sc->offchannel.scan_idx); in ath_scan_next_channel()
898 chan = req->channels[sc->offchannel.scan_idx++]; in ath_scan_next_channel()
899 sc->offchannel.duration = ath_scan_channel_duration(sc, chan); in ath_scan_next_channel()
900 sc->offchannel.state = ATH_OFFCHANNEL_PROBE_SEND; in ath_scan_next_channel()
909 if (sc->offchannel.scan_req) { in ath_offchannel_next()
910 vif = sc->offchannel.scan_vif; in ath_offchannel_next()
911 sc->offchannel.chan.txpower = vif->bss_conf.txpower; in ath_offchannel_next()
913 } else if (sc->offchannel.roc_vif) { in ath_offchannel_next()
914 vif = sc->offchannel.roc_vif; in ath_offchannel_next()
915 sc->offchannel.chan.txpower = vif->bss_conf.txpower; in ath_offchannel_next()
916 sc->offchannel.duration = in ath_offchannel_next()
917 msecs_to_jiffies(sc->offchannel.roc_duration); in ath_offchannel_next()
918 sc->offchannel.state = ATH_OFFCHANNEL_ROC_START; in ath_offchannel_next()
919 ath_chanctx_offchan_switch(sc, sc->offchannel.roc_chan); in ath_offchannel_next()
921 spin_lock_bh(&sc->chan_lock); in ath_offchannel_next()
922 sc->sched.offchannel_pending = false; in ath_offchannel_next()
923 sc->sched.wait_switch = false; in ath_offchannel_next()
924 spin_unlock_bh(&sc->chan_lock); in ath_offchannel_next()
928 sc->offchannel.state = ATH_OFFCHANNEL_IDLE; in ath_offchannel_next()
929 if (sc->ps_idle) in ath_offchannel_next()
936 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_roc_complete()
938 sc->offchannel.roc_vif = NULL; in ath_roc_complete()
939 sc->offchannel.roc_chan = NULL; in ath_roc_complete()
944 ieee80211_remain_on_channel_expired(sc->hw); in ath_roc_complete()
948 ieee80211_remain_on_channel_expired(sc->hw); in ath_roc_complete()
961 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_scan_complete()
967 ath_dbg(common, CHAN_CTX, "HW scan aborted\n"); in ath_scan_complete()
969 ath_dbg(common, CHAN_CTX, "HW scan complete\n"); in ath_scan_complete()
971 sc->offchannel.scan_req = NULL; in ath_scan_complete()
972 sc->offchannel.scan_vif = NULL; in ath_scan_complete()
973 sc->offchannel.state = ATH_OFFCHANNEL_IDLE; in ath_scan_complete()
974 ieee80211_scan_completed(sc->hw, &info); in ath_scan_complete()
975 clear_bit(ATH_OP_SCANNING, &common->op_flags); in ath_scan_complete()
976 spin_lock_bh(&sc->chan_lock); in ath_scan_complete()
977 if (test_bit(ATH_OP_MULTI_CHANNEL, &common->op_flags)) in ath_scan_complete()
978 sc->sched.force_noa_update = true; in ath_scan_complete()
979 spin_unlock_bh(&sc->chan_lock); in ath_scan_complete()
987 struct cfg80211_scan_request *req = sc->offchannel.scan_req; in ath_scan_send_probe()
988 struct ieee80211_vif *vif = sc->offchannel.scan_vif; in ath_scan_send_probe()
992 int band = sc->offchannel.chan.chandef.chan->band; in ath_scan_send_probe()
994 skb = ieee80211_probereq_get(sc->hw, vif->addr, in ath_scan_send_probe()
995 ssid->ssid, ssid->ssid_len, req->ie_len); in ath_scan_send_probe()
1000 if (req->no_cck) in ath_scan_send_probe()
1001 info->flags |= IEEE80211_TX_CTL_NO_CCK_RATE; in ath_scan_send_probe()
1003 if (req->ie_len) in ath_scan_send_probe()
1004 skb_put_data(skb, req->ie, req->ie_len); in ath_scan_send_probe()
1008 if (!ieee80211_tx_prepare_skb(sc->hw, vif, skb, band, NULL)) in ath_scan_send_probe()
1011 txctl.txq = sc->tx.txq_map[IEEE80211_AC_VO]; in ath_scan_send_probe()
1012 if (ath_tx_start(sc->hw, skb, &txctl)) in ath_scan_send_probe()
1018 ieee80211_free_txskb(sc->hw, skb); in ath_scan_send_probe()
1023 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_scan_channel_start()
1024 struct cfg80211_scan_request *req = sc->offchannel.scan_req; in ath_scan_channel_start()
1027 if (!(sc->cur_chan->chandef.chan->flags & IEEE80211_CHAN_NO_IR) && in ath_scan_channel_start()
1028 req->n_ssids) { in ath_scan_channel_start()
1029 for (i = 0; i < req->n_ssids; i++) in ath_scan_channel_start()
1030 ath_scan_send_probe(sc, &req->ssids[i]); in ath_scan_channel_start()
1037 sc->offchannel.state = ATH_OFFCHANNEL_PROBE_WAIT; in ath_scan_channel_start()
1038 mod_timer(&sc->offchannel.timer, jiffies + sc->offchannel.duration); in ath_scan_channel_start()
1044 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_chanctx_timer()
1056 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_offchannel_timer()
1059 __func__, offchannel_state_string(sc->offchannel.state)); in ath_offchannel_timer()
1061 switch (sc->offchannel.state) { in ath_offchannel_timer()
1063 if (!sc->offchannel.scan_req) in ath_offchannel_timer()
1068 if (ctx->active) { in ath_offchannel_timer()
1073 sc->offchannel.state = ATH_OFFCHANNEL_SUSPEND; in ath_offchannel_timer()
1075 mod_timer(&sc->offchannel.timer, jiffies + HZ / 10); in ath_offchannel_timer()
1080 if (!sc->offchannel.scan_req) in ath_offchannel_timer()
1087 sc->offchannel.state = ATH_OFFCHANNEL_ROC_DONE; in ath_offchannel_timer()
1099 struct ieee80211_vif *vif = avp->vif; in ath_chanctx_send_vif_ps_frame()
1104 int band = sc->cur_chan->chandef.chan->band; in ath_chanctx_send_vif_ps_frame()
1106 switch (vif->type) { in ath_chanctx_send_vif_ps_frame()
1108 if (!avp->assoc) in ath_chanctx_send_vif_ps_frame()
1111 skb = ieee80211_nullfunc_get(sc->hw, vif, -1, false); in ath_chanctx_send_vif_ps_frame()
1115 nullfunc = (struct ieee80211_hdr_3addr *) skb->data; in ath_chanctx_send_vif_ps_frame()
1117 nullfunc->frame_control |= in ath_chanctx_send_vif_ps_frame()
1120 skb->priority = 7; in ath_chanctx_send_vif_ps_frame()
1122 if (!ieee80211_tx_prepare_skb(sc->hw, vif, skb, band, &sta)) { in ath_chanctx_send_vif_ps_frame()
1132 txctl.txq = sc->tx.txq_map[IEEE80211_AC_VO]; in ath_chanctx_send_vif_ps_frame()
1134 if (ath_tx_start(sc->hw, skb, &txctl)) { in ath_chanctx_send_vif_ps_frame()
1135 ieee80211_free_txskb(sc->hw, skb); in ath_chanctx_send_vif_ps_frame()
1149 list_for_each_entry(avp, &sc->cur_chan->vifs, list) { in ath_chanctx_send_ps_frame()
1160 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_chanctx_defer_switch()
1162 if (sc->cur_chan == &sc->offchannel.chan) in ath_chanctx_defer_switch()
1165 switch (sc->sched.state) { in ath_chanctx_defer_switch()
1169 if (!sc->cur_chan->switch_after_beacon) in ath_chanctx_defer_switch()
1175 sc->sched.state = ATH_CHANCTX_STATE_WAIT_FOR_BEACON; in ath_chanctx_defer_switch()
1186 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_offchannel_channel_change()
1189 __func__, offchannel_state_string(sc->offchannel.state)); in ath_offchannel_channel_change()
1191 switch (sc->offchannel.state) { in ath_offchannel_channel_change()
1193 if (!sc->offchannel.scan_req) in ath_offchannel_channel_change()
1196 if (sc->cur_chan->chandef.chan != in ath_offchannel_channel_change()
1197 sc->offchannel.chan.chandef.chan) in ath_offchannel_channel_change()
1203 if (!sc->offchannel.scan_req) in ath_offchannel_channel_change()
1209 if (sc->cur_chan != &sc->offchannel.chan) in ath_offchannel_channel_change()
1212 sc->offchannel.state = ATH_OFFCHANNEL_ROC_WAIT; in ath_offchannel_channel_change()
1213 mod_timer(&sc->offchannel.timer, in ath_offchannel_channel_change()
1214 jiffies + sc->offchannel.duration); in ath_offchannel_channel_change()
1215 ieee80211_ready_on_channel(sc->hw); in ath_offchannel_channel_change()
1226 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_chanctx_set_next()
1233 spin_lock_bh(&sc->chan_lock); in ath_chanctx_set_next()
1234 if (!sc->next_chan) { in ath_chanctx_set_next()
1235 spin_unlock_bh(&sc->chan_lock); in ath_chanctx_set_next()
1240 spin_unlock_bh(&sc->chan_lock); in ath_chanctx_set_next()
1247 sc->cur_chan->chandef.center_freq1, in ath_chanctx_set_next()
1248 sc->next_chan->chandef.center_freq1); in ath_chanctx_set_next()
1250 if (sc->cur_chan != sc->next_chan) { in ath_chanctx_set_next()
1253 sc->cur_chan->chandef.center_freq1); in ath_chanctx_set_next()
1254 sc->cur_chan->stopped = true; in ath_chanctx_set_next()
1255 spin_unlock_bh(&sc->chan_lock); in ath_chanctx_set_next()
1257 if (sc->next_chan == &sc->offchannel.chan) { in ath_chanctx_set_next()
1262 ath9k_chanctx_stop_queues(sc, sc->cur_chan); in ath_chanctx_set_next()
1265 __ath9k_flush(sc->hw, ~0, true, false, false); in ath_chanctx_set_next()
1268 __ath9k_flush(sc->hw, BIT(IEEE80211_AC_VO), in ath_chanctx_set_next()
1272 spin_lock_bh(&sc->chan_lock); in ath_chanctx_set_next()
1274 if (sc->cur_chan != &sc->offchannel.chan) { in ath_chanctx_set_next()
1275 sc->cur_chan->tsf_ts = ktime_get_raw(); in ath_chanctx_set_next()
1276 sc->cur_chan->tsf_val = ath9k_hw_gettsf64(sc->sc_ah); in ath_chanctx_set_next()
1279 old_ctx = sc->cur_chan; in ath_chanctx_set_next()
1280 sc->cur_chan = sc->next_chan; in ath_chanctx_set_next()
1281 sc->cur_chan->stopped = false; in ath_chanctx_set_next()
1282 sc->next_chan = NULL; in ath_chanctx_set_next()
1284 if (!sc->sched.offchannel_pending) in ath_chanctx_set_next()
1285 sc->sched.offchannel_duration = 0; in ath_chanctx_set_next()
1287 if (sc->sched.state != ATH_CHANCTX_STATE_FORCE_ACTIVE) in ath_chanctx_set_next()
1288 sc->sched.state = ATH_CHANCTX_STATE_IDLE; in ath_chanctx_set_next()
1290 spin_unlock_bh(&sc->chan_lock); in ath_chanctx_set_next()
1292 if (sc->sc_ah->chip_fullsleep || in ath_chanctx_set_next()
1293 memcmp(&sc->cur_chandef, &sc->cur_chan->chandef, in ath_chanctx_set_next()
1294 sizeof(sc->cur_chandef))) { in ath_chanctx_set_next()
1297 __func__, sc->cur_chan->chandef.center_freq1); in ath_chanctx_set_next()
1300 sc->sched.channel_switch_time = in ath_chanctx_set_next()
1323 mutex_lock(&sc->mutex); in ath_chanctx_work()
1325 mutex_unlock(&sc->mutex); in ath_chanctx_work()
1331 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_offchannel_init()
1336 sband = &common->sbands[NL80211_BAND_2GHZ]; in ath9k_offchannel_init()
1337 if (!sband->n_channels) in ath9k_offchannel_init()
1338 sband = &common->sbands[NL80211_BAND_5GHZ]; in ath9k_offchannel_init()
1340 chan = &sband->channels[0]; in ath9k_offchannel_init()
1342 ctx = &sc->offchannel.chan; in ath9k_offchannel_init()
1343 INIT_LIST_HEAD(&ctx->vifs); in ath9k_offchannel_init()
1344 ctx->txpower = ATH_TXPOWER_MAX; in ath9k_offchannel_init()
1345 cfg80211_chandef_create(&ctx->chandef, chan, NL80211_CHAN_HT20); in ath9k_offchannel_init()
1347 for (i = 0; i < ARRAY_SIZE(ctx->acq); i++) { in ath9k_offchannel_init()
1348 INIT_LIST_HEAD(&ctx->acq[i].acq_new); in ath9k_offchannel_init()
1349 INIT_LIST_HEAD(&ctx->acq[i].acq_old); in ath9k_offchannel_init()
1350 spin_lock_init(&ctx->acq[i].lock); in ath9k_offchannel_init()
1353 sc->offchannel.chan.offchannel = true; in ath9k_offchannel_init()
1358 INIT_WORK(&sc->chanctx_work, ath_chanctx_work); in ath9k_init_channel_context()
1360 timer_setup(&sc->offchannel.timer, ath_offchannel_timer, 0); in ath9k_init_channel_context()
1361 timer_setup(&sc->sched.timer, ath_chanctx_timer, 0); in ath9k_init_channel_context()
1363 init_completion(&sc->go_beacon); in ath9k_init_channel_context()
1368 cancel_work_sync(&sc->chanctx_work); in ath9k_deinit_channel_context()
1382 struct ath_hw *ah = sc->sc_ah; in ath9k_chanctx_stop_queues()
1385 if (ctx == &sc->offchannel.chan) { in ath9k_chanctx_stop_queues()
1386 ieee80211_stop_queue(sc->hw, in ath9k_chanctx_stop_queues()
1387 sc->hw->offchannel_tx_hw_queue); in ath9k_chanctx_stop_queues()
1390 ieee80211_stop_queue(sc->hw, in ath9k_chanctx_stop_queues()
1391 ctx->hw_queue_base + i); in ath9k_chanctx_stop_queues()
1394 if (ah->opmode == NL80211_IFTYPE_AP) in ath9k_chanctx_stop_queues()
1395 ieee80211_stop_queue(sc->hw, sc->hw->queues - 2); in ath9k_chanctx_stop_queues()
1401 struct ath_hw *ah = sc->sc_ah; in ath9k_chanctx_wake_queues()
1404 if (ctx == &sc->offchannel.chan) { in ath9k_chanctx_wake_queues()
1405 ieee80211_wake_queue(sc->hw, in ath9k_chanctx_wake_queues()
1406 sc->hw->offchannel_tx_hw_queue); in ath9k_chanctx_wake_queues()
1409 ieee80211_wake_queue(sc->hw, in ath9k_chanctx_wake_queues()
1410 ctx->hw_queue_base + i); in ath9k_chanctx_wake_queues()
1413 if (ah->opmode == NL80211_IFTYPE_AP) in ath9k_chanctx_wake_queues()
1414 ieee80211_wake_queue(sc->hw, sc->hw->queues - 2); in ath9k_chanctx_wake_queues()
1423 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_update_p2p_ps_timer()
1424 struct ath_hw *ah = sc->sc_ah; in ath9k_update_p2p_ps_timer()
1427 if (!avp || !avp->noa.has_next_tsf) in ath9k_update_p2p_ps_timer()
1430 ath9k_hw_gen_timer_stop(ah, sc->p2p_ps_timer); in ath9k_update_p2p_ps_timer()
1432 tsf = ath9k_hw_gettsf32(sc->sc_ah); in ath9k_update_p2p_ps_timer()
1434 target_tsf = avp->noa.next_tsf; in ath9k_update_p2p_ps_timer()
1435 if (!avp->noa.absent) in ath9k_update_p2p_ps_timer()
1436 target_tsf -= ATH_P2P_PS_STOP_TIME; in ath9k_update_p2p_ps_timer()
1440 if (target_tsf - tsf < ATH_P2P_PS_STOP_TIME) in ath9k_update_p2p_ps_timer()
1444 __func__, avp->noa.absent, tsf, target_tsf, in ath9k_update_p2p_ps_timer()
1445 (target_tsf - tsf) / 1000); in ath9k_update_p2p_ps_timer()
1447 ath9k_hw_gen_timer_start(ah, sc->p2p_ps_timer, target_tsf, 1000000); in ath9k_update_p2p_ps_timer()
1452 struct ath_vif *avp = (void *)vif->drv_priv; in ath9k_update_p2p_ps()
1455 if (!sc->p2p_ps_timer) in ath9k_update_p2p_ps()
1458 if (vif->type != NL80211_IFTYPE_STATION) in ath9k_update_p2p_ps()
1461 sc->p2p_ps_vif = avp; in ath9k_update_p2p_ps()
1463 if (sc->ps_flags & PS_BEACON_SYNC) in ath9k_update_p2p_ps()
1466 tsf = ath9k_hw_gettsf32(sc->sc_ah); in ath9k_update_p2p_ps()
1467 ieee80211_parse_p2p_noa(&vif->bss_conf.p2p_noa_attr, &avp->noa, tsf); in ath9k_update_p2p_ps()
1473 struct ath_beacon_config *cur_conf = &sc->cur_chan->beacon; in ath9k_get_ctwin()
1477 * Channel switch in multi-channel mode is deferred in ath9k_get_ctwin()
1479 * ATH_CHANCTX_EVENT_BEACON_PREPARE, so the P2P-GO in ath9k_get_ctwin()
1483 switch_time = cur_conf->beacon_interval / 4; in ath9k_get_ctwin()
1485 ctwin = avp->vif->bss_conf.p2p_noa_attr.oppps_ctwindow; in ath9k_get_ctwin()
1504 0x00, /* LSB of little-endian len */ in ath9k_beacon_add_noa()
1505 0x00, /* MSB of little-endian len */ in ath9k_beacon_add_noa()
1512 if (!avp->offchannel_duration && !avp->noa_duration) in ath9k_beacon_add_noa()
1515 noa_desc = !!avp->offchannel_duration + !!avp->noa_duration; in ath9k_beacon_add_noa()
1519 hdr[1] = sizeof(noa_ie_hdr) + noa_len - 2; in ath9k_beacon_add_noa()
1524 noa->index = avp->noa_index; in ath9k_beacon_add_noa()
1525 noa->oppps_ctwindow = ath9k_get_ctwin(sc, avp); in ath9k_beacon_add_noa()
1526 if (noa->oppps_ctwindow) in ath9k_beacon_add_noa()
1527 noa->oppps_ctwindow |= BIT(7); in ath9k_beacon_add_noa()
1529 if (avp->noa_duration) { in ath9k_beacon_add_noa()
1530 if (avp->periodic_noa) { in ath9k_beacon_add_noa()
1531 u32 interval = TU_TO_USEC(sc->cur_chan->beacon.beacon_interval); in ath9k_beacon_add_noa()
1532 noa->desc[i].count = 255; in ath9k_beacon_add_noa()
1533 noa->desc[i].interval = cpu_to_le32(interval); in ath9k_beacon_add_noa()
1535 noa->desc[i].count = 1; in ath9k_beacon_add_noa()
1538 noa->desc[i].start_time = cpu_to_le32(avp->noa_start); in ath9k_beacon_add_noa()
1539 noa->desc[i].duration = cpu_to_le32(avp->noa_duration); in ath9k_beacon_add_noa()
1543 if (avp->offchannel_duration) { in ath9k_beacon_add_noa()
1544 noa->desc[i].count = 1; in ath9k_beacon_add_noa()
1545 noa->desc[i].start_time = cpu_to_le32(avp->offchannel_start); in ath9k_beacon_add_noa()
1546 noa->desc[i].duration = cpu_to_le32(avp->offchannel_duration); in ath9k_beacon_add_noa()
1553 struct ath_vif *avp = sc->p2p_ps_vif; in ath9k_p2p_ps_timer()
1559 timer_delete_sync(&sc->sched.timer); in ath9k_p2p_ps_timer()
1560 ath9k_hw_gen_timer_stop(sc->sc_ah, sc->p2p_ps_timer); in ath9k_p2p_ps_timer()
1563 if (!avp || avp->chanctx != sc->cur_chan) in ath9k_p2p_ps_timer()
1566 tsf = ath9k_hw_gettsf32(sc->sc_ah); in ath9k_p2p_ps_timer()
1567 if (!avp->noa.absent) in ath9k_p2p_ps_timer()
1570 tsf -= ATH_P2P_PS_STOP_TIME; in ath9k_p2p_ps_timer()
1572 if (!avp->noa.has_next_tsf || in ath9k_p2p_ps_timer()
1573 avp->noa.next_tsf - tsf > BIT(31)) in ath9k_p2p_ps_timer()
1574 ieee80211_update_p2p_noa(&avp->noa, tsf); in ath9k_p2p_ps_timer()
1580 vif = avp->vif; in ath9k_p2p_ps_timer()
1581 sta = ieee80211_find_sta(vif, avp->bssid); in ath9k_p2p_ps_timer()
1585 an = (void *) sta->drv_priv; in ath9k_p2p_ps_timer()
1586 if (an->sleeping == !!avp->noa.absent) in ath9k_p2p_ps_timer()
1589 an->sleeping = avp->noa.absent; in ath9k_p2p_ps_timer()
1590 if (an->sleeping) in ath9k_p2p_ps_timer()
1604 spin_lock_bh(&sc->sc_pcu_lock); in ath9k_p2p_bss_info_changed()
1605 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_p2p_bss_info_changed()
1607 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_p2p_bss_info_changed()
1608 spin_unlock_bh(&sc->sc_pcu_lock); in ath9k_p2p_bss_info_changed()
1613 if (sc->p2p_ps_vif) in ath9k_p2p_beacon_sync()
1614 ath9k_update_p2p_ps(sc, sc->p2p_ps_vif->vif); in ath9k_p2p_beacon_sync()
1620 struct ath_vif *avp = (void *)vif->drv_priv; in ath9k_p2p_remove_vif()
1622 spin_lock_bh(&sc->sc_pcu_lock); in ath9k_p2p_remove_vif()
1623 if (avp == sc->p2p_ps_vif) { in ath9k_p2p_remove_vif()
1624 sc->p2p_ps_vif = NULL; in ath9k_p2p_remove_vif()
1627 spin_unlock_bh(&sc->sc_pcu_lock); in ath9k_p2p_remove_vif()
1632 sc->p2p_ps_timer = ath_gen_timer_alloc(sc->sc_ah, ath9k_p2p_ps_timer, in ath9k_init_p2p()
1634 if (!sc->p2p_ps_timer) in ath9k_init_p2p()
1635 return -ENOMEM; in ath9k_init_p2p()
1642 if (sc->p2p_ps_timer) in ath9k_deinit_p2p()
1643 ath_gen_timer_free(sc->sc_ah, sc->p2p_ps_timer); in ath9k_deinit_p2p()