Lines Matching +full:key +full:- +full:wakeup
1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
3 * Copyright (C) 2024-2025 Intel Corporation
25 * enum iwl_mld_d3_notif - d3 notifications
58 u8 key[WOWLAN_KEY_MAX_SIZE]; member
75 * struct iwl_mld_wowlan_status - contains wowlan status data from
77 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
84 * @wake_packet: wakeup packet received
118 * struct iwl_mld_netdetect_res - contains netdetect results from
130 * struct iwl_mld_resume_data - d3 resume flow data
165 struct iwl_mld_wowlan_data *wowlan_data = &mld_vif->wowlan_data; in iwl_mld_set_rekey_data()
167 lockdep_assert_wiphy(mld->wiphy); in iwl_mld_set_rekey_data()
169 wowlan_data->rekey_data.kek_len = data->kek_len; in iwl_mld_set_rekey_data()
170 wowlan_data->rekey_data.kck_len = data->kck_len; in iwl_mld_set_rekey_data()
171 memcpy(wowlan_data->rekey_data.kek, data->kek, data->kek_len); in iwl_mld_set_rekey_data()
172 memcpy(wowlan_data->rekey_data.kck, data->kck, data->kck_len); in iwl_mld_set_rekey_data()
173 wowlan_data->rekey_data.akm = data->akm & 0xFF; in iwl_mld_set_rekey_data()
174 wowlan_data->rekey_data.replay_ctr = in iwl_mld_set_rekey_data()
175 cpu_to_le64(be64_to_cpup((const __be64 *)data->replay_ctr)); in iwl_mld_set_rekey_data()
176 wowlan_data->rekey_data.valid = true; in iwl_mld_set_rekey_data()
185 struct iwl_mld_wowlan_data *wowlan_data = &mld_vif->wowlan_data; in iwl_mld_ipv6_addr_change()
189 memset(wowlan_data->tentative_addrs, 0, in iwl_mld_ipv6_addr_change()
190 sizeof(wowlan_data->tentative_addrs)); in iwl_mld_ipv6_addr_change()
192 read_lock_bh(&idev->lock); in iwl_mld_ipv6_addr_change()
193 list_for_each_entry(ifa, &idev->addr_list, if_list) { in iwl_mld_ipv6_addr_change()
194 wowlan_data->target_ipv6_addrs[idx] = ifa->addr; in iwl_mld_ipv6_addr_change()
195 if (ifa->flags & IFA_F_TENTATIVE) in iwl_mld_ipv6_addr_change()
196 __set_bit(idx, wowlan_data->tentative_addrs); in iwl_mld_ipv6_addr_change()
201 read_unlock_bh(&idev->lock); in iwl_mld_ipv6_addr_change()
203 wowlan_data->num_target_ipv6_addrs = idx; in iwl_mld_ipv6_addr_change()
219 if (iwl_fwrt_read_err_table(mld->trans, in iwl_mld_check_err_tables()
220 mld->trans->dbg.lmac_error_event_table[0], in iwl_mld_check_err_tables()
223 struct cfg80211_wowlan_wakeup wakeup = { in iwl_mld_check_err_tables() local
226 ieee80211_report_wowlan_wakeup(vif, &wakeup, in iwl_mld_check_err_tables()
235 if (iwl_fwrt_read_err_table(mld->trans, in iwl_mld_check_err_tables()
236 mld->trans->dbg.lmac_error_event_table[1], in iwl_mld_check_err_tables()
241 if (iwl_fwrt_read_err_table(mld->trans, in iwl_mld_check_err_tables()
242 mld->trans->dbg.umac_error_event_table, in iwl_mld_check_err_tables()
259 iwl_fwrt_dump_error_logs(&mld->fwrt); in iwl_mld_fw_needs_restart()
260 iwl_dbg_tlv_time_point(&mld->fwrt, in iwl_mld_fw_needs_restart()
274 wowlan->nd_config; in iwl_mld_netdetect_config()
291 seq->tkip.iv16 = (u16)pn; in iwl_mld_le64_to_tkip_seq()
292 seq->tkip.iv32 = (u32)(pn >> 16); in iwl_mld_le64_to_tkip_seq()
300 seq->ccmp.pn[0] = pn >> 40; in iwl_mld_le64_to_aes_seq()
301 seq->ccmp.pn[1] = pn >> 32; in iwl_mld_le64_to_aes_seq()
302 seq->ccmp.pn[2] = pn >> 24; in iwl_mld_le64_to_aes_seq()
303 seq->ccmp.pn[3] = pn >> 16; in iwl_mld_le64_to_aes_seq()
304 seq->ccmp.pn[4] = pn >> 8; in iwl_mld_le64_to_aes_seq()
305 seq->ccmp.pn[5] = pn; in iwl_mld_le64_to_aes_seq()
313 struct ieee80211_key_seq *aes_seq = gtk_data->gtk.aes_seq; in iwl_mld_convert_gtk_resume_seq()
314 struct ieee80211_key_seq *tkip_seq = gtk_data->gtk.tkip_seq; in iwl_mld_convert_gtk_resume_seq()
316 if (rsc_idx >= ARRAY_SIZE(sc->mcast_rsc)) in iwl_mld_convert_gtk_resume_seq()
324 iwl_mld_le64_to_tkip_seq(sc->mcast_rsc[rsc_idx][tid], in iwl_mld_convert_gtk_resume_seq()
326 iwl_mld_le64_to_aes_seq(sc->mcast_rsc[rsc_idx][tid], in iwl_mld_convert_gtk_resume_seq()
339 BUILD_BUG_ON(sizeof(wowlan_status->gtk[0].key) < in iwl_mld_convert_gtk_resume_data()
340 sizeof(gtk_data[0].key)); in iwl_mld_convert_gtk_resume_data()
341 BUILD_BUG_ON(ARRAY_SIZE(wowlan_status->gtk) < WOWLAN_GTK_KEYS_NUM); in iwl_mld_convert_gtk_resume_data()
343 for (int notif_idx = 0; notif_idx < ARRAY_SIZE(wowlan_status->gtk); in iwl_mld_convert_gtk_resume_data()
350 wowlan_status->gtk[status_idx].len = in iwl_mld_convert_gtk_resume_data()
352 wowlan_status->gtk[status_idx].flags = in iwl_mld_convert_gtk_resume_data()
354 wowlan_status->gtk[status_idx].id = in iwl_mld_convert_gtk_resume_data()
355 wowlan_status->gtk[status_idx].flags & in iwl_mld_convert_gtk_resume_data()
357 memcpy(wowlan_status->gtk[status_idx].key, in iwl_mld_convert_gtk_resume_data()
358 gtk_data[notif_idx].key, in iwl_mld_convert_gtk_resume_data()
359 sizeof(gtk_data[notif_idx].key)); in iwl_mld_convert_gtk_resume_data()
361 /* The rsc for both gtk keys are stored in gtk[0]->sc->mcast_rsc in iwl_mld_convert_gtk_resume_data()
363 * the id_map maps between the key id and the index in sc->mcast in iwl_mld_convert_gtk_resume_data()
366 sc->mcast_key_id_map[wowlan_status->gtk[status_idx].id]; in iwl_mld_convert_gtk_resume_data()
367 iwl_mld_convert_gtk_resume_seq(&wowlan_status->gtk[status_idx], in iwl_mld_convert_gtk_resume_data()
370 /* if it's as long as the TKIP encryption key, copy MIC key */ in iwl_mld_convert_gtk_resume_data()
371 if (wowlan_status->gtk[status_idx].len == in iwl_mld_convert_gtk_resume_data()
373 memcpy(wowlan_status->gtk[status_idx].key + in iwl_mld_convert_gtk_resume_data()
386 struct ieee80211_key_seq *aes_seq = wowlan_status->ptk.aes_seq; in iwl_mld_convert_ptk_resume_seq()
387 struct ieee80211_key_seq *tkip_seq = wowlan_status->ptk.tkip_seq; in iwl_mld_convert_ptk_resume_seq()
389 BUILD_BUG_ON(ARRAY_SIZE(sc->ucast_rsc) != IWL_MAX_TID_COUNT); in iwl_mld_convert_ptk_resume_seq()
392 iwl_mld_le64_to_aes_seq(sc->ucast_rsc[tid], &aes_seq[tid]); in iwl_mld_convert_ptk_resume_seq()
393 iwl_mld_le64_to_tkip_seq(sc->ucast_rsc[tid], &tkip_seq[tid]); in iwl_mld_convert_ptk_resume_seq()
399 const struct iwl_wowlan_igtk_status *key) in iwl_mld_convert_mcast_ipn() argument
402 &key_status->igtk_bigtk.cmac_gmac_seq; in iwl_mld_convert_mcast_ipn()
403 u8 ipn_len = ARRAY_SIZE(key->ipn); in iwl_mld_convert_mcast_ipn()
405 BUILD_BUG_ON(ipn_len != ARRAY_SIZE(seq->aes_gmac.pn)); in iwl_mld_convert_mcast_ipn()
406 BUILD_BUG_ON(ipn_len != ARRAY_SIZE(seq->aes_cmac.pn)); in iwl_mld_convert_mcast_ipn()
411 * We don't have the key cipher yet so copy to both to cmac and gmac in iwl_mld_convert_mcast_ipn()
414 seq->aes_gmac.pn[i] = key->ipn[ipn_len - i - 1]; in iwl_mld_convert_mcast_ipn()
415 seq->aes_cmac.pn[i] = key->ipn[ipn_len - i - 1]; in iwl_mld_convert_mcast_ipn()
423 BUILD_BUG_ON(sizeof(wowlan_status->igtk.key) < sizeof(igtk->key)); in iwl_mld_convert_igtk_resume_data()
425 if (!igtk->key_len) in iwl_mld_convert_igtk_resume_data()
428 wowlan_status->igtk.len = igtk->key_len; in iwl_mld_convert_igtk_resume_data()
429 wowlan_status->igtk.flags = igtk->key_flags; in iwl_mld_convert_igtk_resume_data()
430 wowlan_status->igtk.id = in iwl_mld_convert_igtk_resume_data()
431 u32_get_bits(igtk->key_flags, in iwl_mld_convert_igtk_resume_data()
435 memcpy(wowlan_status->igtk.key, igtk->key, sizeof(igtk->key)); in iwl_mld_convert_igtk_resume_data()
436 iwl_mld_convert_mcast_ipn(&wowlan_status->igtk, igtk); in iwl_mld_convert_igtk_resume_data()
445 BUILD_BUG_ON(ARRAY_SIZE(wowlan_status->bigtk) < WOWLAN_BIGTK_KEYS_NUM); in iwl_mld_convert_bigtk_resume_data()
452 wowlan_status->bigtk[status_idx].len = bigtk[notif_idx].key_len; in iwl_mld_convert_bigtk_resume_data()
453 wowlan_status->bigtk[status_idx].flags = in iwl_mld_convert_bigtk_resume_data()
455 wowlan_status->bigtk[status_idx].id = in iwl_mld_convert_bigtk_resume_data()
460 BUILD_BUG_ON(sizeof(wowlan_status->bigtk[status_idx].key) < in iwl_mld_convert_bigtk_resume_data()
461 sizeof(bigtk[notif_idx].key)); in iwl_mld_convert_bigtk_resume_data()
462 memcpy(wowlan_status->bigtk[status_idx].key, in iwl_mld_convert_bigtk_resume_data()
463 bigtk[notif_idx].key, sizeof(bigtk[notif_idx].key)); in iwl_mld_convert_bigtk_resume_data()
464 iwl_mld_convert_mcast_ipn(&wowlan_status->bigtk[status_idx], in iwl_mld_convert_bigtk_resume_data()
475 const struct iwl_wowlan_info_notif *notif = (void *)pkt->data; in iwl_mld_handle_wowlan_info_notif()
485 if (IWL_FW_CHECK(mld, notif->tid_offloaded_tx != IWL_WOWLAN_OFFLOAD_TID, in iwl_mld_handle_wowlan_info_notif()
487 wowlan_status->tid_offloaded_tx)) in iwl_mld_handle_wowlan_info_notif()
490 iwl_mld_convert_gtk_resume_data(mld, wowlan_status, notif->gtk, in iwl_mld_handle_wowlan_info_notif()
491 ¬if->gtk[0].sc); in iwl_mld_handle_wowlan_info_notif()
492 iwl_mld_convert_ptk_resume_seq(mld, wowlan_status, ¬if->gtk[0].sc); in iwl_mld_handle_wowlan_info_notif()
494 iwl_mld_convert_igtk_resume_data(wowlan_status, ¬if->igtk[0]); in iwl_mld_handle_wowlan_info_notif()
495 iwl_mld_convert_bigtk_resume_data(wowlan_status, notif->bigtk); in iwl_mld_handle_wowlan_info_notif()
497 wowlan_status->replay_ctr = le64_to_cpu(notif->replay_ctr); in iwl_mld_handle_wowlan_info_notif()
498 wowlan_status->pattern_number = le16_to_cpu(notif->pattern_number); in iwl_mld_handle_wowlan_info_notif()
500 wowlan_status->tid_offloaded_tx = notif->tid_offloaded_tx; in iwl_mld_handle_wowlan_info_notif()
501 wowlan_status->last_qos_seq = le16_to_cpu(notif->qos_seq_ctr); in iwl_mld_handle_wowlan_info_notif()
502 wowlan_status->num_of_gtk_rekeys = in iwl_mld_handle_wowlan_info_notif()
503 le32_to_cpu(notif->num_of_gtk_rekeys); in iwl_mld_handle_wowlan_info_notif()
504 wowlan_status->wakeup_reasons = le32_to_cpu(notif->wakeup_reasons); in iwl_mld_handle_wowlan_info_notif()
514 const struct iwl_wowlan_wake_pkt_notif *notif = (void *)pkt->data; in iwl_mld_handle_wake_pkt_notif()
516 u32 expected_size = le32_to_cpu(notif->wake_packet_length); in iwl_mld_handle_wake_pkt_notif()
523 if (IWL_FW_CHECK(mld, !(wowlan_status->wakeup_reasons & in iwl_mld_handle_wake_pkt_notif()
525 "Got wake packet but wakeup reason is %x\n", in iwl_mld_handle_wake_pkt_notif()
526 wowlan_status->wakeup_reasons)) in iwl_mld_handle_wake_pkt_notif()
529 actual_size = len - offsetof(struct iwl_wowlan_wake_pkt_notif, in iwl_mld_handle_wake_pkt_notif()
535 wowlan_status->wake_packet = kmemdup(notif->wake_packet, actual_size, in iwl_mld_handle_wake_pkt_notif()
537 if (!wowlan_status->wake_packet) in iwl_mld_handle_wake_pkt_notif()
540 wowlan_status->wake_packet_length = expected_size; in iwl_mld_handle_wake_pkt_notif()
541 wowlan_status->wake_packet_bufsize = actual_size; in iwl_mld_handle_wake_pkt_notif()
550 struct cfg80211_wowlan_wakeup *wakeup, in iwl_mld_set_wake_packet() argument
553 int pkt_bufsize = wowlan_status->wake_packet_bufsize; in iwl_mld_set_wake_packet()
554 int expected_pktlen = wowlan_status->wake_packet_length; in iwl_mld_set_wake_packet()
555 const u8 *pktdata = wowlan_status->wake_packet; in iwl_mld_set_wake_packet()
557 int truncated = expected_pktlen - pkt_bufsize; in iwl_mld_set_wake_packet()
559 if (ieee80211_is_data(hdr->frame_control)) { in iwl_mld_set_wake_packet()
560 int hdrlen = ieee80211_hdrlen(hdr->frame_control); in iwl_mld_set_wake_packet()
570 pkt_bufsize -= hdrlen; in iwl_mld_set_wake_packet()
574 truncated -= icvlen; in iwl_mld_set_wake_packet()
577 icvlen -= truncated; in iwl_mld_set_wake_packet()
581 pkt_bufsize -= ivlen + icvlen; in iwl_mld_set_wake_packet()
586 if (ieee80211_data_to_8023(pkt, vif->addr, vif->type)) in iwl_mld_set_wake_packet()
588 wakeup->packet = pkt->data; in iwl_mld_set_wake_packet()
589 wakeup->packet_present_len = pkt->len; in iwl_mld_set_wake_packet()
590 wakeup->packet_len = pkt->len - truncated; in iwl_mld_set_wake_packet()
591 wakeup->packet_80211 = false; in iwl_mld_set_wake_packet()
596 truncated -= 4; in iwl_mld_set_wake_packet()
599 fcslen -= truncated; in iwl_mld_set_wake_packet()
602 pkt_bufsize -= fcslen; in iwl_mld_set_wake_packet()
603 wakeup->packet = wowlan_status->wake_packet; in iwl_mld_set_wake_packet()
604 wakeup->packet_present_len = pkt_bufsize; in iwl_mld_set_wake_packet()
605 wakeup->packet_len = expected_pktlen - truncated; in iwl_mld_set_wake_packet()
606 wakeup->packet_80211 = true; in iwl_mld_set_wake_packet()
616 struct cfg80211_wowlan_wakeup wakeup = { in iwl_mld_report_wowlan_wakeup() local
617 .pattern_idx = -1, in iwl_mld_report_wowlan_wakeup()
619 u32 reasons = wowlan_status->wakeup_reasons; in iwl_mld_report_wowlan_wakeup()
626 pm_wakeup_event(mld->dev, 0); in iwl_mld_report_wowlan_wakeup()
629 wakeup.magic_pkt = true; in iwl_mld_report_wowlan_wakeup()
632 wakeup.pattern_idx = in iwl_mld_report_wowlan_wakeup()
633 wowlan_status->pattern_number; in iwl_mld_report_wowlan_wakeup()
638 wakeup.disconnect = true; in iwl_mld_report_wowlan_wakeup()
641 wakeup.gtk_rekey_failure = true; in iwl_mld_report_wowlan_wakeup()
644 wakeup.rfkill_release = true; in iwl_mld_report_wowlan_wakeup()
647 wakeup.eap_identity_req = true; in iwl_mld_report_wowlan_wakeup()
650 wakeup.four_way_handshake = true; in iwl_mld_report_wowlan_wakeup()
653 wakeup.tcp_connlost = true; in iwl_mld_report_wowlan_wakeup()
656 wakeup.tcp_nomoretokens = true; in iwl_mld_report_wowlan_wakeup()
659 wakeup.tcp_match = true; in iwl_mld_report_wowlan_wakeup()
662 wakeup.unprot_deauth_disassoc = true; in iwl_mld_report_wowlan_wakeup()
664 if (wowlan_status->wake_packet) in iwl_mld_report_wowlan_wakeup()
665 iwl_mld_set_wake_packet(mld, vif, wowlan_status, &wakeup, &pkt); in iwl_mld_report_wowlan_wakeup()
667 ieee80211_report_wowlan_wakeup(vif, &wakeup, GFP_KERNEL); in iwl_mld_report_wowlan_wakeup()
672 iwl_mld_set_key_rx_seq_tids(struct ieee80211_key_conf *key, in iwl_mld_set_key_rx_seq_tids() argument
678 ieee80211_set_key_rx_seq(key, tid, &seq[tid]); in iwl_mld_set_key_rx_seq_tids()
682 iwl_mld_set_key_rx_seq(struct ieee80211_key_conf *key, in iwl_mld_set_key_rx_seq() argument
685 switch (key->cipher) { in iwl_mld_set_key_rx_seq()
689 iwl_mld_set_key_rx_seq_tids(key, in iwl_mld_set_key_rx_seq()
690 key_data->gtk.aes_seq); in iwl_mld_set_key_rx_seq()
693 iwl_mld_set_key_rx_seq_tids(key, in iwl_mld_set_key_rx_seq()
694 key_data->gtk.tkip_seq); in iwl_mld_set_key_rx_seq()
701 ieee80211_set_key_rx_seq(key, 0, in iwl_mld_set_key_rx_seq()
702 &key_data->igtk_bigtk.cmac_gmac_seq); in iwl_mld_set_key_rx_seq()
713 struct ieee80211_key_conf *key, in iwl_mld_d3_update_mcast_key() argument
716 if (key->keyidx != key_data->id && in iwl_mld_d3_update_mcast_key()
717 (key->keyidx < 4 || key->keyidx > 5)) { in iwl_mld_d3_update_mcast_key()
720 key->keyidx, key_data->id); in iwl_mld_d3_update_mcast_key()
726 * We remove an existing key if it has the same index as in iwl_mld_d3_update_mcast_key()
727 * a new key and a rekey has occurred during d3 in iwl_mld_d3_update_mcast_key()
729 if (wowlan_status->num_of_gtk_rekeys && key_data->len) { in iwl_mld_d3_update_mcast_key()
730 if (key->keyidx == 4 || key->keyidx == 5) { in iwl_mld_d3_update_mcast_key()
734 int link_id = vif->active_links ? in iwl_mld_d3_update_mcast_key()
735 __ffs(vif->active_links) : 0; in iwl_mld_d3_update_mcast_key()
742 if (mld_link->igtk == key) in iwl_mld_d3_update_mcast_key()
743 mld_link->igtk = NULL; in iwl_mld_d3_update_mcast_key()
744 mld->num_igtks--; in iwl_mld_d3_update_mcast_key()
747 ieee80211_remove_key(key); in iwl_mld_d3_update_mcast_key()
751 iwl_mld_set_key_rx_seq(key, key_data); in iwl_mld_d3_update_mcast_key()
758 struct ieee80211_key_conf *key, in iwl_mld_update_ptk_rx_seq() argument
764 wiphy_dereference(mld->wiphy, in iwl_mld_update_ptk_rx_seq()
765 mld_sta->ptk_pn[key->keyidx]); in iwl_mld_update_ptk_rx_seq()
767 iwl_mld_set_key_rx_seq_tids(key, is_tkip ? in iwl_mld_update_ptk_rx_seq()
768 wowlan_status->ptk.tkip_seq : in iwl_mld_update_ptk_rx_seq()
769 wowlan_status->ptk.aes_seq); in iwl_mld_update_ptk_rx_seq()
777 for (int i = 1; i < mld->trans->num_rx_queues; i++) in iwl_mld_update_ptk_rx_seq()
778 memcpy(mld_ptk_pn->q[i].pn[tid], in iwl_mld_update_ptk_rx_seq()
779 wowlan_status->ptk.aes_seq[tid].ccmp.pn, in iwl_mld_update_ptk_rx_seq()
788 struct ieee80211_key_conf *key, in iwl_mld_resume_keys_iter() argument
792 struct iwl_mld_wowlan_status *wowlan_status = data->wowlan_status; in iwl_mld_resume_keys_iter()
795 /* TODO: check key link id (task=MLO) */ in iwl_mld_resume_keys_iter()
796 if (data->unhandled_cipher) in iwl_mld_resume_keys_iter()
799 switch (key->cipher) { in iwl_mld_resume_keys_iter()
809 iwl_mld_update_ptk_rx_seq(data->mld, wowlan_status, in iwl_mld_resume_keys_iter()
810 sta, key, in iwl_mld_resume_keys_iter()
811 key->cipher == in iwl_mld_resume_keys_iter()
816 if (WARN_ON(data->gtk_cipher && in iwl_mld_resume_keys_iter()
817 data->gtk_cipher != key->cipher)) in iwl_mld_resume_keys_iter()
820 data->gtk_cipher = key->cipher; in iwl_mld_resume_keys_iter()
821 status_idx = key->keyidx == wowlan_status->gtk[1].id; in iwl_mld_resume_keys_iter()
822 iwl_mld_d3_update_mcast_key(data->mld, vif, wowlan_status, key, in iwl_mld_resume_keys_iter()
823 &wowlan_status->gtk[status_idx]); in iwl_mld_resume_keys_iter()
829 if (key->keyidx == 4 || key->keyidx == 5) { in iwl_mld_resume_keys_iter()
830 if (WARN_ON(data->igtk_cipher && in iwl_mld_resume_keys_iter()
831 data->igtk_cipher != key->cipher)) in iwl_mld_resume_keys_iter()
834 data->igtk_cipher = key->cipher; in iwl_mld_resume_keys_iter()
835 iwl_mld_d3_update_mcast_key(data->mld, vif, in iwl_mld_resume_keys_iter()
837 key, &wowlan_status->igtk); in iwl_mld_resume_keys_iter()
839 if (key->keyidx == 6 || key->keyidx == 7) { in iwl_mld_resume_keys_iter()
840 if (WARN_ON(data->bigtk_cipher && in iwl_mld_resume_keys_iter()
841 data->bigtk_cipher != key->cipher)) in iwl_mld_resume_keys_iter()
844 data->bigtk_cipher = key->cipher; in iwl_mld_resume_keys_iter()
845 status_idx = key->keyidx == wowlan_status->bigtk[1].id; in iwl_mld_resume_keys_iter()
846 iwl_mld_d3_update_mcast_key(data->mld, vif, in iwl_mld_resume_keys_iter()
847 wowlan_status, key, in iwl_mld_resume_keys_iter()
848 &wowlan_status->bigtk[status_idx]); in iwl_mld_resume_keys_iter()
852 data->unhandled_cipher = true; in iwl_mld_resume_keys_iter()
855 data->num_keys++; in iwl_mld_resume_keys_iter()
868 u8 key[WOWLAN_KEY_MAX_SIZE]; in iwl_mld_add_mcast_rekey() member
871 .conf.keyidx = key_data->id, in iwl_mld_add_mcast_rekey()
873 int link_id = vif->active_links ? __ffs(vif->active_links) : -1; in iwl_mld_add_mcast_rekey()
876 BUILD_BUG_ON(sizeof(conf.key) < WLAN_KEY_LEN_CCMP); in iwl_mld_add_mcast_rekey()
877 BUILD_BUG_ON(sizeof(conf.key) < WLAN_KEY_LEN_GCMP_256); in iwl_mld_add_mcast_rekey()
878 BUILD_BUG_ON(sizeof(conf.key) < WLAN_KEY_LEN_TKIP); in iwl_mld_add_mcast_rekey()
879 BUILD_BUG_ON(sizeof(conf.key) < WLAN_KEY_LEN_BIP_GMAC_128); in iwl_mld_add_mcast_rekey()
880 BUILD_BUG_ON(sizeof(conf.key) < WLAN_KEY_LEN_BIP_GMAC_256); in iwl_mld_add_mcast_rekey()
881 BUILD_BUG_ON(sizeof(conf.key) < WLAN_KEY_LEN_AES_CMAC); in iwl_mld_add_mcast_rekey()
882 BUILD_BUG_ON(sizeof(conf.key) < sizeof(key_data->key)); in iwl_mld_add_mcast_rekey()
884 if (!key_data->len) in iwl_mld_add_mcast_rekey()
914 memcpy(conf.conf.key, key_data->key, conf.conf.keylen); in iwl_mld_add_mcast_rekey()
922 if (key_config->keyidx == 4 || key_config->keyidx == 5) { in iwl_mld_add_mcast_rekey()
925 mld_link->igtk = key_config; in iwl_mld_add_mcast_rekey()
926 mld->num_igtks++; in iwl_mld_add_mcast_rekey()
939 for (i = 0; i < ARRAY_SIZE(wowlan_status->gtk); i++) in iwl_mld_add_all_rekeys()
940 if (!iwl_mld_add_mcast_rekey(vif, key_iter_data->mld, in iwl_mld_add_all_rekeys()
941 &wowlan_status->gtk[i], in iwl_mld_add_all_rekeys()
943 key_iter_data->gtk_cipher)) in iwl_mld_add_all_rekeys()
946 if (!iwl_mld_add_mcast_rekey(vif, key_iter_data->mld, in iwl_mld_add_all_rekeys()
947 &wowlan_status->igtk, in iwl_mld_add_all_rekeys()
948 link_conf, key_iter_data->igtk_cipher)) in iwl_mld_add_all_rekeys()
951 for (i = 0; i < ARRAY_SIZE(wowlan_status->bigtk); i++) in iwl_mld_add_all_rekeys()
952 if (!iwl_mld_add_mcast_rekey(vif, key_iter_data->mld, in iwl_mld_add_all_rekeys()
953 &wowlan_status->bigtk[i], in iwl_mld_add_all_rekeys()
955 key_iter_data->bigtk_cipher)) in iwl_mld_add_all_rekeys()
966 int link_id = vif->active_links ? __ffs(vif->active_links) : 0; in iwl_mld_update_sec_keys()
969 __be64 replay_ctr = cpu_to_be64(wowlan_status->replay_ctr); in iwl_mld_update_sec_keys()
978 ieee80211_iter_keys(mld->hw, vif, iwl_mld_resume_keys_iter, in iwl_mld_update_sec_keys()
987 wowlan_status->num_of_gtk_rekeys); in iwl_mld_update_sec_keys()
989 if (!key_iter_data.num_keys || !wowlan_status->num_of_gtk_rekeys) in iwl_mld_update_sec_keys()
995 ieee80211_gtk_rekey_notify(vif, link_conf->bssid, in iwl_mld_update_sec_keys()
1007 struct ieee80211_sta *ap_sta = mld_vif->ap_sta; in iwl_mld_process_wowlan_status()
1016 iwl_mld_txq_from_mac80211(ap_sta->txq[wowlan_status->tid_offloaded_tx]); in iwl_mld_process_wowlan_status()
1020 * The firmware stores last-used value, we store next value. in iwl_mld_process_wowlan_status()
1022 WARN_ON(!mld_txq->status.allocated); in iwl_mld_process_wowlan_status()
1023 iwl_trans_set_q_ptrs(mld->trans, mld_txq->fw_id, in iwl_mld_process_wowlan_status()
1024 (wowlan_status->last_qos_seq + in iwl_mld_process_wowlan_status()
1030 if (wowlan_status->wakeup_reasons & in iwl_mld_process_wowlan_status()
1044 struct iwl_mld_netdetect_res *results = resume_data->netdetect_res; in iwl_mld_netdetect_match_info_handler()
1045 const struct iwl_scan_offload_match_info *notif = (void *)pkt->data; in iwl_mld_netdetect_match_info_handler()
1048 if (IWL_FW_CHECK(mld, !mld->netdetect, in iwl_mld_netdetect_match_info_handler()
1049 "Got scan match info notif when mld->netdetect==%d\n", in iwl_mld_netdetect_match_info_handler()
1050 mld->netdetect)) in iwl_mld_netdetect_match_info_handler()
1058 if (IWL_FW_CHECK(mld, resume_data->wowlan_status->wakeup_reasons != in iwl_mld_netdetect_match_info_handler()
1060 "Ignore scan match info: unexpected wakeup reason (expected=0x%x got=0x%x)\n", in iwl_mld_netdetect_match_info_handler()
1062 resume_data->wowlan_status->wakeup_reasons)) in iwl_mld_netdetect_match_info_handler()
1065 results->matched_profiles = le32_to_cpu(notif->matched_profiles); in iwl_mld_netdetect_match_info_handler()
1067 results->matched_profiles); in iwl_mld_netdetect_match_info_handler()
1069 if (results->matched_profiles) in iwl_mld_netdetect_match_info_handler()
1070 memcpy(results->matches, notif->matches, in iwl_mld_netdetect_match_info_handler()
1074 mld->scan.status = 0; in iwl_mld_netdetect_match_info_handler()
1075 memset(mld->scan.uid_status, 0, sizeof(mld->scan.uid_status)); in iwl_mld_netdetect_match_info_handler()
1088 for_each_set_bit(i, &matched_profiles, netdetect_cfg->n_match_sets) { in iwl_mld_set_netdetect_info()
1092 (void *)netdetect_res->matches; in iwl_mld_set_netdetect_info()
1102 netdetect_info->matches[netdetect_info->n_matches] = match; in iwl_mld_set_netdetect_info()
1103 netdetect_info->n_matches++; in iwl_mld_set_netdetect_info()
1108 idx = netdetect_cfg->n_match_sets - i - 1; in iwl_mld_set_netdetect_info()
1109 match->ssid.ssid_len = in iwl_mld_set_netdetect_info()
1110 netdetect_cfg->match_sets[idx].ssid.ssid_len; in iwl_mld_set_netdetect_info()
1111 memcpy(match->ssid.ssid, in iwl_mld_set_netdetect_info()
1112 netdetect_cfg->match_sets[idx].ssid.ssid, in iwl_mld_set_netdetect_info()
1113 match->ssid.ssid_len); in iwl_mld_set_netdetect_info()
1115 if (netdetect_cfg->n_channels < n_channels) in iwl_mld_set_netdetect_info()
1121 match->channels[match->n_channels] = in iwl_mld_set_netdetect_info()
1122 netdetect_cfg->channels[j]->center_freq; in iwl_mld_set_netdetect_info()
1123 match->n_channels++; in iwl_mld_set_netdetect_info()
1135 struct cfg80211_wowlan_wakeup wakeup = { in iwl_mld_process_netdetect_res() local
1136 .pattern_idx = -1, in iwl_mld_process_netdetect_res()
1138 struct cfg80211_wowlan_wakeup *wakeup_report = &wakeup; in iwl_mld_process_netdetect_res()
1143 lockdep_assert_wiphy(mld->wiphy); in iwl_mld_process_netdetect_res()
1145 if (WARN_ON(!mld->wiphy->wowlan_config || in iwl_mld_process_netdetect_res()
1146 !mld->wiphy->wowlan_config->nd_config)) { in iwl_mld_process_netdetect_res()
1152 netdetect_cfg = mld->wiphy->wowlan_config->nd_config; in iwl_mld_process_netdetect_res()
1153 wakeup_reasons = resume_data->wowlan_status->wakeup_reasons; in iwl_mld_process_netdetect_res()
1156 wakeup.rfkill_release = true; in iwl_mld_process_netdetect_res()
1161 if (!resume_data->netdetect_res->matched_profiles) { in iwl_mld_process_netdetect_res()
1168 matched_profiles = resume_data->netdetect_res->matched_profiles; in iwl_mld_process_netdetect_res()
1169 if (!netdetect_cfg->n_match_sets) { in iwl_mld_process_netdetect_res()
1179 resume_data->netdetect_res, in iwl_mld_process_netdetect_res()
1182 wakeup.net_detect = netdetect_info; in iwl_mld_process_netdetect_res()
1186 for (int i = 0; i < netdetect_info->n_matches; i++) in iwl_mld_process_netdetect_res()
1187 kfree(netdetect_info->matches[i]); in iwl_mld_process_netdetect_res()
1199 switch (WIDE_ID(pkt->hdr.group_id, pkt->hdr.cmd)) { in iwl_mld_handle_d3_notif()
1201 if (resume_data->notifs_received & IWL_D3_NOTIF_WOWLAN_INFO) { in iwl_mld_handle_d3_notif()
1206 resume_data->notif_handling_err = in iwl_mld_handle_d3_notif()
1208 resume_data->wowlan_status, in iwl_mld_handle_d3_notif()
1210 resume_data->notifs_received |= IWL_D3_NOTIF_WOWLAN_INFO; in iwl_mld_handle_d3_notif()
1212 if (resume_data->wowlan_status->wakeup_reasons & in iwl_mld_handle_d3_notif()
1214 resume_data->notifs_expected |= in iwl_mld_handle_d3_notif()
1219 if (resume_data->notifs_received & in iwl_mld_handle_d3_notif()
1226 resume_data->notif_handling_err = in iwl_mld_handle_d3_notif()
1228 resume_data->wowlan_status, in iwl_mld_handle_d3_notif()
1230 resume_data->notifs_received |= IWL_D3_NOTIF_WOWLAN_WAKE_PKT; in iwl_mld_handle_d3_notif()
1234 if (resume_data->notifs_received & IWL_D3_ND_MATCH_INFO) { in iwl_mld_handle_d3_notif()
1240 resume_data->notif_handling_err = in iwl_mld_handle_d3_notif()
1243 resume_data->notifs_received |= IWL_D3_ND_MATCH_INFO; in iwl_mld_handle_d3_notif()
1247 struct iwl_d3_end_notif *notif = (void *)pkt->data; in iwl_mld_handle_d3_notif()
1249 resume_data->d3_end_flags = le32_to_cpu(notif->flags); in iwl_mld_handle_d3_notif()
1250 resume_data->notifs_received |= IWL_D3_NOTIF_D3_END_NOTIF; in iwl_mld_handle_d3_notif()
1257 return resume_data->notifs_received == resume_data->notifs_expected; in iwl_mld_handle_d3_notif()
1280 iwl_init_notification_wait(&mld->notif_wait, &wait_d3_notif, in iwl_mld_wait_d3_notif()
1286 iwl_init_notification_wait(&mld->notif_wait, &wait_d3_notif, in iwl_mld_wait_d3_notif()
1292 ret = iwl_trans_d3_resume(mld->trans, &d3_status, false, false); in iwl_mld_wait_d3_notif()
1296 ret = -ENOENT; in iwl_mld_wait_d3_notif()
1300 iwl_remove_notification(&mld->notif_wait, &wait_d3_notif); in iwl_mld_wait_d3_notif()
1304 ret = iwl_wait_notification(&mld->notif_wait, &wait_d3_notif, in iwl_mld_wait_d3_notif()
1309 if (resume_data->notif_handling_err) in iwl_mld_wait_d3_notif()
1310 ret = -EIO; in iwl_mld_wait_d3_notif()
1320 lockdep_assert_wiphy(mld->wiphy); in iwl_mld_no_wowlan_suspend()
1327 if (mld->trans->state == IWL_TRANS_NO_FW && in iwl_mld_no_wowlan_suspend()
1328 test_bit(STATUS_FW_ERROR, &mld->trans->status)) in iwl_mld_no_wowlan_suspend()
1329 return -ENODEV; in iwl_mld_no_wowlan_suspend()
1346 ret = iwl_trans_d3_suspend(mld->trans, false, false); in iwl_mld_no_wowlan_suspend()
1350 mld->trans->system_pm_mode = IWL_PLAT_PM_MODE_D3; in iwl_mld_no_wowlan_suspend()
1351 mld->fw_status.in_d3 = true; in iwl_mld_no_wowlan_suspend()
1356 mld->trans->state = IWL_TRANS_NO_FW; in iwl_mld_no_wowlan_suspend()
1357 set_bit(STATUS_FW_ERROR, &mld->trans->status); in iwl_mld_no_wowlan_suspend()
1371 lockdep_assert_wiphy(mld->wiphy); in iwl_mld_no_wowlan_resume()
1375 mld->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED; in iwl_mld_no_wowlan_resume()
1376 mld->fw_status.in_d3 = false; in iwl_mld_no_wowlan_resume()
1377 iwl_fw_dbg_read_d3_debug_data(&mld->fwrt); in iwl_mld_no_wowlan_resume()
1380 ret = -ENODEV; in iwl_mld_no_wowlan_resume()
1385 return -ENODEV; in iwl_mld_no_wowlan_resume()
1388 mld->trans->state = IWL_TRANS_NO_FW; in iwl_mld_no_wowlan_resume()
1389 set_bit(STATUS_FW_ERROR, &mld->trans->status); in iwl_mld_no_wowlan_resume()
1398 iwl_mld_aes_seq_to_le64_pn(struct ieee80211_key_conf *key, in iwl_mld_aes_seq_to_le64_pn() argument
1403 u8 *pn = key->cipher == WLAN_CIPHER_SUITE_CCMP ? seq.ccmp.pn : in iwl_mld_aes_seq_to_le64_pn()
1406 ieee80211_get_key_rx_seq(key, i, &seq); in iwl_mld_aes_seq_to_le64_pn()
1418 struct ieee80211_key_conf *key, __le64 *key_rsc) in iwl_mld_suspend_set_ucast_pn() argument
1424 if (WARN_ON(key->keyidx >= ARRAY_SIZE(mld_sta->ptk_pn))) in iwl_mld_suspend_set_ucast_pn()
1427 mld_ptk_pn = wiphy_dereference(mld->wiphy, in iwl_mld_suspend_set_ucast_pn()
1428 mld_sta->ptk_pn[key->keyidx]); in iwl_mld_suspend_set_ucast_pn()
1437 ieee80211_get_key_rx_seq(key, tid, &seq); in iwl_mld_suspend_set_ucast_pn()
1440 for (int que = 1; que < mld->trans->num_rx_queues; que++) { in iwl_mld_suspend_set_ucast_pn()
1441 u8 *cur_pn = mld_ptk_pn->q[que].pn[tid]; in iwl_mld_suspend_set_ucast_pn()
1456 iwl_mld_suspend_convert_tkip_ipn(struct ieee80211_key_conf *key, in iwl_mld_suspend_convert_tkip_ipn() argument
1462 ieee80211_get_key_rx_seq(key, i, &seq); in iwl_mld_suspend_convert_tkip_ipn()
1473 struct ieee80211_key_conf *key, in iwl_mld_suspend_key_data_iter() argument
1481 switch (key->cipher) { in iwl_mld_suspend_key_data_iter()
1494 key_rsc = data->rsc->ucast_rsc; in iwl_mld_suspend_key_data_iter()
1495 if (key->cipher == WLAN_CIPHER_SUITE_TKIP) in iwl_mld_suspend_key_data_iter()
1496 iwl_mld_suspend_convert_tkip_ipn(key, key_rsc); in iwl_mld_suspend_key_data_iter()
1498 iwl_mld_suspend_set_ucast_pn(mld, sta, key, in iwl_mld_suspend_key_data_iter()
1501 data->have_rsc = true; in iwl_mld_suspend_key_data_iter()
1507 if (WARN_ON(data->gtks >= in iwl_mld_suspend_key_data_iter()
1508 ARRAY_SIZE(data->found_gtk_idx))) in iwl_mld_suspend_key_data_iter()
1511 if (WARN_ON(key->keyidx >= in iwl_mld_suspend_key_data_iter()
1512 ARRAY_SIZE(data->rsc->mcast_key_id_map))) in iwl_mld_suspend_key_data_iter()
1514 data->gtk_cipher = cipher; in iwl_mld_suspend_key_data_iter()
1515 data->found_gtk_idx[data->gtks] = key->keyidx; in iwl_mld_suspend_key_data_iter()
1516 key_rsc = data->rsc->mcast_rsc[data->gtks % 2]; in iwl_mld_suspend_key_data_iter()
1517 data->rsc->mcast_key_id_map[key->keyidx] = in iwl_mld_suspend_key_data_iter()
1518 data->gtks % 2; in iwl_mld_suspend_key_data_iter()
1520 if (data->gtks >= 2) { in iwl_mld_suspend_key_data_iter()
1521 int prev = data->gtks % 2; in iwl_mld_suspend_key_data_iter()
1522 int prev_idx = data->found_gtk_idx[prev]; in iwl_mld_suspend_key_data_iter()
1524 data->rsc->mcast_key_id_map[prev_idx] = in iwl_mld_suspend_key_data_iter()
1528 if (key->cipher == WLAN_CIPHER_SUITE_TKIP) in iwl_mld_suspend_key_data_iter()
1529 iwl_mld_suspend_convert_tkip_ipn(key, key_rsc); in iwl_mld_suspend_key_data_iter()
1531 iwl_mld_aes_seq_to_le64_pn(key, key_rsc); in iwl_mld_suspend_key_data_iter()
1533 data->gtks++; in iwl_mld_suspend_key_data_iter()
1534 data->have_rsc = true; in iwl_mld_suspend_key_data_iter()
1544 if (key->keyidx == 4 || key->keyidx == 5) in iwl_mld_suspend_key_data_iter()
1545 data->igtk_cipher = cipher; in iwl_mld_suspend_key_data_iter()
1547 if (key->keyidx == 6 || key->keyidx == 7) in iwl_mld_suspend_key_data_iter()
1548 data->bigtk_cipher = cipher; in iwl_mld_suspend_key_data_iter()
1562 &mld_vif->wowlan_data.rekey_data; in iwl_mld_send_kek_kck_cmd()
1564 memcpy(kek_kck_cmd.kck, rekey_data->kck, in iwl_mld_send_kek_kck_cmd()
1565 rekey_data->kck_len); in iwl_mld_send_kek_kck_cmd()
1566 kek_kck_cmd.kck_len = cpu_to_le16(rekey_data->kck_len); in iwl_mld_send_kek_kck_cmd()
1567 memcpy(kek_kck_cmd.kek, rekey_data->kek, in iwl_mld_send_kek_kck_cmd()
1568 rekey_data->kek_len); in iwl_mld_send_kek_kck_cmd()
1569 kek_kck_cmd.kek_len = cpu_to_le16(rekey_data->kek_len); in iwl_mld_send_kek_kck_cmd()
1570 kek_kck_cmd.replay_ctr = rekey_data->replay_ctr; in iwl_mld_send_kek_kck_cmd()
1571 kek_kck_cmd.akm = cpu_to_le32(rekey_data->akm); in iwl_mld_send_kek_kck_cmd()
1578 rekey_data->akm); in iwl_mld_send_kek_kck_cmd()
1595 return -ENOMEM; in iwl_mld_suspend_send_security_cmds()
1597 memset(data.rsc->mcast_key_id_map, IWL_MCAST_KEY_MAP_INVALID, in iwl_mld_suspend_send_security_cmds()
1598 ARRAY_SIZE(data.rsc->mcast_key_id_map)); in iwl_mld_suspend_send_security_cmds()
1600 data.rsc->sta_id = cpu_to_le32(ap_sta_id); in iwl_mld_suspend_send_security_cmds()
1601 ieee80211_iter_keys(mld->hw, vif, in iwl_mld_suspend_send_security_cmds()
1611 if (!ret && mld_vif->wowlan_data.rekey_data.valid) in iwl_mld_suspend_send_security_cmds()
1625 wowlan_config_cmd->is_11n_connection = in iwl_mld_set_wowlan_config_cmd()
1626 ap_sta->deflink.ht_cap.ht_supported; in iwl_mld_set_wowlan_config_cmd()
1627 wowlan_config_cmd->flags = ENABLE_L3_FILTERING | in iwl_mld_set_wowlan_config_cmd()
1630 if (ap_sta->mfp) in iwl_mld_set_wowlan_config_cmd()
1631 wowlan_config_cmd->flags |= IS_11W_ASSOC; in iwl_mld_set_wowlan_config_cmd()
1633 if (wowlan->disconnect) in iwl_mld_set_wowlan_config_cmd()
1634 wowlan_config_cmd->wakeup_filter |= in iwl_mld_set_wowlan_config_cmd()
1637 if (wowlan->magic_pkt) in iwl_mld_set_wowlan_config_cmd()
1638 wowlan_config_cmd->wakeup_filter |= in iwl_mld_set_wowlan_config_cmd()
1640 if (wowlan->gtk_rekey_failure) in iwl_mld_set_wowlan_config_cmd()
1641 wowlan_config_cmd->wakeup_filter |= in iwl_mld_set_wowlan_config_cmd()
1643 if (wowlan->eap_identity_req) in iwl_mld_set_wowlan_config_cmd()
1644 wowlan_config_cmd->wakeup_filter |= in iwl_mld_set_wowlan_config_cmd()
1646 if (wowlan->four_way_handshake) in iwl_mld_set_wowlan_config_cmd()
1647 wowlan_config_cmd->wakeup_filter |= in iwl_mld_set_wowlan_config_cmd()
1649 if (wowlan->n_patterns) in iwl_mld_set_wowlan_config_cmd()
1650 wowlan_config_cmd->wakeup_filter |= in iwl_mld_set_wowlan_config_cmd()
1653 if (wowlan->rfkill_release) in iwl_mld_set_wowlan_config_cmd()
1654 wowlan_config_cmd->wakeup_filter |= in iwl_mld_set_wowlan_config_cmd()
1657 if (wowlan->any) { in iwl_mld_set_wowlan_config_cmd()
1658 wowlan_config_cmd->wakeup_filter |= in iwl_mld_set_wowlan_config_cmd()
1677 if (!wowlan->n_patterns) in iwl_mld_send_patterns()
1680 cmd.len[0] = struct_size(pattern_cmd, patterns, wowlan->n_patterns); in iwl_mld_send_patterns()
1684 return -ENOMEM; in iwl_mld_send_patterns()
1686 pattern_cmd->n_patterns = wowlan->n_patterns; in iwl_mld_send_patterns()
1687 pattern_cmd->sta_id = ap_sta_id; in iwl_mld_send_patterns()
1689 for (int i = 0; i < wowlan->n_patterns; i++) { in iwl_mld_send_patterns()
1690 int mask_len = DIV_ROUND_UP(wowlan->patterns[i].pattern_len, 8); in iwl_mld_send_patterns()
1692 pattern_cmd->patterns[i].pattern_type = in iwl_mld_send_patterns()
1695 memcpy(&pattern_cmd->patterns[i].u.bitmask.mask, in iwl_mld_send_patterns()
1696 wowlan->patterns[i].mask, mask_len); in iwl_mld_send_patterns()
1697 memcpy(&pattern_cmd->patterns[i].u.bitmask.pattern, in iwl_mld_send_patterns()
1698 wowlan->patterns[i].pattern, in iwl_mld_send_patterns()
1699 wowlan->patterns[i].pattern_len); in iwl_mld_send_patterns()
1700 pattern_cmd->patterns[i].u.bitmask.mask_size = mask_len; in iwl_mld_send_patterns()
1701 pattern_cmd->patterns[i].u.bitmask.pattern_size = in iwl_mld_send_patterns()
1702 wowlan->patterns[i].pattern_len; in iwl_mld_send_patterns()
1728 struct iwl_mld_wowlan_data *wowlan_data = &mld_vif->wowlan_data; in iwl_mld_send_proto_offload()
1735 nsc = cmd->ns_config; in iwl_mld_send_proto_offload()
1737 addrs = cmd->targ_addrs; in iwl_mld_send_proto_offload()
1745 i < wowlan_data->num_target_ipv6_addrs && in iwl_mld_send_proto_offload()
1753 if (test_bit(i, wowlan_data->tentative_addrs)) { in iwl_mld_send_proto_offload()
1758 addrconf_addr_solict_mult(&wowlan_data->target_ipv6_addrs[i], in iwl_mld_send_proto_offload()
1766 addrs[i].addr = wowlan_data->target_ipv6_addrs[i]; in iwl_mld_send_proto_offload()
1769 memcpy(nsc[j].target_mac_addr, vif->addr, ETH_ALEN); in iwl_mld_send_proto_offload()
1772 if (wowlan_data->num_target_ipv6_addrs - num_skipped) in iwl_mld_send_proto_offload()
1775 cmd->num_valid_ipv6_addrs = cpu_to_le32(i - num_skipped); in iwl_mld_send_proto_offload()
1780 if (vif->cfg.arp_addr_cnt) { in iwl_mld_send_proto_offload()
1782 cmd->common.host_ipv4_addr = vif->cfg.arp_addr_list[0]; in iwl_mld_send_proto_offload()
1783 ether_addr_copy(cmd->common.arp_mac_addr, vif->addr); in iwl_mld_send_proto_offload()
1787 cmd->common.enabled = cpu_to_le32(enabled); in iwl_mld_send_proto_offload()
1788 cmd->sta_id = cpu_to_le32(ap_sta_id); in iwl_mld_send_proto_offload()
1798 struct ieee80211_sta *ap_sta = mld_vif->ap_sta; in iwl_mld_wowlan_config()
1815 return -EINVAL; in iwl_mld_wowlan_config()
1819 return -EINVAL; in iwl_mld_wowlan_config()
1825 ap_sta->txq[wowlan_config_cmd.offloading_tid]); in iwl_mld_wowlan_config()
1857 lockdep_assert_wiphy(mld->wiphy); in iwl_mld_wowlan_suspend()
1868 if (!bss_vif->cfg.assoc) { in iwl_mld_wowlan_suspend()
1871 if (WARN_ON(!wowlan->nd_config)) in iwl_mld_wowlan_suspend()
1876 mld->netdetect = true; in iwl_mld_wowlan_suspend()
1902 lockdep_assert_wiphy(mld->wiphy); in iwl_mld_wowlan_resume()
1906 mld->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED; in iwl_mld_wowlan_resume()
1907 if (!mld->fw_status.in_d3) { in iwl_mld_wowlan_resume()
1913 mld->fw_status.in_d3 = false; in iwl_mld_wowlan_resume()
1914 mld->scan.last_start_time_jiffies = jiffies; in iwl_mld_wowlan_resume()
1923 WARN_ON(hweight16(bss_vif->active_links) > 1); in iwl_mld_wowlan_resume()
1924 link_id = bss_vif->active_links ? __ffs(bss_vif->active_links) : 0; in iwl_mld_wowlan_resume()
1930 iwl_fw_dbg_read_d3_debug_data(&mld->fwrt); in iwl_mld_wowlan_resume()
1940 return -1; in iwl_mld_wowlan_resume()
1942 if (mld->netdetect) in iwl_mld_wowlan_resume()
1953 mld->fw_status.in_hw_restart = true; in iwl_mld_wowlan_resume()
1962 if (mld->netdetect) in iwl_mld_wowlan_resume()
1966 if (mld->netdetect) { in iwl_mld_wowlan_resume()
1968 mld->netdetect = false; in iwl_mld_wowlan_resume()
1986 mld->trans->state = IWL_TRANS_NO_FW; in iwl_mld_wowlan_resume()
1987 set_bit(STATUS_FW_ERROR, &mld->trans->status); in iwl_mld_wowlan_resume()
1990 mld->fw_status.in_hw_restart = true; in iwl_mld_wowlan_resume()
1994 kfree(resume_data.wowlan_status->wake_packet); in iwl_mld_wowlan_resume()