Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'wireless-next-2026-03-04' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next

Johannes Berg says:

====================
Notable features this time:
- cfg80211/mac80211
- finished assoc frame encryption/EPPKE/802.1X-over-auth
(also hwsim)
- radar detection improvements
- 6 GHz incumbent signal detection APIs
- multi-link support for FILS, probe response
templates and client probling
- ath12k:
- monitor mode support on IPQ5332
- basic hwmon temperature reporting

* tag 'wireless-next-2026-03-04' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (38 commits)
wifi: UHR: define DPS/DBE/P-EDCA elements and fix size parsing
wifi: mac80211_hwsim: change hwsim_class to a const struct
wifi: mac80211: give the AP more time for EPPKE as well
wifi: ath12k: Remove the unused argument from the Rx data path
wifi: ath12k: Enable monitor mode support on IPQ5332
wifi: ath12k: Set up MLO after SSR
wifi: ath11k: Silence remoteproc probe deferral prints
wifi: cfg80211: support key installation on non-netdev wdevs
wifi: cfg80211: make cluster id an array
wifi: mac80211: update outdated comment
wifi: mac80211: Advertise IEEE 802.1X authentication support
wifi: mac80211: Add support for IEEE 802.1X authentication protocol in non-AP STA mode
wifi: cfg80211: add support for IEEE 802.1X Authentication Protocol
wifi: mac80211: Advertise EPPKE support based on driver capabilities
wifi: mac80211_hwsim: Advertise support for (Re)Association frame encryption
wifi: mac80211: Fix AAD/Nonce computation for management frames with MLO
wifi: rt2x00: use generic nvmem_cell_get
wifi: mac80211: fetch unsolicited probe response template by link ID
wifi: mac80211: fetch FILS discovery template by link ID
wifi: nl80211: don't allow DFS channels for NAN
...
====================

