Lines Matching +full:wakeup +full:- +full:method
1 // SPDX-License-Identifier: BSD-3-Clause-Clear
4 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
34 clear_bit(ATH11K_FLAG_HTC_SUSPEND_COMPLETE, &ab->dev_flags); in ath11k_wow_enable()
37 reinit_completion(&ab->htc_suspend); in ath11k_wow_enable()
45 ret = wait_for_completion_timeout(&ab->htc_suspend, 3 * HZ); in ath11k_wow_enable()
49 return -ETIMEDOUT; in ath11k_wow_enable()
52 if (test_bit(ATH11K_FLAG_HTC_SUSPEND_COMPLETE, &ab->dev_flags)) in ath11k_wow_enable()
63 return -ETIMEDOUT; in ath11k_wow_enable()
71 /* In the case of WCN6750, WoW wakeup is done in ath11k_wow_wakeup()
75 if (ab->hw_params.smp2p_wow_exit) in ath11k_wow_wakeup()
78 reinit_completion(&ab->wow.wakeup_completed); in ath11k_wow_wakeup()
82 ath11k_warn(ab, "failed to send wow wakeup indication: %d\n", in ath11k_wow_wakeup()
87 ret = wait_for_completion_timeout(&ab->wow.wakeup_completed, 3 * HZ); in ath11k_wow_wakeup()
89 ath11k_warn(ab, "timed out while waiting for wow wakeup completion\n"); in ath11k_wow_wakeup()
90 return -ETIMEDOUT; in ath11k_wow_wakeup()
98 struct ath11k *ar = arvif->ar; in ath11k_wow_vif_cleanup()
102 ret = ath11k_wmi_wow_add_wakeup_event(ar, arvif->vdev_id, i, 0); in ath11k_wow_vif_cleanup()
104 ath11k_warn(ar->ab, "failed to issue wow wakeup for event %s on vdev %i: %d\n", in ath11k_wow_vif_cleanup()
105 wow_wakeup_event(i), arvif->vdev_id, ret); in ath11k_wow_vif_cleanup()
110 for (i = 0; i < ar->wow.max_num_patterns; i++) { in ath11k_wow_vif_cleanup()
111 ret = ath11k_wmi_wow_del_pattern(ar, arvif->vdev_id, i); in ath11k_wow_vif_cleanup()
113 ath11k_warn(ar->ab, "failed to delete wow pattern %d for vdev %i: %d\n", in ath11k_wow_vif_cleanup()
114 i, arvif->vdev_id, ret); in ath11k_wow_vif_cleanup()
127 lockdep_assert_held(&ar->conf_mutex); in ath11k_wow_cleanup()
129 list_for_each_entry(arvif, &ar->arvifs, list) { in ath11k_wow_cleanup()
132 ath11k_warn(ar->ab, "failed to clean wow wakeups on vdev %i: %d\n", in ath11k_wow_cleanup()
133 arvif->vdev_id, ret); in ath11k_wow_cleanup()
142 * +------------+-----------+--------+----------------+
144 * +------------+-----------+--------+----------------+
147 * +--+------------+----+-----------+---------------+-----------+
149 * +--+------------+----+-----------+---------------+-----------+
159 int total_len = old->pkt_offset + old->pattern_len; in ath11k_wow_convert_8023_to_80211()
176 memcpy(hdr_8023_pattern + old->pkt_offset, in ath11k_wow_convert_8023_to_80211()
177 old->pattern, ETH_HLEN - old->pkt_offset); in ath11k_wow_convert_8023_to_80211()
178 memcpy(hdr_8023_bit_mask + old->pkt_offset, in ath11k_wow_convert_8023_to_80211()
179 old->mask, ETH_HLEN - old->pkt_offset); in ath11k_wow_convert_8023_to_80211()
182 memcpy(new_hdr_pattern->addr1, old_hdr_pattern->h_dest, ETH_ALEN); in ath11k_wow_convert_8023_to_80211()
183 memcpy(new_hdr_mask->addr1, old_hdr_mask->h_dest, ETH_ALEN); in ath11k_wow_convert_8023_to_80211()
186 memcpy(new_hdr_pattern->addr3, old_hdr_pattern->h_source, ETH_ALEN); in ath11k_wow_convert_8023_to_80211()
187 memcpy(new_hdr_mask->addr3, old_hdr_mask->h_source, ETH_ALEN); in ath11k_wow_convert_8023_to_80211()
190 memcpy(&new_rfc_pattern->snap_type, in ath11k_wow_convert_8023_to_80211()
191 &old_hdr_pattern->h_proto, in ath11k_wow_convert_8023_to_80211()
192 sizeof(old_hdr_pattern->h_proto)); in ath11k_wow_convert_8023_to_80211()
193 memcpy(&new_rfc_mask->snap_type, in ath11k_wow_convert_8023_to_80211()
194 &old_hdr_mask->h_proto, in ath11k_wow_convert_8023_to_80211()
195 sizeof(old_hdr_mask->h_proto)); in ath11k_wow_convert_8023_to_80211()
198 if (old->pkt_offset < ETH_ALEN) in ath11k_wow_convert_8023_to_80211()
199 new->pkt_offset = old->pkt_offset + in ath11k_wow_convert_8023_to_80211()
201 else if (old->pkt_offset < offsetof(struct ethhdr, h_proto)) in ath11k_wow_convert_8023_to_80211()
202 new->pkt_offset = old->pkt_offset + in ath11k_wow_convert_8023_to_80211()
203 offsetof(struct ieee80211_hdr_3addr, addr3) - in ath11k_wow_convert_8023_to_80211()
206 new->pkt_offset = old->pkt_offset + hdr_len + rfc_len - ETH_HLEN; in ath11k_wow_convert_8023_to_80211()
212 hdr_80211_end_offset = hdr_len + rfc_len + total_len - ETH_HLEN; in ath11k_wow_convert_8023_to_80211()
214 hdr_80211_end_offset = total_len - ETH_ALEN + in ath11k_wow_convert_8023_to_80211()
220 new->pattern_len = hdr_80211_end_offset - new->pkt_offset; in ath11k_wow_convert_8023_to_80211()
222 memcpy((u8 *)new->pattern, in ath11k_wow_convert_8023_to_80211()
223 hdr_80211_pattern + new->pkt_offset, in ath11k_wow_convert_8023_to_80211()
224 new->pattern_len); in ath11k_wow_convert_8023_to_80211()
225 memcpy((u8 *)new->mask, in ath11k_wow_convert_8023_to_80211()
226 hdr_80211_bit_mask + new->pkt_offset, in ath11k_wow_convert_8023_to_80211()
227 new->pattern_len); in ath11k_wow_convert_8023_to_80211()
231 memcpy((u8 *)new->pattern + new->pattern_len, in ath11k_wow_convert_8023_to_80211()
232 (void *)old->pattern + ETH_HLEN - old->pkt_offset, in ath11k_wow_convert_8023_to_80211()
233 total_len - ETH_HLEN); in ath11k_wow_convert_8023_to_80211()
234 memcpy((u8 *)new->mask + new->pattern_len, in ath11k_wow_convert_8023_to_80211()
235 (void *)old->mask + ETH_HLEN - old->pkt_offset, in ath11k_wow_convert_8023_to_80211()
236 total_len - ETH_HLEN); in ath11k_wow_convert_8023_to_80211()
238 new->pattern_len += total_len - ETH_HLEN; in ath11k_wow_convert_8023_to_80211()
249 pno->enable = 1; in ath11k_wmi_pno_check_and_convert()
250 pno->vdev_id = vdev_id; in ath11k_wmi_pno_check_and_convert()
251 pno->uc_networks_count = nd_config->n_match_sets; in ath11k_wmi_pno_check_and_convert()
253 if (!pno->uc_networks_count || in ath11k_wmi_pno_check_and_convert()
254 pno->uc_networks_count > WMI_PNO_MAX_SUPP_NETWORKS) in ath11k_wmi_pno_check_and_convert()
255 return -EINVAL; in ath11k_wmi_pno_check_and_convert()
257 if (nd_config->n_channels > WMI_PNO_MAX_NETW_CHANNELS_EX) in ath11k_wmi_pno_check_and_convert()
258 return -EINVAL; in ath11k_wmi_pno_check_and_convert()
261 for (i = 0; i < pno->uc_networks_count; i++) { in ath11k_wmi_pno_check_and_convert()
262 ssid_len = nd_config->match_sets[i].ssid.ssid_len; in ath11k_wmi_pno_check_and_convert()
265 return -EINVAL; in ath11k_wmi_pno_check_and_convert()
267 pno->a_networks[i].ssid.ssid_len = ssid_len; in ath11k_wmi_pno_check_and_convert()
269 memcpy(pno->a_networks[i].ssid.ssid, in ath11k_wmi_pno_check_and_convert()
270 nd_config->match_sets[i].ssid.ssid, in ath11k_wmi_pno_check_and_convert()
271 nd_config->match_sets[i].ssid.ssid_len); in ath11k_wmi_pno_check_and_convert()
272 pno->a_networks[i].authentication = 0; in ath11k_wmi_pno_check_and_convert()
273 pno->a_networks[i].encryption = 0; in ath11k_wmi_pno_check_and_convert()
274 pno->a_networks[i].bcast_nw_type = 0; in ath11k_wmi_pno_check_and_convert()
277 pno->a_networks[i].channel_count = nd_config->n_channels; in ath11k_wmi_pno_check_and_convert()
278 pno->a_networks[i].rssi_threshold = nd_config->match_sets[i].rssi_thold; in ath11k_wmi_pno_check_and_convert()
280 for (j = 0; j < nd_config->n_channels; j++) { in ath11k_wmi_pno_check_and_convert()
281 pno->a_networks[i].channels[j] = in ath11k_wmi_pno_check_and_convert()
282 nd_config->channels[j]->center_freq; in ath11k_wmi_pno_check_and_convert()
287 if (nd_config->n_ssids == 0) in ath11k_wmi_pno_check_and_convert()
288 pno->do_passive_scan = true; in ath11k_wmi_pno_check_and_convert()
290 pno->do_passive_scan = false; in ath11k_wmi_pno_check_and_convert()
292 for (i = 0; i < nd_config->n_ssids; i++) { in ath11k_wmi_pno_check_and_convert()
294 while (j < pno->uc_networks_count) { in ath11k_wmi_pno_check_and_convert()
295 if (pno->a_networks[j].ssid.ssid_len == in ath11k_wmi_pno_check_and_convert()
296 nd_config->ssids[i].ssid_len && in ath11k_wmi_pno_check_and_convert()
297 (memcmp(pno->a_networks[j].ssid.ssid, in ath11k_wmi_pno_check_and_convert()
298 nd_config->ssids[i].ssid, in ath11k_wmi_pno_check_and_convert()
299 pno->a_networks[j].ssid.ssid_len) == 0)) { in ath11k_wmi_pno_check_and_convert()
300 pno->a_networks[j].bcast_nw_type = BCAST_HIDDEN; in ath11k_wmi_pno_check_and_convert()
307 if (nd_config->n_scan_plans == 2) { in ath11k_wmi_pno_check_and_convert()
308 pno->fast_scan_period = nd_config->scan_plans[0].interval * MSEC_PER_SEC; in ath11k_wmi_pno_check_and_convert()
309 pno->fast_scan_max_cycles = nd_config->scan_plans[0].iterations; in ath11k_wmi_pno_check_and_convert()
310 pno->slow_scan_period = in ath11k_wmi_pno_check_and_convert()
311 nd_config->scan_plans[1].interval * MSEC_PER_SEC; in ath11k_wmi_pno_check_and_convert()
312 } else if (nd_config->n_scan_plans == 1) { in ath11k_wmi_pno_check_and_convert()
313 pno->fast_scan_period = nd_config->scan_plans[0].interval * MSEC_PER_SEC; in ath11k_wmi_pno_check_and_convert()
314 pno->fast_scan_max_cycles = 1; in ath11k_wmi_pno_check_and_convert()
315 pno->slow_scan_period = nd_config->scan_plans[0].interval * MSEC_PER_SEC; in ath11k_wmi_pno_check_and_convert()
317 ath11k_warn(ar->ab, "Invalid number of scan plans %d !!", in ath11k_wmi_pno_check_and_convert()
318 nd_config->n_scan_plans); in ath11k_wmi_pno_check_and_convert()
321 if (nd_config->flags & NL80211_SCAN_FLAG_RANDOM_ADDR) { in ath11k_wmi_pno_check_and_convert()
323 pno->enable_pno_scan_randomization = 1; in ath11k_wmi_pno_check_and_convert()
324 memcpy(pno->mac_addr, nd_config->mac_addr, ETH_ALEN); in ath11k_wmi_pno_check_and_convert()
325 memcpy(pno->mac_addr_mask, nd_config->mac_addr_mask, ETH_ALEN); in ath11k_wmi_pno_check_and_convert()
328 pno->delay_start_time = nd_config->delay; in ath11k_wmi_pno_check_and_convert()
330 /* Current FW does not support min-max range for dwell time */ in ath11k_wmi_pno_check_and_convert()
331 pno->active_max_time = WMI_ACTIVE_MAX_CHANNEL_TIME; in ath11k_wmi_pno_check_and_convert()
332 pno->passive_max_time = WMI_PASSIVE_MAX_CHANNEL_TIME; in ath11k_wmi_pno_check_and_convert()
342 struct ath11k *ar = arvif->ar; in ath11k_vif_wow_set_wakeups()
343 const struct cfg80211_pkt_pattern *patterns = wowlan->patterns; in ath11k_vif_wow_set_wakeups()
347 switch (arvif->vdev_type) { in ath11k_vif_wow_set_wakeups()
361 if (wowlan->disconnect) { in ath11k_vif_wow_set_wakeups()
368 if (wowlan->magic_pkt) in ath11k_vif_wow_set_wakeups()
371 if (wowlan->nd_config) { in ath11k_vif_wow_set_wakeups()
377 return -ENOMEM; in ath11k_vif_wow_set_wakeups()
379 ar->nlo_enabled = true; in ath11k_vif_wow_set_wakeups()
381 ret = ath11k_wmi_pno_check_and_convert(ar, arvif->vdev_id, in ath11k_vif_wow_set_wakeups()
382 wowlan->nd_config, pno); in ath11k_vif_wow_set_wakeups()
384 ath11k_wmi_wow_config_pno(ar, arvif->vdev_id, pno); in ath11k_vif_wow_set_wakeups()
395 for (i = 0; i < wowlan->n_patterns; i++) { in ath11k_vif_wow_set_wakeups()
413 if (ar->wmi->wmi_ab->wlan_resource_config.rx_decap_mode == in ath11k_vif_wow_set_wakeups()
425 new_pattern.pkt_offset += WOW_HDR_LEN - ETH_HLEN; in ath11k_vif_wow_set_wakeups()
430 return -EINVAL; in ath11k_vif_wow_set_wakeups()
432 ret = ath11k_wmi_wow_add_pattern(ar, arvif->vdev_id, in ath11k_vif_wow_set_wakeups()
439 ath11k_warn(ar->ab, "failed to add pattern %i to vdev %i: %d\n", in ath11k_vif_wow_set_wakeups()
441 arvif->vdev_id, ret); in ath11k_vif_wow_set_wakeups()
452 ret = ath11k_wmi_wow_add_wakeup_event(ar, arvif->vdev_id, i, 1); in ath11k_vif_wow_set_wakeups()
454 ath11k_warn(ar->ab, "failed to enable wakeup event %s on vdev %i: %d\n", in ath11k_vif_wow_set_wakeups()
455 wow_wakeup_event(i), arvif->vdev_id, ret); in ath11k_vif_wow_set_wakeups()
469 lockdep_assert_held(&ar->conf_mutex); in ath11k_wow_set_wakeups()
471 list_for_each_entry(arvif, &ar->arvifs, list) { in ath11k_wow_set_wakeups()
474 ath11k_warn(ar->ab, "failed to set wow wakeups on vdev %i: %d\n", in ath11k_wow_set_wakeups()
475 arvif->vdev_id, ret); in ath11k_wow_set_wakeups()
486 struct ath11k *ar = arvif->ar; in ath11k_vif_wow_clean_nlo()
488 switch (arvif->vdev_type) { in ath11k_vif_wow_clean_nlo()
490 if (ar->nlo_enabled) { in ath11k_vif_wow_clean_nlo()
495 return -ENOMEM; in ath11k_vif_wow_clean_nlo()
497 pno->enable = 0; in ath11k_vif_wow_clean_nlo()
498 ar->nlo_enabled = false; in ath11k_vif_wow_clean_nlo()
499 ret = ath11k_wmi_wow_config_pno(ar, arvif->vdev_id, pno); in ath11k_vif_wow_clean_nlo()
514 lockdep_assert_held(&ar->conf_mutex); in ath11k_wow_nlo_cleanup()
516 list_for_each_entry(arvif, &ar->arvifs, list) { in ath11k_wow_nlo_cleanup()
519 ath11k_warn(ar->ab, "failed to clean nlo settings on vdev %i: %d\n", in ath11k_wow_nlo_cleanup()
520 arvif->vdev_id, ret); in ath11k_wow_nlo_cleanup()
534 lockdep_assert_held(&ar->conf_mutex); in ath11k_wow_set_hw_filter()
536 list_for_each_entry(arvif, &ar->arvifs, list) { in ath11k_wow_set_hw_filter()
539 ret = ath11k_wmi_hw_data_filter_cmd(ar, arvif->vdev_id, in ath11k_wow_set_hw_filter()
543 ath11k_warn(ar->ab, "failed to set hw data filter on vdev %i: %d\n", in ath11k_wow_set_hw_filter()
544 arvif->vdev_id, ret); in ath11k_wow_set_hw_filter()
557 lockdep_assert_held(&ar->conf_mutex); in ath11k_wow_clear_hw_filter()
559 list_for_each_entry(arvif, &ar->arvifs, list) { in ath11k_wow_clear_hw_filter()
560 ret = ath11k_wmi_hw_data_filter_cmd(ar, arvif->vdev_id, 0, false); in ath11k_wow_clear_hw_filter()
563 ath11k_warn(ar->ab, "failed to clear hw data filter on vdev %i: %d\n", in ath11k_wow_clear_hw_filter()
564 arvif->vdev_id, ret); in ath11k_wow_clear_hw_filter()
577 lockdep_assert_held(&ar->conf_mutex); in ath11k_wow_arp_ns_offload()
579 list_for_each_entry(arvif, &ar->arvifs, list) { in ath11k_wow_arp_ns_offload()
580 if (arvif->vdev_type != WMI_VDEV_TYPE_STA) in ath11k_wow_arp_ns_offload()
586 ath11k_warn(ar->ab, "failed to set arp ns offload vdev %i: enable %d, ret %d\n", in ath11k_wow_arp_ns_offload()
587 arvif->vdev_id, enable, ret); in ath11k_wow_arp_ns_offload()
600 lockdep_assert_held(&ar->conf_mutex); in ath11k_gtk_rekey_offload()
602 list_for_each_entry(arvif, &ar->arvifs, list) { in ath11k_gtk_rekey_offload()
603 if (arvif->vdev_type != WMI_VDEV_TYPE_STA || in ath11k_gtk_rekey_offload()
604 !arvif->is_up || in ath11k_gtk_rekey_offload()
605 !arvif->rekey_data.enable_offload) in ath11k_gtk_rekey_offload()
612 ath11k_warn(ar->ab, "failed to request rekey info vdev %i, ret %d\n", in ath11k_gtk_rekey_offload()
613 arvif->vdev_id, ret); in ath11k_gtk_rekey_offload()
621 ath11k_warn(ar->ab, "failed to offload gtk reky vdev %i: enable %d, ret %d\n", in ath11k_gtk_rekey_offload()
622 arvif->vdev_id, enable, ret); in ath11k_gtk_rekey_offload()
636 ath11k_warn(ar->ab, "failed to offload ARP and NS %d %d\n", in ath11k_wow_protocol_offload()
643 ath11k_warn(ar->ab, "failed to offload gtk rekey %d %d\n", in ath11k_wow_protocol_offload()
652 enum wmi_sta_keepalive_method method, in ath11k_wow_set_keepalive() argument
658 lockdep_assert_held(&ar->conf_mutex); in ath11k_wow_set_keepalive()
660 list_for_each_entry(arvif, &ar->arvifs, list) { in ath11k_wow_set_keepalive()
661 ret = ath11k_mac_vif_set_keepalive(arvif, method, interval); in ath11k_wow_set_keepalive()
672 struct ath11k *ar = hw->priv; in ath11k_wow_op_suspend()
677 ath11k_warn(ar->ab, "failed to wait tx complete: %d\n", ret); in ath11k_wow_op_suspend()
681 mutex_lock(&ar->conf_mutex); in ath11k_wow_op_suspend()
683 ret = ath11k_dp_rx_pktlog_stop(ar->ab, true); in ath11k_wow_op_suspend()
685 ath11k_warn(ar->ab, in ath11k_wow_op_suspend()
693 ath11k_warn(ar->ab, "failed to clear wow wakeup events: %d\n", in ath11k_wow_op_suspend()
700 ath11k_warn(ar->ab, "failed to set wow wakeup events: %d\n", in ath11k_wow_op_suspend()
707 ath11k_warn(ar->ab, "failed to set wow protocol offload events: %d\n", in ath11k_wow_op_suspend()
714 ath11k_warn(ar->ab, "failed to set hw filter: %d\n", in ath11k_wow_op_suspend()
723 ath11k_warn(ar->ab, "failed to enable wow keepalive: %d\n", ret); in ath11k_wow_op_suspend()
727 ret = ath11k_wow_enable(ar->ab); in ath11k_wow_op_suspend()
729 ath11k_warn(ar->ab, "failed to start wow: %d\n", ret); in ath11k_wow_op_suspend()
733 ret = ath11k_dp_rx_pktlog_stop(ar->ab, false); in ath11k_wow_op_suspend()
735 ath11k_warn(ar->ab, in ath11k_wow_op_suspend()
741 ath11k_ce_stop_shadow_timers(ar->ab); in ath11k_wow_op_suspend()
742 ath11k_dp_stop_shadow_timers(ar->ab); in ath11k_wow_op_suspend()
744 ath11k_hif_irq_disable(ar->ab); in ath11k_wow_op_suspend()
745 ath11k_hif_ce_irq_disable(ar->ab); in ath11k_wow_op_suspend()
747 ret = ath11k_hif_suspend(ar->ab); in ath11k_wow_op_suspend()
749 ath11k_warn(ar->ab, "failed to suspend hif: %d\n", ret); in ath11k_wow_op_suspend()
750 goto wakeup; in ath11k_wow_op_suspend()
755 wakeup: in ath11k_wow_op_suspend()
756 ath11k_wow_wakeup(ar->ab); in ath11k_wow_op_suspend()
762 mutex_unlock(&ar->conf_mutex); in ath11k_wow_op_suspend()
768 struct ath11k *ar = hw->priv; in ath11k_wow_op_set_wakeup()
770 mutex_lock(&ar->conf_mutex); in ath11k_wow_op_set_wakeup()
771 device_set_wakeup_enable(ar->ab->dev, enabled); in ath11k_wow_op_set_wakeup()
772 mutex_unlock(&ar->conf_mutex); in ath11k_wow_op_set_wakeup()
777 struct ath11k *ar = hw->priv; in ath11k_wow_op_resume()
780 mutex_lock(&ar->conf_mutex); in ath11k_wow_op_resume()
782 ret = ath11k_hif_resume(ar->ab); in ath11k_wow_op_resume()
784 ath11k_warn(ar->ab, "failed to resume hif: %d\n", ret); in ath11k_wow_op_resume()
788 ath11k_hif_ce_irq_enable(ar->ab); in ath11k_wow_op_resume()
789 ath11k_hif_irq_enable(ar->ab); in ath11k_wow_op_resume()
791 ret = ath11k_dp_rx_pktlog_start(ar->ab); in ath11k_wow_op_resume()
793 ath11k_warn(ar->ab, "failed to start rx pktlog from wow: %d\n", ret); in ath11k_wow_op_resume()
797 ret = ath11k_wow_wakeup(ar->ab); in ath11k_wow_op_resume()
799 ath11k_warn(ar->ab, "failed to wakeup from wow: %d\n", ret); in ath11k_wow_op_resume()
805 ath11k_warn(ar->ab, "failed to cleanup nlo: %d\n", ret); in ath11k_wow_op_resume()
811 ath11k_warn(ar->ab, "failed to clear hw filter: %d\n", ret); in ath11k_wow_op_resume()
817 ath11k_warn(ar->ab, "failed to clear wow protocol offload events: %d\n", in ath11k_wow_op_resume()
826 ath11k_warn(ar->ab, "failed to disable wow keepalive: %d\n", ret); in ath11k_wow_op_resume()
832 switch (ar->state) { in ath11k_wow_op_resume()
834 ar->state = ATH11K_STATE_RESTARTING; in ath11k_wow_op_resume()
842 ath11k_warn(ar->ab, "encountered unexpected device state %d on resume, cannot recover\n", in ath11k_wow_op_resume()
843 ar->state); in ath11k_wow_op_resume()
844 ret = -EIO; in ath11k_wow_op_resume()
849 mutex_unlock(&ar->conf_mutex); in ath11k_wow_op_resume()
855 if (!test_bit(WMI_TLV_SERVICE_WOW, ar->wmi->wmi_ab->svc_map)) in ath11k_wow_init()
858 ar->wow.wowlan_support = ath11k_wowlan_support; in ath11k_wow_init()
860 if (ar->wmi->wmi_ab->wlan_resource_config.rx_decap_mode == in ath11k_wow_init()
862 ar->wow.wowlan_support.pattern_max_len -= WOW_MAX_REDUCE; in ath11k_wow_init()
863 ar->wow.wowlan_support.max_pkt_offset -= WOW_MAX_REDUCE; in ath11k_wow_init()
866 if (test_bit(WMI_TLV_SERVICE_NLO, ar->wmi->wmi_ab->svc_map)) { in ath11k_wow_init()
867 ar->wow.wowlan_support.flags |= WIPHY_WOWLAN_NET_DETECT; in ath11k_wow_init()
868 ar->wow.wowlan_support.max_nd_match_sets = WMI_PNO_MAX_SUPP_NETWORKS; in ath11k_wow_init()
871 ar->wow.max_num_patterns = ATH11K_WOW_PATTERNS; in ath11k_wow_init()
872 ar->wow.wowlan_support.n_patterns = ar->wow.max_num_patterns; in ath11k_wow_init()
873 ar->hw->wiphy->wowlan = &ar->wow.wowlan_support; in ath11k_wow_init()
875 device_set_wakeup_capable(ar->ab->dev, true); in ath11k_wow_init()