Link: https://patch.msgid.link/20260304113707.175181-3-johannes@sipsolutions.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+1628 -584
+3 -7
drivers/net/wireless/ath/ath11k/ahb.c
··· 807 807 } 808 808 809 809 prproc = rproc_get_by_phandle(rproc_phandle); 810 - if (!prproc) { 811 - ath11k_dbg(ab, ATH11K_DBG_AHB, "failed to get rproc, deferring\n"); 812 - return -EPROBE_DEFER; 813 - } 810 + if (!prproc) 811 + return dev_err_probe(&ab->pdev->dev, -EPROBE_DEFER, "failed to get rproc\n"); 814 812 ab_ahb->tgt_rproc = prproc; 815 813 816 814 return 0; ··· 1188 1190 ath11k_ahb_init_qmi_ce_config(ab); 1189 1191 1190 1192 ret = ath11k_core_get_rproc(ab); 1191 - if (ret) { 1192 - ath11k_err(ab, "failed to get rproc: %d\n", ret); 1193 + if (ret) 1193 1194 goto err_ce_free; 1194 - } 1195 1195 1196 1196 ret = ath11k_core_init(ab); 1197 1197 if (ret) {
+19 -13
drivers/net/wireless/ath/ath11k/mac.c
··· 1557 1557 if (!beacons || !beacons->cnt) { 1558 1558 ath11k_warn(arvif->ar->ab, 1559 1559 "failed to get ema beacon templates from mac80211\n"); 1560 - return -EPERM; 1560 + ret = -EPERM; 1561 + goto free; 1561 1562 } 1562 1563 1563 1564 if (tx_arvif == arvif) { 1564 - if (ath11k_mac_set_vif_params(tx_arvif, beacons->bcn[0].skb)) 1565 - return -EINVAL; 1565 + if (ath11k_mac_set_vif_params(tx_arvif, beacons->bcn[0].skb)) { 1566 + ret = -EINVAL; 1567 + goto free; 1568 + } 1566 1569 } else { 1567 1570 arvif->wpaie_present = tx_arvif->wpaie_present; 1568 1571 } ··· 1592 1589 } 1593 1590 } 1594 1591 1595 - ieee80211_beacon_free_ema_list(beacons); 1596 - 1597 1592 if (tx_arvif != arvif && !nontx_vif_params_set) 1598 - return -EINVAL; /* Profile not found in the beacons */ 1593 + ret = -EINVAL; /* Profile not found in the beacons */ 1599 1594 1595 + free: 1596 + ieee80211_beacon_free_ema_list(beacons); 1600 1597 return ret; 1601 1598 } 1602 1599 ··· 1625 1622 } 1626 1623 1627 1624 if (tx_arvif == arvif) { 1628 - if (ath11k_mac_set_vif_params(tx_arvif, bcn)) 1629 - return -EINVAL; 1625 + if (ath11k_mac_set_vif_params(tx_arvif, bcn)) { 1626 + ret = -EINVAL; 1627 + goto free; 1628 + } 1630 1629 } else if (!ath11k_mac_set_nontx_vif_params(tx_arvif, arvif, bcn)) { 1631 - return -EINVAL; 1630 + ret = -EINVAL; 1631 + goto free; 1632 1632 } 1633 1633 1634 1634 ret = ath11k_wmi_bcn_tmpl(ar, arvif->vdev_id, &offs, bcn, 0); 1635 - kfree_skb(bcn); 1636 - 1637 1635 if (ret) 1638 1636 ath11k_warn(ab, "failed to submit beacon template command: %d\n", 1639 1637 ret); 1640 1638 1639 + free: 1640 + kfree_skb(bcn); 1641 1641 return ret; 1642 1642 } 1643 1643 ··· 3311 3305 if (info->fils_discovery.max_interval) { 3312 3306 interval = info->fils_discovery.max_interval; 3313 3307 3314 - tmpl = ieee80211_get_fils_discovery_tmpl(ar->hw, arvif->vif); 3308 + tmpl = ieee80211_get_fils_discovery_tmpl(ar->hw, arvif->vif, 0); 3315 3309 if (tmpl) 3316 3310 ret = ath11k_wmi_fils_discovery_tmpl(ar, arvif->vdev_id, 3317 3311 tmpl); ··· 3320 3314 interval = info->unsol_bcast_probe_resp_interval; 3321 3315 3322 3316 tmpl = ieee80211_get_unsol_bcast_probe_resp_tmpl(ar->hw, 3323 - arvif->vif); 3317 + arvif->vif, 0); 3324 3318 if (tmpl) 3325 3319 ret = ath11k_wmi_probe_resp_tmpl(ar, arvif->vdev_id, 3326 3320 tmpl);
+1
drivers/net/wireless/ath/ath12k/Makefile
··· 32 32 ath12k-$(CONFIG_PM) += wow.o 33 33 ath12k-$(CONFIG_ATH12K_COREDUMP) += coredump.o 34 34 ath12k-$(CONFIG_NL80211_TESTMODE) += testmode.o 35 + ath12k-$(CONFIG_THERMAL) += thermal.o 35 36 36 37 # for tracing framework to find trace.h 37 38 CFLAGS_trace.o := -I$(src)
+22 -1
drivers/net/wireless/ath/ath12k/core.c
··· 863 863 return ret; 864 864 } 865 865 866 + ret = ath12k_thermal_register(ab); 867 + if (ret) { 868 + ath12k_err(ab, "could not register thermal device: %d\n", ret); 869 + goto err_dp_pdev_free; 870 + } 871 + 866 872 return 0; 873 + 874 + err_dp_pdev_free: 875 + ath12k_dp_pdev_free(ab); 876 + return ret; 867 877 } 868 878 869 879 static void ath12k_core_pdev_destroy(struct ath12k_base *ab) 870 880 { 881 + ath12k_thermal_unregister(ab); 871 882 ath12k_dp_pdev_free(ab); 872 883 } 873 884 ··· 1017 1006 1018 1007 ath12k_mac_unregister(ag); 1019 1008 1009 + ath12k_mac_mlo_teardown(ag); 1010 + 1020 1011 for (i = ag->num_devices - 1; i >= 0; i--) { 1021 1012 ab = ag->ab[i]; 1022 1013 if (!ab) ··· 1136 1123 1137 1124 lockdep_assert_held(&ag->mutex); 1138 1125 1139 - if (test_bit(ATH12K_GROUP_FLAG_REGISTERED, &ag->flags)) 1126 + if (test_bit(ATH12K_GROUP_FLAG_REGISTERED, &ag->flags)) { 1127 + ret = ath12k_core_mlo_setup(ag); 1128 + if (WARN_ON(ret)) { 1129 + ath12k_mac_unregister(ag); 1130 + goto err_mac_destroy; 1131 + } 1140 1132 goto core_pdev_create; 1133 + } 1141 1134 1142 1135 ret = ath12k_mac_allocate(ag); 1143 1136 if (WARN_ON(ret)) ··· 1380 1361 1381 1362 mutex_lock(&ab->core_lock); 1382 1363 ath12k_link_sta_rhash_tbl_destroy(ab); 1364 + ath12k_thermal_unregister(ab); 1383 1365 ath12k_dp_pdev_free(ab); 1384 1366 ath12k_ce_cleanup_pipes(ab); 1385 1367 ath12k_wmi_detach(ab); ··· 1522 1502 complete(&ar->vdev_delete_done); 1523 1503 complete(&ar->bss_survey_done); 1524 1504 complete_all(&ar->regd_update_completed); 1505 + complete_all(&ar->thermal.wmi_sync); 1525 1506 1526 1507 wake_up(&ar->dp.tx_empty_waitq); 1527 1508 idr_for_each(&ar->txmgmt_idr,
+3
drivers/net/wireless/ath/ath12k/core.h
··· 36 36 #include "coredump.h" 37 37 #include "cmn_defs.h" 38 38 #include "dp_cmn.h" 39 + #include "thermal.h" 39 40 40 41 #define SM(_v, _f) (((_v) << _f##_LSB) & _f##_MASK) 41 42 ··· 758 757 759 758 s8 max_allowed_tx_power; 760 759 struct ath12k_pdev_rssi_offsets rssi_info; 760 + 761 + struct ath12k_thermal thermal; 761 762 }; 762 763 763 764 struct ath12k_hw {
-2
drivers/net/wireless/ath/ath12k/dp_rx.c
··· 1117 1117 } 1118 1118 1119 1119 void ath12k_dp_rx_h_undecap(struct ath12k_pdev_dp *dp_pdev, struct sk_buff *msdu, 1120 - struct hal_rx_desc *rx_desc, 1121 1120 enum hal_encrypt_type enctype, 1122 1121 bool decrypted, 1123 1122 struct hal_rx_desc_data *rx_info) ··· 1392 1393 EXPORT_SYMBOL(ath12k_dp_rx_deliver_msdu); 1393 1394 1394 1395 bool ath12k_dp_rx_check_nwifi_hdr_len_valid(struct ath12k_dp *dp, 1395 - struct hal_rx_desc *rx_desc, 1396 1396 struct sk_buff *msdu, 1397 1397 struct hal_rx_desc_data *rx_info) 1398 1398 {
-2
drivers/net/wireless/ath/ath12k/dp_rx.h
··· 189 189 } 190 190 191 191 void ath12k_dp_rx_h_undecap(struct ath12k_pdev_dp *dp_pdev, struct sk_buff *msdu, 192 - struct hal_rx_desc *rx_desc, 193 192 enum hal_encrypt_type enctype, 194 193 bool decrypted, 195 194 struct hal_rx_desc_data *rx_info); ··· 196 197 struct sk_buff *msdu, 197 198 struct hal_rx_desc_data *rx_info); 198 199 bool ath12k_dp_rx_check_nwifi_hdr_len_valid(struct ath12k_dp *dp, 199 - struct hal_rx_desc *rx_desc, 200 200 struct sk_buff *msdu, 201 201 struct hal_rx_desc_data *rx_info); 202 202 u64 ath12k_dp_rx_h_get_pn(struct ath12k_dp *dp, struct sk_buff *skb);
+8 -2
drivers/net/wireless/ath/ath12k/mac.c
··· 4311 4311 if (info->fils_discovery.max_interval) { 4312 4312 interval = info->fils_discovery.max_interval; 4313 4313 4314 - tmpl = ieee80211_get_fils_discovery_tmpl(hw, vif); 4314 + tmpl = ieee80211_get_fils_discovery_tmpl(hw, vif, 4315 + info->link_id); 4315 4316 if (tmpl) 4316 4317 ret = ath12k_wmi_fils_discovery_tmpl(ar, arvif->vdev_id, 4317 4318 tmpl); ··· 4320 4319 unsol_bcast_probe_resp_enabled = 1; 4321 4320 interval = info->unsol_bcast_probe_resp_interval; 4322 4321 4323 - tmpl = ieee80211_get_unsol_bcast_probe_resp_tmpl(hw, vif); 4322 + tmpl = ieee80211_get_unsol_bcast_probe_resp_tmpl(hw, vif, 4323 + info->link_id); 4324 4324 if (tmpl) 4325 4325 ret = ath12k_wmi_probe_resp_tmpl(ar, arvif->vdev_id, 4326 4326 tmpl); ··· 14793 14791 init_completion(&ar->mlo_setup_done); 14794 14792 init_completion(&ar->completed_11d_scan); 14795 14793 init_completion(&ar->regd_update_completed); 14794 + init_completion(&ar->thermal.wmi_sync); 14795 + 14796 + ar->thermal.temperature = 0; 14797 + ar->thermal.hwmon_dev = NULL; 14796 14798 14797 14799 INIT_DELAYED_WORK(&ar->scan.timeout, ath12k_scan_timeout_work); 14798 14800 wiphy_work_init(&ar->scan.vdev_clean_wk, ath12k_scan_vdev_clean_work);
+1 -1
drivers/net/wireless/ath/ath12k/qmi.c
··· 3339 3339 goto out; 3340 3340 } 3341 3341 3342 - aux_uc_mem->total_size = aux_uc_len; 3342 + aux_uc_mem->total_size = aux_uc_len; 3343 3343 3344 3344 copy: 3345 3345 memcpy(aux_uc_mem->vaddr, aux_uc_data, aux_uc_len);
+124
drivers/net/wireless/ath/ath12k/thermal.c
··· 1 + // SPDX-License-Identifier: BSD-3-Clause-Clear 2 + /* 3 + * Copyright (c) 2020 The Linux Foundation. All rights reserved. 4 + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. 5 + */ 6 + 7 + #include <linux/device.h> 8 + #include <linux/hwmon.h> 9 + #include <linux/hwmon-sysfs.h> 10 + #include <linux/sysfs.h> 11 + #include <linux/thermal.h> 12 + #include "core.h" 13 + #include "debug.h" 14 + 15 + static ssize_t ath12k_thermal_temp_show(struct device *dev, 16 + struct device_attribute *attr, 17 + char *buf) 18 + { 19 + struct ath12k *ar = dev_get_drvdata(dev); 20 + unsigned long time_left; 21 + int ret, temperature; 22 + 23 + guard(wiphy)(ath12k_ar_to_hw(ar)->wiphy); 24 + 25 + if (ar->ah->state != ATH12K_HW_STATE_ON) 26 + return -ENETDOWN; 27 + 28 + reinit_completion(&ar->thermal.wmi_sync); 29 + ret = ath12k_wmi_send_pdev_temperature_cmd(ar); 30 + if (ret) { 31 + ath12k_warn(ar->ab, "failed to read temperature %d\n", ret); 32 + return ret; 33 + } 34 + 35 + if (test_bit(ATH12K_FLAG_CRASH_FLUSH, &ar->ab->dev_flags)) 36 + return -ESHUTDOWN; 37 + 38 + time_left = wait_for_completion_timeout(&ar->thermal.wmi_sync, 39 + ATH12K_THERMAL_SYNC_TIMEOUT_HZ); 40 + if (!time_left) { 41 + ath12k_warn(ar->ab, "failed to synchronize thermal read\n"); 42 + return -ETIMEDOUT; 43 + } 44 + 45 + spin_lock_bh(&ar->data_lock); 46 + temperature = ar->thermal.temperature; 47 + spin_unlock_bh(&ar->data_lock); 48 + 49 + /* display in millidegree celsius */ 50 + return sysfs_emit(buf, "%d\n", temperature * 1000); 51 + } 52 + 53 + void ath12k_thermal_event_temperature(struct ath12k *ar, int temperature) 54 + { 55 + spin_lock_bh(&ar->data_lock); 56 + ar->thermal.temperature = temperature; 57 + spin_unlock_bh(&ar->data_lock); 58 + complete_all(&ar->thermal.wmi_sync); 59 + } 60 + 61 + static SENSOR_DEVICE_ATTR_RO(temp1_input, ath12k_thermal_temp, 0); 62 + 63 + static struct attribute *ath12k_hwmon_attrs[] = { 64 + &sensor_dev_attr_temp1_input.dev_attr.attr, 65 + NULL, 66 + }; 67 + ATTRIBUTE_GROUPS(ath12k_hwmon); 68 + 69 + int ath12k_thermal_register(struct ath12k_base *ab) 70 + { 71 + struct ath12k *ar; 72 + int i, j, ret; 73 + 74 + if (!IS_REACHABLE(CONFIG_HWMON)) 75 + return 0; 76 + 77 + for (i = 0; i < ab->num_radios; i++) { 78 + ar = ab->pdevs[i].ar; 79 + if (!ar) 80 + continue; 81 + 82 + ar->thermal.hwmon_dev = 83 + hwmon_device_register_with_groups(&ar->ah->hw->wiphy->dev, 84 + "ath12k_hwmon", ar, 85 + ath12k_hwmon_groups); 86 + if (IS_ERR(ar->thermal.hwmon_dev)) { 87 + ret = PTR_ERR(ar->thermal.hwmon_dev); 88 + ar->thermal.hwmon_dev = NULL; 89 + ath12k_err(ar->ab, "failed to register hwmon device: %d\n", 90 + ret); 91 + for (j = i - 1; j >= 0; j--) { 92 + ar = ab->pdevs[j].ar; 93 + if (!ar) 94 + continue; 95 + 96 + hwmon_device_unregister(ar->thermal.hwmon_dev); 97 + ar->thermal.hwmon_dev = NULL; 98 + } 99 + return ret; 100 + } 101 + } 102 + 103 + return 0; 104 + } 105 + 106 + void ath12k_thermal_unregister(struct ath12k_base *ab) 107 + { 108 + struct ath12k *ar; 109 + int i; 110 + 111 + if (!IS_REACHABLE(CONFIG_HWMON)) 112 + return; 113 + 114 + for (i = 0; i < ab->num_radios; i++) { 115 + ar = ab->pdevs[i].ar; 116 + if (!ar) 117 + continue; 118 + 119 + if (ar->thermal.hwmon_dev) { 120 + hwmon_device_unregister(ar->thermal.hwmon_dev); 121 + ar->thermal.hwmon_dev = NULL; 122 + } 123 + } 124 + }
+40
drivers/net/wireless/ath/ath12k/thermal.h
··· 1 + /* SPDX-License-Identifier: BSD-3-Clause-Clear */ 2 + /* 3 + * Copyright (c) 2020 The Linux Foundation. All rights reserved. 4 + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. 5 + */ 6 + 7 + #ifndef _ATH12K_THERMAL_ 8 + #define _ATH12K_THERMAL_ 9 + 10 + #define ATH12K_THERMAL_SYNC_TIMEOUT_HZ (5 * HZ) 11 + 12 + struct ath12k_thermal { 13 + struct completion wmi_sync; 14 + 15 + /* temperature value in Celsius degree protected by data_lock. */ 16 + int temperature; 17 + struct device *hwmon_dev; 18 + }; 19 + 20 + #if IS_REACHABLE(CONFIG_THERMAL) 21 + int ath12k_thermal_register(struct ath12k_base *ab); 22 + void ath12k_thermal_unregister(struct ath12k_base *ab); 23 + void ath12k_thermal_event_temperature(struct ath12k *ar, int temperature); 24 + #else 25 + static inline int ath12k_thermal_register(struct ath12k_base *ab) 26 + { 27 + return 0; 28 + } 29 + 30 + static inline void ath12k_thermal_unregister(struct ath12k_base *ab) 31 + { 32 + } 33 + 34 + static inline void ath12k_thermal_event_temperature(struct ath12k *ar, 35 + int temperature) 36 + { 37 + } 38 + 39 + #endif 40 + #endif /* _ATH12K_THERMAL_ */
+11 -14
drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c
··· 325 325 326 326 static void ath12k_wifi7_dp_rx_h_mpdu(struct ath12k_pdev_dp *dp_pdev, 327 327 struct sk_buff *msdu, 328 - struct hal_rx_desc *rx_desc, 329 328 struct hal_rx_desc_data *rx_info) 330 329 { 331 330 struct ath12k_skb_rxcb *rxcb; ··· 387 388 } 388 389 389 390 ath12k_wifi7_dp_rx_h_csum_offload(msdu, rx_info); 390 - ath12k_dp_rx_h_undecap(dp_pdev, msdu, rx_desc, 391 - enctype, is_decrypted, rx_info); 391 + ath12k_dp_rx_h_undecap(dp_pdev, msdu, enctype, is_decrypted, rx_info); 392 392 393 393 if (!is_decrypted || rx_info->is_mcbc) 394 394 return; ··· 547 549 } 548 550 } 549 551 550 - if (unlikely(!ath12k_dp_rx_check_nwifi_hdr_len_valid(dp, rx_desc, msdu, 552 + if (unlikely(!ath12k_dp_rx_check_nwifi_hdr_len_valid(dp, msdu, 551 553 rx_info))) { 552 554 ret = -EINVAL; 553 555 goto free_out; 554 556 } 555 557 556 558 ath12k_dp_rx_h_ppdu(dp_pdev, rx_info); 557 - ath12k_wifi7_dp_rx_h_mpdu(dp_pdev, msdu, rx_desc, rx_info); 559 + ath12k_wifi7_dp_rx_h_mpdu(dp_pdev, msdu, rx_info); 558 560 559 561 rx_info->rx_status->flag |= RX_FLAG_SKIP_MONITOR | RX_FLAG_DUP_VALIDATED; 560 562 ··· 1028 1030 RX_FLAG_IV_STRIPPED | RX_FLAG_DECRYPTED; 1029 1031 skb_pull(msdu, hal_rx_desc_sz); 1030 1032 1031 - if (unlikely(!ath12k_dp_rx_check_nwifi_hdr_len_valid(dp, rx_desc, msdu, 1033 + if (unlikely(!ath12k_dp_rx_check_nwifi_hdr_len_valid(dp, msdu, 1032 1034 rx_info))) 1033 1035 return -EINVAL; 1034 1036 1035 1037 ath12k_dp_rx_h_ppdu(dp_pdev, rx_info); 1036 - ath12k_dp_rx_h_undecap(dp_pdev, msdu, rx_desc, 1037 - HAL_ENCRYPT_TYPE_TKIP_MIC, true, rx_info); 1038 + ath12k_dp_rx_h_undecap(dp_pdev, msdu, HAL_ENCRYPT_TYPE_TKIP_MIC, true, 1039 + rx_info); 1038 1040 ieee80211_rx(ath12k_pdev_dp_to_hw(dp_pdev), msdu); 1039 1041 return -EINVAL; 1040 1042 } ··· 1586 1588 struct ath12k_dp *dp = dp_pdev->dp; 1587 1589 struct ath12k_base *ab = dp->ab; 1588 1590 u16 msdu_len = rx_info->msdu_len; 1589 - struct hal_rx_desc *desc = (struct hal_rx_desc *)msdu->data; 1590 1591 u8 l3pad_bytes = rx_info->l3_pad_bytes; 1591 1592 struct ath12k_skb_rxcb *rxcb = ATH12K_SKB_RXCB(msdu); 1592 1593 u32 hal_rx_desc_sz = dp->ab->hal.hal_desc_sz; ··· 1629 1632 skb_put(msdu, hal_rx_desc_sz + l3pad_bytes + msdu_len); 1630 1633 skb_pull(msdu, hal_rx_desc_sz + l3pad_bytes); 1631 1634 } 1632 - if (unlikely(!ath12k_dp_rx_check_nwifi_hdr_len_valid(dp, desc, msdu, rx_info))) 1635 + if (unlikely(!ath12k_dp_rx_check_nwifi_hdr_len_valid(dp, msdu, rx_info))) 1633 1636 return -EINVAL; 1634 1637 1635 1638 ath12k_dp_rx_h_ppdu(dp_pdev, rx_info); 1636 - ath12k_wifi7_dp_rx_h_mpdu(dp_pdev, msdu, desc, rx_info); 1639 + ath12k_wifi7_dp_rx_h_mpdu(dp_pdev, msdu, rx_info); 1637 1640 1638 1641 rxcb->tid = rx_info->tid; 1639 1642 ··· 1670 1673 skb_put(msdu, hal_rx_desc_sz + l3pad_bytes + msdu_len); 1671 1674 skb_pull(msdu, hal_rx_desc_sz + l3pad_bytes); 1672 1675 1673 - if (unlikely(!ath12k_dp_rx_check_nwifi_hdr_len_valid(dp, desc, msdu, rx_info))) 1676 + if (unlikely(!ath12k_dp_rx_check_nwifi_hdr_len_valid(dp, msdu, rx_info))) 1674 1677 return true; 1675 1678 1676 1679 ath12k_dp_rx_h_ppdu(dp_pdev, rx_info); ··· 1678 1681 rx_info->rx_status->flag |= (RX_FLAG_MMIC_STRIPPED | RX_FLAG_MMIC_ERROR | 1679 1682 RX_FLAG_DECRYPTED); 1680 1683 1681 - ath12k_dp_rx_h_undecap(dp_pdev, msdu, desc, 1682 - HAL_ENCRYPT_TYPE_TKIP_MIC, false, rx_info); 1684 + ath12k_dp_rx_h_undecap(dp_pdev, msdu, HAL_ENCRYPT_TYPE_TKIP_MIC, false, 1685 + rx_info); 1683 1686 return false; 1684 1687 } 1685 1688
+2 -2
drivers/net/wireless/ath/ath12k/wifi7/hw.c
··· 617 617 ath12k_wifi7_target_service_to_ce_map_wlan_ipq5332, 618 618 .svc_to_ce_map_len = 18, 619 619 620 - .rxdma1_enable = false, 620 + .rxdma1_enable = true, 621 621 .num_rxdma_per_pdev = 1, 622 622 .num_rxdma_dst_ring = 0, 623 623 .rx_mac_buf_ring = false, ··· 626 626 .interface_modes = BIT(NL80211_IFTYPE_STATION) | 627 627 BIT(NL80211_IFTYPE_AP) | 628 628 BIT(NL80211_IFTYPE_MESH_POINT), 629 - .supports_monitor = false, 629 + .supports_monitor = true, 630 630 631 631 .idle_ps = false, 632 632 .download_calib = true,
+26 -31
drivers/net/wireless/ath/ath12k/wmi.c
··· 6778 6778 return 0; 6779 6779 } 6780 6780 6781 - static int 6782 - ath12k_pull_pdev_temp_ev(struct ath12k_base *ab, struct sk_buff *skb, 6783 - const struct wmi_pdev_temperature_event *ev) 6784 - { 6785 - const void **tb; 6786 - int ret; 6787 - 6788 - tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC); 6789 - if (IS_ERR(tb)) { 6790 - ret = PTR_ERR(tb); 6791 - ath12k_warn(ab, "failed to parse tlv: %d\n", ret); 6792 - return ret; 6793 - } 6794 - 6795 - ev = tb[WMI_TAG_PDEV_TEMPERATURE_EVENT]; 6796 - if (!ev) { 6797 - ath12k_warn(ab, "failed to fetch pdev temp ev"); 6798 - kfree(tb); 6799 - return -EPROTO; 6800 - } 6801 - 6802 - kfree(tb); 6803 - return 0; 6804 - } 6805 - 6806 6781 static void ath12k_wmi_op_ep_tx_credits(struct ath12k_base *ab) 6807 6782 { 6808 6783 /* try to send pending beacons first. they take priority */ ··· 8786 8811 ath12k_wmi_pdev_temperature_event(struct ath12k_base *ab, 8787 8812 struct sk_buff *skb) 8788 8813 { 8814 + const struct wmi_pdev_temperature_event *ev; 8789 8815 struct ath12k *ar; 8790 - struct wmi_pdev_temperature_event ev = {}; 8816 + const void **tb; 8817 + int temp; 8818 + u32 pdev_id; 8791 8819 8792 - if (ath12k_pull_pdev_temp_ev(ab, skb, &ev) != 0) { 8793 - ath12k_warn(ab, "failed to extract pdev temperature event"); 8820 + tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC); 8821 + if (IS_ERR(tb)) { 8822 + ath12k_warn(ab, "failed to parse tlv: %ld\n", PTR_ERR(tb)); 8794 8823 return; 8795 8824 } 8796 8825 8826 + ev = tb[WMI_TAG_PDEV_TEMPERATURE_EVENT]; 8827 + if (!ev) { 8828 + ath12k_warn(ab, "failed to fetch pdev temp ev\n"); 8829 + kfree(tb); 8830 + return; 8831 + } 8832 + 8833 + temp = a_sle32_to_cpu(ev->temp); 8834 + pdev_id = le32_to_cpu(ev->pdev_id); 8835 + 8836 + kfree(tb); 8837 + 8797 8838 ath12k_dbg(ab, ATH12K_DBG_WMI, 8798 - "pdev temperature ev temp %d pdev_id %d\n", ev.temp, ev.pdev_id); 8839 + "pdev temperature ev temp %d pdev_id %u\n", 8840 + temp, pdev_id); 8799 8841 8800 8842 rcu_read_lock(); 8801 8843 8802 - ar = ath12k_mac_get_ar_by_pdev_id(ab, le32_to_cpu(ev.pdev_id)); 8844 + ar = ath12k_mac_get_ar_by_pdev_id(ab, pdev_id); 8803 8845 if (!ar) { 8804 - ath12k_warn(ab, "invalid pdev id in pdev temperature ev %d", ev.pdev_id); 8846 + ath12k_warn(ab, "invalid pdev id %u in pdev temperature ev\n", 8847 + pdev_id); 8805 8848 goto exit; 8806 8849 } 8850 + 8851 + ath12k_thermal_event_temperature(ar, temp); 8807 8852 8808 8853 exit: 8809 8854 rcu_read_unlock();
+14 -11
drivers/net/wireless/ath/ath6kl/cfg80211.c
··· 1123 1123 wiphy_unlock(vif->ar->wiphy); 1124 1124 } 1125 1125 1126 - static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, 1126 + static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev, 1127 1127 int link_id, u8 key_index, bool pairwise, 1128 1128 const u8 *mac_addr, 1129 1129 struct key_params *params) 1130 1130 { 1131 - struct ath6kl *ar = ath6kl_priv(ndev); 1132 - struct ath6kl_vif *vif = netdev_priv(ndev); 1131 + struct ath6kl *ar = ath6kl_priv(wdev->netdev); 1132 + struct ath6kl_vif *vif = netdev_priv(wdev->netdev); 1133 1133 struct ath6kl_key *key = NULL; 1134 1134 int seq_len; 1135 1135 u8 key_usage; ··· 1248 1248 (u8 *) mac_addr, SYNC_BOTH_WMIFLAG); 1249 1249 } 1250 1250 1251 - static int ath6kl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev, 1251 + static int ath6kl_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev, 1252 1252 int link_id, u8 key_index, bool pairwise, 1253 1253 const u8 *mac_addr) 1254 1254 { 1255 - struct ath6kl *ar = ath6kl_priv(ndev); 1256 - struct ath6kl_vif *vif = netdev_priv(ndev); 1255 + struct ath6kl *ar = ath6kl_priv(wdev->netdev); 1256 + struct ath6kl_vif *vif = netdev_priv(wdev->netdev); 1257 1257 1258 1258 ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: index %d\n", __func__, key_index); 1259 1259 ··· 1278 1278 return ath6kl_wmi_deletekey_cmd(ar->wmi, vif->fw_vif_idx, key_index); 1279 1279 } 1280 1280 1281 - static int ath6kl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, 1281 + static int ath6kl_cfg80211_get_key(struct wiphy *wiphy, struct wireless_dev *wdev, 1282 1282 int link_id, u8 key_index, bool pairwise, 1283 1283 const u8 *mac_addr, void *cookie, 1284 1284 void (*callback) (void *cookie, 1285 1285 struct key_params *)) 1286 1286 { 1287 - struct ath6kl_vif *vif = netdev_priv(ndev); 1287 + struct ath6kl_vif *vif = netdev_priv(wdev->netdev); 1288 1288 struct ath6kl_key *key = NULL; 1289 1289 struct key_params params; 1290 1290 ··· 1775 1775 return false; 1776 1776 } 1777 1777 1778 - static int ath6kl_get_station(struct wiphy *wiphy, struct net_device *dev, 1778 + static int ath6kl_get_station(struct wiphy *wiphy, struct wireless_dev *wdev, 1779 1779 const u8 *mac, struct station_info *sinfo) 1780 1780 { 1781 + struct net_device *dev = wdev->netdev; 1781 1782 struct ath6kl *ar = ath6kl_priv(dev); 1782 1783 struct ath6kl_vif *vif = netdev_priv(dev); 1783 1784 long left; ··· 2993 2992 2994 2993 static const u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; 2995 2994 2996 - static int ath6kl_del_station(struct wiphy *wiphy, struct net_device *dev, 2995 + static int ath6kl_del_station(struct wiphy *wiphy, struct wireless_dev *wdev, 2997 2996 struct station_del_parameters *params) 2998 2997 { 2998 + struct net_device *dev = wdev->netdev; 2999 2999 struct ath6kl *ar = ath6kl_priv(dev); 3000 3000 struct ath6kl_vif *vif = netdev_priv(dev); 3001 3001 const u8 *addr = params->mac ? params->mac : bcast_addr; ··· 3005 3003 addr, WLAN_REASON_PREV_AUTH_NOT_VALID); 3006 3004 } 3007 3005 3008 - static int ath6kl_change_station(struct wiphy *wiphy, struct net_device *dev, 3006 + static int ath6kl_change_station(struct wiphy *wiphy, struct wireless_dev *wdev, 3009 3007 const u8 *mac, 3010 3008 struct station_parameters *params) 3011 3009 { 3010 + struct net_device *dev = wdev->netdev; 3012 3011 struct ath6kl *ar = ath6kl_priv(dev); 3013 3012 struct ath6kl_vif *vif = netdev_priv(dev); 3014 3013 int err;
+2 -2
drivers/net/wireless/ath/ath6kl/main.c
··· 494 494 sinfo->assoc_req_ies = ies; 495 495 sinfo->assoc_req_ies_len = ies_len; 496 496 497 - cfg80211_new_sta(vif->ndev, mac_addr, sinfo, GFP_KERNEL); 497 + cfg80211_new_sta(&vif->wdev, mac_addr, sinfo, GFP_KERNEL); 498 498 499 499 netif_wake_queue(vif->ndev); 500 500 ··· 1011 1011 1012 1012 if (!is_broadcast_ether_addr(bssid)) { 1013 1013 /* send event to application */ 1014 - cfg80211_del_sta(vif->ndev, bssid, GFP_KERNEL); 1014 + cfg80211_del_sta(&vif->wdev, bssid, GFP_KERNEL); 1015 1015 } 1016 1016 1017 1017 if (memcmp(vif->ndev->dev_addr, bssid, ETH_ALEN) == 0) {
+1 -1
drivers/net/wireless/ath/ath9k/ath9k.h
··· 443 443 444 444 #define case_rtn_string(val) case val: return #val 445 445 446 - #define ath_for_each_chanctx(_sc, _ctx) \ 446 + #define ath_for_each_chanctx(sc, ctx) \ 447 447 for (ctx = &sc->chanctx[0]; \ 448 448 ctx <= &sc->chanctx[ARRAY_SIZE(sc->chanctx) - 1]; \ 449 449 ctx++)
+16 -17
drivers/net/wireless/ath/wil6210/cfg80211.c
··· 533 533 } 534 534 535 535 static int wil_cfg80211_get_station(struct wiphy *wiphy, 536 - struct net_device *ndev, 536 + struct wireless_dev *wdev, 537 537 const u8 *mac, struct station_info *sinfo) 538 538 { 539 - struct wil6210_vif *vif = ndev_to_vif(ndev); 540 539 struct wil6210_priv *wil = wiphy_to_wil(wiphy); 540 + struct wil6210_vif *vif = wdev_to_vif(wil, wdev); 541 541 int rc; 542 542 543 543 int cid = wil_find_cid(wil, vif->mid, mac); ··· 573 573 } 574 574 575 575 static int wil_cfg80211_dump_station(struct wiphy *wiphy, 576 - struct net_device *dev, int idx, 576 + struct wireless_dev *wdev, int idx, 577 577 u8 *mac, struct station_info *sinfo) 578 578 { 579 - struct wil6210_vif *vif = ndev_to_vif(dev); 580 579 struct wil6210_priv *wil = wiphy_to_wil(wiphy); 580 + struct wil6210_vif *vif = wdev_to_vif(wil, wdev); 581 581 int rc; 582 582 int cid = wil_find_cid_by_idx(wil, vif->mid, idx); 583 583 ··· 1619 1619 } 1620 1620 1621 1621 static int wil_cfg80211_add_key(struct wiphy *wiphy, 1622 - struct net_device *ndev, int link_id, 1622 + struct wireless_dev *wdev, int link_id, 1623 1623 u8 key_index, bool pairwise, 1624 1624 const u8 *mac_addr, 1625 1625 struct key_params *params) 1626 1626 { 1627 1627 int rc; 1628 - struct wil6210_vif *vif = ndev_to_vif(ndev); 1629 1628 struct wil6210_priv *wil = wiphy_to_wil(wiphy); 1630 - struct wireless_dev *wdev = vif_to_wdev(vif); 1629 + struct wil6210_vif *vif = wdev_to_vif(wil, wdev); 1631 1630 enum wmi_key_usage key_usage = wil_detect_key_usage(wdev, pairwise); 1632 1631 struct wil_sta_info *cs = wil_find_sta_by_key_usage(wil, vif->mid, 1633 1632 key_usage, ··· 1694 1695 } 1695 1696 1696 1697 static int wil_cfg80211_del_key(struct wiphy *wiphy, 1697 - struct net_device *ndev, int link_id, 1698 + struct wireless_dev *wdev, int link_id, 1698 1699 u8 key_index, bool pairwise, 1699 1700 const u8 *mac_addr) 1700 1701 { 1701 - struct wil6210_vif *vif = ndev_to_vif(ndev); 1702 1702 struct wil6210_priv *wil = wiphy_to_wil(wiphy); 1703 - struct wireless_dev *wdev = vif_to_wdev(vif); 1703 + struct wil6210_vif *vif = wdev_to_vif(wil, wdev); 1704 1704 enum wmi_key_usage key_usage = wil_detect_key_usage(wdev, pairwise); 1705 1705 struct wil_sta_info *cs = wil_find_sta_by_key_usage(wil, vif->mid, 1706 1706 key_usage, ··· 2069 2071 key_params.key = vif->gtk; 2070 2072 key_params.key_len = vif->gtk_len; 2071 2073 key_params.seq_len = IEEE80211_GCMP_PN_LEN; 2072 - rc = wil_cfg80211_add_key(wiphy, ndev, -1, vif->gtk_index, 2074 + rc = wil_cfg80211_add_key(wiphy, vif_to_wdev(vif), -1, 2075 + vif->gtk_index, 2073 2076 false, NULL, &key_params); 2074 2077 if (rc) 2075 2078 wil_err(wil, "vif %d recovery add key failed (%d)\n", ··· 2224 2225 } 2225 2226 2226 2227 static int wil_cfg80211_add_station(struct wiphy *wiphy, 2227 - struct net_device *dev, 2228 + struct wireless_dev *wdev, 2228 2229 const u8 *mac, 2229 2230 struct station_parameters *params) 2230 2231 { 2231 - struct wil6210_vif *vif = ndev_to_vif(dev); 2232 2232 struct wil6210_priv *wil = wiphy_to_wil(wiphy); 2233 + struct wil6210_vif *vif = wdev_to_vif(wil, wdev); 2233 2234 2234 2235 wil_dbg_misc(wil, "add station %pM aid %d mid %d mask 0x%x set 0x%x\n", 2235 2236 mac, params->aid, vif->mid, ··· 2249 2250 } 2250 2251 2251 2252 static int wil_cfg80211_del_station(struct wiphy *wiphy, 2252 - struct net_device *dev, 2253 + struct wireless_dev *wdev, 2253 2254 struct station_del_parameters *params) 2254 2255 { 2255 - struct wil6210_vif *vif = ndev_to_vif(dev); 2256 2256 struct wil6210_priv *wil = wiphy_to_wil(wiphy); 2257 + struct wil6210_vif *vif = wdev_to_vif(wil, wdev); 2257 2258 2258 2259 wil_dbg_misc(wil, "del_station: %pM, reason=%d mid=%d\n", 2259 2260 params->mac, params->reason_code, vif->mid); ··· 2266 2267 } 2267 2268 2268 2269 static int wil_cfg80211_change_station(struct wiphy *wiphy, 2269 - struct net_device *dev, 2270 + struct wireless_dev *wdev, 2270 2271 const u8 *mac, 2271 2272 struct station_parameters *params) 2272 2273 { 2273 - struct wil6210_vif *vif = ndev_to_vif(dev); 2274 2274 struct wil6210_priv *wil = wiphy_to_wil(wiphy); 2275 + struct wil6210_vif *vif = wdev_to_vif(wil, wdev); 2275 2276 int authorize; 2276 2277 int cid, i; 2277 2278 struct wil_ring_tx_data *txdata = NULL;
+1 -2
drivers/net/wireless/ath/wil6210/main.c
··· 245 245 { 246 246 uint i; 247 247 struct wil6210_priv *wil = vif_to_wil(vif); 248 - struct net_device *ndev = vif_to_ndev(vif); 249 248 struct wireless_dev *wdev = vif_to_wdev(vif); 250 249 struct wil_sta_info *sta = &wil->sta[cid]; 251 250 int min_ring_id = wil_get_min_tx_ring_id(wil); ··· 264 265 case NL80211_IFTYPE_AP: 265 266 case NL80211_IFTYPE_P2P_GO: 266 267 /* AP-like interface */ 267 - cfg80211_del_sta(ndev, sta->addr, GFP_KERNEL); 268 + cfg80211_del_sta(wdev, sta->addr, GFP_KERNEL); 268 269 break; 269 270 default: 270 271 break;
+3 -2
drivers/net/wireless/ath/wil6210/wmi.c
··· 1076 1076 if (rc) { 1077 1077 if (disable_ap_sme) 1078 1078 /* notify new_sta has failed */ 1079 - cfg80211_del_sta(ndev, evt->bssid, GFP_KERNEL); 1079 + cfg80211_del_sta(wdev, evt->bssid, GFP_KERNEL); 1080 1080 goto out; 1081 1081 } 1082 1082 ··· 1093 1093 sinfo->assoc_req_ies_len = assoc_req_ielen; 1094 1094 } 1095 1095 1096 - cfg80211_new_sta(ndev, evt->bssid, sinfo, GFP_KERNEL); 1096 + cfg80211_new_sta(ndev->ieee80211_ptr, evt->bssid, sinfo, 1097 + GFP_KERNEL); 1097 1098 1098 1099 kfree(sinfo); 1099 1100 } else {
+22 -19
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
··· 2758 2758 } 2759 2759 2760 2760 static s32 2761 - brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev, 2761 + brcmf_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev, 2762 2762 int link_id, u8 key_idx, bool pairwise, 2763 2763 const u8 *mac_addr) 2764 2764 { 2765 - struct brcmf_if *ifp = netdev_priv(ndev); 2765 + struct brcmf_if *ifp = netdev_priv(wdev->netdev); 2766 2766 struct brcmf_wsec_key *key; 2767 2767 s32 err; 2768 2768 ··· 2796 2796 } 2797 2797 2798 2798 static s32 2799 - brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, 2799 + brcmf_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev, 2800 2800 int link_id, u8 key_idx, bool pairwise, 2801 2801 const u8 *mac_addr, struct key_params *params) 2802 2802 { 2803 2803 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); 2804 - struct brcmf_if *ifp = netdev_priv(ndev); 2804 + struct brcmf_if *ifp = netdev_priv(wdev->netdev); 2805 2805 struct brcmf_pub *drvr = cfg->pub; 2806 2806 struct brcmf_wsec_key *key; 2807 2807 s32 val; ··· 2822 2822 } 2823 2823 2824 2824 if (params->key_len == 0) 2825 - return brcmf_cfg80211_del_key(wiphy, ndev, -1, key_idx, 2825 + return brcmf_cfg80211_del_key(wiphy, wdev, -1, key_idx, 2826 2826 pairwise, mac_addr); 2827 2827 2828 2828 if (params->key_len > sizeof(key->data)) { ··· 2918 2918 } 2919 2919 2920 2920 static s32 2921 - brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, 2921 + brcmf_cfg80211_get_key(struct wiphy *wiphy, struct wireless_dev *wdev, 2922 2922 int link_id, u8 key_idx, bool pairwise, 2923 2923 const u8 *mac_addr, void *cookie, 2924 2924 void (*callback)(void *cookie, ··· 2926 2926 { 2927 2927 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); 2928 2928 struct key_params params; 2929 - struct brcmf_if *ifp = netdev_priv(ndev); 2929 + struct brcmf_if *ifp = netdev_priv(wdev->netdev); 2930 2930 struct brcmf_cfg80211_profile *profile = &ifp->vif->profile; 2931 2931 struct brcmf_pub *drvr = cfg->pub; 2932 2932 struct brcmf_cfg80211_security *sec; ··· 2976 2976 2977 2977 static s32 2978 2978 brcmf_cfg80211_config_default_mgmt_key(struct wiphy *wiphy, 2979 - struct net_device *ndev, int link_id, 2979 + struct wireless_dev *wdev, int link_id, 2980 2980 u8 key_idx) 2981 2981 { 2982 - struct brcmf_if *ifp = netdev_priv(ndev); 2982 + struct brcmf_if *ifp = netdev_priv(wdev->netdev); 2983 2983 2984 2984 brcmf_dbg(TRACE, "Enter key_idx %d\n", key_idx); 2985 2985 ··· 3132 3132 } 3133 3133 3134 3134 static s32 3135 - brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, 3135 + brcmf_cfg80211_get_station(struct wiphy *wiphy, struct wireless_dev *wdev, 3136 3136 const u8 *mac, struct station_info *sinfo) 3137 3137 { 3138 3138 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); 3139 - struct brcmf_if *ifp = netdev_priv(ndev); 3139 + struct brcmf_if *ifp = netdev_priv(wdev->netdev); 3140 3140 struct brcmf_pub *drvr = cfg->pub; 3141 3141 struct brcmf_scb_val_le scb_val; 3142 3142 s32 err = 0; ··· 3255 3255 } 3256 3256 3257 3257 static int 3258 - brcmf_cfg80211_dump_station(struct wiphy *wiphy, struct net_device *ndev, 3258 + brcmf_cfg80211_dump_station(struct wiphy *wiphy, struct wireless_dev *wdev, 3259 3259 int idx, u8 *mac, struct station_info *sinfo) 3260 3260 { 3261 3261 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); 3262 - struct brcmf_if *ifp = netdev_priv(ndev); 3262 + struct brcmf_if *ifp = netdev_priv(wdev->netdev); 3263 3263 struct brcmf_pub *drvr = cfg->pub; 3264 3264 s32 err; 3265 3265 ··· 3284 3284 } 3285 3285 if (idx < le32_to_cpu(cfg->assoclist.count)) { 3286 3286 memcpy(mac, cfg->assoclist.mac[idx], ETH_ALEN); 3287 - return brcmf_cfg80211_get_station(wiphy, ndev, mac, sinfo); 3287 + return brcmf_cfg80211_get_station(wiphy, wdev, 3288 + mac, sinfo); 3288 3289 } 3289 3290 return -ENOENT; 3290 3291 } ··· 5453 5452 } 5454 5453 5455 5454 static int 5456 - brcmf_cfg80211_del_station(struct wiphy *wiphy, struct net_device *ndev, 5455 + brcmf_cfg80211_del_station(struct wiphy *wiphy, struct wireless_dev *wdev, 5457 5456 struct station_del_parameters *params) 5458 5457 { 5459 5458 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); 5460 5459 struct brcmf_pub *drvr = cfg->pub; 5461 5460 struct brcmf_scb_val_le scbval; 5461 + struct net_device *ndev = wdev->netdev; 5462 5462 struct brcmf_if *ifp = netdev_priv(ndev); 5463 5463 s32 err; 5464 5464 ··· 5486 5484 } 5487 5485 5488 5486 static int 5489 - brcmf_cfg80211_change_station(struct wiphy *wiphy, struct net_device *ndev, 5487 + brcmf_cfg80211_change_station(struct wiphy *wiphy, struct wireless_dev *wdev, 5490 5488 const u8 *mac, struct station_parameters *params) 5491 5489 { 5492 5490 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); 5493 5491 struct brcmf_pub *drvr = cfg->pub; 5494 - struct brcmf_if *ifp = netdev_priv(ndev); 5492 + struct brcmf_if *ifp = netdev_priv(wdev->netdev); 5495 5493 s32 err; 5496 5494 5497 5495 brcmf_dbg(TRACE, "Enter, MAC %pM, mask 0x%04x set 0x%04x\n", mac, ··· 6550 6548 sinfo->assoc_req_ies_len = e->datalen; 6551 6549 generation++; 6552 6550 sinfo->generation = generation; 6553 - cfg80211_new_sta(ndev, e->addr, sinfo, GFP_KERNEL); 6551 + cfg80211_new_sta(ndev->ieee80211_ptr, e->addr, sinfo, 6552 + GFP_KERNEL); 6554 6553 6555 6554 kfree(sinfo); 6556 6555 } else if ((event == BRCMF_E_DISASSOC_IND) || 6557 6556 (event == BRCMF_E_DEAUTH_IND) || 6558 6557 (event == BRCMF_E_DEAUTH)) { 6559 - cfg80211_del_sta(ndev, e->addr, GFP_KERNEL); 6558 + cfg80211_del_sta(ndev->ieee80211_ptr, e->addr, GFP_KERNEL); 6560 6559 } 6561 6560 return 0; 6562 6561 }
+3 -1
drivers/net/wireless/intel/iwlegacy/3945.h
··· 123 123 #define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) 124 124 125 125 struct il3945_frame { 126 + struct list_head list; 127 + 128 + /* Must be last as it ends in a flexible-array member. */ 126 129 union { 127 130 struct ieee80211_hdr frame; 128 131 struct il3945_tx_beacon_cmd beacon; 129 132 u8 raw[IEEE80211_FRAME_LEN]; 130 133 u8 cmd[360]; 131 134 } u; 132 - struct list_head list; 133 135 }; 134 136 135 137 #define SUP_RATE_11A_MAX_NUM_CHANNELS 8
+1 -1
drivers/net/wireless/intel/iwlegacy/4965-mac.c
··· 4076 4076 u8 rate = il4965_hw_get_rate(beacon->beacon_notify_hdr.rate_n_flags); 4077 4077 4078 4078 D_RX("beacon status %x retries %d iss %d tsf:0x%.8x%.8x rate %d\n", 4079 - le32_to_cpu(beacon->beacon_notify_hdr.u.status) & TX_STATUS_MSK, 4079 + le32_to_cpu(beacon->beacon_tx_status) & TX_STATUS_MSK, 4080 4080 beacon->beacon_notify_hdr.failure_frame, 4081 4081 le32_to_cpu(beacon->ibss_mgr_status), 4082 4082 le32_to_cpu(beacon->high_tsf), le32_to_cpu(beacon->low_tsf), rate);
+7 -2
drivers/net/wireless/intel/iwlegacy/commands.h
··· 1690 1690 __le16 sequence; 1691 1691 } __packed; 1692 1692 1693 - struct il4965_tx_resp { 1693 + struct il4965_tx_resp_hdr { 1694 1694 u8 frame_count; /* 1 no aggregation, >1 aggregation */ 1695 1695 u8 bt_kill_count; /* # blocked by bluetooth (unused for agg) */ 1696 1696 u8 failure_rts; /* # failures due to unsuccessful RTS */ ··· 1707 1707 __le16 reserved; 1708 1708 __le32 pa_power1; /* RF power amplifier measurement (not used) */ 1709 1709 __le32 pa_power2; 1710 + } __packed; 1711 + 1712 + struct il4965_tx_resp { 1713 + struct il4965_tx_resp_hdr; 1710 1714 1711 1715 /* 1712 1716 * For non-agg: frame status TX_STATUS_* ··· 2668 2664 } __packed; 2669 2665 2670 2666 struct il4965_beacon_notif { 2671 - struct il4965_tx_resp beacon_notify_hdr; 2667 + struct il4965_tx_resp_hdr beacon_notify_hdr; 2668 + __le32 beacon_tx_status; 2672 2669 __le32 low_tsf; 2673 2670 __le32 high_tsf; 2674 2671 __le32 ibss_mgr_status;
+3 -1
drivers/net/wireless/intel/iwlegacy/common.h
··· 518 518 #define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) 519 519 520 520 struct il_frame { 521 + struct list_head list; 522 + 523 + /* Must be last as it ends in a flexible-array member. */ 521 524 union { 522 525 struct ieee80211_hdr frame; 523 526 struct il_tx_beacon_cmd beacon; 524 527 u8 raw[IEEE80211_FRAME_LEN]; 525 528 u8 cmd[360]; 526 529 } u; 527 - struct list_head list; 528 530 }; 529 531 530 532 enum {
+2 -3
drivers/net/wireless/intel/iwlwifi/mld/nan.c
··· 54 54 ether_addr_copy(cmd.nmi_addr, vif->addr); 55 55 cmd.master_pref = conf->master_pref; 56 56 57 - if (conf->cluster_id) 58 - memcpy(cmd.cluster_id, conf->cluster_id + 4, 59 - sizeof(cmd.cluster_id)); 57 + memcpy(cmd.cluster_id, conf->cluster_id + 4, 58 + sizeof(cmd.cluster_id)); 60 59 61 60 cmd.scan_period = conf->scan_period < 255 ? conf->scan_period : 255; 62 61 cmd.dwell_time =
+4 -4
drivers/net/wireless/marvell/libertas/cfg.c
··· 1507 1507 } 1508 1508 1509 1509 1510 - static int lbs_cfg_add_key(struct wiphy *wiphy, struct net_device *netdev, 1510 + static int lbs_cfg_add_key(struct wiphy *wiphy, struct wireless_dev *wdev, 1511 1511 int link_id, u8 idx, bool pairwise, 1512 1512 const u8 *mac_addr, struct key_params *params) 1513 1513 { ··· 1516 1516 u16 key_type; 1517 1517 int ret = 0; 1518 1518 1519 - if (netdev == priv->mesh_dev) 1519 + if (wdev->netdev == priv->mesh_dev) 1520 1520 return -EOPNOTSUPP; 1521 1521 1522 1522 lbs_deb_assoc("add_key: cipher 0x%x, mac_addr %pM\n", ··· 1568 1568 } 1569 1569 1570 1570 1571 - static int lbs_cfg_del_key(struct wiphy *wiphy, struct net_device *netdev, 1571 + static int lbs_cfg_del_key(struct wiphy *wiphy, struct wireless_dev *wdev, 1572 1572 int link_id, u8 key_index, bool pairwise, 1573 1573 const u8 *mac_addr) 1574 1574 { ··· 1607 1607 * Get station 1608 1608 */ 1609 1609 1610 - static int lbs_cfg_get_station(struct wiphy *wiphy, struct net_device *dev, 1610 + static int lbs_cfg_get_station(struct wiphy *wiphy, struct wireless_dev *wdev, 1611 1611 const u8 *mac, struct station_info *sinfo) 1612 1612 { 1613 1613 struct lbs_private *priv = wiphy_priv(wiphy);
+1
drivers/net/wireless/marvell/mwifiex/11n_aggr.c
··· 203 203 204 204 if (!mwifiex_is_ralist_valid(priv, pra_list, ptrindex)) { 205 205 spin_unlock_bh(&priv->wmm.ra_list_spinlock); 206 + mwifiex_write_data_complete(adapter, skb_aggr, 1, -1); 206 207 return -1; 207 208 } 208 209
+19 -17
drivers/net/wireless/marvell/mwifiex/cfg80211.c
··· 141 141 * CFG802.11 operation handler to delete a network key. 142 142 */ 143 143 static int 144 - mwifiex_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev, 144 + mwifiex_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev, 145 145 int link_id, u8 key_index, bool pairwise, 146 146 const u8 *mac_addr) 147 147 { 148 - struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev); 148 + struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev); 149 149 static const u8 bc_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 150 150 const u8 *peer_mac = pairwise ? mac_addr : bc_mac; 151 151 ··· 480 480 * CFG802.11 operation handler to add a network key. 481 481 */ 482 482 static int 483 - mwifiex_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev, 483 + mwifiex_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev, 484 484 int link_id, u8 key_index, bool pairwise, 485 485 const u8 *mac_addr, struct key_params *params) 486 486 { 487 - struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev); 487 + struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev); 488 488 struct mwifiex_wep_key *wep_key; 489 489 static const u8 bc_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 490 490 const u8 *peer_mac = pairwise ? mac_addr : bc_mac; ··· 518 518 */ 519 519 static int 520 520 mwifiex_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, 521 - struct net_device *netdev, 521 + struct wireless_dev *wdev, 522 522 int link_id, 523 523 u8 key_index) 524 524 { 525 - struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev); 525 + struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev); 526 526 struct mwifiex_ds_encrypt_key encrypt_key; 527 527 528 528 wiphy_dbg(wiphy, "set default mgmt key, key index=%d\n", key_index); ··· 1554 1554 * requested station information, if available. 1555 1555 */ 1556 1556 static int 1557 - mwifiex_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev, 1557 + mwifiex_cfg80211_get_station(struct wiphy *wiphy, struct wireless_dev *wdev, 1558 1558 const u8 *mac, struct station_info *sinfo) 1559 1559 { 1560 - struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); 1560 + struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev); 1561 1561 1562 1562 if (!priv->media_connected) 1563 1563 return -ENOENT; ··· 1571 1571 * CFG802.11 operation handler to dump station information. 1572 1572 */ 1573 1573 static int 1574 - mwifiex_cfg80211_dump_station(struct wiphy *wiphy, struct net_device *dev, 1574 + mwifiex_cfg80211_dump_station(struct wiphy *wiphy, struct wireless_dev *wdev, 1575 1575 int idx, u8 *mac, struct station_info *sinfo) 1576 1576 { 1577 - struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); 1577 + struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev); 1578 1578 struct mwifiex_sta_node *node; 1579 1579 int i; 1580 1580 ··· 1901 1901 * associated stations list, no action is taken. 1902 1902 */ 1903 1903 static int 1904 - mwifiex_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, 1904 + mwifiex_cfg80211_del_station(struct wiphy *wiphy, struct wireless_dev *wdev, 1905 1905 struct station_del_parameters *params) 1906 1906 { 1907 - struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); 1907 + struct mwifiex_private *priv = 1908 + mwifiex_netdev_get_priv(wdev->netdev); 1908 1909 struct mwifiex_sta_node *sta_node; 1909 1910 u8 deauth_mac[ETH_ALEN]; 1910 1911 ··· 3994 3993 if (!sinfo) 3995 3994 return -ENOMEM; 3996 3995 3997 - cfg80211_new_sta(priv->netdev, mac, sinfo, GFP_KERNEL); 3996 + cfg80211_new_sta(priv->netdev->ieee80211_ptr, mac, sinfo, 3997 + GFP_KERNEL); 3998 3998 kfree(sinfo); 3999 3999 } 4000 4000 ··· 4003 4001 } 4004 4002 4005 4003 static int 4006 - mwifiex_cfg80211_add_station(struct wiphy *wiphy, struct net_device *dev, 4004 + mwifiex_cfg80211_add_station(struct wiphy *wiphy, struct wireless_dev *wdev, 4007 4005 const u8 *mac, struct station_parameters *params) 4008 4006 { 4009 - struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); 4007 + struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev); 4010 4008 4011 4009 if (priv->adapter->host_mlme_enabled && 4012 4010 (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP)) ··· 4242 4240 } 4243 4241 4244 4242 static int 4245 - mwifiex_cfg80211_change_station(struct wiphy *wiphy, struct net_device *dev, 4243 + mwifiex_cfg80211_change_station(struct wiphy *wiphy, struct wireless_dev *wdev, 4246 4244 const u8 *mac, 4247 4245 struct station_parameters *params) 4248 4246 { 4249 4247 int ret; 4250 - struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); 4248 + struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev); 4251 4249 4252 4250 if (priv->adapter->host_mlme_enabled && 4253 4251 (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP))
+1 -1
drivers/net/wireless/marvell/mwifiex/init.c
··· 391 391 static void 392 392 mwifiex_adapter_cleanup(struct mwifiex_adapter *adapter) 393 393 { 394 - timer_delete(&adapter->wakeup_timer); 394 + timer_delete_sync(&adapter->wakeup_timer); 395 395 cancel_delayed_work_sync(&adapter->devdump_work); 396 396 mwifiex_cancel_all_pending_cmd(adapter); 397 397 wake_up_interruptible(&adapter->cmd_wait_q.wait);
+4 -3
drivers/net/wireless/marvell/mwifiex/uap_event.c
··· 130 130 le16_to_cpu(event->len) - (u16)len; 131 131 } 132 132 } 133 - cfg80211_new_sta(priv->netdev, event->sta_addr, sinfo, 134 - GFP_KERNEL); 133 + cfg80211_new_sta(priv->netdev->ieee80211_ptr, event->sta_addr, 134 + sinfo, GFP_KERNEL); 135 135 136 136 node = mwifiex_add_sta_entry(priv, event->sta_addr); 137 137 if (!node) { ··· 162 162 case EVENT_UAP_STA_DEAUTH: 163 163 deauth_mac = adapter->event_body + 164 164 MWIFIEX_UAP_EVENT_EXTRA_HEADER; 165 - cfg80211_del_sta(priv->netdev, deauth_mac, GFP_KERNEL); 165 + cfg80211_del_sta(priv->netdev->ieee80211_ptr, deauth_mac, 166 + GFP_KERNEL); 166 167 167 168 if (priv->ap_11n_enabled) { 168 169 mwifiex_11n_del_rx_reorder_tbl_by_ta(priv, deauth_mac);
+2 -2
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
··· 1977 1977 1978 1978 if (changed & BSS_CHANGED_FILS_DISCOVERY) { 1979 1979 interval = vif->bss_conf.fils_discovery.max_interval; 1980 - skb = ieee80211_get_fils_discovery_tmpl(hw, vif); 1980 + skb = ieee80211_get_fils_discovery_tmpl(hw, vif, 0); 1981 1981 } else if (changed & BSS_CHANGED_UNSOL_BCAST_PROBE_RESP && 1982 1982 vif->bss_conf.unsol_bcast_probe_resp_interval) { 1983 1983 interval = vif->bss_conf.unsol_bcast_probe_resp_interval; 1984 - skb = ieee80211_get_unsol_bcast_probe_resp_tmpl(hw, vif); 1984 + skb = ieee80211_get_unsol_bcast_probe_resp_tmpl(hw, vif, 0); 1985 1985 } 1986 1986 1987 1987 if (!skb) {
+4 -2
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
··· 2863 2863 if (changed & BSS_CHANGED_FILS_DISCOVERY && 2864 2864 link_conf->fils_discovery.max_interval) { 2865 2865 interval = link_conf->fils_discovery.max_interval; 2866 - skb = ieee80211_get_fils_discovery_tmpl(hw, vif); 2866 + skb = ieee80211_get_fils_discovery_tmpl(hw, vif, 2867 + link_conf->link_id); 2867 2868 } else if (changed & BSS_CHANGED_UNSOL_BCAST_PROBE_RESP && 2868 2869 link_conf->unsol_bcast_probe_resp_interval) { 2869 2870 interval = link_conf->unsol_bcast_probe_resp_interval; 2870 - skb = ieee80211_get_unsol_bcast_probe_resp_tmpl(hw, vif); 2871 + skb = ieee80211_get_unsol_bcast_probe_resp_tmpl(hw, vif, 2872 + link_conf->link_id); 2871 2873 } 2872 2874 2873 2875 if (!skb) {
+22 -22
drivers/net/wireless/microchip/wilc1000/cfg80211.c
··· 534 534 return 0; 535 535 } 536 536 537 - static int add_key(struct wiphy *wiphy, struct net_device *netdev, int link_id, 537 + static int add_key(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id, 538 538 u8 key_index, bool pairwise, const u8 *mac_addr, 539 539 struct key_params *params) 540 540 ··· 544 544 const u8 *tx_mic = NULL; 545 545 u8 mode = WILC_FW_SEC_NO; 546 546 u8 op_mode; 547 - struct wilc_vif *vif = netdev_priv(netdev); 547 + struct wilc_vif *vif = netdev_priv(wdev->netdev); 548 548 struct wilc_priv *priv = &vif->priv; 549 549 struct wilc_wfi_key *key; 550 550 ··· 632 632 break; 633 633 634 634 default: 635 - netdev_err(netdev, "%s: Unsupported cipher\n", __func__); 635 + netdev_err(wdev->netdev, "%s: Unsupported cipher\n", __func__); 636 636 ret = -ENOTSUPP; 637 637 } 638 638 639 639 return ret; 640 640 } 641 641 642 - static int del_key(struct wiphy *wiphy, struct net_device *netdev, int link_id, 642 + static int del_key(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id, 643 643 u8 key_index, 644 644 bool pairwise, 645 645 const u8 *mac_addr) 646 646 { 647 - struct wilc_vif *vif = netdev_priv(netdev); 647 + struct wilc_vif *vif = netdev_priv(wdev->netdev); 648 648 struct wilc_priv *priv = &vif->priv; 649 649 650 650 if (!pairwise && (key_index == 4 || key_index == 5)) { ··· 680 680 return 0; 681 681 } 682 682 683 - static int get_key(struct wiphy *wiphy, struct net_device *netdev, int link_id, 683 + static int get_key(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id, 684 684 u8 key_index, bool pairwise, const u8 *mac_addr, 685 685 void *cookie, 686 686 void (*callback)(void *cookie, struct key_params *)) 687 687 { 688 - struct wilc_vif *vif = netdev_priv(netdev); 688 + struct wilc_vif *vif = netdev_priv(wdev->netdev); 689 689 struct wilc_priv *priv = &vif->priv; 690 690 struct key_params key_params; 691 691 ··· 725 725 return 0; 726 726 } 727 727 728 - static int set_default_mgmt_key(struct wiphy *wiphy, struct net_device *netdev, 728 + static int set_default_mgmt_key(struct wiphy *wiphy, struct wireless_dev *wdev, 729 729 int link_id, u8 key_index) 730 730 { 731 - struct wilc_vif *vif = netdev_priv(netdev); 731 + struct wilc_vif *vif = netdev_priv(wdev->netdev); 732 732 733 733 return wilc_set_default_mgmt_key_index(vif, key_index); 734 734 } 735 735 736 - static int get_station(struct wiphy *wiphy, struct net_device *dev, 736 + static int get_station(struct wiphy *wiphy, struct wireless_dev *wdev, 737 737 const u8 *mac, struct station_info *sinfo) 738 738 { 739 + struct net_device *dev = wdev->netdev; 739 740 struct wilc_vif *vif = netdev_priv(dev); 740 741 struct wilc_priv *priv = &vif->priv; 741 742 struct wilc *wilc = vif->wilc; ··· 1313 1312 return 0; 1314 1313 } 1315 1314 1316 - static int dump_station(struct wiphy *wiphy, struct net_device *dev, 1315 + static int dump_station(struct wiphy *wiphy, struct wireless_dev *wdev, 1317 1316 int idx, u8 *mac, struct station_info *sinfo) 1318 1317 { 1319 - struct wilc_vif *vif = netdev_priv(dev); 1318 + struct wilc_vif *vif = netdev_priv(wdev->netdev); 1320 1319 int ret; 1321 1320 1322 1321 if (idx != 0) ··· 1451 1450 return ret; 1452 1451 } 1453 1452 1454 - static int add_station(struct wiphy *wiphy, struct net_device *dev, 1453 + static int add_station(struct wiphy *wiphy, struct wireless_dev *wdev, 1455 1454 const u8 *mac, struct station_parameters *params) 1456 1455 { 1457 1456 int ret = 0; 1458 - struct wilc_vif *vif = netdev_priv(dev); 1457 + struct wilc_vif *vif = netdev_priv(wdev->netdev); 1459 1458 struct wilc_priv *priv = &vif->priv; 1460 1459 1461 1460 if (vif->iftype == WILC_AP_MODE || vif->iftype == WILC_GO_MODE) { ··· 1464 1463 1465 1464 ret = wilc_add_station(vif, mac, params); 1466 1465 if (ret) 1467 - netdev_err(dev, "Host add station fail\n"); 1466 + netdev_err(wdev->netdev, "Host add station fail\n"); 1468 1467 } 1469 1468 1470 1469 return ret; 1471 1470 } 1472 1471 1473 - static int del_station(struct wiphy *wiphy, struct net_device *dev, 1472 + static int del_station(struct wiphy *wiphy, struct wireless_dev *wdev, 1474 1473 struct station_del_parameters *params) 1475 1474 { 1476 1475 const u8 *mac = params->mac; 1477 1476 int ret = 0; 1478 - struct wilc_vif *vif = netdev_priv(dev); 1477 + struct wilc_vif *vif = netdev_priv(wdev->netdev); 1479 1478 struct wilc_priv *priv = &vif->priv; 1480 1479 struct sta_info *info; 1481 1480 ··· 1489 1488 1490 1489 ret = wilc_del_station(vif, mac); 1491 1490 if (ret) 1492 - netdev_err(dev, "Host delete station fail\n"); 1491 + netdev_err(wdev->netdev, "Host delete station fail\n"); 1493 1492 return ret; 1494 1493 } 1495 1494 1496 - static int change_station(struct wiphy *wiphy, struct net_device *dev, 1495 + static int change_station(struct wiphy *wiphy, struct wireless_dev *wdev, 1497 1496 const u8 *mac, struct station_parameters *params) 1498 1497 { 1499 1498 int ret = 0; 1500 - struct wilc_vif *vif = netdev_priv(dev); 1501 - 1499 + struct wilc_vif *vif = netdev_priv(wdev->netdev); 1502 1500 if (vif->iftype == WILC_AP_MODE || vif->iftype == WILC_GO_MODE) { 1503 1501 ret = wilc_edit_station(vif, mac, params); 1504 1502 if (ret) 1505 - netdev_err(dev, "Host edit station fail\n"); 1503 + netdev_err(wdev->netdev, "Host edit station fail\n"); 1506 1504 } 1507 1505 return ret; 1508 1506 }
+19 -19
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
··· 483 483 } 484 484 485 485 static int 486 - qtnf_get_station(struct wiphy *wiphy, struct net_device *dev, 486 + qtnf_get_station(struct wiphy *wiphy, struct wireless_dev *wdev, 487 487 const u8 *mac, struct station_info *sinfo) 488 488 { 489 - struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); 489 + struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev); 490 490 491 491 sinfo->generation = vif->generation; 492 492 return qtnf_cmd_get_sta_info(vif, mac, sinfo); 493 493 } 494 494 495 495 static int 496 - qtnf_dump_station(struct wiphy *wiphy, struct net_device *dev, 496 + qtnf_dump_station(struct wiphy *wiphy, struct wireless_dev *wdev, 497 497 int idx, u8 *mac, struct station_info *sinfo) 498 498 { 499 - struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); 499 + struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev); 500 500 const struct qtnf_sta_node *sta_node; 501 501 int ret; 502 502 503 - switch (vif->wdev.iftype) { 503 + switch (wdev->iftype) { 504 504 case NL80211_IFTYPE_STATION: 505 - if (idx != 0 || !vif->wdev.connected) 505 + if (idx != 0 || !wdev->connected) 506 506 return -ENOENT; 507 507 508 508 ether_addr_copy(mac, vif->bssid); ··· 520 520 521 521 ret = qtnf_cmd_get_sta_info(vif, mac, sinfo); 522 522 523 - if (vif->wdev.iftype == NL80211_IFTYPE_AP) { 523 + if (wdev->iftype == NL80211_IFTYPE_AP) { 524 524 if (ret == -ENOENT) { 525 - cfg80211_del_sta(vif->netdev, mac, GFP_KERNEL); 525 + cfg80211_del_sta(&vif->wdev, mac, GFP_KERNEL); 526 526 sinfo->filled = 0; 527 527 } 528 528 } ··· 532 532 return ret; 533 533 } 534 534 535 - static int qtnf_add_key(struct wiphy *wiphy, struct net_device *dev, 535 + static int qtnf_add_key(struct wiphy *wiphy, struct wireless_dev *wdev, 536 536 int link_id, u8 key_index, bool pairwise, 537 537 const u8 *mac_addr, struct key_params *params) 538 538 { 539 - struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); 539 + struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev); 540 540 int ret; 541 541 542 542 ret = qtnf_cmd_send_add_key(vif, key_index, pairwise, mac_addr, params); ··· 548 548 return ret; 549 549 } 550 550 551 - static int qtnf_del_key(struct wiphy *wiphy, struct net_device *dev, 551 + static int qtnf_del_key(struct wiphy *wiphy, struct wireless_dev *wdev, 552 552 int link_id, u8 key_index, bool pairwise, 553 553 const u8 *mac_addr) 554 554 { 555 - struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); 555 + struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev); 556 556 int ret; 557 557 558 558 ret = qtnf_cmd_send_del_key(vif, key_index, pairwise, mac_addr); ··· 587 587 } 588 588 589 589 static int 590 - qtnf_set_default_mgmt_key(struct wiphy *wiphy, struct net_device *dev, 590 + qtnf_set_default_mgmt_key(struct wiphy *wiphy, struct wireless_dev *wdev, 591 591 int link_id, u8 key_index) 592 592 { 593 - struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); 593 + struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev); 594 594 int ret; 595 595 596 596 ret = qtnf_cmd_send_set_default_mgmt_key(vif, key_index); ··· 602 602 } 603 603 604 604 static int 605 - qtnf_change_station(struct wiphy *wiphy, struct net_device *dev, 605 + qtnf_change_station(struct wiphy *wiphy, struct wireless_dev *wdev, 606 606 const u8 *mac, struct station_parameters *params) 607 607 { 608 - struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); 608 + struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev); 609 609 int ret; 610 610 611 611 ret = qtnf_cmd_send_change_sta(vif, mac, params); ··· 617 617 } 618 618 619 619 static int 620 - qtnf_del_station(struct wiphy *wiphy, struct net_device *dev, 620 + qtnf_del_station(struct wiphy *wiphy, struct wireless_dev *wdev, 621 621 struct station_del_parameters *params) 622 622 { 623 - struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); 623 + struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev); 624 624 int ret; 625 625 626 626 if (params->mac && 627 - (vif->wdev.iftype == NL80211_IFTYPE_AP) && 627 + (wdev->iftype == NL80211_IFTYPE_AP) && 628 628 !is_broadcast_ether_addr(params->mac) && 629 629 !qtnf_sta_list_lookup(&vif->sta_list, params->mac)) 630 630 return 0;
+3 -3
drivers/net/wireless/quantenna/qtnfmac/event.c
··· 90 90 goto out; 91 91 } 92 92 93 - cfg80211_new_sta(vif->netdev, sta_assoc->sta_addr, sinfo, 94 - GFP_KERNEL); 93 + cfg80211_new_sta(vif->netdev->ieee80211_ptr, sta_assoc->sta_addr, 94 + sinfo, GFP_KERNEL); 95 95 96 96 out: 97 97 kfree(sinfo); ··· 126 126 sta_addr, reason); 127 127 128 128 if (qtnf_sta_list_del(vif, sta_addr)) 129 - cfg80211_del_sta(vif->netdev, sta_deauth->sta_addr, 129 + cfg80211_del_sta(&vif->wdev, sta_deauth->sta_addr, 130 130 GFP_KERNEL); 131 131 132 132 return 0;
+2 -2
drivers/net/wireless/ralink/rt2x00/rt2800lib.c
··· 10965 10965 10966 10966 int rt2800_read_eeprom_nvmem(struct rt2x00_dev *rt2x00dev) 10967 10967 { 10968 - struct device_node *np = rt2x00dev->dev->of_node; 10968 + struct device *dev = rt2x00dev->dev; 10969 10969 unsigned int len = rt2x00dev->ops->eeprom_size; 10970 10970 struct nvmem_cell *cell; 10971 10971 const void *data; 10972 10972 size_t retlen; 10973 10973 10974 - cell = of_nvmem_cell_get(np, "eeprom"); 10974 + cell = nvmem_cell_get(dev, "eeprom"); 10975 10975 if (IS_ERR(cell)) 10976 10976 return PTR_ERR(cell); 10977 10977
+132 -9
drivers/net/wireless/virtual/mac80211_hwsim.c
··· 337 337 hwsim_net->wmediumd = portid; 338 338 } 339 339 340 - static struct class *hwsim_class; 340 + static const struct class hwsim_class = { 341 + .name = "mac80211_hwsim" 342 + }; 341 343 342 344 static struct net_device *hwsim_mon; /* global monitor netdev */ 343 345 ··· 717 715 } ps; 718 716 bool ps_poll_pending; 719 717 struct dentry *debugfs; 718 + struct cfg80211_chan_def radar_background_chandef; 720 719 721 720 atomic_t pending_cookie; 722 721 struct sk_buff_head pending; /* packets pending */ ··· 939 936 [HWSIM_ATTR_PMSR_RESULT] = NLA_POLICY_NESTED(hwsim_pmsr_peers_result_policy), 940 937 [HWSIM_ATTR_MULTI_RADIO] = { .type = NLA_FLAG }, 941 938 [HWSIM_ATTR_SUPPORT_NAN_DEVICE] = { .type = NLA_FLAG }, 939 + [HWSIM_ATTR_SUPPORT_BACKGROUND_RADAR] = { .type = NLA_FLAG }, 942 940 }; 943 941 944 942 #if IS_REACHABLE(CONFIG_VIRTIO) ··· 1167 1163 1168 1164 DEFINE_DEBUGFS_ATTRIBUTE(hwsim_simulate_radar, NULL, 1169 1165 hwsim_write_simulate_radar, "%llu\n"); 1166 + 1167 + static ssize_t hwsim_background_cac_write(struct file *file, 1168 + const char __user *user_buf, 1169 + size_t count, loff_t *ppos) 1170 + { 1171 + struct mac80211_hwsim_data *data = file->private_data; 1172 + char buf[8] = {}; 1173 + 1174 + if (count >= sizeof(buf)) 1175 + return -EINVAL; 1176 + 1177 + if (copy_from_user(buf, user_buf, count)) 1178 + return -EFAULT; 1179 + 1180 + /* Check if background radar channel is configured */ 1181 + if (!data->radar_background_chandef.chan) 1182 + return -ENOENT; 1183 + 1184 + if (sysfs_streq(buf, "radar")) 1185 + cfg80211_background_radar_event(data->hw->wiphy, 1186 + &data->radar_background_chandef, 1187 + GFP_KERNEL); 1188 + else if (sysfs_streq(buf, "cancel")) 1189 + cfg80211_background_cac_abort(data->hw->wiphy); 1190 + else 1191 + return -EINVAL; 1192 + 1193 + return count; 1194 + } 1195 + 1196 + static const struct file_operations hwsim_background_cac_ops = { 1197 + .write = hwsim_background_cac_write, 1198 + .open = simple_open, 1199 + .llseek = default_llseek, 1200 + }; 1170 1201 1171 1202 static int hwsim_fops_group_read(void *dat, u64 *val) 1172 1203 { ··· 1994 1955 return NULL; 1995 1956 } 1996 1957 1958 + static int mac80211_hwsim_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, 1959 + struct ieee80211_vif *vif, 1960 + struct ieee80211_sta *sta, 1961 + struct ieee80211_key_conf *key) 1962 + { 1963 + switch (key->cipher) { 1964 + case WLAN_CIPHER_SUITE_CCMP: 1965 + case WLAN_CIPHER_SUITE_CCMP_256: 1966 + case WLAN_CIPHER_SUITE_GCMP: 1967 + case WLAN_CIPHER_SUITE_GCMP_256: 1968 + break; 1969 + default: 1970 + return 1; 1971 + } 1972 + 1973 + key->flags |= IEEE80211_KEY_FLAG_RESERVE_TAILROOM; 1974 + return 0; 1975 + } 1976 + 1997 1977 static void mac80211_hwsim_tx(struct ieee80211_hw *hw, 1998 1978 struct ieee80211_tx_control *control, 1999 1979 struct sk_buff *skb) ··· 2023 1965 struct ieee80211_chanctx_conf *chanctx_conf; 2024 1966 struct ieee80211_channel *channel; 2025 1967 struct ieee80211_vif *vif = txi->control.vif; 2026 - bool ack; 1968 + bool ack, unicast_data; 2027 1969 enum nl80211_chan_width confbw = NL80211_CHAN_WIDTH_20_NOHT; 2028 1970 u32 _portid, i; 2029 1971 ··· 2032 1974 ieee80211_free_txskb(hw, skb); 2033 1975 return; 2034 1976 } 1977 + 1978 + unicast_data = is_unicast_ether_addr(hdr->addr1) && 1979 + ieee80211_is_data(hdr->frame_control); 1980 + 1981 + if (unicast_data && ieee80211_encrypt_tx_skb(skb) < 0) { 1982 + ieee80211_free_txskb(hw, skb); 1983 + return; 1984 + } 1985 + /* re-assign hdr since skb data may have shifted after encryption */ 1986 + hdr = (void *)skb->data; 2035 1987 2036 1988 if (vif && vif->type == NL80211_IFTYPE_NAN && !data->tmp_chan) { 2037 1989 /* For NAN Device simulation purposes, assume that NAN is always ··· 2127 2059 channel = NULL; 2128 2060 } 2129 2061 } 2062 + 2063 + if (!unicast_data && ieee80211_encrypt_tx_skb(skb) < 0) { 2064 + ieee80211_free_txskb(hw, skb); 2065 + return; 2066 + } 2067 + /* re-assign hdr since skb data may have shifted after encryption */ 2068 + hdr = (void *)skb->data; 2130 2069 2131 2070 if (WARN(!channel, "TX w/o channel - queue = %d\n", txi->hw_queue)) { 2132 2071 ieee80211_free_txskb(hw, skb); ··· 4153 4078 ns_to_ktime(until_dw * NSEC_PER_USEC), 4154 4079 HRTIMER_MODE_REL_SOFT); 4155 4080 4156 - if (conf->cluster_id && !is_zero_ether_addr(conf->cluster_id) && 4081 + if (!is_zero_ether_addr(conf->cluster_id) && 4157 4082 is_zero_ether_addr(hwsim_nan_cluster_id)) { 4158 4083 memcpy(hwsim_nan_cluster_id, conf->cluster_id, ETH_ALEN); 4159 4084 } else if (is_zero_ether_addr(hwsim_nan_cluster_id)) { ··· 4229 4154 return 0; 4230 4155 } 4231 4156 4157 + static int mac80211_hwsim_set_radar_background(struct ieee80211_hw *hw, 4158 + struct cfg80211_chan_def *chan) 4159 + { 4160 + struct mac80211_hwsim_data *data = hw->priv; 4161 + 4162 + if (!wiphy_ext_feature_isset(hw->wiphy, 4163 + NL80211_EXT_FEATURE_RADAR_BACKGROUND)) 4164 + return -EOPNOTSUPP; 4165 + 4166 + if (chan) 4167 + data->radar_background_chandef = *chan; 4168 + else 4169 + memset(&data->radar_background_chandef, 0, 4170 + sizeof(data->radar_background_chandef)); 4171 + 4172 + return 0; 4173 + } 4174 + 4232 4175 #ifdef CONFIG_MAC80211_DEBUGFS 4233 4176 #define HWSIM_DEBUGFS_OPS \ 4234 4177 .link_add_debugfs = mac80211_hwsim_link_add_debugfs, ··· 4282 4189 .start_nan = mac80211_hwsim_start_nan, \ 4283 4190 .stop_nan = mac80211_hwsim_stop_nan, \ 4284 4191 .nan_change_conf = mac80211_hwsim_change_nan_config, \ 4192 + .set_radar_background = mac80211_hwsim_set_radar_background, \ 4193 + .set_key = mac80211_hwsim_set_key, \ 4285 4194 HWSIM_DEBUGFS_OPS 4286 4195 4287 4196 #define HWSIM_NON_MLO_OPS \ ··· 4350 4255 bool mlo; 4351 4256 const struct cfg80211_pmsr_capabilities *pmsr_capa; 4352 4257 bool nan_device; 4258 + bool background_radar; 4353 4259 }; 4354 4260 4355 4261 static void hwsim_mcast_config_msg(struct sk_buff *mcast_skb, ··· 4433 4337 4434 4338 if (param->nan_device) { 4435 4339 ret = nla_put_flag(skb, HWSIM_ATTR_SUPPORT_NAN_DEVICE); 4340 + if (ret < 0) 4341 + return ret; 4342 + } 4343 + 4344 + if (param->background_radar) { 4345 + ret = nla_put_flag(skb, HWSIM_ATTR_SUPPORT_BACKGROUND_RADAR); 4436 4346 if (ret < 0) 4437 4347 return ret; 4438 4348 } ··· 5526 5424 data = hw->priv; 5527 5425 data->hw = hw; 5528 5426 5529 - data->dev = device_create(hwsim_class, NULL, 0, hw, "hwsim%d", idx); 5427 + data->dev = device_create(&hwsim_class, NULL, 0, hw, "hwsim%d", idx); 5530 5428 if (IS_ERR(data->dev)) { 5531 5429 printk(KERN_DEBUG 5532 5430 "mac80211_hwsim: device_create failed (%ld)\n", ··· 5723 5621 WIPHY_FLAG_AP_UAPSD | 5724 5622 WIPHY_FLAG_SUPPORTS_5_10_MHZ | 5725 5623 WIPHY_FLAG_HAS_CHANNEL_SWITCH; 5624 + hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; 5726 5625 hw->wiphy->features |= NL80211_FEATURE_ACTIVE_MONITOR | 5727 5626 NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE | 5728 5627 NL80211_FEATURE_STATIC_SMPS | ··· 5742 5639 NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT); 5743 5640 wiphy_ext_feature_set(hw->wiphy, 5744 5641 NL80211_EXT_FEATURE_BSS_COLOR); 5642 + wiphy_ext_feature_set(hw->wiphy, 5643 + NL80211_EXT_FEATURE_SPP_AMSDU_SUPPORT); 5644 + wiphy_ext_feature_set(hw->wiphy, 5645 + NL80211_EXT_FEATURE_CAN_REPLACE_PTK0); 5646 + wiphy_ext_feature_set(hw->wiphy, 5647 + NL80211_EXT_FEATURE_EXT_KEY_ID); 5648 + wiphy_ext_feature_set(hw->wiphy, 5649 + NL80211_EXT_FEATURE_ASSOC_FRAME_ENCRYPTION); 5745 5650 5746 5651 hw->wiphy->interface_modes = param->iftypes; 5747 5652 ··· 5905 5794 5906 5795 wiphy_ext_feature_set(hw->wiphy, 5907 5796 NL80211_EXT_FEATURE_DFS_CONCURRENT); 5797 + if (param->background_radar) 5798 + wiphy_ext_feature_set(hw->wiphy, 5799 + NL80211_EXT_FEATURE_RADAR_BACKGROUND); 5908 5800 5909 5801 if (param->no_vif) 5910 5802 ieee80211_hw_set(hw, NO_AUTO_VIF); ··· 5946 5832 debugfs_create_file("dfs_simulate_radar", 0222, 5947 5833 data->debugfs, 5948 5834 data, &hwsim_simulate_radar); 5835 + if (param->background_radar) 5836 + debugfs_create_file("dfs_background_cac", 0200, 5837 + data->debugfs, 5838 + data, &hwsim_background_cac_ops); 5949 5839 5950 5840 if (param->pmsr_capa) { 5951 5841 data->pmsr_capa = *param->pmsr_capa; ··· 6068 5950 param.channels = data->channels; 6069 5951 param.hwname = wiphy_name(data->hw->wiphy); 6070 5952 param.pmsr_capa = &data->pmsr_capa; 5953 + param.background_radar = 5954 + wiphy_ext_feature_isset(data->hw->wiphy, 5955 + NL80211_EXT_FEATURE_RADAR_BACKGROUND); 6071 5956 6072 5957 res = append_radio_msg(skb, data->idx, &param); 6073 5958 if (res < 0) ··· 6099 5978 spin_lock_bh(&hwsim_radio_lock); 6100 5979 } 6101 5980 spin_unlock_bh(&hwsim_radio_lock); 6102 - class_destroy(hwsim_class); 5981 + class_unregister(&hwsim_class); 6103 5982 } 6104 5983 6105 5984 static const struct net_device_ops hwsim_netdev_ops = { ··· 6507 6386 6508 6387 if (info->attrs[HWSIM_ATTR_MULTI_RADIO]) 6509 6388 param.multi_radio = true; 6389 + 6390 + if (info->attrs[HWSIM_ATTR_SUPPORT_BACKGROUND_RADAR]) 6391 + param.background_radar = true; 6510 6392 6511 6393 if (info->attrs[HWSIM_ATTR_REG_HINT_ALPHA2]) 6512 6394 param.reg_alpha2 = ··· 7207 7083 if (err) 7208 7084 goto out_exit_netlink; 7209 7085 7210 - hwsim_class = class_create("mac80211_hwsim"); 7211 - if (IS_ERR(hwsim_class)) { 7212 - err = PTR_ERR(hwsim_class); 7086 + err = class_register(&hwsim_class); 7087 + if (err) 7213 7088 goto out_exit_virtio; 7214 - } 7215 7089 7216 7090 hwsim_init_s1g_channels(hwsim_channels_s1g); 7217 7091 ··· 7287 7165 param.p2p_device = support_p2p_device; 7288 7166 param.mlo = mlo; 7289 7167 param.multi_radio = multi_radio; 7168 + param.background_radar = true; 7290 7169 param.use_chanctx = channels > 1 || mlo || multi_radio; 7291 7170 param.iftypes = HWSIM_IFTYPE_SUPPORT_MASK; 7292 7171 if (param.p2p_device)
+2
drivers/net/wireless/virtual/mac80211_hwsim.h
··· 161 161 * Adds one radio for each band. Number of supported channels will be set for 162 162 * each radio instead of for the wiphy. 163 163 * @HWSIM_ATTR_SUPPORT_NAN_DEVICE: support NAN Device virtual interface (flag) 164 + * @HWSIM_ATTR_SUPPORT_BACKGROUND_RADAR: background radar/CAC support (flag) 164 165 * @__HWSIM_ATTR_MAX: enum limit 165 166 */ 166 167 enum hwsim_attrs { ··· 196 195 HWSIM_ATTR_PMSR_RESULT, 197 196 HWSIM_ATTR_MULTI_RADIO, 198 197 HWSIM_ATTR_SUPPORT_NAN_DEVICE, 198 + HWSIM_ATTR_SUPPORT_BACKGROUND_RADAR, 199 199 __HWSIM_ATTR_MAX, 200 200 }; 201 201 #define HWSIM_ATTR_MAX (__HWSIM_ATTR_MAX - 1)
+7 -5
drivers/net/wireless/virtual/virt_wifi.c
··· 320 320 } 321 321 322 322 /* Called with the rtnl lock held. */ 323 - static int virt_wifi_get_station(struct wiphy *wiphy, struct net_device *dev, 324 - const u8 *mac, struct station_info *sinfo) 323 + static int virt_wifi_get_station(struct wiphy *wiphy, 324 + struct wireless_dev *wdev, const u8 *mac, 325 + struct station_info *sinfo) 325 326 { 327 + struct net_device *dev = wdev->netdev; 326 328 struct virt_wifi_netdev_priv *priv = netdev_priv(dev); 327 329 328 330 wiphy_debug(wiphy, "get_station\n"); ··· 347 345 } 348 346 349 347 /* Called with the rtnl lock held. */ 350 - static int virt_wifi_dump_station(struct wiphy *wiphy, struct net_device *dev, 348 + static int virt_wifi_dump_station(struct wiphy *wiphy, struct wireless_dev *wdev, 351 349 int idx, u8 *mac, struct station_info *sinfo) 352 350 { 353 - struct virt_wifi_netdev_priv *priv = netdev_priv(dev); 351 + struct virt_wifi_netdev_priv *priv = netdev_priv(wdev->netdev); 354 352 355 353 wiphy_debug(wiphy, "dump_station\n"); 356 354 ··· 358 356 return -ENOENT; 359 357 360 358 ether_addr_copy(mac, fake_router_bssid); 361 - return virt_wifi_get_station(wiphy, dev, fake_router_bssid, sinfo); 359 + return virt_wifi_get_station(wiphy, wdev, fake_router_bssid, sinfo); 362 360 } 363 361 364 362 static const struct cfg80211_ops virt_wifi_cfg80211_ops = {
+18 -15
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
··· 831 831 return ret; 832 832 } 833 833 834 - static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, 834 + static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct wireless_dev *wdev, 835 835 int link_id, u8 key_index, bool pairwise, 836 836 const u8 *mac_addr, struct key_params *params) 837 837 { ··· 839 839 u32 param_len; 840 840 struct ieee_param *param = NULL; 841 841 int ret = 0; 842 + struct net_device *ndev = wdev->netdev; 842 843 struct adapter *padapter = rtw_netdev_priv(ndev); 843 844 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 844 845 ··· 910 909 return ret; 911 910 } 912 911 913 - static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev, 912 + static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct wireless_dev *wdev, 914 913 int link_id, u8 key_index, bool pairwise, 915 914 const u8 *mac_addr, void *cookie, 916 915 void (*callback)(void *cookie, ··· 919 918 return 0; 920 919 } 921 920 922 - static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev, 921 + static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct wireless_dev *wdev, 923 922 int link_id, u8 key_index, bool pairwise, 924 923 const u8 *mac_addr) 925 924 { 926 - struct adapter *padapter = rtw_netdev_priv(ndev); 925 + struct adapter *padapter = rtw_netdev_priv(wdev->netdev); 927 926 struct security_priv *psecuritypriv = &padapter->securitypriv; 928 927 929 928 if (key_index == psecuritypriv->dot11PrivacyKeyIndex) { ··· 961 960 } 962 961 963 962 static int cfg80211_rtw_get_station(struct wiphy *wiphy, 964 - struct net_device *ndev, 963 + struct wireless_dev *wdev, 965 964 const u8 *mac, 966 965 struct station_info *sinfo) 967 966 { 968 967 int ret = 0; 968 + struct net_device *ndev = wdev_to_ndev(wdev); 969 969 struct adapter *padapter = rtw_netdev_priv(ndev); 970 970 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 971 971 struct sta_info *psta = NULL; ··· 1914 1912 1915 1913 void rtw_cfg80211_indicate_sta_assoc(struct adapter *padapter, u8 *pmgmt_frame, uint frame_len) 1916 1914 { 1917 - struct net_device *ndev = padapter->pnetdev; 1915 + struct wireless_dev *wdev = padapter->rtw_wdev; 1918 1916 1919 1917 { 1920 1918 struct station_info sinfo = {}; ··· 1928 1926 sinfo.filled = 0; 1929 1927 sinfo.assoc_req_ies = pmgmt_frame + WLAN_HDR_A3_LEN + ie_offset; 1930 1928 sinfo.assoc_req_ies_len = frame_len - WLAN_HDR_A3_LEN - ie_offset; 1931 - cfg80211_new_sta(ndev, GetAddr2Ptr(pmgmt_frame), &sinfo, GFP_ATOMIC); 1929 + cfg80211_new_sta(wdev, GetAddr2Ptr(pmgmt_frame), &sinfo, GFP_ATOMIC); 1932 1930 } 1933 1931 } 1934 1932 1935 1933 void rtw_cfg80211_indicate_sta_disassoc(struct adapter *padapter, unsigned char *da, unsigned short reason) 1936 1934 { 1937 - struct net_device *ndev = padapter->pnetdev; 1935 + struct wireless_dev *wdev = padapter->rtw_wdev; 1938 1936 1939 - cfg80211_del_sta(ndev, da, GFP_ATOMIC); 1937 + cfg80211_del_sta(wdev, da, GFP_ATOMIC); 1940 1938 } 1941 1939 1942 1940 static u8 rtw_get_chan_type(struct adapter *adapter) ··· 2325 2323 } 2326 2324 2327 2325 static int cfg80211_rtw_add_station(struct wiphy *wiphy, 2328 - struct net_device *ndev, 2326 + struct wireless_dev *wdev, 2329 2327 const u8 *mac, 2330 2328 struct station_parameters *params) 2331 2329 { 2332 2330 return 0; 2333 2331 } 2334 2332 2335 - static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev, 2333 + static int cfg80211_rtw_del_station(struct wiphy *wiphy, 2334 + struct wireless_dev *wdev, 2336 2335 struct station_del_parameters *params) 2337 2336 { 2338 2337 int ret = 0; 2339 2338 struct list_head *phead, *plist, *tmp; 2340 2339 u8 updated = false; 2341 2340 struct sta_info *psta = NULL; 2342 - struct adapter *padapter = rtw_netdev_priv(ndev); 2341 + struct adapter *padapter = rtw_netdev_priv(wdev->netdev); 2343 2342 struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); 2344 2343 struct sta_priv *pstapriv = &padapter->stapriv; 2345 2344 const u8 *mac = params->mac; ··· 2391 2388 } 2392 2389 2393 2390 static int cfg80211_rtw_change_station(struct wiphy *wiphy, 2394 - struct net_device *ndev, 2391 + struct wireless_dev *wdev, 2395 2392 const u8 *mac, 2396 2393 struct station_parameters *params) 2397 2394 { ··· 2419 2416 } 2420 2417 2421 2418 static int cfg80211_rtw_dump_station(struct wiphy *wiphy, 2422 - struct net_device *ndev, 2419 + struct wireless_dev *wdev, 2423 2420 int idx, u8 *mac, 2424 2421 struct station_info *sinfo) 2425 2422 { 2426 2423 int ret = 0; 2427 - struct adapter *padapter = rtw_netdev_priv(ndev); 2424 + struct adapter *padapter = rtw_netdev_priv(wdev_to_ndev(wdev)); 2428 2425 struct sta_info *psta = NULL; 2429 2426 struct sta_priv *pstapriv = &padapter->stapriv; 2430 2427
+265 -6
include/linux/ieee80211-uhr.h
··· 29 29 #define IEEE80211_UHR_NPCA_PARAMS_MOPLEN 0x00400000 30 30 #define IEEE80211_UHR_NPCA_PARAMS_DIS_SUBCH_BMAP_PRES 0x00800000 31 31 32 + /** 33 + * struct ieee80211_uhr_npca_info - npca operation information 34 + * 35 + * This structure is the "NPCA Operation Parameters field format" of "UHR 36 + * Operation Element" fields as described in P802.11bn_D1.3 37 + * subclause 9.4.2.353. See Figure 9-aa4. 38 + * 39 + * Refer to IEEE80211_UHR_NPCA* 40 + * @params: 41 + * NPCA Primary Channel - NPCA primary channel 42 + * NPCA_Min Duration Threshold - Minimum duration of inter-BSS activity 43 + * NPCA Switching Delay - 44 + * Time needed by an NPCA AP to switch from the 45 + * BSS primary channel to the NPCA primary channel 46 + * in the unit of 4 µs. 47 + * NPCA Switching Back Delay - 48 + * Time to switch from the NPCA primary channel 49 + * to the BSS primary channel in the unit of 4 µs. 50 + * NPCA Initial QSRC - 51 + * Initialize the EDCAF QSRC[AC] variables 52 + * when an NPCA STA in the BSS 53 + * switches to NPCA operation. 54 + * NPCA MOPLEN - 55 + * Indicates which conditions can be used to 56 + * initiate an NPCA operation, 57 + * 1 -> both PHYLEN NPCA operation and MOPLEN 58 + * NPCA operation are 59 + * permitted in the BSS 60 + * 0 -> only PHYLEN NPCA operation is allowed in the BSS. 61 + * NPCA Disabled Subchannel Bitmap Present - 62 + * Indicates whether the NPCA Disabled Subchannel 63 + * Bitmap field is present. A 1 in this field indicates that 64 + * the NPCA Disabled Subchannel Bitmap field is present 65 + * @dis_subch_bmap: 66 + * A bit in the bitmap that lies within the BSS bandwidth is set 67 + * to 1 to indicate that the corresponding 20 MHz subchannel is 68 + * punctured and is set to 0 to indicate that the corresponding 69 + * 20 MHz subchannel is not punctured. A bit in the bitmap that 70 + * falls outside of the BSS bandwidth is reserved. This field is 71 + * present when the value of the NPCA Disabled Subchannel Bitmap 72 + * Field Present field is equal to 1, and not present, otherwise 73 + */ 32 74 struct ieee80211_uhr_npca_info { 33 75 __le32 params; 34 76 __le16 dis_subch_bmap[]; 77 + } __packed; 78 + 79 + #define IEEE80211_UHR_DPS_PADDING_DELAY 0x0000003F 80 + #define IEEE80211_UHR_DPS_TRANSITION_DELAY 0x00003F00 81 + #define IEEE80211_UHR_DPS_ICF_REQUIRED 0x00010000 82 + #define IEEE80211_UHR_DPS_PARAMETERIZED_FLAG 0x00020000 83 + #define IEEE80211_UHR_DPS_LC_MODE_BW 0x001C0000 84 + #define IEEE80211_UHR_DPS_LC_MODE_NSS 0x01E00000 85 + #define IEEE80211_UHR_DPS_LC_MODE_MCS 0x1E000000 86 + #define IEEE80211_UHR_DPS_MOBILE_AP_DPS_STATIC_HCM 0x20000000 87 + 88 + /** 89 + * struct ieee80211_uhr_dps_info - DPS operation information 90 + * 91 + * This structure is the "DPS Operation Parameter field" of "UHR 92 + * Operation Element" fields as described in P802.11bn_D1.3 93 + * subclause 9.4.1.87. See Figure 9-207u. 94 + * 95 + * Refer to IEEE80211_UHR_DPS* 96 + * @params: 97 + * DPS Padding Delay - 98 + * Indicates the minimum MAC padding 99 + * duration that is required by a DPS STA 100 + * in an ICF to cause the STA to transition 101 + * from the lower capability mode to the 102 + * higher capability mode. The DPS Padding 103 + * Delay field is in units of 4 µs. 104 + * DPS Transition Delay - 105 + * Indicates the amount of time required by a 106 + * DPS STA to transition from the higher 107 + * capability mode to the lower capability 108 + * mode. The DPS Transition Delay field is in 109 + * units of 4 µs. 110 + * ICF Required - 111 + * Indicates when the DPS assisting STA needs 112 + * to transmit an ICF frame to the peer DPS STA 113 + * before performing the frame exchanges with 114 + * the peer DPS STA in a TXOP. 115 + * 1 -> indicates that the transmission of the 116 + * ICF frame to the peer DPS STA prior to 117 + * any frame exchange is needed. 118 + * 0 -> ICF transmission before the frame 119 + * exchanges with the peer DPS STA is only 120 + * needed if the frame exchange is performed 121 + * in the HC mode. 122 + * Parameterized Flag - 123 + * 0 -> indicates that only 20 MHz, 1 SS, 124 + * non-HT PPDU format with the data 125 + * rate of 6, 12, and 24 Mb/s as the 126 + * default mode are supported by the 127 + * DPS STA in the LC mode 128 + * 1 -> indicates that a bandwidth up to the 129 + * bandwidth indicated in the LC Mode 130 + * Bandwidth field, a number of spatial 131 + * streams up to the NSS indicated in 132 + * the LC Mode Nss field, and an MCS up 133 + * to the MCS indicated in the LC Mode 134 + * MCS fields are supported by the DPS 135 + * STA in the LC mode as the 136 + * parameterized mode. 137 + * LC Mode Bandwidth - 138 + * Indicates the maximum bandwidth supported 139 + * by the STA in the LC mode. 140 + * LC Mode NSS - 141 + * Indicates the maximum number of the spatial 142 + * streams supported by the STA in the LC mode. 143 + * LC Mode MCS - 144 + * Indicates the highest MCS supported by the STA 145 + * in the LC mode. 146 + * Mobile AP DPS Static HCM - 147 + * 1 -> indicates that it will remain in the DPS high 148 + * capability mode until the next TBTT on that 149 + * link. 150 + * 0 -> otherwise. 151 + */ 152 + struct ieee80211_uhr_dps_info { 153 + __le32 params; 154 + } __packed; 155 + 156 + #define IEEE80211_UHR_DBE_OPER_BANDWIDTH 0x07 157 + #define IEEE80211_UHR_DBE_OPER_DIS_SUBCHANNEL_BITMAP_PRES 0x08 158 + 159 + /** 160 + * enum ieee80211_uhr_dbe_oper_bw - DBE Operational Bandwidth 161 + * 162 + * Encoding for the DBE Operational Bandwidth field in the UHR Operation 163 + * element (DBE Operation Parameters). 164 + * 165 + * @IEEE80211_UHR_DBE_OPER_BW_40: 40 MHz operational DBE bandwidth 166 + * @IEEE80211_UHR_DBE_OPER_BW_80: 80 MHz operational DBE bandwidth 167 + * @IEEE80211_UHR_DBE_OPER_BW_160: 160 MHz operational DBE bandwidth 168 + * @IEEE80211_UHR_DBE_OPER_BW_320_1: 320-1 MHz operational DBE bandwidth 169 + * @IEEE80211_UHR_DBE_OPER_BW_320_2: 320-2 MHz operational DBE bandwidth 170 + */ 171 + enum ieee80211_uhr_dbe_oper_bw { 172 + IEEE80211_UHR_DBE_OPER_BW_40 = 1, 173 + IEEE80211_UHR_DBE_OPER_BW_80 = 2, 174 + IEEE80211_UHR_DBE_OPER_BW_160 = 3, 175 + IEEE80211_UHR_DBE_OPER_BW_320_1 = 4, 176 + IEEE80211_UHR_DBE_OPER_BW_320_2 = 5, 177 + }; 178 + 179 + /** 180 + * struct ieee80211_uhr_dbe_info - DBE operation information 181 + * 182 + * This structure is the "DBE Operation Parameters field" of 183 + * "UHR Operation Element" fields as described in P802.11bn_D1.3 184 + * subclause 9.4.2.353. See Figure 9-aa6. 185 + * 186 + * Refer to IEEE80211_UHR_DBE_OPER* 187 + * @params: 188 + * B0-B2 - DBE Operational Bandwidth field, see 189 + * "enum ieee80211_uhr_dbe_oper_bw" for values. 190 + * Value 0 is reserved. 191 + * Value 1 indicates 40 MHz operational DBE bandwidth. 192 + * Value 2 indicates 80 MHz operational DBE bandwidth. 193 + * Value 3 indicates 160 MHz operational DBE bandwidth. 194 + * Value 4 indicates 320-1 MHz operational DBE bandwidth. 195 + * Value 5 indicates 320-2 MHz operational DBE bandwidth. 196 + * Values 6 to 7 are reserved. 197 + * B3 - DBE Disabled Subchannel Bitmap Present. 198 + * @dis_subch_bmap: DBE Disabled Subchannel Bitmap field is set to indicate 199 + * disabled 20 MHz subchannels within the DBE Bandwidth. 200 + */ 201 + struct ieee80211_uhr_dbe_info { 202 + u8 params; 203 + __le16 dis_subch_bmap[]; 204 + } __packed; 205 + 206 + #define IEEE80211_UHR_P_EDCA_ECWMIN 0x0F 207 + #define IEEE80211_UHR_P_EDCA_ECWMAX 0xF0 208 + #define IEEE80211_UHR_P_EDCA_AIFSN 0x000F 209 + #define IEEE80211_UHR_P_EDCA_CW_DS 0x0030 210 + #define IEEE80211_UHR_P_EDCA_PSRC_THRESHOLD 0x01C0 211 + #define IEEE80211_UHR_P_EDCA_QSRC_THRESHOLD 0x0600 212 + 213 + /** 214 + * struct ieee80211_uhr_p_edca_info - P-EDCA operation information 215 + * 216 + * This structure is the "P-EDCA Operation Parameters field" of 217 + * "UHR Operation Element" fields as described in P802.11bn_D1.3 218 + * subclause 9.4.2.353. See Figure 9-aa5. 219 + * 220 + * Refer to IEEE80211_UHR_P_EDCA* 221 + * @p_edca_ec: P-EDCA ECWmin and ECWmax. 222 + * These fields indicate the CWmin and CWmax values used by a 223 + * P-EDCA STA during P-EDCA contention. 224 + * @params: AIFSN, CW DS, PSRC threshold, and QSRC threshold. 225 + * - The AIFSN field indicates the AIFSN value used by a P-EDCA STA 226 + * during P-EDCA contention. 227 + * - The CW DS field indicates the value used for randomization of the 228 + * transmission slot of the DS-CTS frame. The value 3 is reserved. 229 + * The value 0 indicates that randomization is not enabled. 230 + * - The P-EDCA PSRC threshold field indicates the maximum number of 231 + * allowed consecutive DS-CTS transmissions. The value 0 and values 232 + * greater than 4 are reserved. 233 + * - The P-EDCA QSRC threshold field indicates the value of the 234 + * QSRC[AC_VO] counter required to start P-EDCA contention. The 235 + * value 0 is reserved. 236 + */ 237 + struct ieee80211_uhr_p_edca_info { 238 + u8 p_edca_ec; 239 + __le16 params; 35 240 } __packed; 36 241 37 242 static inline bool ieee80211_uhr_oper_size_ok(const u8 *data, u8 len, ··· 252 47 if (beacon) 253 48 return true; 254 49 255 - /* FIXME: DPS, DBE, P-EDCA (consider order, also relative to NPCA) */ 50 + /* DPS Operation Parameters (fixed 4 bytes) */ 51 + if (oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_DPS_ENA)) { 52 + needed += sizeof(struct ieee80211_uhr_dps_info); 53 + if (len < needed) 54 + return false; 55 + } 256 56 57 + /* NPCA Operation Parameters (fixed 4 bytes + optional 2 bytes) */ 257 58 if (oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_NPCA_ENA)) { 258 59 const struct ieee80211_uhr_npca_info *npca = 259 - (const void *)oper->variable; 60 + (const void *)(data + needed); 260 61 261 62 needed += sizeof(*npca); 262 - 263 63 if (len < needed) 264 64 return false; 265 65 266 - if (npca->params & cpu_to_le32(IEEE80211_UHR_NPCA_PARAMS_DIS_SUBCH_BMAP_PRES)) 66 + if (npca->params & 67 + cpu_to_le32(IEEE80211_UHR_NPCA_PARAMS_DIS_SUBCH_BMAP_PRES)) { 267 68 needed += sizeof(npca->dis_subch_bmap[0]); 69 + if (len < needed) 70 + return false; 71 + } 72 + } 73 + 74 + /* P-EDCA Operation Parameters (fixed 3 bytes) */ 75 + if (oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_PEDCA_ENA)) { 76 + needed += sizeof(struct ieee80211_uhr_p_edca_info); 77 + if (len < needed) 78 + return false; 79 + } 80 + 81 + /* DBE Operation Parameters (fixed 1 byte + optional 2 bytes) */ 82 + if (oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_DBE_ENA)) { 83 + const struct ieee80211_uhr_dbe_info *dbe = 84 + (const void *)(data + needed); 85 + 86 + needed += sizeof(*dbe); 87 + if (len < needed) 88 + return false; 89 + 90 + if (dbe->params & 91 + IEEE80211_UHR_DBE_OPER_DIS_SUBCHANNEL_BITMAP_PRES) { 92 + needed += sizeof(dbe->dis_subch_bmap[0]); 93 + if (len < needed) 94 + return false; 95 + } 268 96 } 269 97 270 98 return len >= needed; ··· 310 72 static inline const struct ieee80211_uhr_npca_info * 311 73 ieee80211_uhr_npca_info(const struct ieee80211_uhr_operation *oper) 312 74 { 75 + const u8 *pos = oper->variable; 76 + 313 77 if (!(oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_NPCA_ENA))) 314 78 return NULL; 315 79 316 - /* FIXME: DPS */ 80 + if (oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_DPS_ENA)) 81 + pos += sizeof(struct ieee80211_uhr_dps_info); 317 82 318 - return (const void *)oper->variable; 83 + return (const void *)pos; 319 84 } 320 85 321 86 static inline const __le16 * ··· 371 130 #define IEEE80211_UHR_MAC_CAP_DBE_MAX_BW 0x07 372 131 #define IEEE80211_UHR_MAC_CAP_DBE_EHT_MCS_MAP_160_PRES 0x08 373 132 #define IEEE80211_UHR_MAC_CAP_DBE_EHT_MCS_MAP_320_PRES 0x10 133 + 134 + /** 135 + * enum ieee80211_uhr_dbe_max_supported_bw - DBE Maximum Supported Bandwidth 136 + * 137 + * As per spec P802.11bn_D1.3 "Table 9-bb5—Encoding of the DBE Maximum 138 + * Supported Bandwidth field". 139 + * 140 + * @IEEE80211_UHR_DBE_MAX_BW_40: Indicates 40 MHz DBE max supported bw 141 + * @IEEE80211_UHR_DBE_MAX_BW_80: Indicates 80 MHz DBE max supported bw 142 + * @IEEE80211_UHR_DBE_MAX_BW_160: Indicates 160 MHz DBE max supported bw 143 + * @IEEE80211_UHR_DBE_MAX_BW_320: Indicates 320 MHz DBE max supported bw 144 + */ 145 + enum ieee80211_uhr_dbe_max_supported_bw { 146 + IEEE80211_UHR_DBE_MAX_BW_40 = 1, 147 + IEEE80211_UHR_DBE_MAX_BW_80 = 2, 148 + IEEE80211_UHR_DBE_MAX_BW_160 = 3, 149 + IEEE80211_UHR_DBE_MAX_BW_320 = 4, 150 + }; 374 151 375 152 struct ieee80211_uhr_cap_mac { 376 153 u8 mac_cap[5];
+2
include/linux/ieee80211.h
··· 1358 1358 #define WLAN_AUTH_FILS_SK 4 1359 1359 #define WLAN_AUTH_FILS_SK_PFS 5 1360 1360 #define WLAN_AUTH_FILS_PK 6 1361 + #define WLAN_AUTH_IEEE8021X 8 1361 1362 #define WLAN_AUTH_EPPKE 9 1362 1363 #define WLAN_AUTH_LEAP 128 1363 1364 ··· 1508 1507 WLAN_STATUS_SAE_PK = 127, 1509 1508 WLAN_STATUS_DENIED_TID_TO_LINK_MAPPING = 133, 1510 1509 WLAN_STATUS_PREF_TID_TO_LINK_MAPPING_SUGGESTED = 134, 1510 + WLAN_STATUS_8021X_AUTH_SUCCESS = 153, 1511 1511 }; 1512 1512 1513 1513
+44 -19
include/net/cfg80211.h
··· 190 190 * on this channel. 191 191 * @dfs_state_entered: timestamp (jiffies) when the dfs state was entered. 192 192 * @dfs_cac_ms: DFS CAC time in milliseconds, this is valid for DFS channels. 193 + * @cac_start_time: timestamp (CLOCK_BOOTTIME, nanoseconds) when CAC was 194 + * started on this channel. Zero when CAC is not in progress. 193 195 * @psd: power spectral density (in dBm) 194 196 */ 195 197 struct ieee80211_channel { ··· 209 207 enum nl80211_dfs_state dfs_state; 210 208 unsigned long dfs_state_entered; 211 209 unsigned int dfs_cac_ms; 210 + u64 cac_start_time; 212 211 s8 psd; 213 212 }; 214 213 ··· 4023 4020 * (i.e. BIT(NL80211_BAND_2GHZ)). 4024 4021 * @cluster_id: cluster ID used for NAN synchronization. This is a MAC address 4025 4022 * that can take a value from 50-6F-9A-01-00-00 to 50-6F-9A-01-FF-FF. 4026 - * If NULL, the device will pick a random Cluster ID. 4027 4023 * @scan_period: period (in seconds) between NAN scans. 4028 4024 * @scan_dwell_time: dwell time (in milliseconds) for NAN scans. 4029 4025 * @discovery_beacon_interval: interval (in TUs) for discovery beacons. ··· 4038 4036 struct cfg80211_nan_conf { 4039 4037 u8 master_pref; 4040 4038 u8 bands; 4041 - const u8 *cluster_id; 4039 + u8 cluster_id[ETH_ALEN] __aligned(2); 4042 4040 u16 scan_period; 4043 4041 u16 scan_dwell_time; 4044 4042 u8 discovery_beacon_interval; ··· 4924 4922 struct wireless_dev *wdev, 4925 4923 unsigned int link_id); 4926 4924 4927 - int (*add_key)(struct wiphy *wiphy, struct net_device *netdev, 4925 + int (*add_key)(struct wiphy *wiphy, struct wireless_dev *wdev, 4928 4926 int link_id, u8 key_index, bool pairwise, 4929 4927 const u8 *mac_addr, struct key_params *params); 4930 - int (*get_key)(struct wiphy *wiphy, struct net_device *netdev, 4928 + int (*get_key)(struct wiphy *wiphy, struct wireless_dev *wdev, 4931 4929 int link_id, u8 key_index, bool pairwise, 4932 4930 const u8 *mac_addr, void *cookie, 4933 4931 void (*callback)(void *cookie, struct key_params*)); 4934 - int (*del_key)(struct wiphy *wiphy, struct net_device *netdev, 4932 + int (*del_key)(struct wiphy *wiphy, struct wireless_dev *wdev, 4935 4933 int link_id, u8 key_index, bool pairwise, 4936 4934 const u8 *mac_addr); 4937 4935 int (*set_default_key)(struct wiphy *wiphy, 4938 4936 struct net_device *netdev, int link_id, 4939 4937 u8 key_index, bool unicast, bool multicast); 4940 4938 int (*set_default_mgmt_key)(struct wiphy *wiphy, 4941 - struct net_device *netdev, int link_id, 4939 + struct wireless_dev *wdev, int link_id, 4942 4940 u8 key_index); 4943 4941 int (*set_default_beacon_key)(struct wiphy *wiphy, 4944 - struct net_device *netdev, 4942 + struct wireless_dev *wdev, 4945 4943 int link_id, 4946 4944 u8 key_index); 4947 4945 ··· 4953 4951 unsigned int link_id); 4954 4952 4955 4953 4956 - int (*add_station)(struct wiphy *wiphy, struct net_device *dev, 4954 + int (*add_station)(struct wiphy *wiphy, struct wireless_dev *wdev, 4957 4955 const u8 *mac, 4958 4956 struct station_parameters *params); 4959 - int (*del_station)(struct wiphy *wiphy, struct net_device *dev, 4957 + int (*del_station)(struct wiphy *wiphy, struct wireless_dev *wdev, 4960 4958 struct station_del_parameters *params); 4961 - int (*change_station)(struct wiphy *wiphy, struct net_device *dev, 4959 + int (*change_station)(struct wiphy *wiphy, struct wireless_dev *wdev, 4962 4960 const u8 *mac, 4963 4961 struct station_parameters *params); 4964 - int (*get_station)(struct wiphy *wiphy, struct net_device *dev, 4962 + int (*get_station)(struct wiphy *wiphy, struct wireless_dev *wdev, 4965 4963 const u8 *mac, struct station_info *sinfo); 4966 - int (*dump_station)(struct wiphy *wiphy, struct net_device *dev, 4964 + int (*dump_station)(struct wiphy *wiphy, struct wireless_dev *wdev, 4967 4965 int idx, u8 *mac, struct station_info *sinfo); 4968 4966 4969 4967 int (*add_mpath)(struct wiphy *wiphy, struct net_device *dev, ··· 8964 8962 /** 8965 8963 * cfg80211_new_sta - notify userspace about station 8966 8964 * 8967 - * @dev: the netdev 8965 + * @wdev: the wireless device 8968 8966 * @mac_addr: the station's address 8969 8967 * @sinfo: the station information 8970 8968 * @gfp: allocation flags 8971 8969 */ 8972 - void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr, 8970 + void cfg80211_new_sta(struct wireless_dev *wdev, const u8 *mac_addr, 8973 8971 struct station_info *sinfo, gfp_t gfp); 8974 8972 8975 8973 /** 8976 8974 * cfg80211_del_sta_sinfo - notify userspace about deletion of a station 8977 - * @dev: the netdev 8975 + * @wdev: the wireless device 8978 8976 * @mac_addr: the station's address. For MLD station, MLD address is used. 8979 8977 * @sinfo: the station information/statistics 8980 8978 * @gfp: allocation flags 8981 8979 */ 8982 - void cfg80211_del_sta_sinfo(struct net_device *dev, const u8 *mac_addr, 8980 + void cfg80211_del_sta_sinfo(struct wireless_dev *wdev, const u8 *mac_addr, 8983 8981 struct station_info *sinfo, gfp_t gfp); 8984 8982 8985 8983 /** 8986 8984 * cfg80211_del_sta - notify userspace about deletion of a station 8987 8985 * 8988 - * @dev: the netdev 8986 + * @wdev: the wireless device 8989 8987 * @mac_addr: the station's address. For MLD station, MLD address is used. 8990 8988 * @gfp: allocation flags 8991 8989 */ 8992 - static inline void cfg80211_del_sta(struct net_device *dev, 8990 + static inline void cfg80211_del_sta(struct wireless_dev *wdev, 8993 8991 const u8 *mac_addr, gfp_t gfp) 8994 8992 { 8995 - cfg80211_del_sta_sinfo(dev, mac_addr, NULL, gfp); 8993 + cfg80211_del_sta_sinfo(wdev, mac_addr, NULL, gfp); 8996 8994 } 8997 8995 8998 8996 /** ··· 10473 10471 10474 10472 return ieee80211_get_channel_khz(wiphy, sibling_1mhz_khz); 10475 10473 } 10474 + 10475 + 10476 + /** 10477 + * cfg80211_incumbent_signal_notify - Notify userspace of incumbent signal detection 10478 + * @wiphy: the wiphy to use 10479 + * @chandef: channel definition in which the interference was detected 10480 + * @signal_interference_bitmap: bitmap indicating interference across 20 MHz segments 10481 + * @gfp: allocation context for message creation and multicast; pass GFP_ATOMIC 10482 + * if called from atomic context (e.g. firmware event handler), otherwise 10483 + * GFP_KERNEL 10484 + * 10485 + * Use this function to notify userspace when an incumbent signal is detected on 10486 + * the operating channel in the 6 GHz band. The notification includes the 10487 + * current channel definition and a bitmap representing interference across 10488 + * the operating bandwidth. Each bit in the bitmap corresponds to a 20 MHz 10489 + * segment, with the lowest bit representing the lowest frequency segment. 10490 + * Punctured sub-channels are included in the bitmap structure but are always 10491 + * set to zero since interference detection is not performed on them. 10492 + */ 10493 + void cfg80211_incumbent_signal_notify(struct wiphy *wiphy, 10494 + const struct cfg80211_chan_def *chandef, 10495 + u32 signal_interference_bitmap, 10496 + gfp_t gfp); 10476 10497 10477 10498 #endif /* __NET_CFG80211_H */
+13 -2
include/net/mac80211.h
··· 7766 7766 * ieee80211_get_fils_discovery_tmpl - Get FILS discovery template. 7767 7767 * @hw: pointer obtained from ieee80211_alloc_hw(). 7768 7768 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 7769 + * @link_id: valid link_id during MLO or 0 for non-MLO. 7769 7770 * 7770 7771 * The driver is responsible for freeing the returned skb. 7771 7772 * 7772 7773 * Return: FILS discovery template. %NULL on error. 7773 7774 */ 7774 7775 struct sk_buff *ieee80211_get_fils_discovery_tmpl(struct ieee80211_hw *hw, 7775 - struct ieee80211_vif *vif); 7776 + struct ieee80211_vif *vif, 7777 + unsigned int link_id); 7776 7778 7777 7779 /** 7778 7780 * ieee80211_get_unsol_bcast_probe_resp_tmpl - Get unsolicited broadcast 7779 7781 * probe response template. 7780 7782 * @hw: pointer obtained from ieee80211_alloc_hw(). 7781 7783 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 7784 + * @link_id: valid link_id during MLO or 0 for non-MLO. 7782 7785 * 7783 7786 * The driver is responsible for freeing the returned skb. 7784 7787 * ··· 7789 7786 */ 7790 7787 struct sk_buff * 7791 7788 ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw, 7792 - struct ieee80211_vif *vif); 7789 + struct ieee80211_vif *vif, 7790 + unsigned int link_id); 7793 7791 7794 7792 /** 7795 7793 * ieee80211_obss_color_collision_notify - notify userland about a BSS color ··· 7966 7962 * Return: %true iff the vif is a NAN interface and NAN is started 7967 7963 */ 7968 7964 bool ieee80211_vif_nan_started(struct ieee80211_vif *vif); 7965 + 7966 + /** 7967 + * ieee80211_encrypt_tx_skb - Encrypt the transmit skb 7968 + * @skb: the skb 7969 + * Return: 0 if success and non-zero on error 7970 + */ 7971 + int ieee80211_encrypt_tx_skb(struct sk_buff *skb); 7969 7972 #endif /* MAC80211_H */
+34
include/uapi/linux/nl80211.h
··· 1361 1361 * user space that the NAN new cluster has been joined. The cluster ID is 1362 1362 * indicated by %NL80211_ATTR_MAC. 1363 1363 * 1364 + * @NL80211_CMD_INCUMBENT_SIGNAL_DETECT: Once any incumbent signal is detected 1365 + * on the operating channel in 6 GHz band, userspace is notified with the 1366 + * signal interference bitmap using 1367 + * %NL80211_ATTR_INCUMBENT_SIGNAL_INTERFERENCE_BITMAP. The current channel 1368 + * definition is also sent. 1369 + * 1364 1370 * @NL80211_CMD_MAX: highest used command number 1365 1371 * @__NL80211_CMD_AFTER_LAST: internal use 1366 1372 */ ··· 1629 1623 1630 1624 NL80211_CMD_NAN_NEXT_DW_NOTIFICATION, 1631 1625 NL80211_CMD_NAN_CLUSTER_JOINED, 1626 + 1627 + NL80211_CMD_INCUMBENT_SIGNAL_DETECT, 1632 1628 1633 1629 /* add new commands above here */ 1634 1630 ··· 2992 2984 * this feature during association. This is a flag attribute. 2993 2985 * Currently only supported in mac80211 drivers. 2994 2986 * 2987 + * @NL80211_ATTR_INCUMBENT_SIGNAL_INTERFERENCE_BITMAP: u32 attribute specifying 2988 + * the signal interference bitmap detected on the operating bandwidth for 2989 + * %NL80211_CMD_INCUMBENT_SIGNAL_DETECT. Each bit represents a 20 MHz 2990 + * segment, lowest bit corresponds to the lowest 20 MHz segment, in the 2991 + * operating bandwidth where the interference is detected. Punctured 2992 + * sub-channels are included in the bitmap structure; however, since 2993 + * interference detection is not performed on these sub-channels, their 2994 + * corresponding bits are consistently set to zero. 2995 + * 2995 2996 * @NUM_NL80211_ATTR: total number of nl80211_attrs available 2996 2997 * @NL80211_ATTR_MAX: highest attribute number currently defined 2997 2998 * @__NL80211_ATTR_AFTER_LAST: internal use ··· 3573 3556 3574 3557 NL80211_ATTR_UHR_CAPABILITY, 3575 3558 NL80211_ATTR_DISABLE_UHR, 3559 + 3560 + NL80211_ATTR_INCUMBENT_SIGNAL_INTERFERENCE_BITMAP, 3576 3561 3577 3562 /* add attributes here, update the policy in nl80211.c */ 3578 3563 ··· 4499 4480 * as a non-primary subchannel. Only applicable to S1G channels. 4500 4481 * @NL80211_FREQUENCY_ATTR_NO_UHR: UHR operation is not allowed on this channel 4501 4482 * in current regulatory domain. 4483 + * @NL80211_FREQUENCY_ATTR_CAC_START_TIME: Channel Availability Check (CAC) 4484 + * start time (CLOCK_BOOTTIME, nanoseconds). Only present when CAC is 4485 + * currently in progress on this channel. 4486 + * @NL80211_FREQUENCY_ATTR_PAD: attribute used for padding for 64-bit alignment 4502 4487 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number 4503 4488 * currently defined 4504 4489 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use ··· 4553 4530 NL80211_FREQUENCY_ATTR_NO_16MHZ, 4554 4531 NL80211_FREQUENCY_ATTR_S1G_NO_PRIMARY, 4555 4532 NL80211_FREQUENCY_ATTR_NO_UHR, 4533 + NL80211_FREQUENCY_ATTR_CAC_START_TIME, 4534 + NL80211_FREQUENCY_ATTR_PAD, 4556 4535 4557 4536 /* keep last */ 4558 4537 __NL80211_FREQUENCY_ATTR_AFTER_LAST, ··· 5491 5466 * @NL80211_AUTHTYPE_FILS_SK_PFS: Fast Initial Link Setup shared key with PFS 5492 5467 * @NL80211_AUTHTYPE_FILS_PK: Fast Initial Link Setup public key 5493 5468 * @NL80211_AUTHTYPE_EPPKE: Enhanced Privacy Protection Key Exchange 5469 + * @NL80211_AUTHTYPE_IEEE8021X: IEEE 802.1X authentication utilizing 5470 + * Authentication frames 5494 5471 * @__NL80211_AUTHTYPE_NUM: internal 5495 5472 * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm 5496 5473 * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by ··· 5509 5482 NL80211_AUTHTYPE_FILS_SK_PFS, 5510 5483 NL80211_AUTHTYPE_FILS_PK, 5511 5484 NL80211_AUTHTYPE_EPPKE, 5485 + NL80211_AUTHTYPE_IEEE8021X, 5512 5486 5513 5487 /* keep last */ 5514 5488 __NL80211_AUTHTYPE_NUM, ··· 6823 6795 * frames in both non‑AP STA and AP mode as specified in 6824 6796 * "IEEE P802.11bi/D3.0, 12.16.6". 6825 6797 * 6798 + * @NL80211_EXT_FEATURE_IEEE8021X_AUTH: Driver supports IEEE 802.1X 6799 + * authentication utilizing Authentication frames with user space SME 6800 + * (NL80211_CMD_AUTHENTICATE) in non-AP STA mode, as specified in 6801 + * "IEEE P802.11bi/D4.0, 12.16.5". 6802 + * 6826 6803 * @NUM_NL80211_EXT_FEATURES: number of extended features. 6827 6804 * @MAX_NL80211_EXT_FEATURES: highest extended feature index. 6828 6805 */ ··· 6906 6873 NL80211_EXT_FEATURE_BEACON_RATE_EHT, 6907 6874 NL80211_EXT_FEATURE_EPPKE, 6908 6875 NL80211_EXT_FEATURE_ASSOC_FRAME_ENCRYPTION, 6876 + NL80211_EXT_FEATURE_IEEE8021X_AUTH, 6909 6877 6910 6878 /* add new features before the definition below */ 6911 6879 NUM_NL80211_EXT_FEATURES,
+62 -37
net/mac80211/cfg.c
··· 330 330 331 331 static void ieee80211_nan_conf_free(struct cfg80211_nan_conf *conf) 332 332 { 333 - kfree(conf->cluster_id); 334 333 kfree(conf->extra_nan_attrs); 335 334 kfree(conf->vendor_elems); 336 335 memset(conf, 0, sizeof(*conf)); ··· 371 372 memcpy(&dst->band_cfgs, &src->band_cfgs, 372 373 sizeof(dst->band_cfgs)); 373 374 374 - kfree(dst->cluster_id); 375 - dst->cluster_id = NULL; 376 - 377 375 kfree(dst->extra_nan_attrs); 378 376 dst->extra_nan_attrs = NULL; 379 377 dst->extra_nan_attrs_len = 0; ··· 379 383 dst->vendor_elems = NULL; 380 384 dst->vendor_elems_len = 0; 381 385 382 - if (src->cluster_id) { 383 - dst->cluster_id = kmemdup(src->cluster_id, ETH_ALEN, 384 - GFP_KERNEL); 385 - if (!dst->cluster_id) 386 - goto no_mem; 387 - } 386 + if (is_zero_ether_addr(dst->cluster_id)) 387 + ether_addr_copy(dst->cluster_id, src->cluster_id); 388 388 389 389 if (src->extra_nan_attrs && src->extra_nan_attrs_len) { 390 390 dst->extra_nan_attrs = kmemdup(src->extra_nan_attrs, ··· 608 616 return ret; 609 617 } 610 618 611 - static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev, 619 + static int ieee80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev, 612 620 int link_id, u8 key_idx, bool pairwise, 613 621 const u8 *mac_addr, struct key_params *params) 614 622 { 615 - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 623 + struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); 616 624 struct ieee80211_link_data *link = 617 625 ieee80211_link_or_deflink(sdata, link_id, false); 618 626 struct ieee80211_local *local = sdata->local; ··· 790 798 return NULL; 791 799 } 792 800 793 - static int ieee80211_del_key(struct wiphy *wiphy, struct net_device *dev, 801 + static int ieee80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev, 794 802 int link_id, u8 key_idx, bool pairwise, 795 803 const u8 *mac_addr) 796 804 { 797 - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 805 + struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); 798 806 struct ieee80211_local *local = sdata->local; 799 807 struct ieee80211_key *key; 800 808 ··· 809 817 return 0; 810 818 } 811 819 812 - static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev, 820 + static int ieee80211_get_key(struct wiphy *wiphy, struct wireless_dev *wdev, 813 821 int link_id, u8 key_idx, bool pairwise, 814 822 const u8 *mac_addr, void *cookie, 815 823 void (*callback)(void *cookie, ··· 825 833 int err = -ENOENT; 826 834 struct ieee80211_key_seq kseq = {}; 827 835 828 - sdata = IEEE80211_DEV_TO_SUB_IF(dev); 836 + sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); 829 837 830 838 rcu_read_lock(); 831 839 ··· 929 937 } 930 938 931 939 static int ieee80211_config_default_mgmt_key(struct wiphy *wiphy, 932 - struct net_device *dev, 940 + struct wireless_dev *wdev, 933 941 int link_id, u8 key_idx) 934 942 { 935 - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 943 + struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); 936 944 struct ieee80211_link_data *link = 937 945 ieee80211_link_or_deflink(sdata, link_id, true); 938 946 ··· 945 953 } 946 954 947 955 static int ieee80211_config_default_beacon_key(struct wiphy *wiphy, 948 - struct net_device *dev, 956 + struct wireless_dev *wdev, 949 957 int link_id, u8 key_idx) 950 958 { 951 - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 959 + struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); 952 960 struct ieee80211_link_data *link = 953 961 ieee80211_link_or_deflink(sdata, link_id, true); 954 962 ··· 992 1000 rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI; 993 1001 } 994 1002 995 - static int ieee80211_dump_station(struct wiphy *wiphy, struct net_device *dev, 1003 + static int ieee80211_dump_station(struct wiphy *wiphy, struct wireless_dev *wdev, 996 1004 int idx, u8 *mac, struct station_info *sinfo) 997 1005 { 998 - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1006 + struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); 999 1007 struct ieee80211_local *local = sdata->local; 1000 1008 struct sta_info *sta; 1001 1009 int ret = -ENOENT; ··· 1027 1035 return drv_get_survey(local, idx, survey); 1028 1036 } 1029 1037 1030 - static int ieee80211_get_station(struct wiphy *wiphy, struct net_device *dev, 1038 + static int ieee80211_get_station(struct wiphy *wiphy, 1039 + struct wireless_dev *wdev, 1031 1040 const u8 *mac, struct station_info *sinfo) 1032 1041 { 1033 - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1042 + struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); 1034 1043 struct ieee80211_local *local = sdata->local; 1035 1044 struct sta_info *sta; 1036 1045 int ret = -ENOENT; ··· 2356 2363 return 0; 2357 2364 } 2358 2365 2359 - static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, 2366 + static int ieee80211_add_station(struct wiphy *wiphy, struct wireless_dev *wdev, 2360 2367 const u8 *mac, 2361 2368 struct station_parameters *params) 2362 2369 { ··· 2374 2381 sdata->vif.type != NL80211_IFTYPE_AP) 2375 2382 return -EINVAL; 2376 2383 } else 2377 - sdata = IEEE80211_DEV_TO_SUB_IF(dev); 2384 + sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); 2378 2385 2379 2386 if (ether_addr_equal(mac, sdata->vif.addr)) 2380 2387 return -EINVAL; ··· 2428 2435 return sta_info_insert(sta); 2429 2436 } 2430 2437 2431 - static int ieee80211_del_station(struct wiphy *wiphy, struct net_device *dev, 2438 + static int ieee80211_del_station(struct wiphy *wiphy, struct wireless_dev *wdev, 2432 2439 struct station_del_parameters *params) 2433 2440 { 2434 2441 struct ieee80211_sub_if_data *sdata; 2435 2442 2436 - sdata = IEEE80211_DEV_TO_SUB_IF(dev); 2443 + sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); 2437 2444 2438 2445 if (params->mac) 2439 2446 return sta_info_destroy_addr_bss(sdata, params->mac); ··· 2443 2450 } 2444 2451 2445 2452 static int ieee80211_change_station(struct wiphy *wiphy, 2446 - struct net_device *dev, const u8 *mac, 2453 + struct wireless_dev *wdev, const u8 *mac, 2447 2454 struct station_parameters *params) 2448 2455 { 2449 - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 2456 + struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); 2450 2457 struct ieee80211_local *local = wiphy_priv(wiphy); 2451 2458 struct sta_info *sta; 2452 2459 struct ieee80211_sub_if_data *vlansdata; ··· 4607 4614 struct ieee80211_tx_info *info; 4608 4615 struct sta_info *sta; 4609 4616 struct ieee80211_chanctx_conf *chanctx_conf; 4617 + struct ieee80211_bss_conf *conf; 4610 4618 enum nl80211_band band; 4619 + u8 link_id; 4611 4620 int ret; 4612 4621 4613 4622 /* the lock is needed to assign the cookie later */ ··· 4624 4629 4625 4630 qos = sta->sta.wme; 4626 4631 4627 - chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf); 4628 - if (WARN_ON(!chanctx_conf)) { 4629 - ret = -EINVAL; 4630 - goto unlock; 4632 + if (ieee80211_vif_is_mld(&sdata->vif)) { 4633 + if (sta->sta.mlo) { 4634 + link_id = IEEE80211_LINK_UNSPECIFIED; 4635 + } else { 4636 + /* 4637 + * For non-MLO clients connected to an AP MLD, band 4638 + * information is not used; instead, sta->deflink is 4639 + * used to send packets. 4640 + */ 4641 + link_id = sta->deflink.link_id; 4642 + 4643 + conf = rcu_dereference(sdata->vif.link_conf[link_id]); 4644 + 4645 + if (unlikely(!conf)) { 4646 + ret = -ENOLINK; 4647 + goto unlock; 4648 + } 4649 + } 4650 + /* MLD transmissions must not rely on the band */ 4651 + band = 0; 4652 + } else { 4653 + chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf); 4654 + if (WARN_ON(!chanctx_conf)) { 4655 + ret = -EINVAL; 4656 + goto unlock; 4657 + } 4658 + band = chanctx_conf->def.chan->band; 4659 + link_id = 0; 4631 4660 } 4632 - band = chanctx_conf->def.chan->band; 4633 4661 4634 4662 if (qos) { 4635 4663 fc = cpu_to_le16(IEEE80211_FTYPE_DATA | ··· 4679 4661 nullfunc->frame_control = fc; 4680 4662 nullfunc->duration_id = 0; 4681 4663 memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN); 4682 - memcpy(nullfunc->addr2, sdata->vif.addr, ETH_ALEN); 4683 - memcpy(nullfunc->addr3, sdata->vif.addr, ETH_ALEN); 4664 + if (ieee80211_vif_is_mld(&sdata->vif) && !sta->sta.mlo) { 4665 + memcpy(nullfunc->addr2, conf->addr, ETH_ALEN); 4666 + memcpy(nullfunc->addr3, conf->addr, ETH_ALEN); 4667 + } else { 4668 + memcpy(nullfunc->addr2, sdata->vif.addr, ETH_ALEN); 4669 + memcpy(nullfunc->addr3, sdata->vif.addr, ETH_ALEN); 4670 + } 4684 4671 nullfunc->seq_ctrl = 0; 4685 4672 4686 4673 info = IEEE80211_SKB_CB(skb); ··· 4694 4671 IEEE80211_TX_INTFL_NL80211_FRAME_TX; 4695 4672 info->band = band; 4696 4673 4674 + info->control.flags |= u32_encode_bits(link_id, 4675 + IEEE80211_TX_CTRL_MLO_LINK); 4697 4676 skb_set_queue_mapping(skb, IEEE80211_AC_VO); 4698 4677 skb->priority = 7; 4699 4678 if (qos)
+2
net/mac80211/ieee80211_i.h
··· 256 256 u8 pn[IEEE80211_CCMP_PN_LEN]; 257 257 } ccm_gcm; 258 258 }; 259 + 260 + u8 link_addrs[3 * ETH_ALEN]; 259 261 }; 260 262 261 263 struct ieee80211_csa_settings {
+10
net/mac80211/main.c
··· 915 915 916 916 wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_TXQS); 917 917 wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_RRM); 918 + wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_IEEE8021X_AUTH); 918 919 919 920 wiphy->bss_priv_size = sizeof(struct ieee80211_bss); 920 921 ··· 1597 1596 local->hw.wiphy->bands[band] = sband; 1598 1597 local->sband_allocated |= BIT(band); 1599 1598 } 1599 + 1600 + /* 1601 + * mac80211 supports EPPKE, if the driver supports (Re)Association 1602 + * frame encryption 1603 + */ 1604 + if (wiphy_ext_feature_isset(local->hw.wiphy, 1605 + NL80211_EXT_FEATURE_ASSOC_FRAME_ENCRYPTION)) 1606 + wiphy_ext_feature_set(local->hw.wiphy, 1607 + NL80211_EXT_FEATURE_EPPKE); 1600 1608 1601 1609 result = wiphy_register(local->hw.wiphy); 1602 1610 if (result < 0)
+74 -7
net/mac80211/mlme.c
··· 4920 4920 struct ieee80211_mgmt *mgmt, size_t len) 4921 4921 { 4922 4922 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 4923 - u16 auth_alg, auth_transaction, status_code; 4923 + u16 auth_alg, auth_transaction, status_code, encap_len; 4924 4924 struct ieee80211_event event = { 4925 4925 .type = MLME_EVENT, 4926 4926 .u.mlme.data = AUTH_EVENT, ··· 4929 4929 .subtype = IEEE80211_STYPE_AUTH, 4930 4930 }; 4931 4931 bool sae_need_confirm = false; 4932 + bool auth_fail = false; 4932 4933 4933 4934 lockdep_assert_wiphy(sdata->local->hw.wiphy); 4934 4935 ··· 4946 4945 auth_transaction = le16_to_cpu(mgmt->u.auth.auth_transaction); 4947 4946 status_code = le16_to_cpu(mgmt->u.auth.status_code); 4948 4947 4948 + /* 4949 + * IEEE 802.1X Authentication: 4950 + * Header + Authentication Algorithm Number(2 byte) + Authentication 4951 + * Transaction Sequence Number(2 byte) + Status Code(2 byte) + 4952 + * Encapsulation Length(2 byte). 4953 + */ 4954 + if (auth_alg == WLAN_AUTH_IEEE8021X && len < 24 + 8) 4955 + return; 4956 + 4949 4957 info.link_id = ifmgd->auth_data->link_id; 4950 4958 4951 4959 if (auth_alg != ifmgd->auth_data->algorithm || ··· 4970 4960 goto notify_driver; 4971 4961 } 4972 4962 4973 - if (status_code != WLAN_STATUS_SUCCESS) { 4963 + switch (auth_alg) { 4964 + case WLAN_AUTH_IEEE8021X: 4965 + if (status_code != WLAN_STATUS_SUCCESS && 4966 + status_code != WLAN_STATUS_8021X_AUTH_SUCCESS) 4967 + auth_fail = true; 4968 + 4969 + if (!auth_fail) { 4970 + /* Indicates length of encapsulated EAPOL PDU */ 4971 + encap_len = get_unaligned_le16(mgmt->u.auth.variable); 4972 + } 4973 + break; 4974 + default: 4975 + if (status_code != WLAN_STATUS_SUCCESS) 4976 + auth_fail = true; 4977 + break; 4978 + } 4979 + 4980 + if (auth_fail) { 4974 4981 cfg80211_rx_mlme_mgmt(sdata->dev, (u8 *)mgmt, len); 4975 4982 4976 4983 if (auth_alg == WLAN_AUTH_SAE && ··· 5024 4997 case WLAN_AUTH_FILS_SK_PFS: 5025 4998 case WLAN_AUTH_FILS_PK: 5026 4999 case WLAN_AUTH_EPPKE: 5000 + case WLAN_AUTH_IEEE8021X: 5027 5001 break; 5028 5002 case WLAN_AUTH_SHARED_KEY: 5029 5003 if (ifmgd->auth_data->expected_transaction != 4) { ··· 5045 5017 if (ifmgd->auth_data->algorithm != WLAN_AUTH_SAE || 5046 5018 (auth_transaction == 2 && 5047 5019 ifmgd->auth_data->expected_transaction == 2)) { 5048 - if (!ieee80211_mark_sta_auth(sdata)) 5049 - return; /* ignore frame -- wait for timeout */ 5020 + switch (ifmgd->auth_data->algorithm) { 5021 + case WLAN_AUTH_IEEE8021X: 5022 + /* 5023 + * IEEE 802.1X authentication: 5024 + * - When the full EAP handshake completes over the 5025 + * Authentication process, the responder sets the 5026 + * Status Code to WLAN_STATUS_8021X_AUTH_SUCCESS as 5027 + * specified in "IEEE P802.11bi/D4.0, 12.16.5". 5028 + * 5029 + * - In the PMKSA caching case, only two Authentication 5030 + * frames are exchanged if the responder (e.g., AP) 5031 + * identifies a valid PMKSA, then as specified in 5032 + * "IEEE P802.11bi/D4.0, 12.16.8.3", the responder 5033 + * shall set the Status Code to SUCCESS in the final 5034 + * Authentication frame and must not include an 5035 + * encapsulated EAPOL PDU. 5036 + * 5037 + * Both conditions are treated as successful 5038 + * authentication, so mark the state to Authenticated. 5039 + */ 5040 + if (status_code != WLAN_STATUS_8021X_AUTH_SUCCESS && 5041 + !(status_code == WLAN_STATUS_SUCCESS && 5042 + encap_len == 0)) 5043 + break; 5044 + fallthrough; 5045 + default: 5046 + if (!ieee80211_mark_sta_auth(sdata)) 5047 + return; /* ignore frame -- wait for timeout */ 5048 + 5049 + break; 5050 + } 5050 5051 } else if (ifmgd->auth_data->algorithm == WLAN_AUTH_SAE && 5051 5052 auth_transaction == 1) { 5052 5053 sae_need_confirm = true; ··· 8498 8441 return -ETIMEDOUT; 8499 8442 } 8500 8443 8501 - if (auth_data->algorithm == WLAN_AUTH_SAE) 8444 + if (auth_data->algorithm == WLAN_AUTH_SAE || 8445 + auth_data->algorithm == WLAN_AUTH_EPPKE) 8502 8446 info.duration = jiffies_to_msecs(IEEE80211_AUTH_TIMEOUT_SAE); 8503 8447 8504 8448 info.link_id = auth_data->link_id; ··· 8518 8460 } else if (auth_data->algorithm == WLAN_AUTH_EPPKE) { 8519 8461 trans = auth_data->trans; 8520 8462 status = auth_data->status; 8463 + } else if (auth_data->algorithm == WLAN_AUTH_IEEE8021X) { 8464 + trans = auth_data->trans; 8465 + status = auth_data->status; 8466 + auth_data->expected_transaction = trans + 1; 8521 8467 } 8522 8468 8523 8469 if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) ··· 9179 9117 } 9180 9118 9181 9119 if (ifmgd->auth_data && 9182 - ifmgd->auth_data->algorithm == WLAN_AUTH_EPPKE) 9120 + (ifmgd->auth_data->algorithm == WLAN_AUTH_EPPKE || 9121 + ifmgd->auth_data->algorithm == WLAN_AUTH_IEEE8021X)) 9183 9122 new_sta->sta.epp_peer = true; 9184 9123 9185 9124 new_sta->sta.mlo = mlo; ··· 9440 9377 case NL80211_AUTHTYPE_EPPKE: 9441 9378 auth_alg = WLAN_AUTH_EPPKE; 9442 9379 break; 9380 + case NL80211_AUTHTYPE_IEEE8021X: 9381 + auth_alg = WLAN_AUTH_IEEE8021X; 9382 + break; 9443 9383 default: 9444 9384 return -EOPNOTSUPP; 9445 9385 } ··· 9468 9402 9469 9403 if (req->auth_data_len >= 4) { 9470 9404 if (req->auth_type == NL80211_AUTHTYPE_SAE || 9471 - req->auth_type == NL80211_AUTHTYPE_EPPKE) { 9405 + req->auth_type == NL80211_AUTHTYPE_EPPKE || 9406 + req->auth_type == NL80211_AUTHTYPE_IEEE8021X) { 9472 9407 __le16 *pos = (__le16 *) req->auth_data; 9473 9408 9474 9409 auth_data->trans = le16_to_cpu(pos[0]);
+5
net/mac80211/rx.c
··· 5127 5127 hdr = (struct ieee80211_hdr *)rx->skb->data; 5128 5128 } 5129 5129 5130 + /* Store a copy of the pre-translated link addresses for SW crypto */ 5131 + if (unlikely(is_unicast_ether_addr(hdr->addr1) && 5132 + !ieee80211_is_data(hdr->frame_control))) 5133 + memcpy(rx->link_addrs, &hdr->addrs, 3 * ETH_ALEN); 5134 + 5130 5135 if (unlikely(rx->sta && rx->sta->sta.mlo) && 5131 5136 is_unicast_ether_addr(hdr->addr1) && 5132 5137 !ieee80211_is_probe_resp(hdr->frame_control) &&
+2 -2
net/mac80211/sta_info.c
··· 974 974 } 975 975 976 976 sinfo->generation = local->sta_generation; 977 - cfg80211_new_sta(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL); 977 + cfg80211_new_sta(&sdata->wdev, sta->sta.addr, sinfo, GFP_KERNEL); 978 978 kfree(sinfo); 979 979 980 980 sta_dbg(sdata, "Inserted STA %pM\n", sta->sta.addr); ··· 1557 1557 1558 1558 sta_dbg(sdata, "Removed STA %pM\n", sta->sta.addr); 1559 1559 1560 - cfg80211_del_sta_sinfo(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL); 1560 + cfg80211_del_sta_sinfo(&sdata->wdev, sta->sta.addr, sinfo, GFP_KERNEL); 1561 1561 kfree(sinfo); 1562 1562 1563 1563 ieee80211_sta_debugfs_remove(sta);
+59 -18
net/mac80211/tx.c
··· 287 287 * active scan) are allowed, all other frames should not be 288 288 * sent and we should not get here, but if we do 289 289 * nonetheless, drop them to avoid sending them 290 - * off-channel. See the link below and 291 - * ieee80211_start_scan() for more. 292 - * 293 - * http://article.gmane.org/gmane.linux.kernel.wireless.general/30089 290 + * off-channel. See __ieee80211_start_scan() for more. 294 291 */ 295 292 return TX_DROP; 296 293 ··· 5312 5315 return 0; 5313 5316 } 5314 5317 5318 + int ieee80211_encrypt_tx_skb(struct sk_buff *skb) 5319 + { 5320 + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 5321 + struct ieee80211_sub_if_data *sdata; 5322 + struct sk_buff *check_skb; 5323 + struct ieee80211_tx_data tx; 5324 + ieee80211_tx_result res; 5325 + 5326 + if (!info->control.hw_key) 5327 + return 0; 5328 + 5329 + memset(&tx, 0, sizeof(tx)); 5330 + tx.key = container_of(info->control.hw_key, struct ieee80211_key, conf); 5331 + /* NULL it out now so we do full SW crypto */ 5332 + info->control.hw_key = NULL; 5333 + __skb_queue_head_init(&tx.skbs); 5334 + __skb_queue_tail(&tx.skbs, skb); 5335 + 5336 + sdata = IEEE80211_DEV_TO_SUB_IF(skb->dev); 5337 + tx.sdata = sdata; 5338 + tx.local = sdata->local; 5339 + res = ieee80211_tx_h_encrypt(&tx); 5340 + check_skb = __skb_dequeue(&tx.skbs); 5341 + /* we may crash after this, but it'd be a bug in crypto */ 5342 + WARN_ON(check_skb != skb); 5343 + if (WARN_ON_ONCE(res != TX_CONTINUE)) 5344 + return -EINVAL; 5345 + 5346 + return 0; 5347 + } 5348 + EXPORT_SYMBOL_GPL(ieee80211_encrypt_tx_skb); 5349 + 5315 5350 static void 5316 5351 ieee80211_beacon_get_finish(struct ieee80211_hw *hw, 5317 5352 struct ieee80211_vif *vif, ··· 5866 5837 EXPORT_SYMBOL(ieee80211_proberesp_get); 5867 5838 5868 5839 struct sk_buff *ieee80211_get_fils_discovery_tmpl(struct ieee80211_hw *hw, 5869 - struct ieee80211_vif *vif) 5840 + struct ieee80211_vif *vif, 5841 + unsigned int link_id) 5870 5842 { 5871 5843 struct sk_buff *skb = NULL; 5872 5844 struct fils_discovery_data *tmpl = NULL; 5873 5845 struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); 5846 + struct ieee80211_link_data *link; 5874 5847 5875 5848 if (sdata->vif.type != NL80211_IFTYPE_AP) 5876 5849 return NULL; 5877 5850 5878 - rcu_read_lock(); 5879 - tmpl = rcu_dereference(sdata->deflink.u.ap.fils_discovery); 5880 - if (!tmpl) { 5881 - rcu_read_unlock(); 5851 + if (link_id >= IEEE80211_MLD_MAX_NUM_LINKS) 5882 5852 return NULL; 5883 - } 5853 + 5854 + guard(rcu)(); 5855 + link = rcu_dereference(sdata->link[link_id]); 5856 + if (!link) 5857 + return NULL; 5858 + 5859 + tmpl = rcu_dereference(link->u.ap.fils_discovery); 5860 + if (!tmpl) 5861 + return NULL; 5884 5862 5885 5863 skb = dev_alloc_skb(sdata->local->hw.extra_tx_headroom + tmpl->len); 5886 5864 if (skb) { ··· 5895 5859 skb_put_data(skb, tmpl->data, tmpl->len); 5896 5860 } 5897 5861 5898 - rcu_read_unlock(); 5899 5862 return skb; 5900 5863 } 5901 5864 EXPORT_SYMBOL(ieee80211_get_fils_discovery_tmpl); 5902 5865 5903 5866 struct sk_buff * 5904 5867 ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw, 5905 - struct ieee80211_vif *vif) 5868 + struct ieee80211_vif *vif, 5869 + unsigned int link_id) 5906 5870 { 5907 5871 struct sk_buff *skb = NULL; 5908 5872 struct unsol_bcast_probe_resp_data *tmpl = NULL; 5909 5873 struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); 5874 + struct ieee80211_link_data *link; 5910 5875 5911 5876 if (sdata->vif.type != NL80211_IFTYPE_AP) 5912 5877 return NULL; 5913 5878 5914 - rcu_read_lock(); 5915 - tmpl = rcu_dereference(sdata->deflink.u.ap.unsol_bcast_probe_resp); 5916 - if (!tmpl) { 5917 - rcu_read_unlock(); 5879 + if (link_id >= IEEE80211_MLD_MAX_NUM_LINKS) 5918 5880 return NULL; 5919 - } 5881 + 5882 + guard(rcu)(); 5883 + link = rcu_dereference(sdata->link[link_id]); 5884 + if (!link) 5885 + return NULL; 5886 + 5887 + tmpl = rcu_dereference(link->u.ap.unsol_bcast_probe_resp); 5888 + if (!tmpl) 5889 + return NULL; 5920 5890 5921 5891 skb = dev_alloc_skb(sdata->local->hw.extra_tx_headroom + tmpl->len); 5922 5892 if (skb) { ··· 5930 5888 skb_put_data(skb, tmpl->data, tmpl->len); 5931 5889 } 5932 5890 5933 - rcu_read_unlock(); 5934 5891 return skb; 5935 5892 } 5936 5893 EXPORT_SYMBOL(ieee80211_get_unsol_bcast_probe_resp_tmpl);
+43 -12
net/mac80211/wpa.c
··· 315 315 * Calculate AAD for CCMP/GCMP, returning qos_tid since we 316 316 * need that in CCMP also for b_0. 317 317 */ 318 - static u8 ccmp_gcmp_aad(struct sk_buff *skb, u8 *aad, bool spp_amsdu) 318 + static u8 ccmp_gcmp_aad(struct sk_buff *skb, u8 *aad, bool spp_amsdu, 319 + bool aad_nonce_computed) 319 320 { 320 321 struct ieee80211_hdr *hdr = (void *)skb->data; 321 322 __le16 mask_fc; ··· 359 358 * FC | A1 | A2 | A3 | SC | [A4] | [QC] */ 360 359 put_unaligned_be16(len_a, &aad[0]); 361 360 put_unaligned(mask_fc, (__le16 *)&aad[2]); 362 - memcpy(&aad[4], &hdr->addrs, 3 * ETH_ALEN); 361 + if (!aad_nonce_computed) 362 + memcpy(&aad[4], &hdr->addrs, 3 * ETH_ALEN); 363 363 364 364 /* Mask Seq#, leave Frag# */ 365 365 aad[22] = *((u8 *) &hdr->seq_ctrl) & 0x0f; ··· 379 377 } 380 378 381 379 static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad, 382 - bool spp_amsdu) 380 + bool spp_amsdu, bool aad_nonce_computed) 383 381 { 384 382 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 385 - u8 qos_tid = ccmp_gcmp_aad(skb, aad, spp_amsdu); 383 + u8 qos_tid = ccmp_gcmp_aad(skb, aad, spp_amsdu, aad_nonce_computed); 386 384 387 385 /* In CCM, the initial vectors (IV) used for CTR mode encryption and CBC 388 386 * mode authentication are not allowed to collide, yet both are derived ··· 397 395 * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7) 398 396 */ 399 397 b_0[1] = qos_tid | (ieee80211_is_mgmt(hdr->frame_control) << 4); 400 - memcpy(&b_0[2], hdr->addr2, ETH_ALEN); 398 + if (!aad_nonce_computed) 399 + memcpy(&b_0[2], hdr->addr2, ETH_ALEN); 401 400 memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN); 402 401 } 403 402 ··· 491 488 492 489 pos += IEEE80211_CCMP_HDR_LEN; 493 490 ccmp_special_blocks(skb, pn, b_0, aad, 494 - key->conf.flags & IEEE80211_KEY_FLAG_SPP_AMSDU); 491 + key->conf.flags & IEEE80211_KEY_FLAG_SPP_AMSDU, 492 + false); 495 493 return ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, 496 494 skb_put(skb, mic_len)); 497 495 } ··· 570 566 if (!(status->flag & RX_FLAG_DECRYPTED)) { 571 567 u8 aad[2 * AES_BLOCK_SIZE]; 572 568 u8 b_0[AES_BLOCK_SIZE]; 569 + bool aad_nonce_computed = false; 570 + 571 + if (is_unicast_ether_addr(hdr->addr1) && 572 + !ieee80211_is_data(hdr->frame_control)) { 573 + /* AAD computation */ 574 + memcpy(&aad[4], rx->link_addrs, 3 * ETH_ALEN); 575 + /* Nonce computation */ 576 + ether_addr_copy(&b_0[2], 577 + &rx->link_addrs[ETH_ALEN]); 578 + aad_nonce_computed = true; 579 + } 580 + 573 581 /* hardware didn't decrypt/verify MIC */ 574 582 ccmp_special_blocks(skb, pn, b_0, aad, 575 - key->conf.flags & IEEE80211_KEY_FLAG_SPP_AMSDU); 583 + key->conf.flags & IEEE80211_KEY_FLAG_SPP_AMSDU, 584 + aad_nonce_computed); 576 585 577 586 if (ieee80211_aes_ccm_decrypt( 578 587 key->u.ccmp.tfm, b_0, aad, ··· 610 593 } 611 594 612 595 static void gcmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *j_0, u8 *aad, 613 - bool spp_amsdu) 596 + bool spp_amsdu, bool aad_nonce_computed) 614 597 { 615 598 struct ieee80211_hdr *hdr = (void *)skb->data; 616 599 617 - memcpy(j_0, hdr->addr2, ETH_ALEN); 600 + if (!aad_nonce_computed) 601 + memcpy(j_0, hdr->addr2, ETH_ALEN); 618 602 memcpy(&j_0[ETH_ALEN], pn, IEEE80211_GCMP_PN_LEN); 619 603 620 - ccmp_gcmp_aad(skb, aad, spp_amsdu); 604 + ccmp_gcmp_aad(skb, aad, spp_amsdu, aad_nonce_computed); 621 605 } 622 606 623 607 static inline void gcmp_pn2hdr(u8 *hdr, const u8 *pn, int key_id) ··· 708 690 709 691 pos += IEEE80211_GCMP_HDR_LEN; 710 692 gcmp_special_blocks(skb, pn, j_0, aad, 711 - key->conf.flags & IEEE80211_KEY_FLAG_SPP_AMSDU); 693 + key->conf.flags & IEEE80211_KEY_FLAG_SPP_AMSDU, 694 + false); 712 695 return ieee80211_aes_gcm_encrypt(key->u.gcmp.tfm, j_0, aad, pos, len, 713 696 skb_put(skb, IEEE80211_GCMP_MIC_LEN)); 714 697 } ··· 782 763 if (!(status->flag & RX_FLAG_DECRYPTED)) { 783 764 u8 aad[2 * AES_BLOCK_SIZE]; 784 765 u8 j_0[AES_BLOCK_SIZE]; 766 + bool aad_nonce_computed = false; 767 + 768 + if (is_unicast_ether_addr(hdr->addr1) && 769 + !ieee80211_is_data(hdr->frame_control)) { 770 + /* AAD computation */ 771 + memcpy(&aad[4], rx->link_addrs, 3 * ETH_ALEN); 772 + /* Nonce computation */ 773 + ether_addr_copy(&j_0[0], 774 + &rx->link_addrs[ETH_ALEN]); 775 + aad_nonce_computed = true; 776 + } 785 777 /* hardware didn't decrypt/verify MIC */ 786 778 gcmp_special_blocks(skb, pn, j_0, aad, 787 - key->conf.flags & IEEE80211_KEY_FLAG_SPP_AMSDU); 779 + key->conf.flags & IEEE80211_KEY_FLAG_SPP_AMSDU, 780 + aad_nonce_computed); 788 781 789 782 if (ieee80211_aes_gcm_decrypt( 790 783 key->u.gcmp.tfm, j_0, aad,
+28 -1
net/wireless/chan.c
··· 642 642 } 643 643 } 644 644 645 + void cfg80211_set_cac_state(struct wiphy *wiphy, 646 + const struct cfg80211_chan_def *chandef, 647 + bool cac_ongoing) 648 + { 649 + struct ieee80211_channel *c; 650 + int width; 651 + u64 cac_time; 652 + 653 + if (WARN_ON(!cfg80211_chandef_valid(chandef))) 654 + return; 655 + 656 + width = cfg80211_chandef_get_width(chandef); 657 + if (width < 0) 658 + return; 659 + 660 + /* Get the same timestamp for all subchannels */ 661 + cac_time = cac_ongoing ? ktime_get_boottime_ns() : 0; 662 + 663 + for_each_subchan(chandef, freq, cf) { 664 + c = ieee80211_get_channel_khz(wiphy, freq); 665 + if (!c) 666 + continue; 667 + 668 + c->cac_start_time = cac_time; 669 + } 670 + } 671 + 645 672 static bool 646 673 cfg80211_dfs_permissive_check_wdev(struct cfg80211_registered_device *rdev, 647 674 enum nl80211_iftype iftype, ··· 781 754 case NL80211_IFTYPE_AP: 782 755 case NL80211_IFTYPE_P2P_GO: 783 756 case NL80211_IFTYPE_MESH_POINT: 757 + case NL80211_IFTYPE_NAN: 784 758 width = cfg80211_chandef_get_width(chandef); 785 759 if (width < 0) 786 760 return -EINVAL; ··· 796 768 case NL80211_IFTYPE_MONITOR: 797 769 case NL80211_IFTYPE_AP_VLAN: 798 770 case NL80211_IFTYPE_P2P_DEVICE: 799 - case NL80211_IFTYPE_NAN: 800 771 break; 801 772 case NL80211_IFTYPE_WDS: 802 773 case NL80211_IFTYPE_UNSPECIFIED:
-1
net/wireless/core.c
··· 349 349 350 350 guard(wiphy)(&rdev->wiphy); 351 351 352 - cfg80211_leave(rdev, wdev, -1); 353 352 cfg80211_remove_virtual_intf(rdev, wdev); 354 353 } 355 354 }
+4
net/wireless/core.h
··· 481 481 const struct cfg80211_chan_def *chandef, 482 482 enum nl80211_dfs_state dfs_state); 483 483 484 + void cfg80211_set_cac_state(struct wiphy *wiphy, 485 + const struct cfg80211_chan_def *chandef, 486 + bool cac_ongoing); 487 + 484 488 void cfg80211_dfs_channels_update_work(struct work_struct *work); 485 489 486 490 void cfg80211_sched_dfs_chan_update(struct cfg80211_registered_device *rdev);
+2 -2
net/wireless/ibss.c
··· 3 3 * Some IBSS support code for cfg80211. 4 4 * 5 5 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> 6 - * Copyright (C) 2020-2024 Intel Corporation 6 + * Copyright (C) 2020-2026 Intel Corporation 7 7 */ 8 8 9 9 #include <linux/etherdevice.h> ··· 172 172 */ 173 173 if (rdev->ops->del_key) 174 174 for (i = 0; i < 6; i++) 175 - rdev_del_key(rdev, dev, -1, i, false, NULL); 175 + rdev_del_key(rdev, wdev, -1, i, false, NULL); 176 176 177 177 if (wdev->u.ibss.current_bss) { 178 178 cfg80211_unhold_bss(wdev->u.ibss.current_bss);
+29 -22
net/wireless/mlme.c
··· 1115 1115 */ 1116 1116 cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_UNAVAILABLE); 1117 1117 1118 - if (offchan) 1118 + if (offchan) { 1119 + cancel_delayed_work(&rdev->background_cac_done_wk); 1119 1120 queue_work(cfg80211_wq, &rdev->background_cac_abort_wk); 1121 + } 1120 1122 1121 1123 cfg80211_sched_dfs_chan_update(rdev); 1122 1124 ··· 1162 1160 fallthrough; 1163 1161 case NL80211_RADAR_CAC_ABORTED: 1164 1162 wdev->links[link_id].cac_started = false; 1163 + cfg80211_set_cac_state(wiphy, chandef, false); 1165 1164 break; 1166 1165 case NL80211_RADAR_CAC_STARTED: 1167 1166 wdev->links[link_id].cac_started = true; 1167 + cfg80211_set_cac_state(wiphy, chandef, true); 1168 1168 break; 1169 1169 default: 1170 1170 WARN_ON(1); ··· 1191 1187 if (!cfg80211_chandef_valid(chandef)) 1192 1188 return; 1193 1189 1194 - if (!rdev->background_radar_wdev) 1195 - return; 1196 - 1197 1190 switch (event) { 1198 1191 case NL80211_RADAR_CAC_FINISHED: 1199 1192 cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_AVAILABLE); 1193 + cfg80211_set_cac_state(wiphy, chandef, false); 1200 1194 memcpy(&rdev->cac_done_chandef, chandef, sizeof(*chandef)); 1201 1195 queue_work(cfg80211_wq, &rdev->propagate_cac_done_wk); 1202 1196 cfg80211_sched_dfs_chan_update(rdev); 1203 - wdev = rdev->background_radar_wdev; 1204 1197 break; 1205 1198 case NL80211_RADAR_CAC_ABORTED: 1199 + cfg80211_set_cac_state(wiphy, chandef, false); 1206 1200 if (!cancel_delayed_work(&rdev->background_cac_done_wk)) 1207 1201 return; 1208 - wdev = rdev->background_radar_wdev; 1209 1202 break; 1210 1203 case NL80211_RADAR_CAC_STARTED: 1204 + cfg80211_set_cac_state(wiphy, chandef, true); 1211 1205 break; 1212 1206 default: 1213 1207 return; ··· 1215 1213 nl80211_radar_notify(rdev, chandef, event, netdev, GFP_KERNEL); 1216 1214 } 1217 1215 1218 - static void 1219 - cfg80211_background_cac_event(struct cfg80211_registered_device *rdev, 1220 - const struct cfg80211_chan_def *chandef, 1221 - enum nl80211_radar_event event) 1222 - { 1223 - guard(wiphy)(&rdev->wiphy); 1224 - 1225 - __cfg80211_background_cac_event(rdev, rdev->background_radar_wdev, 1226 - chandef, event); 1227 - } 1228 - 1229 1216 void cfg80211_background_cac_done_wk(struct work_struct *work) 1230 1217 { 1231 1218 struct delayed_work *delayed_work = to_delayed_work(work); ··· 1222 1231 1223 1232 rdev = container_of(delayed_work, struct cfg80211_registered_device, 1224 1233 background_cac_done_wk); 1225 - cfg80211_background_cac_event(rdev, &rdev->background_radar_chandef, 1226 - NL80211_RADAR_CAC_FINISHED); 1234 + 1235 + guard(wiphy)(&rdev->wiphy); 1236 + 1237 + rdev_set_radar_background(rdev, NULL); 1238 + 1239 + __cfg80211_background_cac_event(rdev, rdev->background_radar_wdev, 1240 + &rdev->background_radar_chandef, 1241 + NL80211_RADAR_CAC_FINISHED); 1242 + 1243 + rdev->background_radar_wdev = NULL; 1227 1244 } 1228 1245 1229 1246 void cfg80211_background_cac_abort_wk(struct work_struct *work) 1230 1247 { 1231 1248 struct cfg80211_registered_device *rdev; 1249 + struct wireless_dev *wdev; 1232 1250 1233 1251 rdev = container_of(work, struct cfg80211_registered_device, 1234 1252 background_cac_abort_wk); 1235 - cfg80211_background_cac_event(rdev, &rdev->background_radar_chandef, 1236 - NL80211_RADAR_CAC_ABORTED); 1253 + 1254 + guard(wiphy)(&rdev->wiphy); 1255 + 1256 + wdev = rdev->background_radar_wdev; 1257 + if (wdev) 1258 + cfg80211_stop_background_radar_detection(wdev); 1237 1259 } 1238 1260 1239 1261 void cfg80211_background_cac_abort(struct wiphy *wiphy) ··· 1313 1309 1314 1310 chandef = *wdev_chandef(wdev, link_id); 1315 1311 rdev_end_cac(rdev, wdev->netdev, link_id); 1312 + wdev->links[link_id].cac_started = false; 1313 + cfg80211_set_cac_state(wiphy, &chandef, false); 1316 1314 nl80211_radar_notify(rdev, &chandef, NL80211_RADAR_CAC_ABORTED, 1317 1315 wdev->netdev, GFP_KERNEL); 1318 1316 } ··· 1331 1325 return; 1332 1326 1333 1327 rdev_set_radar_background(rdev, NULL); 1334 - rdev->background_radar_wdev = NULL; /* Release offchain ownership */ 1335 1328 1336 1329 __cfg80211_background_cac_event(rdev, wdev, 1337 1330 &rdev->background_radar_chandef, 1338 1331 NL80211_RADAR_CAC_ABORTED); 1332 + 1333 + rdev->background_radar_wdev = NULL; 1339 1334 } 1340 1335 1341 1336 int cfg80211_assoc_ml_reconf(struct cfg80211_registered_device *rdev,
+191 -88
net/wireless/nl80211.c
··· 21 21 #include <linux/nospec.h> 22 22 #include <linux/etherdevice.h> 23 23 #include <linux/if_vlan.h> 24 + #include <linux/random.h> 24 25 #include <net/net_namespace.h> 25 26 #include <net/genetlink.h> 26 27 #include <net/cfg80211.h> ··· 1333 1332 goto nla_put_failure; 1334 1333 if ((chan->flags & IEEE80211_CHAN_NO_UHR) && 1335 1334 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_UHR)) 1335 + goto nla_put_failure; 1336 + if (chan->cac_start_time && 1337 + nla_put_u64_64bit(msg, 1338 + NL80211_FREQUENCY_ATTR_CAC_START_TIME, 1339 + chan->cac_start_time, 1340 + NL80211_FREQUENCY_ATTR_PAD)) 1336 1341 goto nla_put_failure; 1337 1342 } 1338 1343 ··· 3574 3567 } 3575 3568 3576 3569 static int _nl80211_parse_chandef(struct cfg80211_registered_device *rdev, 3577 - struct genl_info *info, bool monitor, 3570 + struct netlink_ext_ack *extack, 3571 + struct nlattr **attrs, bool monitor, 3578 3572 struct cfg80211_chan_def *chandef) 3579 3573 { 3580 - struct netlink_ext_ack *extack = info->extack; 3581 - struct nlattr **attrs = info->attrs; 3582 3574 u32 control_freq; 3583 3575 3584 3576 if (!attrs[NL80211_ATTR_WIPHY_FREQ]) { ··· 3587 3581 } 3588 3582 3589 3583 control_freq = MHZ_TO_KHZ( 3590 - nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ])); 3591 - if (info->attrs[NL80211_ATTR_WIPHY_FREQ_OFFSET]) 3584 + nla_get_u32(attrs[NL80211_ATTR_WIPHY_FREQ])); 3585 + if (attrs[NL80211_ATTR_WIPHY_FREQ_OFFSET]) 3592 3586 control_freq += 3593 - nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ_OFFSET]); 3587 + nla_get_u32(attrs[NL80211_ATTR_WIPHY_FREQ_OFFSET]); 3594 3588 3595 3589 memset(chandef, 0, sizeof(*chandef)); 3596 3590 chandef->chan = ieee80211_get_channel_khz(&rdev->wiphy, control_freq); ··· 3661 3655 attrs[NL80211_ATTR_S1G_PRIMARY_2MHZ]); 3662 3656 } 3663 3657 3664 - if (info->attrs[NL80211_ATTR_WIPHY_EDMG_CHANNELS]) { 3658 + if (attrs[NL80211_ATTR_WIPHY_EDMG_CHANNELS]) { 3665 3659 chandef->edmg.channels = 3666 - nla_get_u8(info->attrs[NL80211_ATTR_WIPHY_EDMG_CHANNELS]); 3660 + nla_get_u8(attrs[NL80211_ATTR_WIPHY_EDMG_CHANNELS]); 3667 3661 3668 - if (info->attrs[NL80211_ATTR_WIPHY_EDMG_BW_CONFIG]) 3662 + if (attrs[NL80211_ATTR_WIPHY_EDMG_BW_CONFIG]) 3669 3663 chandef->edmg.bw_config = 3670 - nla_get_u8(info->attrs[NL80211_ATTR_WIPHY_EDMG_BW_CONFIG]); 3664 + nla_get_u8(attrs[NL80211_ATTR_WIPHY_EDMG_BW_CONFIG]); 3671 3665 } else { 3672 3666 chandef->edmg.bw_config = 0; 3673 3667 chandef->edmg.channels = 0; 3674 3668 } 3675 3669 3676 - if (info->attrs[NL80211_ATTR_PUNCT_BITMAP]) { 3670 + if (attrs[NL80211_ATTR_PUNCT_BITMAP]) { 3677 3671 chandef->punctured = 3678 - nla_get_u32(info->attrs[NL80211_ATTR_PUNCT_BITMAP]); 3672 + nla_get_u32(attrs[NL80211_ATTR_PUNCT_BITMAP]); 3679 3673 3680 3674 if (chandef->punctured && 3681 3675 !wiphy_ext_feature_isset(&rdev->wiphy, 3682 3676 NL80211_EXT_FEATURE_PUNCT)) { 3683 - NL_SET_ERR_MSG(extack, 3684 - "driver doesn't support puncturing"); 3677 + NL_SET_ERR_MSG_ATTR(extack, 3678 + attrs[NL80211_ATTR_WIPHY_FREQ], 3679 + "driver doesn't support puncturing"); 3685 3680 return -EINVAL; 3686 3681 } 3687 3682 } 3688 3683 3689 3684 if (!cfg80211_chandef_valid(chandef)) { 3690 - NL_SET_ERR_MSG(extack, "invalid channel definition"); 3685 + NL_SET_ERR_MSG_ATTR(extack, attrs[NL80211_ATTR_WIPHY_FREQ], 3686 + "invalid channel definition"); 3691 3687 return -EINVAL; 3692 3688 } 3693 3689 3694 3690 if (!_cfg80211_chandef_usable(&rdev->wiphy, chandef, 3695 3691 IEEE80211_CHAN_DISABLED, 3696 3692 monitor ? IEEE80211_CHAN_CAN_MONITOR : 0)) { 3697 - NL_SET_ERR_MSG(extack, "(extension) channel is disabled"); 3693 + NL_SET_ERR_MSG_ATTR(extack, attrs[NL80211_ATTR_WIPHY_FREQ], 3694 + "(extension) channel is disabled"); 3698 3695 return -EINVAL; 3699 3696 } 3700 3697 ··· 3712 3703 } 3713 3704 3714 3705 int nl80211_parse_chandef(struct cfg80211_registered_device *rdev, 3715 - struct genl_info *info, 3706 + struct netlink_ext_ack *extack, 3707 + struct nlattr **attrs, 3716 3708 struct cfg80211_chan_def *chandef) 3717 3709 { 3718 - return _nl80211_parse_chandef(rdev, info, false, chandef); 3710 + return _nl80211_parse_chandef(rdev, extack, attrs, false, chandef); 3719 3711 } 3720 3712 3721 3713 static int __nl80211_set_channel(struct cfg80211_registered_device *rdev, ··· 3743 3733 link_id = 0; 3744 3734 } 3745 3735 3746 - result = _nl80211_parse_chandef(rdev, info, 3736 + result = _nl80211_parse_chandef(rdev, info->extack, info->attrs, 3747 3737 iftype == NL80211_IFTYPE_MONITOR, 3748 3738 &chandef); 3749 3739 if (result) ··· 4960 4950 { 4961 4951 struct cfg80211_registered_device *rdev = info->user_ptr[0]; 4962 4952 int err; 4963 - struct net_device *dev = info->user_ptr[1]; 4953 + struct wireless_dev *wdev = info->user_ptr[1]; 4964 4954 u8 key_idx = 0; 4965 4955 const u8 *mac_addr = NULL; 4966 4956 bool pairwise; ··· 4971 4961 struct sk_buff *msg; 4972 4962 bool bigtk_support = false; 4973 4963 int link_id = nl80211_link_id_or_invalid(info->attrs); 4974 - struct wireless_dev *wdev = dev->ieee80211_ptr; 4975 4964 4976 4965 if (wiphy_ext_feature_isset(&rdev->wiphy, 4977 4966 NL80211_EXT_FEATURE_BEACON_PROTECTION)) ··· 5022 5013 cookie.msg = msg; 5023 5014 cookie.idx = key_idx; 5024 5015 5025 - if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || 5016 + if ((wdev->netdev && 5017 + nla_put_u32(msg, NL80211_ATTR_IFINDEX, wdev->netdev->ifindex)) || 5018 + nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), 5019 + NL80211_ATTR_PAD) || 5026 5020 nla_put_u8(msg, NL80211_ATTR_KEY_IDX, key_idx)) 5027 5021 goto nla_put_failure; 5028 5022 if (mac_addr && ··· 5036 5024 if (err) 5037 5025 goto free_msg; 5038 5026 5039 - err = rdev_get_key(rdev, dev, link_id, key_idx, pairwise, mac_addr, 5027 + err = rdev_get_key(rdev, wdev, link_id, key_idx, pairwise, mac_addr, 5040 5028 &cookie, get_key_callback); 5041 5029 5042 5030 if (err) ··· 5060 5048 struct cfg80211_registered_device *rdev = info->user_ptr[0]; 5061 5049 struct key_parse key; 5062 5050 int err; 5063 - struct net_device *dev = info->user_ptr[1]; 5051 + struct wireless_dev *wdev = info->user_ptr[1]; 5064 5052 int link_id = nl80211_link_id_or_invalid(info->attrs); 5065 - struct wireless_dev *wdev = dev->ieee80211_ptr; 5066 5053 5067 5054 err = nl80211_parse_key(info, &key); 5068 5055 if (err) ··· 5081 5070 if (!rdev->ops->set_default_key) 5082 5071 return -EOPNOTSUPP; 5083 5072 5073 + if (!wdev->netdev) 5074 + return -EINVAL; 5075 + 5084 5076 err = nl80211_key_allowed(wdev); 5085 5077 if (err) 5086 5078 return err; ··· 5092 5078 if (err) 5093 5079 return err; 5094 5080 5095 - err = rdev_set_default_key(rdev, dev, link_id, key.idx, 5081 + err = rdev_set_default_key(rdev, wdev->netdev, link_id, key.idx, 5096 5082 key.def_uni, key.def_multi); 5097 5083 5098 5084 if (err) ··· 5117 5103 if (err) 5118 5104 return err; 5119 5105 5120 - err = rdev_set_default_mgmt_key(rdev, dev, link_id, key.idx); 5106 + err = rdev_set_default_mgmt_key(rdev, wdev, link_id, key.idx); 5121 5107 if (err) 5122 5108 return err; 5123 5109 ··· 5140 5126 if (err) 5141 5127 return err; 5142 5128 5143 - return rdev_set_default_beacon_key(rdev, dev, link_id, key.idx); 5129 + return rdev_set_default_beacon_key(rdev, wdev, link_id, 5130 + key.idx); 5144 5131 } else if (key.p.mode == NL80211_KEY_SET_TX && 5145 5132 wiphy_ext_feature_isset(&rdev->wiphy, 5146 5133 NL80211_EXT_FEATURE_EXT_KEY_ID)) { ··· 5157 5142 if (err) 5158 5143 return err; 5159 5144 5160 - return rdev_add_key(rdev, dev, link_id, key.idx, 5145 + return rdev_add_key(rdev, wdev, link_id, key.idx, 5161 5146 NL80211_KEYTYPE_PAIRWISE, 5162 5147 mac_addr, &key.p); 5163 5148 } ··· 5169 5154 { 5170 5155 struct cfg80211_registered_device *rdev = info->user_ptr[0]; 5171 5156 int err; 5172 - struct net_device *dev = info->user_ptr[1]; 5157 + struct wireless_dev *wdev = info->user_ptr[1]; 5173 5158 struct key_parse key; 5174 5159 const u8 *mac_addr = NULL; 5175 5160 int link_id = nl80211_link_id_or_invalid(info->attrs); 5176 - struct wireless_dev *wdev = dev->ieee80211_ptr; 5177 5161 5178 5162 err = nl80211_parse_key(info, &key); 5179 5163 if (err) ··· 5223 5209 key.type == NL80211_KEYTYPE_PAIRWISE); 5224 5210 5225 5211 if (!err) { 5226 - err = rdev_add_key(rdev, dev, link_id, key.idx, 5212 + err = rdev_add_key(rdev, wdev, link_id, key.idx, 5227 5213 key.type == NL80211_KEYTYPE_PAIRWISE, 5228 5214 mac_addr, &key.p); 5229 5215 if (err) ··· 5237 5223 { 5238 5224 struct cfg80211_registered_device *rdev = info->user_ptr[0]; 5239 5225 int err; 5240 - struct net_device *dev = info->user_ptr[1]; 5226 + struct wireless_dev *wdev = info->user_ptr[1]; 5241 5227 u8 *mac_addr = NULL; 5242 5228 struct key_parse key; 5243 5229 int link_id = nl80211_link_id_or_invalid(info->attrs); 5244 - struct wireless_dev *wdev = dev->ieee80211_ptr; 5245 5230 5246 5231 err = nl80211_parse_key(info, &key); 5247 5232 if (err) ··· 5279 5266 key.type == NL80211_KEYTYPE_PAIRWISE); 5280 5267 5281 5268 if (!err) 5282 - err = rdev_del_key(rdev, dev, link_id, key.idx, 5269 + err = rdev_del_key(rdev, wdev, link_id, key.idx, 5283 5270 key.type == NL80211_KEYTYPE_PAIRWISE, 5284 5271 mac_addr); 5285 5272 ··· 6554 6541 NL80211_EXT_FEATURE_EPPKE) && 6555 6542 auth_type == NL80211_AUTHTYPE_EPPKE) 6556 6543 return false; 6544 + if (!wiphy_ext_feature_isset(&rdev->wiphy, 6545 + NL80211_EXT_FEATURE_IEEE8021X_AUTH) && 6546 + auth_type == NL80211_AUTHTYPE_IEEE8021X) 6547 + return false; 6557 6548 return true; 6558 6549 case NL80211_CMD_CONNECT: 6559 6550 if (!(rdev->wiphy.features & NL80211_FEATURE_SAE) && ··· 6578 6561 if (!wiphy_ext_feature_isset(&rdev->wiphy, 6579 6562 NL80211_EXT_FEATURE_EPPKE) && 6580 6563 auth_type == NL80211_AUTHTYPE_EPPKE) 6564 + return false; 6565 + if (!wiphy_ext_feature_isset(&rdev->wiphy, 6566 + NL80211_EXT_FEATURE_IEEE8021X_AUTH) && 6567 + auth_type == NL80211_AUTHTYPE_IEEE8021X) 6581 6568 return false; 6582 6569 return true; 6583 6570 case NL80211_CMD_START_AP: ··· 6832 6811 } 6833 6812 6834 6813 if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) { 6835 - err = nl80211_parse_chandef(rdev, info, &params->chandef); 6814 + err = nl80211_parse_chandef(rdev, info->extack, info->attrs, 6815 + &params->chandef); 6836 6816 if (err) 6837 6817 goto out; 6838 6818 } else if (wdev->valid_links) { ··· 7519 7497 static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid, 7520 7498 u32 seq, int flags, 7521 7499 struct cfg80211_registered_device *rdev, 7522 - struct net_device *dev, 7500 + struct wireless_dev *wdev, 7523 7501 const u8 *mac_addr, struct station_info *sinfo, 7524 7502 bool link_stats) 7525 7503 { ··· 7535 7513 return -1; 7536 7514 } 7537 7515 7538 - if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || 7516 + if ((wdev->netdev && 7517 + nla_put_u32(msg, NL80211_ATTR_IFINDEX, wdev->netdev->ifindex)) || 7518 + nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), 7519 + NL80211_ATTR_PAD) || 7539 7520 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr) || 7540 7521 nla_put_u32(msg, NL80211_ATTR_GENERATION, sinfo->generation)) 7541 7522 goto nla_put_failure; ··· 8017 7992 sinfo_alloc = true; 8018 7993 } 8019 7994 8020 - err = rdev_dump_station(rdev, wdev->netdev, sta_idx, 7995 + err = rdev_dump_station(rdev, wdev, sta_idx, 8021 7996 mac_addr, &sinfo); 8022 7997 if (err == -ENOENT) 8023 7998 break; ··· 8035 8010 if (nl80211_send_station(skb, NL80211_CMD_NEW_STATION, 8036 8011 NETLINK_CB(cb->skb).portid, 8037 8012 cb->nlh->nlmsg_seq, NLM_F_MULTI, 8038 - rdev, wdev->netdev, mac_addr, 8013 + rdev, wdev, mac_addr, 8039 8014 &sinfo, false) < 0) 8040 8015 goto out; 8041 8016 ··· 8056 8031 static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info) 8057 8032 { 8058 8033 struct cfg80211_registered_device *rdev = info->user_ptr[0]; 8059 - struct net_device *dev = info->user_ptr[1]; 8034 + struct wireless_dev *wdev = info->user_ptr[1]; 8060 8035 struct station_info sinfo; 8061 8036 struct sk_buff *msg; 8062 8037 u8 *mac_addr = NULL; 8063 8038 int err, i; 8064 8039 8065 8040 memset(&sinfo, 0, sizeof(sinfo)); 8041 + 8042 + if (!wdev->netdev) 8043 + return -EINVAL; 8066 8044 8067 8045 if (!info->attrs[NL80211_ATTR_MAC]) 8068 8046 return -EINVAL; ··· 8083 8055 } 8084 8056 } 8085 8057 8086 - err = rdev_get_station(rdev, dev, mac_addr, &sinfo); 8058 + err = rdev_get_station(rdev, wdev, mac_addr, &sinfo); 8087 8059 if (err) { 8088 8060 cfg80211_sinfo_release_content(&sinfo); 8089 8061 return err; ··· 8100 8072 8101 8073 if (nl80211_send_station(msg, NL80211_CMD_NEW_STATION, 8102 8074 info->snd_portid, info->snd_seq, 0, 8103 - rdev, dev, mac_addr, &sinfo, false) < 0) { 8075 + rdev, wdev, mac_addr, &sinfo, false) < 0) { 8104 8076 nlmsg_free(msg); 8105 8077 return -ENOBUFS; 8106 8078 } ··· 8462 8434 static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info) 8463 8435 { 8464 8436 struct cfg80211_registered_device *rdev = info->user_ptr[0]; 8465 - struct net_device *dev = info->user_ptr[1]; 8437 + struct wireless_dev *wdev = info->user_ptr[1]; 8438 + struct net_device *dev = wdev->netdev; 8466 8439 struct station_parameters params; 8467 8440 u8 *mac_addr; 8468 8441 int err; 8469 8442 8470 8443 memset(&params, 0, sizeof(params)); 8444 + 8445 + if (!dev) 8446 + return -EINVAL; 8471 8447 8472 8448 if (!rdev->ops->change_station) 8473 8449 return -EOPNOTSUPP; ··· 8545 8513 nla_len(info->attrs[NL80211_ATTR_STA_EXT_CAPABILITY]); 8546 8514 } 8547 8515 8548 - if (parse_station_flags(info, dev->ieee80211_ptr->iftype, &params)) 8516 + if (parse_station_flags(info, wdev->iftype, &params)) 8549 8517 return -EINVAL; 8550 8518 8551 8519 if (info->attrs[NL80211_ATTR_STA_PLINK_ACTION]) ··· 8605 8573 if (IS_ERR(params.vlan)) 8606 8574 return PTR_ERR(params.vlan); 8607 8575 8608 - switch (dev->ieee80211_ptr->iftype) { 8576 + switch (wdev->iftype) { 8609 8577 case NL80211_IFTYPE_AP: 8610 8578 case NL80211_IFTYPE_AP_VLAN: 8611 8579 case NL80211_IFTYPE_P2P_GO: ··· 8620 8588 } 8621 8589 8622 8590 /* driver will call cfg80211_check_station_change() */ 8623 - err = rdev_change_station(rdev, dev, mac_addr, &params); 8591 + err = rdev_change_station(rdev, wdev, mac_addr, &params); 8624 8592 8625 8593 out_put_vlan: 8626 8594 dev_put(params.vlan); ··· 8632 8600 { 8633 8601 struct cfg80211_registered_device *rdev = info->user_ptr[0]; 8634 8602 int err; 8635 - struct net_device *dev = info->user_ptr[1]; 8636 - struct wireless_dev *wdev = dev->ieee80211_ptr; 8603 + struct wireless_dev *wdev = info->user_ptr[1]; 8604 + struct net_device *dev = wdev->netdev; 8637 8605 struct station_parameters params; 8638 8606 u8 *mac_addr = NULL; 8639 8607 u32 auth_assoc = BIT(NL80211_STA_FLAG_AUTHENTICATED) | 8640 8608 BIT(NL80211_STA_FLAG_ASSOCIATED); 8641 8609 8642 8610 memset(&params, 0, sizeof(params)); 8611 + 8612 + if (!dev) 8613 + return -EINVAL; 8643 8614 8644 8615 if (!rdev->ops->add_station) 8645 8616 return -EOPNOTSUPP; ··· 8693 8658 * and is NOT supported for AP interface 8694 8659 */ 8695 8660 params.support_p2p_ps = 8696 - dev->ieee80211_ptr->iftype == NL80211_IFTYPE_P2P_GO; 8661 + wdev->iftype == NL80211_IFTYPE_P2P_GO; 8697 8662 } 8698 8663 8699 8664 if (info->attrs[NL80211_ATTR_PEER_AID]) ··· 8799 8764 if (err) 8800 8765 return err; 8801 8766 8802 - if (parse_station_flags(info, dev->ieee80211_ptr->iftype, &params)) 8767 + if (parse_station_flags(info, wdev->iftype, &params)) 8803 8768 return -EINVAL; 8804 8769 8805 8770 /* HT/VHT requires QoS, but if we don't have that just ignore HT/VHT ··· 8827 8792 /* When you run into this, adjust the code below for the new flag */ 8828 8793 BUILD_BUG_ON(NL80211_STA_FLAG_MAX != 8); 8829 8794 8830 - switch (dev->ieee80211_ptr->iftype) { 8795 + switch (wdev->iftype) { 8831 8796 case NL80211_IFTYPE_AP: 8832 8797 case NL80211_IFTYPE_AP_VLAN: 8833 8798 case NL80211_IFTYPE_P2P_GO: ··· 8936 8901 params.epp_peer = 8937 8902 nla_get_flag(info->attrs[NL80211_ATTR_EPP_PEER]); 8938 8903 8939 - err = rdev_add_station(rdev, dev, mac_addr, &params); 8904 + err = rdev_add_station(rdev, wdev, mac_addr, &params); 8940 8905 out: 8941 8906 dev_put(params.vlan); 8942 8907 return err; ··· 8945 8910 static int nl80211_del_station(struct sk_buff *skb, struct genl_info *info) 8946 8911 { 8947 8912 struct cfg80211_registered_device *rdev = info->user_ptr[0]; 8948 - struct net_device *dev = info->user_ptr[1]; 8949 - struct wireless_dev *wdev = dev->ieee80211_ptr; 8913 + struct wireless_dev *wdev = info->user_ptr[1]; 8914 + struct net_device *dev = wdev->netdev; 8950 8915 struct station_del_parameters params; 8951 8916 int link_id = nl80211_link_id_or_invalid(info->attrs); 8952 8917 8953 8918 memset(&params, 0, sizeof(params)); 8919 + 8920 + if (!dev) 8921 + return -EINVAL; 8954 8922 8955 8923 if (info->attrs[NL80211_ATTR_MAC]) 8956 8924 params.mac = nla_data(info->attrs[NL80211_ATTR_MAC]); ··· 9010 8972 9011 8973 params.link_id = link_id; 9012 8974 9013 - return rdev_del_station(rdev, dev, &params); 8975 + return rdev_del_station(rdev, wdev, &params); 9014 8976 } 9015 8977 9016 8978 static int nl80211_send_mpath(struct sk_buff *msg, u32 portid, u32 seq, ··· 11325 11287 if (dfs_region == NL80211_DFS_UNSET) 11326 11288 return -EINVAL; 11327 11289 11328 - err = nl80211_parse_chandef(rdev, info, &chandef); 11290 + err = nl80211_parse_chandef(rdev, info->extack, info->attrs, &chandef); 11329 11291 if (err) 11330 11292 return err; 11331 11293 ··· 11391 11353 wdev->links[link_id].cac_started = true; 11392 11354 wdev->links[link_id].cac_start_time = jiffies; 11393 11355 wdev->links[link_id].cac_time_ms = cac_time_ms; 11356 + cfg80211_set_cac_state(wiphy, &chandef, true); 11394 11357 11395 11358 return 0; 11396 11359 } ··· 11414 11375 return -EINVAL; 11415 11376 } 11416 11377 11417 - err = nl80211_parse_chandef(rdev, info, &chandef); 11378 + err = nl80211_parse_chandef(rdev, info->extack, info->attrs, &chandef); 11418 11379 if (err) { 11419 11380 GENL_SET_ERR_MSG(info, "Unable to extract chandef info"); 11420 11381 return err; ··· 11599 11560 goto free; 11600 11561 11601 11562 skip_beacons: 11602 - err = nl80211_parse_chandef(rdev, info, &params.chandef); 11563 + err = nl80211_parse_chandef(rdev, info->extack, info->attrs, 11564 + &params.chandef); 11603 11565 if (err) 11604 11566 goto free; 11605 11567 ··· 12115 12075 auth_type == NL80211_AUTHTYPE_FILS_SK || 12116 12076 auth_type == NL80211_AUTHTYPE_FILS_SK_PFS || 12117 12077 auth_type == NL80211_AUTHTYPE_FILS_PK || 12118 - auth_type == NL80211_AUTHTYPE_EPPKE) && 12078 + auth_type == NL80211_AUTHTYPE_EPPKE || 12079 + auth_type == NL80211_AUTHTYPE_IEEE8021X) && 12119 12080 !info->attrs[NL80211_ATTR_AUTH_DATA]) 12120 12081 return -EINVAL; 12121 12082 ··· 12125 12084 auth_type != NL80211_AUTHTYPE_FILS_SK && 12126 12085 auth_type != NL80211_AUTHTYPE_FILS_SK_PFS && 12127 12086 auth_type != NL80211_AUTHTYPE_FILS_PK && 12128 - auth_type != NL80211_AUTHTYPE_EPPKE) 12087 + auth_type != NL80211_AUTHTYPE_EPPKE && 12088 + auth_type != NL80211_AUTHTYPE_IEEE8021X) 12129 12089 return -EINVAL; 12130 12090 req.auth_data = nla_data(info->attrs[NL80211_ATTR_AUTH_DATA]); 12131 12091 req.auth_data_len = nla_len(info->attrs[NL80211_ATTR_AUTH_DATA]); ··· 12823 12781 ibss.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); 12824 12782 } 12825 12783 12826 - err = nl80211_parse_chandef(rdev, info, &ibss.chandef); 12784 + err = nl80211_parse_chandef(rdev, info->extack, info->attrs, 12785 + &ibss.chandef); 12827 12786 if (err) 12828 12787 return err; 12829 12788 ··· 13822 13779 duration > rdev->wiphy.max_remain_on_channel_duration) 13823 13780 return -EINVAL; 13824 13781 13825 - err = nl80211_parse_chandef(rdev, info, &chandef); 13782 + err = nl80211_parse_chandef(rdev, info->extack, info->attrs, &chandef); 13826 13783 if (err) 13827 13784 return err; 13828 13785 ··· 14038 13995 */ 14039 13996 chandef.chan = NULL; 14040 13997 if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) { 14041 - err = nl80211_parse_chandef(rdev, info, &chandef); 13998 + err = nl80211_parse_chandef(rdev, info->extack, info->attrs, 13999 + &chandef); 14042 14000 if (err) 14043 14001 return err; 14044 14002 } ··· 14271 14227 14272 14228 mac_addr = wdev->links[0].client.current_bss->pub.bssid; 14273 14229 14274 - err = rdev_get_station(rdev, dev, mac_addr, &sinfo); 14230 + err = rdev_get_station(rdev, wdev, mac_addr, &sinfo); 14275 14231 if (err) 14276 14232 return err; 14277 14233 ··· 14441 14397 struct ocb_setup setup = {}; 14442 14398 int err; 14443 14399 14444 - err = nl80211_parse_chandef(rdev, info, &setup.chandef); 14400 + err = nl80211_parse_chandef(rdev, info->extack, info->attrs, 14401 + &setup.chandef); 14445 14402 if (err) 14446 14403 return err; 14447 14404 ··· 14517 14472 cfg.auto_open_plinks = false; 14518 14473 14519 14474 if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) { 14520 - err = nl80211_parse_chandef(rdev, info, &setup.chandef); 14475 + err = nl80211_parse_chandef(rdev, info->extack, info->attrs, 14476 + &setup.chandef); 14521 14477 if (err) 14522 14478 return err; 14523 14479 } else { ··· 15771 15725 return err; 15772 15726 15773 15727 changed |= CFG80211_NAN_CONF_CHANGED_CONFIG; 15774 - if (attrs[NL80211_NAN_CONF_CLUSTER_ID] && start) 15775 - conf->cluster_id = 15776 - nla_data(attrs[NL80211_NAN_CONF_CLUSTER_ID]); 15728 + if (attrs[NL80211_NAN_CONF_CLUSTER_ID] && start) { 15729 + ether_addr_copy(conf->cluster_id, 15730 + nla_data(attrs[NL80211_NAN_CONF_CLUSTER_ID])); 15731 + } else if (start) { 15732 + conf->cluster_id[0] = 0x50; 15733 + conf->cluster_id[1] = 0x6f; 15734 + conf->cluster_id[2] = 0x9a; 15735 + conf->cluster_id[3] = 0x01; 15736 + get_random_bytes(&conf->cluster_id[4], 2); 15737 + } 15777 15738 15778 15739 if (attrs[NL80211_NAN_CONF_EXTRA_ATTRS]) { 15779 15740 conf->extra_nan_attrs = ··· 17000 16947 !info->attrs[NL80211_ATTR_OPER_CLASS]) 17001 16948 return -EINVAL; 17002 16949 17003 - err = nl80211_parse_chandef(rdev, info, &chandef); 16950 + err = nl80211_parse_chandef(rdev, info->extack, info->attrs, &chandef); 17004 16951 if (err) 17005 16952 return err; 17006 16953 ··· 17379 17326 !ether_addr_equal(buf + ETH_ALEN, dev->dev_addr)) 17380 17327 return -EINVAL; 17381 17328 17382 - err = rdev_get_station(rdev, dev, dest, &sinfo); 17329 + err = rdev_get_station(rdev, wdev, dest, &sinfo); 17383 17330 if (err) 17384 17331 return err; 17385 17332 ··· 18074 18021 NL80211_FLAG_CLEAR_SKB) \ 18075 18022 SELECTOR(__sel, WDEV_UP, \ 18076 18023 NL80211_FLAG_NEED_WDEV_UP) \ 18024 + SELECTOR(__sel, WDEV_UP_CLEAR, \ 18025 + NL80211_FLAG_NEED_WDEV_UP | \ 18026 + NL80211_FLAG_CLEAR_SKB) \ 18077 18027 SELECTOR(__sel, WDEV_UP_LINK, \ 18078 18028 NL80211_FLAG_NEED_WDEV_UP | \ 18079 18029 NL80211_FLAG_MLO_VALID_LINK_ID) \ ··· 18409 18353 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, 18410 18354 .doit = nl80211_get_key, 18411 18355 .flags = GENL_UNS_ADMIN_PERM, 18412 - .internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV_UP), 18356 + .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP), 18413 18357 }, 18414 18358 { 18415 18359 .cmd = NL80211_CMD_SET_KEY, ··· 18417 18361 .doit = nl80211_set_key, 18418 18362 .flags = GENL_UNS_ADMIN_PERM, 18419 18363 /* cannot use NL80211_FLAG_MLO_VALID_LINK_ID, depends on key */ 18420 - .internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV_UP | 18364 + .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP | 18421 18365 NL80211_FLAG_CLEAR_SKB), 18422 18366 }, 18423 18367 { ··· 18425 18369 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, 18426 18370 .doit = nl80211_new_key, 18427 18371 .flags = GENL_UNS_ADMIN_PERM, 18428 - .internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV_UP | 18372 + .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP | 18429 18373 NL80211_FLAG_CLEAR_SKB), 18430 18374 }, 18431 18375 { ··· 18433 18377 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, 18434 18378 .doit = nl80211_del_key, 18435 18379 .flags = GENL_UNS_ADMIN_PERM, 18436 - .internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV_UP), 18380 + .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP), 18437 18381 }, 18438 18382 { 18439 18383 .cmd = NL80211_CMD_SET_BEACON, ··· 18464 18408 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, 18465 18409 .doit = nl80211_get_station, 18466 18410 .dumpit = nl80211_dump_station, 18467 - .internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV), 18411 + .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV), 18468 18412 }, 18469 18413 { 18470 18414 .cmd = NL80211_CMD_SET_STATION, 18471 18415 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, 18472 18416 .doit = nl80211_set_station, 18473 18417 .flags = GENL_UNS_ADMIN_PERM, 18474 - .internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV_UP), 18418 + .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP), 18475 18419 }, 18476 18420 { 18477 18421 .cmd = NL80211_CMD_NEW_STATION, 18478 18422 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, 18479 18423 .doit = nl80211_new_station, 18480 18424 .flags = GENL_UNS_ADMIN_PERM, 18481 - .internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV_UP), 18425 + .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP), 18482 18426 }, 18483 18427 { 18484 18428 .cmd = NL80211_CMD_DEL_STATION, ··· 18489 18433 * whether MAC address is passed or not. If MAC address is 18490 18434 * passed, then even during MLO, link ID is not required. 18491 18435 */ 18492 - .internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV_UP), 18436 + .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP), 18493 18437 }, 18494 18438 { 18495 18439 .cmd = NL80211_CMD_GET_MPATH, ··· 20420 20364 } 20421 20365 EXPORT_SYMBOL(cfg80211_tx_mgmt_expired); 20422 20366 20423 - void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr, 20367 + void cfg80211_new_sta(struct wireless_dev *wdev, const u8 *mac_addr, 20424 20368 struct station_info *sinfo, gfp_t gfp) 20425 20369 { 20426 - struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; 20370 + struct wiphy *wiphy = wdev->wiphy; 20427 20371 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); 20428 20372 struct sk_buff *msg; 20429 20373 20430 - trace_cfg80211_new_sta(dev, mac_addr, sinfo); 20374 + trace_cfg80211_new_sta(wdev, mac_addr, sinfo); 20431 20375 20432 20376 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); 20433 20377 if (!msg) 20434 20378 return; 20435 20379 20436 20380 if (nl80211_send_station(msg, NL80211_CMD_NEW_STATION, 0, 0, 0, 20437 - rdev, dev, mac_addr, sinfo, false) < 0) { 20381 + rdev, wdev, mac_addr, sinfo, false) < 0) { 20438 20382 nlmsg_free(msg); 20439 20383 return; 20440 20384 } ··· 20444 20388 } 20445 20389 EXPORT_SYMBOL(cfg80211_new_sta); 20446 20390 20447 - void cfg80211_del_sta_sinfo(struct net_device *dev, const u8 *mac_addr, 20391 + void cfg80211_del_sta_sinfo(struct wireless_dev *wdev, const u8 *mac_addr, 20448 20392 struct station_info *sinfo, gfp_t gfp) 20449 20393 { 20450 - struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; 20394 + struct wiphy *wiphy = wdev->wiphy; 20451 20395 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); 20452 20396 struct sk_buff *msg; 20453 20397 struct station_info empty_sinfo = {}; ··· 20455 20399 if (!sinfo) 20456 20400 sinfo = &empty_sinfo; 20457 20401 20458 - trace_cfg80211_del_sta(dev, mac_addr); 20402 + trace_cfg80211_del_sta(wdev, mac_addr); 20459 20403 20460 20404 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); 20461 20405 if (!msg) { ··· 20464 20408 } 20465 20409 20466 20410 if (nl80211_send_station(msg, NL80211_CMD_DEL_STATION, 0, 0, 0, 20467 - rdev, dev, mac_addr, sinfo, false) < 0) { 20411 + rdev, wdev, mac_addr, sinfo, false) < 0) { 20468 20412 nlmsg_free(msg); 20469 20413 return; 20470 20414 } ··· 21176 21120 } 21177 21121 EXPORT_SYMBOL(cfg80211_ch_switch_notify); 21178 21122 21123 + void cfg80211_incumbent_signal_notify(struct wiphy *wiphy, 21124 + const struct cfg80211_chan_def *chandef, 21125 + u32 signal_interference_bitmap, 21126 + gfp_t gfp) 21127 + { 21128 + struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); 21129 + struct sk_buff *msg; 21130 + void *hdr; 21131 + 21132 + trace_cfg80211_incumbent_signal_notify(wiphy, chandef, signal_interference_bitmap); 21133 + 21134 + msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); 21135 + if (!msg) 21136 + return; 21137 + 21138 + hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_INCUMBENT_SIGNAL_DETECT); 21139 + if (!hdr) 21140 + goto nla_put_failure; 21141 + 21142 + if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx)) 21143 + goto nla_put_failure; 21144 + 21145 + if (nl80211_send_chandef(msg, chandef)) 21146 + goto nla_put_failure; 21147 + 21148 + if (nla_put_u32(msg, NL80211_ATTR_INCUMBENT_SIGNAL_INTERFERENCE_BITMAP, 21149 + signal_interference_bitmap)) 21150 + goto nla_put_failure; 21151 + 21152 + genlmsg_end(msg, hdr); 21153 + 21154 + genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, 21155 + NL80211_MCGRP_MLME, gfp); 21156 + return; 21157 + 21158 + nla_put_failure: 21159 + nlmsg_free(msg); 21160 + } 21161 + EXPORT_SYMBOL(cfg80211_incumbent_signal_notify); 21162 + 21179 21163 void cfg80211_ch_switch_started_notify(struct net_device *dev, 21180 21164 struct cfg80211_chan_def *chandef, 21181 21165 unsigned int link_id, u8 count, ··· 21315 21219 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || 21316 21220 nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), 21317 21221 NL80211_ATTR_PAD)) 21222 + goto nla_put_failure; 21223 + } 21224 + 21225 + if (rdev->background_radar_wdev && 21226 + cfg80211_chandef_identical(&rdev->background_radar_chandef, 21227 + chandef)) { 21228 + if (nla_put_flag(msg, NL80211_ATTR_RADAR_BACKGROUND)) 21318 21229 goto nla_put_failure; 21319 21230 } 21320 21231
+3 -2
net/wireless/nl80211.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 2 /* 3 3 * Portions of this file 4 - * Copyright (C) 2018, 2020-2024 Intel Corporation 4 + * Copyright (C) 2018, 2020-2025 Intel Corporation 5 5 */ 6 6 #ifndef __NET_WIRELESS_NL80211_H 7 7 #define __NET_WIRELESS_NL80211_H ··· 23 23 } 24 24 25 25 int nl80211_parse_chandef(struct cfg80211_registered_device *rdev, 26 - struct genl_info *info, 26 + struct netlink_ext_ack *extack, 27 + struct nlattr **attrs, 27 28 struct cfg80211_chan_def *chandef); 28 29 int nl80211_parse_random_mac(struct nlattr **attrs, 29 30 u8 *mac_addr, u8 *mac_addr_mask);
+3 -2
net/wireless/pmsr.c
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 2 /* 3 - * Copyright (C) 2018 - 2021, 2023 - 2024 Intel Corporation 3 + * Copyright (C) 2018 - 2021, 2023 - 2026 Intel Corporation 4 4 */ 5 5 #include <net/cfg80211.h> 6 6 #include "core.h" ··· 237 237 if (err) 238 238 return err; 239 239 240 - err = nl80211_parse_chandef(rdev, info, &out->chandef); 240 + err = nl80211_parse_chandef(rdev, info->extack, info->attrs, 241 + &out->chandef); 241 242 if (err) 242 243 return err; 243 244
+31 -31
net/wireless/rdev-ops.h
··· 2 2 /* 3 3 * Portions of this file 4 4 * Copyright(c) 2016-2017 Intel Deutschland GmbH 5 - * Copyright (C) 2018, 2021-2025 Intel Corporation 5 + * Copyright (C) 2018, 2021-2026 Intel Corporation 6 6 */ 7 7 #ifndef __CFG80211_RDEV_OPS 8 8 #define __CFG80211_RDEV_OPS ··· 77 77 } 78 78 79 79 static inline int rdev_add_key(struct cfg80211_registered_device *rdev, 80 - struct net_device *netdev, int link_id, 80 + struct wireless_dev *wdev, int link_id, 81 81 u8 key_index, bool pairwise, const u8 *mac_addr, 82 82 struct key_params *params) 83 83 { 84 84 int ret; 85 - trace_rdev_add_key(&rdev->wiphy, netdev, link_id, key_index, pairwise, 85 + trace_rdev_add_key(&rdev->wiphy, wdev, link_id, key_index, pairwise, 86 86 mac_addr, params->mode); 87 - ret = rdev->ops->add_key(&rdev->wiphy, netdev, link_id, key_index, 87 + ret = rdev->ops->add_key(&rdev->wiphy, wdev, link_id, key_index, 88 88 pairwise, mac_addr, params); 89 89 trace_rdev_return_int(&rdev->wiphy, ret); 90 90 return ret; 91 91 } 92 92 93 93 static inline int 94 - rdev_get_key(struct cfg80211_registered_device *rdev, struct net_device *netdev, 94 + rdev_get_key(struct cfg80211_registered_device *rdev, struct wireless_dev *wdev, 95 95 int link_id, u8 key_index, bool pairwise, const u8 *mac_addr, 96 96 void *cookie, 97 97 void (*callback)(void *cookie, struct key_params*)) 98 98 { 99 99 int ret; 100 - trace_rdev_get_key(&rdev->wiphy, netdev, link_id, key_index, pairwise, 100 + trace_rdev_get_key(&rdev->wiphy, wdev, link_id, key_index, pairwise, 101 101 mac_addr); 102 - ret = rdev->ops->get_key(&rdev->wiphy, netdev, link_id, key_index, 102 + ret = rdev->ops->get_key(&rdev->wiphy, wdev, link_id, key_index, 103 103 pairwise, mac_addr, cookie, callback); 104 104 trace_rdev_return_int(&rdev->wiphy, ret); 105 105 return ret; 106 106 } 107 107 108 108 static inline int rdev_del_key(struct cfg80211_registered_device *rdev, 109 - struct net_device *netdev, int link_id, 109 + struct wireless_dev *wdev, int link_id, 110 110 u8 key_index, bool pairwise, const u8 *mac_addr) 111 111 { 112 112 int ret; 113 - trace_rdev_del_key(&rdev->wiphy, netdev, link_id, key_index, pairwise, 113 + trace_rdev_del_key(&rdev->wiphy, wdev, link_id, key_index, pairwise, 114 114 mac_addr); 115 - ret = rdev->ops->del_key(&rdev->wiphy, netdev, link_id, key_index, 115 + ret = rdev->ops->del_key(&rdev->wiphy, wdev, link_id, key_index, 116 116 pairwise, mac_addr); 117 117 trace_rdev_return_int(&rdev->wiphy, ret); 118 118 return ret; ··· 134 134 135 135 static inline int 136 136 rdev_set_default_mgmt_key(struct cfg80211_registered_device *rdev, 137 - struct net_device *netdev, int link_id, u8 key_index) 137 + struct wireless_dev *wdev, int link_id, u8 key_index) 138 138 { 139 139 int ret; 140 - trace_rdev_set_default_mgmt_key(&rdev->wiphy, netdev, link_id, 140 + trace_rdev_set_default_mgmt_key(&rdev->wiphy, wdev, link_id, 141 141 key_index); 142 - ret = rdev->ops->set_default_mgmt_key(&rdev->wiphy, netdev, link_id, 142 + ret = rdev->ops->set_default_mgmt_key(&rdev->wiphy, wdev, link_id, 143 143 key_index); 144 144 trace_rdev_return_int(&rdev->wiphy, ret); 145 145 return ret; ··· 147 147 148 148 static inline int 149 149 rdev_set_default_beacon_key(struct cfg80211_registered_device *rdev, 150 - struct net_device *netdev, int link_id, 150 + struct wireless_dev *wdev, int link_id, 151 151 u8 key_index) 152 152 { 153 153 int ret; 154 154 155 - trace_rdev_set_default_beacon_key(&rdev->wiphy, netdev, link_id, 155 + trace_rdev_set_default_beacon_key(&rdev->wiphy, wdev, link_id, 156 156 key_index); 157 - ret = rdev->ops->set_default_beacon_key(&rdev->wiphy, netdev, link_id, 157 + ret = rdev->ops->set_default_beacon_key(&rdev->wiphy, wdev, link_id, 158 158 key_index); 159 159 trace_rdev_return_int(&rdev->wiphy, ret); 160 160 return ret; ··· 193 193 } 194 194 195 195 static inline int rdev_add_station(struct cfg80211_registered_device *rdev, 196 - struct net_device *dev, u8 *mac, 196 + struct wireless_dev *wdev, u8 *mac, 197 197 struct station_parameters *params) 198 198 { 199 199 int ret; 200 - trace_rdev_add_station(&rdev->wiphy, dev, mac, params); 201 - ret = rdev->ops->add_station(&rdev->wiphy, dev, mac, params); 200 + trace_rdev_add_station(&rdev->wiphy, wdev, mac, params); 201 + ret = rdev->ops->add_station(&rdev->wiphy, wdev, mac, params); 202 202 trace_rdev_return_int(&rdev->wiphy, ret); 203 203 return ret; 204 204 } 205 205 206 206 static inline int rdev_del_station(struct cfg80211_registered_device *rdev, 207 - struct net_device *dev, 207 + struct wireless_dev *wdev, 208 208 struct station_del_parameters *params) 209 209 { 210 210 int ret; 211 - trace_rdev_del_station(&rdev->wiphy, dev, params); 212 - ret = rdev->ops->del_station(&rdev->wiphy, dev, params); 211 + trace_rdev_del_station(&rdev->wiphy, wdev, params); 212 + ret = rdev->ops->del_station(&rdev->wiphy, wdev, params); 213 213 trace_rdev_return_int(&rdev->wiphy, ret); 214 214 return ret; 215 215 } 216 216 217 217 static inline int rdev_change_station(struct cfg80211_registered_device *rdev, 218 - struct net_device *dev, u8 *mac, 218 + struct wireless_dev *wdev, u8 *mac, 219 219 struct station_parameters *params) 220 220 { 221 221 int ret; 222 - trace_rdev_change_station(&rdev->wiphy, dev, mac, params); 223 - ret = rdev->ops->change_station(&rdev->wiphy, dev, mac, params); 222 + trace_rdev_change_station(&rdev->wiphy, wdev, mac, params); 223 + ret = rdev->ops->change_station(&rdev->wiphy, wdev, mac, params); 224 224 trace_rdev_return_int(&rdev->wiphy, ret); 225 225 return ret; 226 226 } 227 227 228 228 static inline int rdev_get_station(struct cfg80211_registered_device *rdev, 229 - struct net_device *dev, const u8 *mac, 229 + struct wireless_dev *wdev, const u8 *mac, 230 230 struct station_info *sinfo) 231 231 { 232 232 int ret; 233 - trace_rdev_get_station(&rdev->wiphy, dev, mac); 234 - ret = rdev->ops->get_station(&rdev->wiphy, dev, mac, sinfo); 233 + trace_rdev_get_station(&rdev->wiphy, wdev, mac); 234 + ret = rdev->ops->get_station(&rdev->wiphy, wdev, mac, sinfo); 235 235 trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo); 236 236 return ret; 237 237 } 238 238 239 239 static inline int rdev_dump_station(struct cfg80211_registered_device *rdev, 240 - struct net_device *dev, int idx, u8 *mac, 240 + struct wireless_dev *wdev, int idx, u8 *mac, 241 241 struct station_info *sinfo) 242 242 { 243 243 int ret; 244 - trace_rdev_dump_station(&rdev->wiphy, dev, idx, mac); 245 - ret = rdev->ops->dump_station(&rdev->wiphy, dev, idx, mac, sinfo); 244 + trace_rdev_dump_station(&rdev->wiphy, wdev, idx, mac); 245 + ret = rdev->ops->dump_station(&rdev->wiphy, wdev, idx, mac, sinfo); 246 246 trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo); 247 247 return ret; 248 248 }
+2 -2
net/wireless/sme.c
··· 5 5 * (for nl80211's connect() and wext) 6 6 * 7 7 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> 8 - * Copyright (C) 2009, 2020, 2022-2025 Intel Corporation. All rights reserved. 8 + * Copyright (C) 2009, 2020, 2022-2026 Intel Corporation. All rights reserved. 9 9 * Copyright 2017 Intel Deutschland GmbH 10 10 */ 11 11 ··· 1386 1386 NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT)) 1387 1387 max_key_idx = 7; 1388 1388 for (i = 0; i <= max_key_idx; i++) 1389 - rdev_del_key(rdev, dev, -1, i, false, NULL); 1389 + rdev_del_key(rdev, wdev, -1, i, false, NULL); 1390 1390 } 1391 1391 1392 1392 rdev_set_qos_map(rdev, dev, NULL);
+19 -14
net/wireless/sysfs.c
··· 99 99 rdev->suspend_at = ktime_get_boottime_seconds(); 100 100 101 101 rtnl_lock(); 102 + if (!rdev->wiphy.registered) 103 + goto out_unlock_rtnl; 104 + 102 105 wiphy_lock(&rdev->wiphy); 103 - if (rdev->wiphy.registered) { 104 - if (!rdev->wiphy.wowlan_config) { 105 - cfg80211_leave_all(rdev); 106 - cfg80211_process_rdev_events(rdev); 107 - } 106 + if (rdev->wiphy.wowlan_config) { 108 107 cfg80211_process_wiphy_works(rdev, NULL); 109 108 if (rdev->ops->suspend) 110 109 ret = rdev_suspend(rdev, rdev->wiphy.wowlan_config); 111 - if (ret == 1) { 112 - /* Driver refuse to configure wowlan */ 113 - cfg80211_leave_all(rdev); 114 - cfg80211_process_rdev_events(rdev); 115 - cfg80211_process_wiphy_works(rdev, NULL); 116 - ret = rdev_suspend(rdev, NULL); 117 - } 118 - if (ret == 0) 119 - rdev->suspended = true; 110 + if (ret <= 0) 111 + goto out_unlock_wiphy; 120 112 } 113 + 114 + /* Driver refused to configure wowlan (ret = 1) or no wowlan */ 115 + 116 + cfg80211_leave_all(rdev); 117 + cfg80211_process_rdev_events(rdev); 118 + cfg80211_process_wiphy_works(rdev, NULL); 119 + if (rdev->ops->suspend) 120 + ret = rdev_suspend(rdev, NULL); 121 + 122 + out_unlock_wiphy: 121 123 wiphy_unlock(&rdev->wiphy); 124 + out_unlock_rtnl: 125 + if (ret == 0) 126 + rdev->suspended = true; 122 127 rtnl_unlock(); 123 128 124 129 return ret;
+118 -67
net/wireless/trace.h
··· 2 2 /* 3 3 * Portions of this file 4 4 * Copyright(c) 2016-2017 Intel Deutschland GmbH 5 - * Copyright (C) 2018, 2020-2025 Intel Corporation 5 + * Copyright (C) 2018, 2020-2026 Intel Corporation 6 6 */ 7 7 #undef TRACE_SYSTEM 8 8 #define TRACE_SYSTEM cfg80211 ··· 546 546 ); 547 547 548 548 DECLARE_EVENT_CLASS(key_handle, 549 - TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id, 549 + TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id, 550 550 u8 key_index, bool pairwise, const u8 *mac_addr), 551 - TP_ARGS(wiphy, netdev, link_id, key_index, pairwise, mac_addr), 551 + TP_ARGS(wiphy, wdev, link_id, key_index, pairwise, mac_addr), 552 552 TP_STRUCT__entry( 553 553 WIPHY_ENTRY 554 - NETDEV_ENTRY 554 + WDEV_ENTRY 555 555 MAC_ENTRY(mac_addr) 556 556 __field(int, link_id) 557 557 __field(u8, key_index) ··· 559 559 ), 560 560 TP_fast_assign( 561 561 WIPHY_ASSIGN; 562 - NETDEV_ASSIGN; 562 + WDEV_ASSIGN; 563 563 MAC_ASSIGN(mac_addr, mac_addr); 564 564 __entry->link_id = link_id; 565 565 __entry->key_index = key_index; 566 566 __entry->pairwise = pairwise; 567 567 ), 568 - TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d, " 568 + TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", link_id: %d, " 569 569 "key_index: %u, pairwise: %s, mac addr: %pM", 570 - WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->link_id, 570 + WIPHY_PR_ARG, WDEV_PR_ARG, __entry->link_id, 571 571 __entry->key_index, BOOL_TO_STR(__entry->pairwise), 572 572 __entry->mac_addr) 573 573 ); 574 574 575 575 DEFINE_EVENT(key_handle, rdev_get_key, 576 - TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id, 576 + TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id, 577 577 u8 key_index, bool pairwise, const u8 *mac_addr), 578 - TP_ARGS(wiphy, netdev, link_id, key_index, pairwise, mac_addr) 578 + TP_ARGS(wiphy, wdev, link_id, key_index, pairwise, mac_addr) 579 579 ); 580 580 581 581 DEFINE_EVENT(key_handle, rdev_del_key, 582 - TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id, 582 + TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id, 583 583 u8 key_index, bool pairwise, const u8 *mac_addr), 584 - TP_ARGS(wiphy, netdev, link_id, key_index, pairwise, mac_addr) 584 + TP_ARGS(wiphy, wdev, link_id, key_index, pairwise, mac_addr) 585 585 ); 586 586 587 587 TRACE_EVENT(rdev_add_key, 588 - TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id, 588 + TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id, 589 589 u8 key_index, bool pairwise, const u8 *mac_addr, u8 mode), 590 - TP_ARGS(wiphy, netdev, link_id, key_index, pairwise, mac_addr, mode), 590 + TP_ARGS(wiphy, wdev, link_id, key_index, pairwise, mac_addr, mode), 591 591 TP_STRUCT__entry( 592 592 WIPHY_ENTRY 593 - NETDEV_ENTRY 593 + WDEV_ENTRY 594 594 MAC_ENTRY(mac_addr) 595 595 __field(int, link_id) 596 596 __field(u8, key_index) ··· 599 599 ), 600 600 TP_fast_assign( 601 601 WIPHY_ASSIGN; 602 - NETDEV_ASSIGN; 602 + WDEV_ASSIGN; 603 603 MAC_ASSIGN(mac_addr, mac_addr); 604 604 __entry->link_id = link_id; 605 605 __entry->key_index = key_index; 606 606 __entry->pairwise = pairwise; 607 607 __entry->mode = mode; 608 608 ), 609 - TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d, " 609 + TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", link_id: %d, " 610 610 "key_index: %u, mode: %u, pairwise: %s, " 611 611 "mac addr: %pM", 612 - WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->link_id, 612 + WIPHY_PR_ARG, WDEV_PR_ARG, __entry->link_id, 613 613 __entry->key_index, __entry->mode, 614 614 BOOL_TO_STR(__entry->pairwise), __entry->mac_addr) 615 615 ); ··· 642 642 ); 643 643 644 644 TRACE_EVENT(rdev_set_default_mgmt_key, 645 - TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id, 645 + TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id, 646 646 u8 key_index), 647 - TP_ARGS(wiphy, netdev, link_id, key_index), 647 + TP_ARGS(wiphy, wdev, link_id, key_index), 648 648 TP_STRUCT__entry( 649 649 WIPHY_ENTRY 650 - NETDEV_ENTRY 650 + WDEV_ENTRY 651 651 __field(int, link_id) 652 652 __field(u8, key_index) 653 653 ), 654 654 TP_fast_assign( 655 655 WIPHY_ASSIGN; 656 - NETDEV_ASSIGN; 656 + WDEV_ASSIGN; 657 657 __entry->link_id = link_id; 658 658 __entry->key_index = key_index; 659 659 ), 660 - TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d, " 661 - "key index: %u", WIPHY_PR_ARG, NETDEV_PR_ARG, 662 - __entry->link_id, __entry->key_index) 660 + TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", link_id: %d, key index: %u", 661 + WIPHY_PR_ARG, WDEV_PR_ARG, __entry->link_id, 662 + __entry->key_index) 663 663 ); 664 664 665 665 TRACE_EVENT(rdev_set_default_beacon_key, 666 - TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id, 666 + TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id, 667 667 u8 key_index), 668 - TP_ARGS(wiphy, netdev, link_id, key_index), 668 + TP_ARGS(wiphy, wdev, link_id, key_index), 669 669 TP_STRUCT__entry( 670 670 WIPHY_ENTRY 671 - NETDEV_ENTRY 671 + WDEV_ENTRY 672 672 __field(int, link_id) 673 673 __field(u8, key_index) 674 674 ), 675 675 TP_fast_assign( 676 676 WIPHY_ASSIGN; 677 - NETDEV_ASSIGN; 677 + WDEV_ASSIGN; 678 678 __entry->link_id = link_id; 679 679 __entry->key_index = key_index; 680 680 ), 681 - TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d, " 682 - "key index: %u", WIPHY_PR_ARG, NETDEV_PR_ARG, 683 - __entry->link_id, __entry->key_index) 681 + TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", link_id: %d, key index: %u", 682 + WIPHY_PR_ARG, WDEV_PR_ARG, __entry->link_id, 683 + __entry->key_index) 684 684 ); 685 685 686 686 TRACE_EVENT(rdev_start_ap, ··· 856 856 ); 857 857 858 858 DECLARE_EVENT_CLASS(station_add_change, 859 - TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac, 859 + TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u8 *mac, 860 860 struct station_parameters *params), 861 - TP_ARGS(wiphy, netdev, mac, params), 861 + TP_ARGS(wiphy, wdev, mac, params), 862 862 TP_STRUCT__entry( 863 863 WIPHY_ENTRY 864 - NETDEV_ENTRY 864 + WDEV_ENTRY 865 865 MAC_ENTRY(sta_mac) 866 866 __field(u32, sta_flags_mask) 867 867 __field(u32, sta_flags_set) ··· 888 888 ), 889 889 TP_fast_assign( 890 890 WIPHY_ASSIGN; 891 - NETDEV_ASSIGN; 891 + WDEV_ASSIGN; 892 892 MAC_ASSIGN(sta_mac, mac); 893 893 __entry->sta_flags_mask = params->sta_flags_mask; 894 894 __entry->sta_flags_set = params->sta_flags_set; ··· 936 936 __entry->opmode_notif_used = 937 937 params->link_sta_params.opmode_notif_used; 938 938 ), 939 - TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: %pM" 939 + TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", station mac: %pM" 940 940 ", station flags mask: 0x%x, station flags set: 0x%x, " 941 941 "station modify mask: 0x%x, listen interval: %d, aid: %u, " 942 942 "plink action: %u, plink state: %u, uapsd queues: %u, vlan:%s", 943 - WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->sta_mac, 943 + WIPHY_PR_ARG, WDEV_PR_ARG, __entry->sta_mac, 944 944 __entry->sta_flags_mask, __entry->sta_flags_set, 945 945 __entry->sta_modify_mask, __entry->listen_interval, 946 946 __entry->aid, __entry->plink_action, __entry->plink_state, ··· 948 948 ); 949 949 950 950 DEFINE_EVENT(station_add_change, rdev_add_station, 951 - TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac, 951 + TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u8 *mac, 952 952 struct station_parameters *params), 953 - TP_ARGS(wiphy, netdev, mac, params) 953 + TP_ARGS(wiphy, wdev, mac, params) 954 954 ); 955 955 956 956 DEFINE_EVENT(station_add_change, rdev_change_station, 957 - TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac, 957 + TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u8 *mac, 958 958 struct station_parameters *params), 959 - TP_ARGS(wiphy, netdev, mac, params) 959 + TP_ARGS(wiphy, wdev, mac, params) 960 960 ); 961 961 962 962 DECLARE_EVENT_CLASS(wiphy_netdev_mac_evt, ··· 977 977 ); 978 978 979 979 DECLARE_EVENT_CLASS(station_del, 980 - TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, 980 + TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, 981 981 struct station_del_parameters *params), 982 - TP_ARGS(wiphy, netdev, params), 982 + TP_ARGS(wiphy, wdev, params), 983 983 TP_STRUCT__entry( 984 984 WIPHY_ENTRY 985 - NETDEV_ENTRY 985 + WDEV_ENTRY 986 986 MAC_ENTRY(sta_mac) 987 987 __field(u8, subtype) 988 988 __field(u16, reason_code) ··· 990 990 ), 991 991 TP_fast_assign( 992 992 WIPHY_ASSIGN; 993 - NETDEV_ASSIGN; 993 + WDEV_ASSIGN; 994 994 MAC_ASSIGN(sta_mac, params->mac); 995 995 __entry->subtype = params->subtype; 996 996 __entry->reason_code = params->reason_code; 997 997 __entry->link_id = params->link_id; 998 998 ), 999 - TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: %pM" 999 + TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", station mac: %pM" 1000 1000 ", subtype: %u, reason_code: %u, link_id: %d", 1001 - WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->sta_mac, 1001 + WIPHY_PR_ARG, WDEV_PR_ARG, __entry->sta_mac, 1002 1002 __entry->subtype, __entry->reason_code, 1003 1003 __entry->link_id) 1004 1004 ); 1005 1005 1006 1006 DEFINE_EVENT(station_del, rdev_del_station, 1007 - TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, 1007 + TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, 1008 1008 struct station_del_parameters *params), 1009 - TP_ARGS(wiphy, netdev, params) 1009 + TP_ARGS(wiphy, wdev, params) 1010 1010 ); 1011 1011 1012 - DEFINE_EVENT(wiphy_netdev_mac_evt, rdev_get_station, 1013 - TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac), 1014 - TP_ARGS(wiphy, netdev, mac) 1012 + DECLARE_EVENT_CLASS(wiphy_wdev_mac_evt, 1013 + TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, const u8 *mac), 1014 + TP_ARGS(wiphy, wdev, mac), 1015 + TP_STRUCT__entry( 1016 + WIPHY_ENTRY 1017 + WDEV_ENTRY 1018 + MAC_ENTRY(sta_mac) 1019 + ), 1020 + TP_fast_assign( 1021 + WIPHY_ASSIGN; 1022 + WDEV_ASSIGN; 1023 + MAC_ASSIGN(sta_mac, mac); 1024 + ), 1025 + TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", mac: %pM", 1026 + WIPHY_PR_ARG, WDEV_PR_ARG, __entry->sta_mac) 1027 + ); 1028 + 1029 + DEFINE_EVENT(wiphy_wdev_mac_evt, rdev_get_station, 1030 + TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, const u8 *mac), 1031 + TP_ARGS(wiphy, wdev, mac) 1015 1032 ); 1016 1033 1017 1034 DEFINE_EVENT(wiphy_netdev_mac_evt, rdev_del_mpath, ··· 1037 1020 ); 1038 1021 1039 1022 TRACE_EVENT(rdev_dump_station, 1040 - TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int _idx, 1023 + TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int _idx, 1041 1024 u8 *mac), 1042 - TP_ARGS(wiphy, netdev, _idx, mac), 1025 + TP_ARGS(wiphy, wdev, _idx, mac), 1043 1026 TP_STRUCT__entry( 1044 1027 WIPHY_ENTRY 1045 - NETDEV_ENTRY 1028 + WDEV_ENTRY 1046 1029 MAC_ENTRY(sta_mac) 1047 1030 __field(int, idx) 1048 1031 ), 1049 1032 TP_fast_assign( 1050 1033 WIPHY_ASSIGN; 1051 - NETDEV_ASSIGN; 1034 + WDEV_ASSIGN; 1052 1035 MAC_ASSIGN(sta_mac, mac); 1053 1036 __entry->idx = _idx; 1054 1037 ), 1055 - TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: %pM, idx: %d", 1056 - WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->sta_mac, 1038 + TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", station mac: %pM, idx: %d", 1039 + WIPHY_PR_ARG, WDEV_PR_ARG, __entry->sta_mac, 1057 1040 __entry->idx) 1058 1041 ); 1059 1042 ··· 3170 3153 NETDEV_PR_ARG, __entry->macaddr) 3171 3154 ); 3172 3155 3156 + DECLARE_EVENT_CLASS(cfg80211_wdev_mac_evt, 3157 + TP_PROTO(struct wireless_dev *wdev, const u8 *macaddr), 3158 + TP_ARGS(wdev, macaddr), 3159 + TP_STRUCT__entry( 3160 + WDEV_ENTRY 3161 + MAC_ENTRY(macaddr) 3162 + ), 3163 + TP_fast_assign( 3164 + WDEV_ASSIGN; 3165 + MAC_ASSIGN(macaddr, macaddr); 3166 + ), 3167 + TP_printk(WDEV_PR_FMT ", mac: %pM", 3168 + WDEV_PR_ARG, __entry->macaddr) 3169 + ); 3170 + 3173 3171 DEFINE_EVENT(cfg80211_netdev_mac_evt, cfg80211_notify_new_peer_candidate, 3174 3172 TP_PROTO(struct net_device *netdev, const u8 *macaddr), 3175 3173 TP_ARGS(netdev, macaddr) ··· 3374 3342 ); 3375 3343 3376 3344 TRACE_EVENT(cfg80211_new_sta, 3377 - TP_PROTO(struct net_device *netdev, const u8 *mac_addr, 3345 + TP_PROTO(struct wireless_dev *wdev, const u8 *mac_addr, 3378 3346 struct station_info *sinfo), 3379 - TP_ARGS(netdev, mac_addr, sinfo), 3347 + TP_ARGS(wdev, mac_addr, sinfo), 3380 3348 TP_STRUCT__entry( 3381 - NETDEV_ENTRY 3349 + WDEV_ENTRY 3382 3350 MAC_ENTRY(mac_addr) 3383 3351 SINFO_ENTRY 3384 3352 ), 3385 3353 TP_fast_assign( 3386 - NETDEV_ASSIGN; 3354 + WDEV_ASSIGN; 3387 3355 MAC_ASSIGN(mac_addr, mac_addr); 3388 3356 SINFO_ASSIGN; 3389 3357 ), 3390 - TP_printk(NETDEV_PR_FMT ", %pM", 3391 - NETDEV_PR_ARG, __entry->mac_addr) 3358 + TP_printk(WDEV_PR_FMT ", %pM", 3359 + WDEV_PR_ARG, __entry->mac_addr) 3392 3360 ); 3393 3361 3394 - DEFINE_EVENT(cfg80211_netdev_mac_evt, cfg80211_del_sta, 3395 - TP_PROTO(struct net_device *netdev, const u8 *macaddr), 3396 - TP_ARGS(netdev, macaddr) 3362 + DEFINE_EVENT(cfg80211_wdev_mac_evt, cfg80211_del_sta, 3363 + TP_PROTO(struct wireless_dev *wdev, const u8 *macaddr), 3364 + TP_ARGS(wdev, macaddr) 3397 3365 ); 3398 3366 3399 3367 TRACE_EVENT(cfg80211_rx_mgmt, ··· 4256 4224 TP_printk(WDEV_PR_FMT " cluster_id %pMF%s", 4257 4225 WDEV_PR_ARG, __entry->cluster_id, 4258 4226 __entry->new_cluster ? " [new]" : "") 4227 + ); 4228 + 4229 + TRACE_EVENT(cfg80211_incumbent_signal_notify, 4230 + TP_PROTO(struct wiphy *wiphy, 4231 + const struct cfg80211_chan_def *chandef, 4232 + u32 signal_interference_bitmap), 4233 + TP_ARGS(wiphy, chandef, signal_interference_bitmap), 4234 + TP_STRUCT__entry( 4235 + WIPHY_ENTRY 4236 + CHAN_DEF_ENTRY 4237 + __field(u32, signal_interference_bitmap) 4238 + ), 4239 + TP_fast_assign( 4240 + WIPHY_ASSIGN; 4241 + CHAN_DEF_ASSIGN(chandef); 4242 + __entry->signal_interference_bitmap = signal_interference_bitmap; 4243 + ), 4244 + TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", signal_interference_bitmap=0x%x", 4245 + WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->signal_interference_bitmap) 4259 4246 ); 4260 4247 #endif /* !__RDEV_OPS_TRACE || TRACE_HEADER_MULTI_READ */ 4261 4248
+2 -2
net/wireless/util.c
··· 1095 1095 for (i = 0; i < 4; i++) { 1096 1096 if (!wdev->connect_keys->params[i].cipher) 1097 1097 continue; 1098 - if (rdev_add_key(rdev, dev, -1, i, false, NULL, 1098 + if (rdev_add_key(rdev, wdev, -1, i, false, NULL, 1099 1099 &wdev->connect_keys->params[i])) { 1100 1100 netdev_err(dev, "failed to set key %d\n", i); 1101 1101 continue; ··· 2669 2669 2670 2670 guard(wiphy)(&rdev->wiphy); 2671 2671 2672 - return rdev_get_station(rdev, dev, mac_addr, sinfo); 2672 + return rdev_get_station(rdev, wdev, mac_addr, sinfo); 2673 2673 } 2674 2674 EXPORT_SYMBOL(cfg80211_get_station); 2675 2675
+6 -6
net/wireless/wext-compat.c
··· 7 7 * we directly assign the wireless handlers of wireless interfaces. 8 8 * 9 9 * Copyright 2008-2009 Johannes Berg <johannes@sipsolutions.net> 10 - * Copyright (C) 2019-2023 Intel Corporation 10 + * Copyright (C) 2019-2023, 2026 Intel Corporation 11 11 */ 12 12 13 13 #include <linux/export.h> ··· 457 457 !(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN)) 458 458 err = -ENOENT; 459 459 else 460 - err = rdev_del_key(rdev, dev, -1, idx, pairwise, 460 + err = rdev_del_key(rdev, wdev, -1, idx, pairwise, 461 461 addr); 462 462 } 463 463 wdev->wext.connect.privacy = false; ··· 496 496 if (wdev->connected || 497 497 (wdev->iftype == NL80211_IFTYPE_ADHOC && 498 498 wdev->u.ibss.current_bss)) 499 - err = rdev_add_key(rdev, dev, -1, idx, pairwise, addr, params); 499 + err = rdev_add_key(rdev, wdev, -1, idx, pairwise, addr, params); 500 500 else if (params->cipher != WLAN_CIPHER_SUITE_WEP40 && 501 501 params->cipher != WLAN_CIPHER_SUITE_WEP104) 502 502 return -EINVAL; ··· 549 549 if (wdev->connected || 550 550 (wdev->iftype == NL80211_IFTYPE_ADHOC && 551 551 wdev->u.ibss.current_bss)) 552 - err = rdev_set_default_mgmt_key(rdev, dev, -1, idx); 552 + err = rdev_set_default_mgmt_key(rdev, wdev, -1, idx); 553 553 if (!err) 554 554 wdev->wext.default_mgmt_key = idx; 555 555 return err; ··· 1261 1261 return err; 1262 1262 1263 1263 scoped_guard(wiphy, &rdev->wiphy) { 1264 - err = rdev_get_station(rdev, dev, addr, &sinfo); 1264 + err = rdev_get_station(rdev, wdev, addr, &sinfo); 1265 1265 } 1266 1266 if (err) 1267 1267 return err; ··· 1305 1305 1306 1306 memset(&sinfo, 0, sizeof(sinfo)); 1307 1307 1308 - ret = rdev_get_station(rdev, dev, bssid, &sinfo); 1308 + ret = rdev_get_station(rdev, wdev, bssid, &sinfo); 1309 1309 wiphy_unlock(&rdev->wiphy); 1310 1310 1311 1311 if (ret)