History

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

Johannes Berg says: ==================== Aside from various small improvements/cleanups, not much: - cfg80211/mac80211: S1G and UHR improvements - hwsim: incumbent signal report test support * tag 'wireless-next-2026-03-19' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (31 commits) qtnfmac: use alloc_netdev macro for single queue devices wifi: libertas: don't kill URBs in interrupt context wifi: libertas: use USB anchors for tracking in-flight URBs wifi: nl80211: use int for band coming from netlink wifi: rsi_91x_usb: do not pause rfkill polling when stopping mac80211 wifi: mac80211: fix STA link removal during link removal wifi: nl80211: reject S1G/60G with HT chantype wifi: ieee80211: fix definition of EHT-MCS 15 in MRU wifi: cfg80211: check non-S1G width with S1G chandef wifi: cfg80211: restrict cfg80211_chandef_create() to only HT-based bands wifi: mac80211: don't use cfg80211_chandef_create() for default chandef wifi: mac80211: Remove deleted sta links in ieee80211_ml_reconf_work() wifi: b43: use register definitions in nphy_op_software_rfkill wifi: cfg80211: split control freq check from chandef check wifi: mac80211: always use full chanctx compatible check wifi: mac80211: refactor chandef tracing macros wifi: mac80211: validate HE 6 GHz operation when EHT is used wifi: nl80211: split out UHR operation information wifi: mwifiex: drop redundant device reference wifi: rt2x00: drop redundant device reference ... ====================

Paolo Abeni committed 8 months ago

Commit 9ac76f32 parents 96450df dee55bc65 files · +735 −682Browse files

Unified · Split

65 files
  1. drivers/net/wireless/ath/ath11k/mac.c +2 −2
  2. drivers/net/wireless/ath/ath12k/mac.c +2 −2
  3. drivers/net/wireless/ath/ath12k/wifi7/hw.c +1 −1
  4. drivers/net/wireless/atmel/at76c50x-usb.c +4 −8
  5. drivers/net/wireless/broadcom/b43/phy_n.c +13 −13
  6. drivers/net/wireless/intel/iwlwifi/mld/time_sync.c +3 −3
  7. drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +3 −4
  8. drivers/net/wireless/intel/iwlwifi/mvm/time-sync.c +3 −3
  9. drivers/net/wireless/marvell/libertas/if_usb.c +22 −13
  10. drivers/net/wireless/marvell/libertas/if_usb.h +3 −0
  11. drivers/net/wireless/marvell/libertas_tf/if_usb.c +0 −2
  12. drivers/net/wireless/marvell/mwifiex/tdls.c +4 −8
  13. drivers/net/wireless/marvell/mwifiex/usb.c +0 −4
  14. drivers/net/wireless/marvell/mwl8k.c +2 −2
  15. drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c +3 −3
  16. drivers/net/wireless/mediatek/mt76/mt7925/mac.c +2 −2
  17. drivers/net/wireless/mediatek/mt76/mt7996/mac.c +2 −2
  18. drivers/net/wireless/quantenna/qtnfmac/core.c +2 −2
  19. drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +1 −11
  20. drivers/net/wireless/realtek/rtl8xxxu/core.c +7 −7
  21. drivers/net/wireless/realtek/rtlwifi/base.c +14 −14
  22. drivers/net/wireless/realtek/rtlwifi/pci.c +1 −1
  23. drivers/net/wireless/rsi/rsi_91x_mac80211.c +16 −1
  24. drivers/net/wireless/rsi/rsi_91x_usb.c +2 −0
  25. drivers/net/wireless/rsi/rsi_common.h +1 −0
  26. drivers/net/wireless/silabs/wfx/data_rx.c +4 −4
  27. drivers/net/wireless/virtual/mac80211_hwsim.c +64 −0
  28. include/linux/ieee80211-eht.h +2 −2
  29. include/linux/ieee80211-ht.h +3 −0
  30. include/linux/ieee80211-uhr.h +2 −2
  31. include/linux/ieee80211.h +32 −53
  32. include/net/mac80211.h +4 −0
  33. include/uapi/linux/nl80211.h +6 −0
  34. net/mac80211/agg-rx.c +34 −15
  35. net/mac80211/agg-tx.c +22 −17
  36. net/mac80211/chan.c +37 −49
  37. net/mac80211/debugfs.c +1 −0
  38. net/mac80211/eht.c +10 −11
  39. net/mac80211/ht.c +20 −17
  40. net/mac80211/ibss.c +5 −13
  41. net/mac80211/ieee80211_i.h +5 −1
  42. net/mac80211/iface.c +12 −9
  43. net/mac80211/main.c +15 −3
  44. net/mac80211/mesh.c +6 −8
  45. net/mac80211/mesh_hwmp.c +8 −12
  46. net/mac80211/mesh_plink.c +10 −11
  47. net/mac80211/mlme.c +66 −47
  48. net/mac80211/rx.c +60 −74
  49. net/mac80211/s1g.c +22 −14
  50. net/mac80211/spectmgmt.c +13 −18
  51. net/mac80211/sta_info.h +2 −1
  52. net/mac80211/tdls.c +12 −17
  53. net/mac80211/trace.h +41 −59
  54. net/mac80211/util.c +2 −3
  55. net/mac80211/vht.c +5 −5
  56. net/wireless/chan.c +65 −45
  57. net/wireless/nl80211.c +24 −13
  58. net/wireless/of.c +1 −12
  59. net/wireless/radiotap.c +1 −9
  60. net/wireless/reg.c +1 −12
  61. net/wireless/reg.h +1 −12
  62. net/wireless/trace.c +1 −0
  63. net/wireless/wext-core.c +1 −2
  64. net/wireless/wext-priv.c +1 −2
  65. net/wireless/wext-proc.c +1 −2
drivers/net/wireless/ath/ath11k/mac.c+2−2
@@ -6288,10 +6288,10 @@ static int ath11k_mac_mgmt_action_frame_fill_elem_data(struct ath11k_vif *arvif, · 6287 unmodified lines
62886288 lockdep_assert_held(&ar->conf_mutex);
62896289
62906290 /* make sure category field is present */
6291− if (skb->len < IEEE80211_MIN_ACTION_SIZE)
6291+ if (skb->len < IEEE80211_MIN_ACTION_SIZE(category))
62926292 return -EINVAL;
62936293
6294− remaining_len = skb->len - IEEE80211_MIN_ACTION_SIZE;
6294+ remaining_len = skb->len - IEEE80211_MIN_ACTION_SIZE(category);
62956295 has_protected = ieee80211_has_protected(hdr->frame_control);
62966296
62976297 /* In case of SW crypto and hdr protected (PMF), packet will already be encrypted,
drivers/net/wireless/ath/ath12k/mac.c+2−2
@@ -9119,10 +9119,10 @@ static int ath12k_mac_mgmt_action_frame_fill_elem_data(struct ath12k_link_vif *a · 9118 unmodified lines
91199119 lockdep_assert_wiphy(wiphy);
91209120
91219121 /* make sure category field is present */
9122− if (skb->len < IEEE80211_MIN_ACTION_SIZE)
9122+ if (skb->len < IEEE80211_MIN_ACTION_SIZE(category))
91239123 return -EINVAL;
91249124
9125− remaining_len = skb->len - IEEE80211_MIN_ACTION_SIZE;
9125+ remaining_len = skb->len - IEEE80211_MIN_ACTION_SIZE(category);
91269126 has_protected = ieee80211_has_protected(hdr->frame_control);
91279127
91289128 /* In case of SW crypto and hdr protected (PMF), packet will already be encrypted,
drivers/net/wireless/ath/ath12k/wifi7/hw.c+1−1
@@ -104,7 +104,7 @@ static bool ath12k_is_addba_resp_action_code(struct ieee80211_mgmt *mgmt) · 103 unmodified lines
104104 if (mgmt->u.action.category != WLAN_CATEGORY_BACK)
105105 return false;
106106
107− if (mgmt->u.action.u.addba_resp.action_code != WLAN_ACTION_ADDBA_RESP)
107+ if (mgmt->u.action.action_code != WLAN_ACTION_ADDBA_RESP)
108108 return false;
109109
110110 return true;
drivers/net/wireless/atmel/at76c50x-usb.c+4−8
@@ -2440,13 +2440,11 @@ static int at76_probe(struct usb_interface *interface, · 2439 unmodified lines
24402440 struct mib_fw_version *fwv;
24412441 int board_type = (int)id->driver_info;
24422442
2443− udev = usb_get_dev(interface_to_usbdev(interface));
2443+ udev = interface_to_usbdev(interface);
24442444
24452445 fwv = kmalloc_obj(*fwv);
2446− if (!fwv) {
2447− ret = -ENOMEM;
2448− goto exit;
2449− }
2446+ if (!fwv)
2447+ return -ENOMEM;
24502448
24512449 /* Load firmware into kernel memory */
24522450 fwe = at76_load_firmware(udev, board_type);
@@ -2534,8 +2532,7 @@ static int at76_probe(struct usb_interface *interface, · 81 unmodified lines
25342532
25352533 exit:
25362534 kfree(fwv);
2537− if (ret < 0)
2538− usb_put_dev(udev);
2535+
25392536 return ret;
25402537 }
25412538
@@ -2552,7 +2549,6 @@ static void at76_disconnect(struct usb_interface *interface) · 10 unmodified lines
25522549
25532550 wiphy_info(priv->hw->wiphy, "disconnecting\n");
25542551 at76_delete_device(priv);
2555− usb_put_dev(interface_to_usbdev(interface));
25562552 dev_info(&interface->dev, "disconnected\n");
25572553 }
25582554
drivers/net/wireless/broadcom/b43/phy_n.c+13−13
@@ -6566,19 +6566,19 @@ static void b43_nphy_op_software_rfkill(struct b43_wldev *dev, · 6565 unmodified lines
65666566
65676567 b43_radio_mask(dev, 0x09, ~0x2);
65686568
6569− b43_radio_write(dev, 0x204D, 0);
6570− b43_radio_write(dev, 0x2053, 0);
6571− b43_radio_write(dev, 0x2058, 0);
6572− b43_radio_write(dev, 0x205E, 0);
6573− b43_radio_mask(dev, 0x2062, ~0xF0);
6574− b43_radio_write(dev, 0x2064, 0);
6575−
6576− b43_radio_write(dev, 0x304D, 0);
6577− b43_radio_write(dev, 0x3053, 0);
6578− b43_radio_write(dev, 0x3058, 0);
6579− b43_radio_write(dev, 0x305E, 0);
6580− b43_radio_mask(dev, 0x3062, ~0xF0);
6581− b43_radio_write(dev, 0x3064, 0);
6569+ b43_radio_write(dev, B2056_TX0 | B2056_TX_PADA_BOOST_TUNE, 0);
6570+ b43_radio_write(dev, B2056_TX0 | B2056_TX_PADG_BOOST_TUNE, 0);
6571+ b43_radio_write(dev, B2056_TX0 | B2056_TX_PGAA_BOOST_TUNE, 0);
6572+ b43_radio_write(dev, B2056_TX0 | B2056_TX_PGAG_BOOST_TUNE, 0);
6573+ b43_radio_mask(dev, B2056_TX0 | B2056_TX_MIXA_BOOST_TUNE, ~0xF0);
6574+ b43_radio_write(dev, B2056_TX0 | B2056_TX_MIXG_BOOST_TUNE, 0);
6575+
6576+ b43_radio_write(dev, B2056_TX1 | B2056_TX_PADA_BOOST_TUNE, 0);
6577+ b43_radio_write(dev, B2056_TX1 | B2056_TX_PADG_BOOST_TUNE, 0);
6578+ b43_radio_write(dev, B2056_TX1 | B2056_TX_PGAA_BOOST_TUNE, 0);
6579+ b43_radio_write(dev, B2056_TX1 | B2056_TX_PGAG_BOOST_TUNE, 0);
6580+ b43_radio_mask(dev, B2056_TX1 | B2056_TX_MIXA_BOOST_TUNE, ~0xF0);
6581+ b43_radio_write(dev, B2056_TX1 | B2056_TX_MIXG_BOOST_TUNE, 0);
65826582 }
65836583 } else {
65846584 if (phy->rev >= 19) {
drivers/net/wireless/intel/iwlwifi/mld/time_sync.c+3−3
@@ -1,6 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
22 /*
3− * Copyright (C) 2025 Intel Corporation
3+ * Copyright (C) 2025-2026 Intel Corporation
44 */
55
66 #include "mld.h"
@@ -116,9 +116,9 @@ static bool iwl_mld_is_skb_match(struct sk_buff *skb, u8 *addr, u8 dialog_token) · 109 unmodified lines
116116 u8 skb_dialog_token;
117117
118118 if (ieee80211_is_timing_measurement(skb))
119− skb_dialog_token = mgmt->u.action.u.wnm_timing_msr.dialog_token;
119+ skb_dialog_token = mgmt->u.action.wnm_timing_msr.dialog_token;
120120 else
121− skb_dialog_token = mgmt->u.action.u.ftm.dialog_token;
121+ skb_dialog_token = mgmt->u.action.ftm.dialog_token;
122122
123123 if ((ether_addr_equal(mgmt->sa, addr) ||
124124 ether_addr_equal(mgmt->da, addr)) &&
drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c+3−4
@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
22 /*
33 * Copyright (C) 2015-2017 Intel Deutschland GmbH
4− * Copyright (C) 2018-2025 Intel Corporation
4+ * Copyright (C) 2018-2026 Intel Corporation
55 */
66 #include <linux/etherdevice.h>
77 #include <linux/math64.h>
@@ -1409,8 +1409,7 @@ void iwl_mvm_ftm_lc_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) · 1401 unmodified lines
14091409 struct iwl_mvm_loc_entry *entry;
14101410 const u8 *ies, *lci, *civic, *msr_ie;
14111411 size_t ies_len, lci_len = 0, civic_len = 0;
1412− size_t baselen = IEEE80211_MIN_ACTION_SIZE +
1413− sizeof(mgmt->u.action.u.ftm);
1412+ size_t baselen = IEEE80211_MIN_ACTION_SIZE(ftm);
14141413 static const u8 rprt_type_lci = IEEE80211_SPCT_MSR_RPRT_TYPE_LCI;
14151414 static const u8 rprt_type_civic = IEEE80211_SPCT_MSR_RPRT_TYPE_CIVIC;
14161415
@@ -1419,7 +1418,7 @@ void iwl_mvm_ftm_lc_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) · 2 unmodified lines
14191418
14201419 lockdep_assert_held(&mvm->mutex);
14211420
1422− ies = mgmt->u.action.u.ftm.variable;
1421+ ies = mgmt->u.action.ftm.variable;
14231422 ies_len = len - baselen;
14241423
14251424 msr_ie = cfg80211_find_ie_match(WLAN_EID_MEASURE_REPORT, ies, ies_len,
drivers/net/wireless/intel/iwlwifi/mvm/time-sync.c+3−3
@@ -1,6 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
22 /*
3− * Copyright (C) 2022 Intel Corporation
3+ * Copyright (C) 2022, 2026 Intel Corporation
44 */
55
66 #include "mvm.h"
@@ -18,9 +18,9 @@ static bool iwl_mvm_is_skb_match(struct sk_buff *skb, u8 *addr, u8 dialog_token) · 11 unmodified lines
1818 u8 skb_dialog_token;
1919
2020 if (ieee80211_is_timing_measurement(skb))
21− skb_dialog_token = mgmt->u.action.u.wnm_timing_msr.dialog_token;
21+ skb_dialog_token = mgmt->u.action.wnm_timing_msr.dialog_token;
2222 else
23− skb_dialog_token = mgmt->u.action.u.ftm.dialog_token;
23+ skb_dialog_token = mgmt->u.action.ftm.dialog_token;
2424
2525 if ((ether_addr_equal(mgmt->sa, addr) ||
2626 ether_addr_equal(mgmt->da, addr)) &&
drivers/net/wireless/marvell/libertas/if_usb.c+22−13
@@ -114,8 +114,8 @@ static void if_usb_write_bulk_callback(struct urb *urb) · 113 unmodified lines
114114 static void if_usb_free(struct if_usb_card *cardp)
115115 {
116116 /* Unlink tx & rx urb */
117− usb_kill_urb(cardp->tx_urb);
118− usb_kill_urb(cardp->rx_urb);
117+ usb_kill_anchored_urbs(&cardp->tx_submitted);
118+ usb_kill_anchored_urbs(&cardp->rx_submitted);
119119
120120 usb_free_urb(cardp->tx_urb);
121121 cardp->tx_urb = NULL;
@@ -221,6 +221,9 @@ static int if_usb_probe(struct usb_interface *intf, · 99 unmodified lines
221221 udev->descriptor.bDeviceSubClass,
222222 udev->descriptor.bDeviceProtocol);
223223
224+ init_usb_anchor(&cardp->rx_submitted);
225+ init_usb_anchor(&cardp->tx_submitted);
226+
224227 for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
225228 endpoint = &iface_desc->endpoint[i].desc;
226229 if (usb_endpoint_is_bulk_in(endpoint)) {
@@ -276,7 +279,6 @@ static int if_usb_probe(struct usb_interface *intf, · 49 unmodified lines
276279
277280 cardp->boot2_version = udev->descriptor.bcdDevice;
278281
279− usb_get_dev(udev);
280282 usb_set_intfdata(intf, cardp);
281283
282284 r = lbs_get_firmware_async(priv, &udev->dev, cardp->model,
@@ -287,7 +289,6 @@ static int if_usb_probe(struct usb_interface *intf, · 4 unmodified lines
287289 return 0;
288290
289291 err_get_fw:
290− usb_put_dev(udev);
291292 lbs_remove_card(priv);
292293 err_add_card:
293294 if_usb_reset_device(cardp);
@@ -321,7 +322,6 @@ static void if_usb_disconnect(struct usb_interface *intf) · 27 unmodified lines
321322 kfree(cardp);
322323
323324 usb_set_intfdata(intf, NULL);
324− usb_put_dev(interface_to_usbdev(intf));
325325 }
326326
327327 /**
@@ -426,7 +426,12 @@ static int usb_tx_block(struct if_usb_card *cardp, uint8_t *payload, uint16_t nb · 98 unmodified lines
426426 goto tx_ret;
427427 }
428428
429− usb_kill_urb(cardp->tx_urb);
429+ /* check if there are pending URBs */
430+ if (!usb_anchor_empty(&cardp->tx_submitted)) {
431+ lbs_deb_usbd(&cardp->udev->dev, "%s failed: pending URB\n", __func__);
432+ ret = -EBUSY;
433+ goto tx_ret;
434+ }
430435
431436 usb_fill_bulk_urb(cardp->tx_urb, cardp->udev,
432437 usb_sndbulkpipe(cardp->udev,
@@ -435,8 +440,10 @@ static int usb_tx_block(struct if_usb_card *cardp, uint8_t *payload, uint16_t nb · 2 unmodified lines
435440
436441 cardp->tx_urb->transfer_flags |= URB_ZERO_PACKET;
437442
443+ usb_anchor_urb(cardp->tx_urb, &cardp->tx_submitted);
438444 if ((ret = usb_submit_urb(cardp->tx_urb, GFP_ATOMIC))) {
439445 lbs_deb_usbd(&cardp->udev->dev, "usb_submit_urb failed: %d\n", ret);
446+ usb_unanchor_urb(cardp->tx_urb);
440447 } else {
441448 lbs_deb_usb2(&cardp->udev->dev, "usb_submit_urb success\n");
442449 ret = 0;
@@ -467,8 +474,10 @@ static int __if_usb_submit_rx_urb(struct if_usb_card *cardp, · 24 unmodified lines
467474 cardp);
468475
469476 lbs_deb_usb2(&cardp->udev->dev, "Pointer for rx_urb %p\n", cardp->rx_urb);
477+ usb_anchor_urb(cardp->rx_urb, &cardp->rx_submitted);
470478 if ((ret = usb_submit_urb(cardp->rx_urb, GFP_ATOMIC))) {
471479 lbs_deb_usbd(&cardp->udev->dev, "Submit Rx URB failed: %d\n", ret);
480+ usb_unanchor_urb(cardp->rx_urb);
472481 kfree_skb(skb);
473482 cardp->rx_skb = NULL;
474483 ret = -1;
@@ -838,8 +847,8 @@ static void if_usb_prog_firmware(struct lbs_private *priv, int ret, · 363 unmodified lines
838847 }
839848
840849 /* Cancel any pending usb business */
841− usb_kill_urb(cardp->rx_urb);
842− usb_kill_urb(cardp->tx_urb);
850+ usb_kill_anchored_urbs(&cardp->rx_submitted);
851+ usb_kill_anchored_urbs(&cardp->tx_submitted);
843852
844853 cardp->fwlastblksent = 0;
845854 cardp->fwdnldover = 0;
@@ -869,8 +878,8 @@ restart: · 23 unmodified lines
869878 if (cardp->bootcmdresp == BOOT_CMD_RESP_NOT_SUPPORTED) {
870879 /* Return to normal operation */
871880 ret = -EOPNOTSUPP;
872− usb_kill_urb(cardp->rx_urb);
873− usb_kill_urb(cardp->tx_urb);
881+ usb_kill_anchored_urbs(&cardp->rx_submitted);
882+ usb_kill_anchored_urbs(&cardp->tx_submitted);
874883 if (if_usb_submit_rx_urb(cardp) < 0)
875884 ret = -EIO;
876885 goto done;
@@ -900,7 +909,7 @@ restart: · 23 unmodified lines
900909 wait_event_interruptible(cardp->fw_wq, cardp->surprise_removed || cardp->fwdnldover);
901910
902911 timer_delete_sync(&cardp->fw_timeout);
903− usb_kill_urb(cardp->rx_urb);
912+ usb_kill_anchored_urbs(&cardp->rx_submitted);
904913
905914 if (!cardp->fwdnldover) {
906915 pr_info("failed to load fw, resetting device!\n");
@@ -960,8 +969,8 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message) · 53 unmodified lines
960969 goto out;
961970
962971 /* Unlink tx & rx urb */
963− usb_kill_urb(cardp->tx_urb);
964− usb_kill_urb(cardp->rx_urb);
972+ usb_kill_anchored_urbs(&cardp->tx_submitted);
973+ usb_kill_anchored_urbs(&cardp->rx_submitted);
965974
966975 out:
967976 return ret;
drivers/net/wireless/marvell/libertas/if_usb.h+3−0
@@ -48,6 +48,9 @@ struct if_usb_card { · 47 unmodified lines
4848 struct urb *rx_urb, *tx_urb;
4949 struct lbs_private *priv;
5050
51+ struct usb_anchor rx_submitted;
52+ struct usb_anchor tx_submitted;
53+
5154 struct sk_buff *rx_skb;
5255
5356 uint8_t ep_in;
drivers/net/wireless/marvell/libertas_tf/if_usb.c+0−2
@@ -223,7 +223,6 @@ static int if_usb_probe(struct usb_interface *intf, · 222 unmodified lines
223223 if (!priv)
224224 goto dealloc;
225225
226− usb_get_dev(udev);
227226 usb_set_intfdata(intf, cardp);
228227
229228 return 0;
@@ -258,7 +257,6 @@ static void if_usb_disconnect(struct usb_interface *intf) · 28 unmodified lines
258257 kfree(cardp);
259258
260259 usb_set_intfdata(intf, NULL);
261− usb_put_dev(interface_to_usbdev(intf));
262260
263261 lbtf_deb_leave(LBTF_DEB_MAIN);
264262 }
drivers/net/wireless/marvell/mwifiex/tdls.c+4−8
@@ -755,16 +755,12 @@ mwifiex_construct_tdls_action_frame(struct mwifiex_private *priv, · 754 unmodified lines
755755 switch (action_code) {
756756 case WLAN_PUB_ACTION_TDLS_DISCOVER_RES:
757757 /* See the layout of 'struct ieee80211_mgmt'. */
758− extra = sizeof(mgmt->u.action.u.tdls_discover_resp) +
759− sizeof(mgmt->u.action.category);
758+ extra = IEEE80211_MIN_ACTION_SIZE(tdls_discover_resp) - 24;
760759 skb_put(skb, extra);
761760 mgmt->u.action.category = WLAN_CATEGORY_PUBLIC;
762− mgmt->u.action.u.tdls_discover_resp.action_code =
763− WLAN_PUB_ACTION_TDLS_DISCOVER_RES;
764− mgmt->u.action.u.tdls_discover_resp.dialog_token =
765− dialog_token;
766− mgmt->u.action.u.tdls_discover_resp.capability =
767− cpu_to_le16(capab);
761+ mgmt->u.action.action_code = WLAN_PUB_ACTION_TDLS_DISCOVER_RES;
762+ mgmt->u.action.tdls_discover_resp.dialog_token = dialog_token;
763+ mgmt->u.action.tdls_discover_resp.capability = cpu_to_le16(capab);
768764 /* move back for addr4 */
769765 memmove(pos + ETH_ALEN, &mgmt->u.action, extra);
770766 /* init address 4 */
drivers/net/wireless/marvell/mwifiex/usb.c+0−4
@@ -520,8 +520,6 @@ static int mwifiex_usb_probe(struct usb_interface *intf, · 519 unmodified lines
520520 return ret;
521521 }
522522
523− usb_get_dev(udev);
524−
525523 return 0;
526524 }
527525
@@ -666,8 +664,6 @@ static void mwifiex_usb_disconnect(struct usb_interface *intf) · 138 unmodified lines
666664 mwifiex_dbg(adapter, FATAL,
667665 "%s: removing card\n", __func__);
668666 mwifiex_remove_card(adapter);
669−
670− usb_put_dev(interface_to_usbdev(intf));
671667 }
672668
673669 static void mwifiex_usb_coredump(struct device *dev)
drivers/net/wireless/marvell/mwl8k.c+2−2
@@ -1985,9 +1985,9 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, · 1984 unmodified lines
19851985 */
19861986 if (unlikely(ieee80211_is_action(wh->frame_control) &&
19871987 mgmt->u.action.category == WLAN_CATEGORY_BACK &&
1988− mgmt->u.action.u.addba_req.action_code == WLAN_ACTION_ADDBA_REQ &&
1988+ mgmt->u.action.action_code == WLAN_ACTION_ADDBA_REQ &&
19891989 priv->ap_fw)) {
1990− u16 capab = le16_to_cpu(mgmt->u.action.u.addba_req.capab);
1990+ u16 capab = le16_to_cpu(mgmt->u.action.addba_req.capab);
19911991 tid = (capab & IEEE80211_ADDBA_PARAM_TID_MASK) >> 2;
19921992 index = mwl8k_tid_queue_mapping(tid);
19931993 }
drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c+3−3
@@ -413,10 +413,10 @@ mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi, · 412 unmodified lines
413413 u32 val;
414414
415415 if (ieee80211_is_action(fc) &&
416− skb->len >= IEEE80211_MIN_ACTION_SIZE + 1 + 1 + 2 &&
416+ skb->len >= IEEE80211_MIN_ACTION_SIZE(addba_req.capab) &&
417417 mgmt->u.action.category == WLAN_CATEGORY_BACK &&
418− mgmt->u.action.u.addba_req.action_code == WLAN_ACTION_ADDBA_REQ) {
419− u16 capab = le16_to_cpu(mgmt->u.action.u.addba_req.capab);
418+ mgmt->u.action.action_code == WLAN_ACTION_ADDBA_REQ) {
419+ u16 capab = le16_to_cpu(mgmt->u.action.addba_req.capab);
420420
421421 txwi[5] |= cpu_to_le32(MT_TXD5_ADD_BA);
422422 tid = (capab >> 2) & IEEE80211_QOS_CTL_TID_MASK;
drivers/net/wireless/mediatek/mt76/mt7925/mac.c+2−2
@@ -668,9 +668,9 @@ mt7925_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi, · 667 unmodified lines
668668 u32 val;
669669
670670 if (ieee80211_is_action(fc) &&
671− skb->len >= IEEE80211_MIN_ACTION_SIZE + 1 &&
671+ skb->len >= IEEE80211_MIN_ACTION_SIZE(action_code) &&
672672 mgmt->u.action.category == WLAN_CATEGORY_BACK &&
673− mgmt->u.action.u.addba_req.action_code == WLAN_ACTION_ADDBA_REQ)
673+ mgmt->u.action.action_code == WLAN_ACTION_ADDBA_REQ)
674674 tid = MT_TX_ADDBA;
675675 else if (ieee80211_is_mgmt(hdr->frame_control))
676676 tid = MT_TX_NORMAL;
drivers/net/wireless/mediatek/mt76/mt7996/mac.c+2−2
@@ -800,9 +800,9 @@ mt7996_mac_write_txwi_80211(struct mt7996_dev *dev, __le32 *txwi, · 799 unmodified lines
800800 u32 val;
801801
802802 if (ieee80211_is_action(fc) &&
803− skb->len >= IEEE80211_MIN_ACTION_SIZE + 1 &&
803+ skb->len >= IEEE80211_MIN_ACTION_SIZE(action_code) &&
804804 mgmt->u.action.category == WLAN_CATEGORY_BACK &&
805− mgmt->u.action.u.addba_req.action_code == WLAN_ACTION_ADDBA_REQ) {
805+ mgmt->u.action.action_code == WLAN_ACTION_ADDBA_REQ) {
806806 if (is_mt7990(&dev->mt76))
807807 txwi[6] |= cpu_to_le32(FIELD_PREP(MT_TXD6_TID_ADDBA, tid));
808808 else
drivers/net/wireless/quantenna/qtnfmac/core.c+2−2
@@ -452,8 +452,8 @@ int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *vif, · 451 unmodified lines
452452 void *qdev_vif;
453453 int ret;
454454
455− dev = alloc_netdev_mqs(sizeof(struct qtnf_vif *), name,
456− name_assign_type, ether_setup, 1, 1);
455+ dev = alloc_netdev(sizeof(struct qtnf_vif *), name,
456+ name_assign_type, ether_setup);
457457 if (!dev)
458458 return -ENOMEM;
459459
drivers/net/wireless/ralink/rt2x00/rt2x00usb.c+1−11
@@ -802,14 +802,12 @@ int rt2x00usb_probe(struct usb_interface *usb_intf, · 801 unmodified lines
802802 struct rt2x00_dev *rt2x00dev;
803803 int retval;
804804
805− usb_dev = usb_get_dev(usb_dev);
806805 usb_reset_device(usb_dev);
807806
808807 hw = ieee80211_alloc_hw(sizeof(struct rt2x00_dev), ops->hw);
809808 if (!hw) {
810809 rt2x00_probe_err("Failed to allocate hardware\n");
811− retval = -ENOMEM;
812− goto exit_put_device;
810+ return -ENOMEM;
813811 }
814812
815813 usb_set_intfdata(usb_intf, hw);
@@ -851,10 +849,6 @@ exit_free_reg: · 35 unmodified lines
851849
852850 exit_free_device:
853851 ieee80211_free_hw(hw);
854−
855−exit_put_device:
856− usb_put_dev(usb_dev);
857−
858852 usb_set_intfdata(usb_intf, NULL);
859853
860854 return retval;
@@ -873,11 +867,7 @@ void rt2x00usb_disconnect(struct usb_interface *usb_intf) · 12 unmodified lines
873867 rt2x00usb_free_reg(rt2x00dev);
874868 ieee80211_free_hw(hw);
875869
876− /*
877− * Free the USB device data.
878− */
879870 usb_set_intfdata(usb_intf, NULL);
880− usb_put_dev(interface_to_usbdev(usb_intf));
881871 }
882872 EXPORT_SYMBOL_GPL(rt2x00usb_disconnect);
883873
drivers/net/wireless/realtek/rtl8xxxu/core.c+7−7
@@ -5146,10 +5146,10 @@ static void rtl8xxxu_dump_action(struct device *dev, · 5145 unmodified lines
51465146 if (!(rtl8xxxu_debug & RTL8XXXU_DEBUG_ACTION))
51475147 return;
51485148
5149− switch (mgmt->u.action.u.addba_resp.action_code) {
5149+ switch (mgmt->u.action.action_code) {
51505150 case WLAN_ACTION_ADDBA_RESP:
5151− cap = le16_to_cpu(mgmt->u.action.u.addba_resp.capab);
5152− timeout = le16_to_cpu(mgmt->u.action.u.addba_resp.timeout);
5151+ cap = le16_to_cpu(mgmt->u.action.addba_resp.capab);
5152+ timeout = le16_to_cpu(mgmt->u.action.addba_resp.timeout);
51535153 dev_info(dev, "WLAN_ACTION_ADDBA_RESP: "
51545154 "timeout %i, tid %02x, buf_size %02x, policy %02x, "
51555155 "status %02x\n",
@@ -5157,11 +5157,11 @@ static void rtl8xxxu_dump_action(struct device *dev, · 1 unmodified line
51575157 (cap & IEEE80211_ADDBA_PARAM_TID_MASK) >> 2,
51585158 (cap & IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK) >> 6,
51595159 (cap >> 1) & 0x1,
5160− le16_to_cpu(mgmt->u.action.u.addba_resp.status));
5160+ le16_to_cpu(mgmt->u.action.addba_resp.status));
51615161 break;
51625162 case WLAN_ACTION_ADDBA_REQ:
5163− cap = le16_to_cpu(mgmt->u.action.u.addba_req.capab);
5164− timeout = le16_to_cpu(mgmt->u.action.u.addba_req.timeout);
5163+ cap = le16_to_cpu(mgmt->u.action.addba_req.capab);
5164+ timeout = le16_to_cpu(mgmt->u.action.addba_req.timeout);
51655165 dev_info(dev, "WLAN_ACTION_ADDBA_REQ: "
51665166 "timeout %i, tid %02x, buf_size %02x, policy %02x\n",
51675167 timeout,
@@ -5171,7 +5171,7 @@ static void rtl8xxxu_dump_action(struct device *dev, · 3 unmodified lines
51715171 break;
51725172 default:
51735173 dev_info(dev, "action frame %02x\n",
5174− mgmt->u.action.u.addba_resp.action_code);
5174+ mgmt->u.action.action_code);
51755175 break;
51765176 }
51775177 }
drivers/net/wireless/realtek/rtlwifi/base.c+14−14
@@ -1409,7 +1409,7 @@ bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) · 1408 unmodified lines
14091409 sta_entry =
14101410 (struct rtl_sta_info *)sta->drv_priv;
14111411 capab =
1412− le16_to_cpu(mgmt->u.action.u.addba_req.capab);
1412+ le16_to_cpu(mgmt->u.action.addba_req.capab);
14131413 tid = (capab &
14141414 IEEE80211_ADDBA_PARAM_TID_MASK) >> 2;
14151415 if (tid >= MAX_TID_COUNT) {
@@ -2392,35 +2392,35 @@ static struct sk_buff *rtl_make_smps_action(struct ieee80211_hw *hw, · 976 unmodified lines
23922392 struct sk_buff *skb;
23932393 struct ieee80211_mgmt *action_frame;
23942394
2395− /* 27 = header + category + action + smps mode */
2396− skb = dev_alloc_skb(27 + hw->extra_tx_headroom);
2395+ skb = dev_alloc_skb(IEEE80211_MIN_ACTION_SIZE(ht_smps) +
2396+ hw->extra_tx_headroom);
23972397 if (!skb)
23982398 return NULL;
23992399
24002400 skb_reserve(skb, hw->extra_tx_headroom);
2401− action_frame = skb_put_zero(skb, 27);
2401+ action_frame = skb_put_zero(skb, IEEE80211_MIN_ACTION_SIZE(ht_smps));
24022402 memcpy(action_frame->da, da, ETH_ALEN);
24032403 memcpy(action_frame->sa, rtlefuse->dev_addr, ETH_ALEN);
24042404 memcpy(action_frame->bssid, bssid, ETH_ALEN);
24052405 action_frame->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
24062406 IEEE80211_STYPE_ACTION);
24072407 action_frame->u.action.category = WLAN_CATEGORY_HT;
2408− action_frame->u.action.u.ht_smps.action = WLAN_HT_ACTION_SMPS;
2408+ action_frame->u.action.action_code = WLAN_HT_ACTION_SMPS;
24092409 switch (smps) {
24102410 case IEEE80211_SMPS_AUTOMATIC:/* 0 */
24112411 case IEEE80211_SMPS_NUM_MODES:/* 4 */
24122412 WARN_ON(1);
24132413 fallthrough;
24142414 case IEEE80211_SMPS_OFF:/* 1 */ /*MIMO_PS_NOLIMIT*/
2415− action_frame->u.action.u.ht_smps.smps_control =
2415+ action_frame->u.action.ht_smps.smps_control =
24162416 WLAN_HT_SMPS_CONTROL_DISABLED;/* 0 */
24172417 break;
24182418 case IEEE80211_SMPS_STATIC:/* 2 */ /*MIMO_PS_STATIC*/
2419− action_frame->u.action.u.ht_smps.smps_control =
2419+ action_frame->u.action.ht_smps.smps_control =
24202420 WLAN_HT_SMPS_CONTROL_STATIC;/* 1 */
24212421 break;
24222422 case IEEE80211_SMPS_DYNAMIC:/* 3 */ /*MIMO_PS_DYNAMIC*/
2423− action_frame->u.action.u.ht_smps.smps_control =
2423+ action_frame->u.action.ht_smps.smps_control =
24242424 WLAN_HT_SMPS_CONTROL_DYNAMIC;/* 3 */
24252425 break;
24262426 }
@@ -2519,25 +2519,25 @@ struct sk_buff *rtl_make_del_ba(struct ieee80211_hw *hw, · 92 unmodified lines
25192519 struct ieee80211_mgmt *action_frame;
25202520 u16 params;
25212521
2522− /* 27 = header + category + action + smps mode */
2523− skb = dev_alloc_skb(34 + hw->extra_tx_headroom);
2522+ skb = dev_alloc_skb(IEEE80211_MIN_ACTION_SIZE(delba) +
2523+ hw->extra_tx_headroom);
25242524 if (!skb)
25252525 return NULL;
25262526
25272527 skb_reserve(skb, hw->extra_tx_headroom);
2528− action_frame = skb_put_zero(skb, 34);
2528+ action_frame = skb_put_zero(skb, IEEE80211_MIN_ACTION_SIZE(delba));
25292529 memcpy(action_frame->sa, sa, ETH_ALEN);
25302530 memcpy(action_frame->da, rtlefuse->dev_addr, ETH_ALEN);
25312531 memcpy(action_frame->bssid, bssid, ETH_ALEN);
25322532 action_frame->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
25332533 IEEE80211_STYPE_ACTION);
25342534 action_frame->u.action.category = WLAN_CATEGORY_BACK;
2535− action_frame->u.action.u.delba.action_code = WLAN_ACTION_DELBA;
2535+ action_frame->u.action.action_code = WLAN_ACTION_DELBA;
25362536 params = (u16)(1 << 11); /* bit 11 initiator */
25372537 params |= (u16)(tid << 12); /* bit 15:12 TID number */
25382538
2539− action_frame->u.action.u.delba.params = cpu_to_le16(params);
2540− action_frame->u.action.u.delba.reason_code =
2539+ action_frame->u.action.delba.params = cpu_to_le16(params);
2540+ action_frame->u.action.delba.reason_code =
25412541 cpu_to_le16(WLAN_REASON_QSTA_TIMEOUT);
25422542
25432543 return skb;
drivers/net/wireless/realtek/rtlwifi/pci.c+1−1
@@ -507,7 +507,7 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) · 506 unmodified lines
507507 if (ieee80211_is_action(fc)) {
508508 struct ieee80211_mgmt *action_frame =
509509 (struct ieee80211_mgmt *)skb->data;
510− if (action_frame->u.action.u.ht_smps.action ==
510+ if (action_frame->u.action.action_code ==
511511 WLAN_HT_ACTION_SMPS) {
512512 dev_kfree_skb(skb);
513513 goto tx_status_ok;
drivers/net/wireless/rsi/rsi_91x_mac80211.c+16−1
@@ -325,6 +325,22 @@ void rsi_mac80211_detach(struct rsi_hw *adapter) · 324 unmodified lines
325325 }
326326 EXPORT_SYMBOL_GPL(rsi_mac80211_detach);
327327
328+/**
329+ * rsi_mac80211_rfkill_exit() - This function is used to stop rfkill polling
330+ * when the device is removed.
331+ * @adapter: Pointer to the adapter structure.
332+ *
333+ * Return: None.
334+ */
335+void rsi_mac80211_rfkill_exit(struct rsi_hw *adapter)
336+{
337+ struct ieee80211_hw *hw = adapter->hw;
338+
339+ if (hw)
340+ wiphy_rfkill_stop_polling(hw->wiphy);
341+}
342+EXPORT_SYMBOL_GPL(rsi_mac80211_rfkill_exit);
343+
328344 /**
329345 * rsi_indicate_tx_status() - This function indicates the transmit status.
330346 * @adapter: Pointer to the adapter structure.
@@ -422,7 +438,6 @@ static void rsi_mac80211_stop(struct ieee80211_hw *hw, bool suspend) · 91 unmodified lines
422438 rsi_dbg(ERR_ZONE, "===> Interface DOWN <===\n");
423439 mutex_lock(&common->mutex);
424440 common->iface_down = true;
425− wiphy_rfkill_stop_polling(hw->wiphy);
426441
427442 /* Block all rx frames */
428443 rsi_send_rx_filter_frame(common, 0xffff);
drivers/net/wireless/rsi/rsi_91x_usb.c+2−0
@@ -877,6 +877,8 @@ static void rsi_disconnect(struct usb_interface *pfunction) · 876 unmodified lines
877877 if (!adapter)
878878 return;
879879
880+ rsi_mac80211_rfkill_exit(adapter);
881+
880882 rsi_mac80211_detach(adapter);
881883
882884 if (IS_ENABLED(CONFIG_RSI_COEX) && adapter->priv->coex_mode > 1 &&
drivers/net/wireless/rsi/rsi_common.h+1−0
@@ -79,6 +79,7 @@ static inline int rsi_kill_thread(struct rsi_thread *handle) · 78 unmodified lines
7979 }
8080
8181 void rsi_mac80211_detach(struct rsi_hw *hw);
82+void rsi_mac80211_rfkill_exit(struct rsi_hw *hw);
8283 u16 rsi_get_connected_channel(struct ieee80211_vif *vif);
8384 struct rsi_hw *rsi_91x_init(u16 oper_mode);
8485 void rsi_91x_deinit(struct rsi_hw *adapter);
drivers/net/wireless/silabs/wfx/data_rx.c+4−4
@@ -21,14 +21,14 @@ static void wfx_rx_handle_ba(struct wfx_vif *wvif, struct ieee80211_mgmt *mgmt) · 20 unmodified lines
2121 if (wfx_api_older_than(wvif->wdev, 3, 6))
2222 return;
2323
24− switch (mgmt->u.action.u.addba_req.action_code) {
24+ switch (mgmt->u.action.action_code) {
2525 case WLAN_ACTION_ADDBA_REQ:
26− params = le16_to_cpu(mgmt->u.action.u.addba_req.capab);
26+ params = le16_to_cpu(mgmt->u.action.addba_req.capab);
2727 tid = (params & IEEE80211_ADDBA_PARAM_TID_MASK) >> 2;
2828 ieee80211_start_rx_ba_session_offl(vif, mgmt->sa, tid);
2929 break;
3030 case WLAN_ACTION_DELBA:
31− params = le16_to_cpu(mgmt->u.action.u.delba.params);
31+ params = le16_to_cpu(mgmt->u.action.delba.params);
3232 tid = (params & IEEE80211_DELBA_PARAM_TID_MASK) >> 12;
3333 ieee80211_stop_rx_ba_session_offl(vif, mgmt->sa, tid);
3434 break;
@@ -80,7 +80,7 @@ void wfx_rx_cb(struct wfx_vif *wvif, const struct wfx_hif_ind_rx *arg, struct sk · 45 unmodified lines
8080 */
8181 if (ieee80211_is_action(frame->frame_control) &&
8282 mgmt->u.action.category == WLAN_CATEGORY_BACK &&
83− skb->len > IEEE80211_MIN_ACTION_SIZE) {
83+ skb->len > IEEE80211_MIN_ACTION_SIZE(action_code)) {
8484 wfx_rx_handle_ba(wvif, mgmt);
8585 goto drop;
8686 }
drivers/net/wireless/virtual/mac80211_hwsim.c+64−0
@@ -36,6 +36,8 @@ · 35 unmodified lines
3636 #include <linux/virtio.h>
3737 #include <linux/virtio_ids.h>
3838 #include <linux/virtio_config.h>
39+#include <linux/uaccess.h>
40+#include <linux/string.h>
3941 #include "mac80211_hwsim.h"
4042
4143 #define WARN_QUEUE 100
@@ -1203,6 +1205,65 @@ static const struct file_operations hwsim_background_cac_ops = { · 1161 unmodified lines
12031205 .llseek = default_llseek,
12041206 };
12051207
1208+struct hwsim_chanctx_iter_arg {
1209+ struct ieee80211_chanctx_conf *conf;
1210+ u32 freq_mhz;
1211+};
1212+
1213+static void hwsim_6ghz_chanctx_iter(struct ieee80211_hw *hw,
1214+ struct ieee80211_chanctx_conf *conf,
1215+ void *data)
1216+{
1217+ struct hwsim_chanctx_iter_arg *arg = data;
1218+
1219+ if (conf->def.chan &&
1220+ conf->def.chan->band == NL80211_BAND_6GHZ &&
1221+ conf->def.chan->center_freq == arg->freq_mhz)
1222+ arg->conf = conf;
1223+}
1224+
1225+static ssize_t hwsim_simulate_incumbent_signal_write(struct file *file,
1226+ const char __user *ubuf,
1227+ size_t len, loff_t *ppos)
1228+{
1229+ struct mac80211_hwsim_data *data = file->private_data;
1230+ struct hwsim_chanctx_iter_arg arg = {};
1231+ u32 bitmap;
1232+ char buf[64];
1233+
1234+ if (!len || len > sizeof(buf) - 1)
1235+ return -EINVAL;
1236+
1237+ if (copy_from_user(buf, ubuf, len))
1238+ return -EFAULT;
1239+ buf[len] = '\0';
1240+
1241+ if (sscanf(buf, "%u %i", &arg.freq_mhz, &bitmap) != 2)
1242+ return -EINVAL;
1243+
1244+ if (!arg.freq_mhz)
1245+ return -EINVAL;
1246+
1247+ ieee80211_iter_chan_contexts_atomic(data->hw,
1248+ hwsim_6ghz_chanctx_iter,
1249+ &arg);
1250+
1251+ if (!arg.conf)
1252+ return -EINVAL;
1253+
1254+ cfg80211_incumbent_signal_notify(data->hw->wiphy,
1255+ &arg.conf->def,
1256+ bitmap,
1257+ GFP_KERNEL);
1258+
1259+ return len;
1260+}
1261+
1262+static const struct file_operations hwsim_simulate_incumbent_signal_fops = {
1263+ .open = simple_open,
1264+ .write = hwsim_simulate_incumbent_signal_write,
1265+};
1266+
12061267 static int hwsim_fops_group_read(void *dat, u64 *val)
12071268 {
12081269 struct mac80211_hwsim_data *data = dat;
@@ -5950,6 +6011,9 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, · 4741 unmodified lines
59506011 debugfs_create_file("dfs_background_cac", 0200,
59516012 data->debugfs,
59526013 data, &hwsim_background_cac_ops);
6014+ debugfs_create_file("simulate_incumbent_signal_interference", 0200,
6015+ data->debugfs,
6016+ data, &hwsim_simulate_incumbent_signal_fops);
59536017
59546018 if (param->pmsr_capa) {
59556019 data->pmsr_capa = *param->pmsr_capa;
include/linux/ieee80211-eht.h+2−2
@@ -251,8 +251,8 @@ struct ieee80211_eht_operation_info { · 250 unmodified lines
251251 #define IEEE80211_EHT_PHY_CAP5_SUPP_EXTRA_EHT_LTF 0x40
252252 #define IEEE80211_EHT_PHY_CAP6_MAX_NUM_SUPP_EHT_LTF_MASK 0x07
253253
254−#define IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_80MHZ 0x08
255−#define IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_160MHZ 0x30
254+#define IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_80MHZ 0x10
255+#define IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_160MHZ 0x20
256256 #define IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_320MHZ 0x40
257257 #define IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_MASK 0x78
258258 #define IEEE80211_EHT_PHY_CAP6_EHT_DUP_6GHZ_SUPP 0x80
include/linux/ieee80211-ht.h+3−0
@@ -281,6 +281,9 @@ enum ieee80211_back_actioncode { · 280 unmodified lines
281281 WLAN_ACTION_ADDBA_REQ = 0,
282282 WLAN_ACTION_ADDBA_RESP = 1,
283283 WLAN_ACTION_DELBA = 2,
284+ WLAN_ACTION_NDP_ADDBA_REQ = 128,
285+ WLAN_ACTION_NDP_ADDBA_RESP = 129,
286+ WLAN_ACTION_NDP_DELBA = 130,
284287 };
285288
286289 /* BACK (block-ack) parties */
include/linux/ieee80211-uhr.h+2−2
@@ -12,8 +12,8 @@ · 11 unmodified lines
1212
1313 #define IEEE80211_UHR_OPER_PARAMS_DPS_ENA 0x0001
1414 #define IEEE80211_UHR_OPER_PARAMS_NPCA_ENA 0x0002
15−#define IEEE80211_UHR_OPER_PARAMS_DBE_ENA 0x0004
16−#define IEEE80211_UHR_OPER_PARAMS_PEDCA_ENA 0x0008
15+#define IEEE80211_UHR_OPER_PARAMS_PEDCA_ENA 0x0004
16+#define IEEE80211_UHR_OPER_PARAMS_DBE_ENA 0x0008
1717
1818 struct ieee80211_uhr_operation {
1919 __le16 params;
include/linux/ieee80211.h+32−53
@@ -1046,31 +1046,28 @@ struct ieee80211_mgmt { · 1045 unmodified lines
10461046 } __packed probe_resp;
10471047 struct {
10481048 u8 category;
1049+ u8 action_code;
10491050 union {
10501051 struct {
1051− u8 action_code;
10521052 u8 dialog_token;
10531053 u8 status_code;
10541054 u8 variable[];
10551055 } __packed wme_action;
10561056 struct{
1057− u8 action_code;
1057+ u8 no_fixed_fields[0];
10581058 u8 variable[];
10591059 } __packed chan_switch;
10601060 struct{
1061− u8 action_code;
10621061 struct ieee80211_ext_chansw_ie data;
10631062 u8 variable[];
10641063 } __packed ext_chan_switch;
10651064 struct{
1066− u8 action_code;
10671065 u8 dialog_token;
10681066 u8 element_id;
10691067 u8 length;
10701068 struct ieee80211_msrment_ie msr_elem;
10711069 } __packed measurement;
10721070 struct{
1073− u8 action_code;
10741071 u8 dialog_token;
10751072 __le16 capab;
10761073 __le16 timeout;
@@ -1079,7 +1076,6 @@ struct ieee80211_mgmt { · 2 unmodified lines
10791076 u8 variable[];
10801077 } __packed addba_req;
10811078 struct{
1082− u8 action_code;
10831079 u8 dialog_token;
10841080 __le16 status;
10851081 __le16 capab;
@@ -1088,54 +1084,45 @@ struct ieee80211_mgmt { · 2 unmodified lines
10881084 u8 variable[];
10891085 } __packed addba_resp;
10901086 struct{
1091− u8 action_code;
10921087 __le16 params;
10931088 __le16 reason_code;
10941089 } __packed delba;
10951090 struct {
1096− u8 action_code;
1091+ u8 no_fixed_fields[0];
10971092 u8 variable[];
10981093 } __packed self_prot;
10991094 struct{
1100− u8 action_code;
1095+ u8 no_fixed_fields[0];
11011096 u8 variable[];
11021097 } __packed mesh_action;
11031098 struct {
1104− u8 action;
11051099 u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
11061100 } __packed sa_query;
11071101 struct {
1108− u8 action;
11091102 u8 smps_control;
11101103 } __packed ht_smps;
11111104 struct {
1112− u8 action_code;
11131105 u8 chanwidth;
11141106 } __packed ht_notify_cw;
11151107 struct {
1116− u8 action_code;
11171108 u8 dialog_token;
11181109 __le16 capability;
11191110 u8 variable[];
11201111 } __packed tdls_discover_resp;
11211112 struct {
1122− u8 action_code;
11231113 u8 operating_mode;
11241114 } __packed vht_opmode_notif;
11251115 struct {
1126− u8 action_code;
11271116 u8 membership[WLAN_MEMBERSHIP_LEN];
11281117 u8 position[WLAN_USER_POSITION_LEN];
11291118 } __packed vht_group_notif;
11301119 struct {
1131− u8 action_code;
11321120 u8 dialog_token;
11331121 u8 tpc_elem_id;
11341122 u8 tpc_elem_length;
11351123 struct ieee80211_tpc_report_ie tpc;
11361124 } __packed tpc_report;
11371125 struct {
1138− u8 action_code;
11391126 u8 dialog_token;
11401127 u8 follow_up;
11411128 u8 tod[6];
@@ -1145,11 +1132,10 @@ struct ieee80211_mgmt { · 3 unmodified lines
11451132 u8 variable[];
11461133 } __packed ftm;
11471134 struct {
1148− u8 action_code;
1135+ u8 no_fixed_fields[0];
11491136 u8 variable[];
11501137 } __packed s1g;
11511138 struct {
1152− u8 action_code;
11531139 u8 dialog_token;
11541140 u8 follow_up;
11551141 u32 tod;
@@ -1158,41 +1144,37 @@ struct ieee80211_mgmt { · 2 unmodified lines
11581144 u8 max_toa_error;
11591145 } __packed wnm_timing_msr;
11601146 struct {
1161− u8 action_code;
11621147 u8 dialog_token;
11631148 u8 variable[];
11641149 } __packed ttlm_req;
11651150 struct {
1166− u8 action_code;
11671151 u8 dialog_token;
11681152 __le16 status_code;
11691153 u8 variable[];
11701154 } __packed ttlm_res;
11711155 struct {
1172− u8 action_code;
1156+ u8 no_fixed_fields[0];
1157+ /* no variable fields either */
11731158 } __packed ttlm_tear_down;
11741159 struct {
1175− u8 action_code;
11761160 u8 dialog_token;
11771161 u8 variable[];
11781162 } __packed ml_reconf_req;
11791163 struct {
1180− u8 action_code;
11811164 u8 dialog_token;
11821165 u8 count;
11831166 u8 variable[];
11841167 } __packed ml_reconf_resp;
11851168 struct {
1186− u8 action_code;
1169+ u8 no_fixed_fields[0];
11871170 u8 variable[];
11881171 } __packed epcs;
11891172 struct {
1190− u8 action_code;
11911173 u8 dialog_token;
11921174 u8 control;
11931175 u8 variable[];
11941176 } __packed eml_omn;
1195− } u;
1177+ };
11961178 } __packed action;
11971179 DECLARE_FLEX_ARRAY(u8, body); /* Generic frame body */
11981180 } u;
@@ -1210,8 +1192,7 @@ struct ieee80211_mgmt { · 11 unmodified lines
12101192
12111193 #define BSS_MEMBERSHIP_SELECTOR_MIN BSS_MEMBERSHIP_SELECTOR_UHR_PHY
12121194
1213−/* mgmt header + 1 byte category code */
1214−#define IEEE80211_MIN_ACTION_SIZE offsetof(struct ieee80211_mgmt, u.action.u)
1195+#define IEEE80211_MIN_ACTION_SIZE(type) offsetofend(struct ieee80211_mgmt, u.action.type)
12151196
12161197
12171198 /* Management MIC information element (IEEE 802.11w) for CMAC */
@@ -1501,6 +1482,8 @@ enum ieee80211_statuscode { · 283 unmodified lines
15011482 WLAN_STATUS_REJECT_DSE_BAND = 96,
15021483 WLAN_STATUS_DENIED_WITH_SUGGESTED_BAND_AND_CHANNEL = 99,
15031484 WLAN_STATUS_DENIED_DUE_TO_SPECTRUM_MANAGEMENT = 103,
1485+ /* 802.11ah */
1486+ WLAN_STATUS_REJECTED_NDP_BLOCK_ACK_SUGGESTED = 109,
15041487 /* 802.11ai */
15051488 WLAN_STATUS_FILS_AUTHENTICATION_FAILURE = 112,
15061489 WLAN_STATUS_UNKNOWN_AUTHENTICATION_SERVER = 113,
@@ -2391,7 +2374,7 @@ static inline bool ieee80211_is_bufferable_mmpdu(struct sk_buff *skb) · 884 unmodified lines
23912374 if (!ieee80211_is_action(fc))
23922375 return false;
23932376
2394− if (skb->len < offsetofend(typeof(*mgmt), u.action.u.ftm.action_code))
2377+ if (skb->len < IEEE80211_MIN_ACTION_SIZE(action_code))
23952378 return true;
23962379
23972380 /* action frame - additionally check for non-bufferable FTM */
@@ -2400,8 +2383,8 @@ static inline bool ieee80211_is_bufferable_mmpdu(struct sk_buff *skb) · 2 unmodified lines
24002383 mgmt->u.action.category != WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION)
24012384 return true;
24022385
2403− if (mgmt->u.action.u.ftm.action_code == WLAN_PUB_ACTION_FTM_REQUEST ||
2404− mgmt->u.action.u.ftm.action_code == WLAN_PUB_ACTION_FTM_RESPONSE)
2386+ if (mgmt->u.action.action_code == WLAN_PUB_ACTION_FTM_REQUEST ||
2387+ mgmt->u.action.action_code == WLAN_PUB_ACTION_FTM_RESPONSE)
24052388 return false;
24062389
24072390 return true;
@@ -2451,7 +2434,7 @@ static inline bool _ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr) · 43 unmodified lines
24512434 */
24522435 static inline bool ieee80211_is_robust_mgmt_frame(struct sk_buff *skb)
24532436 {
2454− if (skb->len < IEEE80211_MIN_ACTION_SIZE)
2437+ if (skb->len < IEEE80211_MIN_ACTION_SIZE(category))
24552438 return false;
24562439 return _ieee80211_is_robust_mgmt_frame((void *)skb->data);
24572440 }
@@ -2467,7 +2450,7 @@ static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr, · 9 unmodified lines
24672450 {
24682451 struct ieee80211_mgmt *mgmt = (void *)hdr;
24692452
2470− if (len < IEEE80211_MIN_ACTION_SIZE)
2453+ if (len < IEEE80211_MIN_ACTION_SIZE(category))
24712454 return false;
24722455 if (!ieee80211_is_action(hdr->frame_control))
24732456 return false;
@@ -2485,13 +2468,14 @@ static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr, · 11 unmodified lines
24852468 static inline bool
24862469 ieee80211_is_protected_dual_of_public_action(struct sk_buff *skb)
24872470 {
2471+ struct ieee80211_mgmt *mgmt = (void *)skb->data;
24882472 u8 action;
24892473
24902474 if (!ieee80211_is_public_action((void *)skb->data, skb->len) ||
2491− skb->len < IEEE80211_MIN_ACTION_SIZE + 1)
2475+ skb->len < IEEE80211_MIN_ACTION_SIZE(action_code))
24922476 return false;
24932477
2494− action = *(u8 *)(skb->data + IEEE80211_MIN_ACTION_SIZE);
2478+ action = mgmt->u.action.action_code;
24952479
24962480 return action != WLAN_PUB_ACTION_20_40_BSS_COEX &&
24972481 action != WLAN_PUB_ACTION_DSE_REG_LOC_ANN &&
@@ -2530,7 +2514,7 @@ static inline bool _ieee80211_is_group_privacy_action(struct ieee80211_hdr *hdr) · 32 unmodified lines
25302514 */
25312515 static inline bool ieee80211_is_group_privacy_action(struct sk_buff *skb)
25322516 {
2533− if (skb->len < IEEE80211_MIN_ACTION_SIZE)
2517+ if (skb->len < IEEE80211_MIN_ACTION_SIZE(category))
25342518 return false;
25352519 return _ieee80211_is_group_privacy_action((void *)skb->data);
25362520 }
@@ -2626,8 +2610,7 @@ static inline bool ieee80211_action_contains_tpc(struct sk_buff *skb) · 89 unmodified lines
26262610 if (!ieee80211_is_action(mgmt->frame_control))
26272611 return false;
26282612
2629− if (skb->len < IEEE80211_MIN_ACTION_SIZE +
2630− sizeof(mgmt->u.action.u.tpc_report))
2613+ if (skb->len < IEEE80211_MIN_ACTION_SIZE(tpc_report))
26312614 return false;
26322615
26332616 /*
@@ -2646,12 +2629,11 @@ static inline bool ieee80211_action_contains_tpc(struct sk_buff *skb) · 12 unmodified lines
26462629 return false;
26472630
26482631 /* both spectrum mgmt and link measurement have same action code */
2649− if (mgmt->u.action.u.tpc_report.action_code !=
2650− WLAN_ACTION_SPCT_TPC_RPRT)
2632+ if (mgmt->u.action.action_code != WLAN_ACTION_SPCT_TPC_RPRT)
26512633 return false;
26522634
2653− if (mgmt->u.action.u.tpc_report.tpc_elem_id != WLAN_EID_TPC_REPORT ||
2654− mgmt->u.action.u.tpc_report.tpc_elem_length !=
2635+ if (mgmt->u.action.tpc_report.tpc_elem_id != WLAN_EID_TPC_REPORT ||
2636+ mgmt->u.action.tpc_report.tpc_elem_length !=
26552637 sizeof(struct ieee80211_tpc_report_ie))
26562638 return false;
26572639
@@ -2667,16 +2649,15 @@ static inline bool ieee80211_is_timing_measurement(struct sk_buff *skb) · 9 unmodified lines
26672649 {
26682650 struct ieee80211_mgmt *mgmt = (void *)skb->data;
26692651
2670− if (skb->len < IEEE80211_MIN_ACTION_SIZE)
2652+ if (skb->len < IEEE80211_MIN_ACTION_SIZE(wnm_timing_msr))
26712653 return false;
26722654
26732655 if (!ieee80211_is_action(mgmt->frame_control))
26742656 return false;
26752657
26762658 if (mgmt->u.action.category == WLAN_CATEGORY_WNM_UNPROTECTED &&
2677− mgmt->u.action.u.wnm_timing_msr.action_code ==
2678− WLAN_UNPROTECTED_WNM_ACTION_TIMING_MEASUREMENT_RESPONSE &&
2679− skb->len >= offsetofend(typeof(*mgmt), u.action.u.wnm_timing_msr))
2659+ mgmt->u.action.action_code ==
2660+ WLAN_UNPROTECTED_WNM_ACTION_TIMING_MEASUREMENT_RESPONSE)
26802661 return true;
26812662
26822663 return false;
@@ -2691,15 +2672,13 @@ static inline bool ieee80211_is_ftm(struct sk_buff *skb) · 8 unmodified lines
26912672 {
26922673 struct ieee80211_mgmt *mgmt = (void *)skb->data;
26932674
2694− if (!ieee80211_is_public_action((void *)mgmt, skb->len))
2675+ if (skb->len < IEEE80211_MIN_ACTION_SIZE(ftm))
26952676 return false;
26962677
2697− if (mgmt->u.action.u.ftm.action_code ==
2698− WLAN_PUB_ACTION_FTM_RESPONSE &&
2699− skb->len >= offsetofend(typeof(*mgmt), u.action.u.ftm))
2700− return true;
2678+ if (!ieee80211_is_public_action((void *)mgmt, skb->len))
2679+ return false;
27012680
2702− return false;
2681+ return mgmt->u.action.action_code == WLAN_PUB_ACTION_FTM_RESPONSE;
27032682 }
27042683
27052684 struct element {
include/net/mac80211.h+4−0
@@ -2913,6 +2913,9 @@ struct ieee80211_txq { · 2912 unmodified lines
29132913 * HW flag so drivers can opt in according to their own control, e.g. in
29142914 * testing.
29152915 *
2916+ * @IEEE80211_HW_SUPPORTS_NDP_BLOCKACK: HW can transmit/receive S1G NDP
2917+ * BlockAck frames.
2918+ *
29162919 * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
29172920 */
29182921 enum ieee80211_hw_flags {
@@ -2973,6 +2976,7 @@ enum ieee80211_hw_flags { · 54 unmodified lines
29732976 IEEE80211_HW_DISALLOW_PUNCTURING,
29742977 IEEE80211_HW_HANDLES_QUIET_CSA,
29752978 IEEE80211_HW_STRICT,
2979+ IEEE80211_HW_SUPPORTS_NDP_BLOCKACK,
29762980
29772981 /* keep last, obviously */
29782982 NUM_IEEE80211_HW_FLAGS
include/uapi/linux/nl80211.h+6−0
@@ -3001,6 +3001,10 @@ enum nl80211_commands { · 3000 unmodified lines
30013001 * interference detection is not performed on these sub-channels, their
30023002 * corresponding bits are consistently set to zero.
30033003 *
3004+ * @NL80211_ATTR_UHR_OPERATION: Full UHR Operation element, as it appears in
3005+ * association response etc., since it's abridged in the beacon. Used
3006+ * for START_AP etc.
3007+ *
30043008 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
30053009 * @NL80211_ATTR_MAX: highest attribute number currently defined
30063010 * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -3576,6 +3580,8 @@ enum nl80211_attrs { · 569 unmodified lines
35763580
35773581 NL80211_ATTR_INCUMBENT_SIGNAL_INTERFERENCE_BITMAP,
35783582
3583+ NL80211_ATTR_UHR_OPERATION,
3584+
35793585 /* add attributes here, update the policy in nl80211.c */
35803586
35813587 __NL80211_ATTR_AFTER_LAST,
net/mac80211/agg-rx.c+34−15
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
1010 * Copyright 2007-2010, Intel Corporation
1111 * Copyright(c) 2015-2017 Intel Deutschland GmbH
12− * Copyright (C) 2018-2025 Intel Corporation
12+ * Copyright (C) 2018-2026 Intel Corporation
1313 */
1414
1515 /**
@@ -94,7 +94,8 @@ void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, · 78 unmodified lines
9494 /* check if this is a self generated aggregation halt */
9595 if (initiator == WLAN_BACK_RECIPIENT && tx)
9696 ieee80211_send_delba(sta->sdata, sta->sta.addr,
97− tid, WLAN_BACK_RECIPIENT, reason);
97+ tid, WLAN_BACK_RECIPIENT, reason,
98+ ieee80211_s1g_use_ndp_ba(sta->sdata, sta));
9899
99100 /*
100101 * return here in case tid_rx is not assigned - which will happen if
@@ -240,6 +241,7 @@ static void ieee80211_send_addba_resp(struct sta_info *sta, u8 *da, u16 tid, · 139 unmodified lines
240241 struct sk_buff *skb;
241242 struct ieee80211_mgmt *mgmt;
242243 bool amsdu = ieee80211_hw_check(&local->hw, SUPPORTS_AMSDU_IN_AMPDU);
244+ bool use_ndp = ieee80211_s1g_use_ndp_ba(sdata, sta);
243245 u16 capab;
244246
245247 skb = dev_alloc_skb(sizeof(*mgmt) +
@@ -251,19 +253,21 @@ static void ieee80211_send_addba_resp(struct sta_info *sta, u8 *da, u16 tid, · 5 unmodified lines
251253 skb_reserve(skb, local->hw.extra_tx_headroom);
252254 mgmt = ieee80211_mgmt_ba(skb, da, sdata);
253255
254− skb_put(skb, 1 + sizeof(mgmt->u.action.u.addba_resp));
256+ skb_put(skb, 2 + sizeof(mgmt->u.action.addba_resp));
255257 mgmt->u.action.category = WLAN_CATEGORY_BACK;
256− mgmt->u.action.u.addba_resp.action_code = WLAN_ACTION_ADDBA_RESP;
257− mgmt->u.action.u.addba_resp.dialog_token = dialog_token;
258+ mgmt->u.action.action_code = use_ndp ?
259+ WLAN_ACTION_NDP_ADDBA_RESP : WLAN_ACTION_ADDBA_RESP;
260+
261+ mgmt->u.action.addba_resp.dialog_token = dialog_token;
258262
259263 capab = u16_encode_bits(amsdu, IEEE80211_ADDBA_PARAM_AMSDU_MASK);
260264 capab |= u16_encode_bits(policy, IEEE80211_ADDBA_PARAM_POLICY_MASK);
261265 capab |= u16_encode_bits(tid, IEEE80211_ADDBA_PARAM_TID_MASK);
262266 capab |= u16_encode_bits(buf_size, IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK);
263267
264− mgmt->u.action.u.addba_resp.capab = cpu_to_le16(capab);
265− mgmt->u.action.u.addba_resp.timeout = cpu_to_le16(timeout);
266− mgmt->u.action.u.addba_resp.status = cpu_to_le16(status);
268+ mgmt->u.action.addba_resp.capab = cpu_to_le16(capab);
269+ mgmt->u.action.addba_resp.timeout = cpu_to_le16(timeout);
270+ mgmt->u.action.addba_resp.status = cpu_to_le16(status);
267271
268272 if (sta->sta.valid_links || sta->sta.deflink.he_cap.has_he)
269273 ieee80211_add_addbaext(skb, req_addba_ext_data, buf_size);
@@ -275,6 +279,7 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta, · 5 unmodified lines
275279 u8 dialog_token, u16 timeout,
276280 u16 start_seq_num, u16 ba_policy, u16 tid,
277281 u16 buf_size, bool tx, bool auto_seq,
282+ bool req_ndp,
278283 const u8 addba_ext_data)
279284 {
280285 struct ieee80211_local *local = sta->sdata->local;
@@ -300,6 +305,18 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta, · 19 unmodified lines
300305 goto end;
301306 }
302307
308+ if (tx && ieee80211_s1g_use_ndp_ba(sta->sdata, sta) && !req_ndp) {
309+ /*
310+ * According to IEEE 802.11-2024: Inform S1G originator
311+ * ADDBA rejected as NDP BlockAck is preferred
312+ */
313+ status = WLAN_STATUS_REJECTED_NDP_BLOCK_ACK_SUGGESTED;
314+ ht_dbg(sta->sdata,
315+ "Rejecting AddBA Req from %pM tid %u - require NDP BlockAck\n",
316+ sta->sta.addr, tid);
317+ goto end;
318+ }
319+
303320 if (!sta->sta.valid_links &&
304321 !sta->sta.deflink.ht_cap.ht_supported &&
305322 !sta->sta.deflink.he_cap.has_he &&
@@ -473,31 +490,33 @@ void ieee80211_process_addba_request(struct ieee80211_local *local, · 167 unmodified lines
473490 struct ieee80211_mgmt *mgmt,
474491 size_t len)
475492 {
493+ bool req_ndp = mgmt->u.action.action_code == WLAN_ACTION_NDP_ADDBA_REQ;
476494 u16 capab, tid, timeout, ba_policy, buf_size, start_seq_num;
477495 u8 dialog_token, addba_ext_data;
478496
479497 /* extract session parameters from addba request frame */
480− dialog_token = mgmt->u.action.u.addba_req.dialog_token;
481− timeout = le16_to_cpu(mgmt->u.action.u.addba_req.timeout);
498+ dialog_token = mgmt->u.action.addba_req.dialog_token;
499+ timeout = le16_to_cpu(mgmt->u.action.addba_req.timeout);
482500 start_seq_num =
483− le16_to_cpu(mgmt->u.action.u.addba_req.start_seq_num) >> 4;
501+ le16_to_cpu(mgmt->u.action.addba_req.start_seq_num) >> 4;
484502
485− capab = le16_to_cpu(mgmt->u.action.u.addba_req.capab);
503+ capab = le16_to_cpu(mgmt->u.action.addba_req.capab);
486504 ba_policy = (capab & IEEE80211_ADDBA_PARAM_POLICY_MASK) >> 1;
487505 tid = (capab & IEEE80211_ADDBA_PARAM_TID_MASK) >> 2;
488506 buf_size = (capab & IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK) >> 6;
489507
490508 addba_ext_data =
491509 ieee80211_retrieve_addba_ext_data(sta,
492− mgmt->u.action.u.addba_req.variable,
510+ mgmt->u.action.addba_req.variable,
493511 len -
494512 offsetof(typeof(*mgmt),
495− u.action.u.addba_req.variable),
513+ u.action.addba_req.variable),
496514 &buf_size);
497515
498516 __ieee80211_start_rx_ba_session(sta, dialog_token, timeout,
499517 start_seq_num, ba_policy, tid,
500− buf_size, true, false, addba_ext_data);
518+ buf_size, true, false,
519+ req_ndp, addba_ext_data);
501520 }
502521
503522 void ieee80211_manage_rx_ba_offl(struct ieee80211_vif *vif,
net/mac80211/agg-tx.c+22−17
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
1010 * Copyright 2007-2010, Intel Corporation
1111 * Copyright(c) 2015-2017 Intel Deutschland GmbH
12− * Copyright (C) 2018 - 2024 Intel Corporation
12+ * Copyright (C) 2018-2026 Intel Corporation
1313 */
1414
1515 #include <linux/ieee80211.h>
@@ -60,7 +60,7 @@ · 44 unmodified lines
6060
6161 static void ieee80211_send_addba_request(struct sta_info *sta, u16 tid,
6262 u8 dialog_token, u16 start_seq_num,
63− u16 agg_size, u16 timeout)
63+ u16 agg_size, u16 timeout, bool ndp)
6464 {
6565 struct ieee80211_sub_if_data *sdata = sta->sdata;
6666 struct ieee80211_local *local = sdata->local;
@@ -68,7 +68,7 @@ static void ieee80211_send_addba_request(struct sta_info *sta, u16 tid, · 1 unmodified line
6868 struct ieee80211_mgmt *mgmt;
6969 u16 capab;
7070
71− skb = dev_alloc_skb(sizeof(*mgmt) +
71+ skb = dev_alloc_skb(IEEE80211_MIN_ACTION_SIZE(addba_req) +
7272 2 + sizeof(struct ieee80211_addba_ext_ie) +
7373 local->hw.extra_tx_headroom);
7474 if (!skb)
@@ -77,21 +77,22 @@ static void ieee80211_send_addba_request(struct sta_info *sta, u16 tid, · 2 unmodified lines
7777 skb_reserve(skb, local->hw.extra_tx_headroom);
7878 mgmt = ieee80211_mgmt_ba(skb, sta->sta.addr, sdata);
7979
80− skb_put(skb, 1 + sizeof(mgmt->u.action.u.addba_req));
80+ skb_put(skb, 2 + sizeof(mgmt->u.action.addba_req));
8181
8282 mgmt->u.action.category = WLAN_CATEGORY_BACK;
83− mgmt->u.action.u.addba_req.action_code = WLAN_ACTION_ADDBA_REQ;
83+ mgmt->u.action.action_code = ndp ?
84+ WLAN_ACTION_NDP_ADDBA_REQ : WLAN_ACTION_ADDBA_REQ;
8485
85− mgmt->u.action.u.addba_req.dialog_token = dialog_token;
86+ mgmt->u.action.addba_req.dialog_token = dialog_token;
8687 capab = IEEE80211_ADDBA_PARAM_AMSDU_MASK;
8788 capab |= IEEE80211_ADDBA_PARAM_POLICY_MASK;
8889 capab |= u16_encode_bits(tid, IEEE80211_ADDBA_PARAM_TID_MASK);
8990 capab |= u16_encode_bits(agg_size, IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK);
9091
91− mgmt->u.action.u.addba_req.capab = cpu_to_le16(capab);
92+ mgmt->u.action.addba_req.capab = cpu_to_le16(capab);
9293
93− mgmt->u.action.u.addba_req.timeout = cpu_to_le16(timeout);
94− mgmt->u.action.u.addba_req.start_seq_num =
94+ mgmt->u.action.addba_req.timeout = cpu_to_le16(timeout);
95+ mgmt->u.action.addba_req.start_seq_num =
9596 cpu_to_le16(start_seq_num << 4);
9697
9798 if (sta->sta.deflink.he_cap.has_he)
@@ -484,7 +485,8 @@ static void ieee80211_send_addba_with_timeout(struct sta_info *sta, · 386 unmodified lines
484485
485486 /* send AddBA request */
486487 ieee80211_send_addba_request(sta, tid, tid_tx->dialog_token,
487− tid_tx->ssn, buf_size, tid_tx->timeout);
488+ tid_tx->ssn, buf_size, tid_tx->timeout,
489+ tid_tx->ndp);
488490
489491 WARN_ON(test_and_set_bit(HT_AGG_STATE_SENT_ADDBA, &tid_tx->state));
490492 }
@@ -521,6 +523,7 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid) · 30 unmodified lines
521523 */
522524 synchronize_net();
523525
526+ tid_tx->ndp = ieee80211_s1g_use_ndp_ba(sdata, sta);
524527 params.ssn = sta->tid_seq[tid] >> 4;
525528 ret = drv_ampdu_action(local, sdata, &params);
526529 tid_tx->ssn = params.ssn;
@@ -940,7 +943,9 @@ void ieee80211_stop_tx_ba_cb(struct sta_info *sta, int tid, · 413 unmodified lines
940943
941944 if (send_delba)
942945 ieee80211_send_delba(sdata, sta->sta.addr, tid,
943− WLAN_BACK_INITIATOR, WLAN_REASON_QSTA_NOT_USE);
946+ WLAN_BACK_INITIATOR,
947+ WLAN_REASON_QSTA_NOT_USE,
948+ tid_tx->ndp);
944949 }
945950
946951 void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif,
@@ -978,15 +983,15 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, · 31 unmodified lines
978983
979984 lockdep_assert_wiphy(sta->local->hw.wiphy);
980985
981− capab = le16_to_cpu(mgmt->u.action.u.addba_resp.capab);
986+ capab = le16_to_cpu(mgmt->u.action.addba_resp.capab);
982987 amsdu = capab & IEEE80211_ADDBA_PARAM_AMSDU_MASK;
983988 tid = u16_get_bits(capab, IEEE80211_ADDBA_PARAM_TID_MASK);
984989 buf_size = u16_get_bits(capab, IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK);
985990
986991 ieee80211_retrieve_addba_ext_data(sta,
987− mgmt->u.action.u.addba_resp.variable,
992+ mgmt->u.action.addba_resp.variable,
988993 len - offsetof(typeof(*mgmt),
989− u.action.u.addba_resp.variable),
994+ u.action.addba_resp.variable),
990995 &buf_size);
991996
992997 buf_size = min(buf_size, local->hw.max_tx_aggregation_subframes);
@@ -999,7 +1004,7 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, · 6 unmodified lines
9991004 if (!tid_tx)
10001005 return;
10011006
1002− if (mgmt->u.action.u.addba_resp.dialog_token != tid_tx->dialog_token) {
1007+ if (mgmt->u.action.addba_resp.dialog_token != tid_tx->dialog_token) {
10031008 ht_dbg(sta->sdata, "wrong addBA response token, %pM tid %d\n",
10041009 sta->sta.addr, tid);
10051010 return;
@@ -1029,7 +1034,7 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, · 23 unmodified lines
10291034 * is set to 0, the Buffer Size subfield is set to a value
10301035 * of at least 1.
10311036 */
1032− if (le16_to_cpu(mgmt->u.action.u.addba_resp.status)
1037+ if (le16_to_cpu(mgmt->u.action.addba_resp.status)
10331038 == WLAN_STATUS_SUCCESS && buf_size) {
10341039 if (test_and_set_bit(HT_AGG_STATE_RESPONSE_RECEIVED,
10351040 &tid_tx->state)) {
@@ -1046,7 +1051,7 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, · 10 unmodified lines
10461051 sta->ampdu_mlme.addba_req_num[tid] = 0;
10471052
10481053 tid_tx->timeout =
1049− le16_to_cpu(mgmt->u.action.u.addba_resp.timeout);
1054+ le16_to_cpu(mgmt->u.action.addba_resp.timeout);
10501055
10511056 if (tid_tx->timeout) {
10521057 mod_timer(&tid_tx->session_timer,
net/mac80211/chan.c+37−49
@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0-only
22 /*
33 * mac80211 - channel management
4− * Copyright 2020 - 2025 Intel Corporation
4+ * Copyright 2020-2026 Intel Corporation
55 */
66
77 #include <linux/nl80211.h>
@@ -239,26 +239,47 @@ ieee80211_chanreq_compatible(const struct ieee80211_chan_req *a, · 231 unmodified lines
239239 return tmp;
240240 }
241241
242+/*
243+ * When checking for compatible, check against all the links using
244+ * the chanctx (except the one passed that might be changing) to
245+ * allow changes to the AP's bandwidth for wider bandwidth OFDMA
246+ * purposes, which wouldn't be treated as compatible by checking
247+ * against the chanctx's oper/ap chandefs.
248+ */
242249 static const struct ieee80211_chan_req *
243−ieee80211_chanctx_compatible(struct ieee80211_chanctx *ctx,
244− const struct ieee80211_chan_req *req,
245− struct ieee80211_chan_req *tmp)
250+_ieee80211_chanctx_compatible(struct ieee80211_local *local,
251+ struct ieee80211_link_data *skip_link,
252+ struct ieee80211_chanctx *ctx,
253+ const struct ieee80211_chan_req *req,
254+ struct ieee80211_chan_req *tmp)
246255 {
247− const struct ieee80211_chan_req *ret;
248− struct ieee80211_chan_req tmp2;
256+ const struct ieee80211_chan_req *ret = req;
257+ struct ieee80211_chanctx_user_iter iter;
249258
250− *tmp = (struct ieee80211_chan_req){
251− .oper = ctx->conf.def,
252− .ap = ctx->conf.ap,
253− };
259+ lockdep_assert_wiphy(local->hw.wiphy);
260+
261+ for_each_chanctx_user_all(local, ctx, &iter) {
262+ if (iter.link && iter.link == skip_link)
263+ continue;
264+
265+ ret = ieee80211_chanreq_compatible(ret, iter.chanreq, tmp);
266+ if (!ret)
267+ return NULL;
268+ }
254269
255− ret = ieee80211_chanreq_compatible(tmp, req, &tmp2);
256− if (!ret)
257− return NULL;
258270 *tmp = *ret;
259271 return tmp;
260272 }
261273
274+static const struct ieee80211_chan_req *
275+ieee80211_chanctx_compatible(struct ieee80211_local *local,
276+ struct ieee80211_chanctx *ctx,
277+ const struct ieee80211_chan_req *req,
278+ struct ieee80211_chan_req *tmp)
279+{
280+ return _ieee80211_chanctx_compatible(local, NULL, ctx, req, tmp);
281+}
282+
262283 static const struct ieee80211_chan_req *
263284 ieee80211_chanctx_reserved_chanreq(struct ieee80211_local *local,
264285 struct ieee80211_chanctx *ctx,
@@ -756,7 +777,8 @@ ieee80211_find_chanctx(struct ieee80211_local *local, · 491 unmodified lines
756777 if (ctx->mode == IEEE80211_CHANCTX_EXCLUSIVE)
757778 continue;
758779
759− compat = ieee80211_chanctx_compatible(ctx, chanreq, &tmp);
780+ compat = ieee80211_chanctx_compatible(local, ctx, chanreq,
781+ &tmp);
760782 if (!compat)
761783 continue;
762784
@@ -2128,40 +2150,6 @@ int ieee80211_link_use_reserved_context(struct ieee80211_link_data *link) · 1365 unmodified lines
21282150 return 0;
21292151 }
21302152
2131−/*
2132− * This is similar to ieee80211_chanctx_compatible(), but rechecks
2133− * against all the links actually using it (except the one that's
2134− * passed, since that one is changing).
2135− * This is done in order to allow changes to the AP's bandwidth for
2136− * wider bandwidth OFDMA purposes, which wouldn't be treated as
2137− * compatible by ieee80211_chanctx_recheck() but is OK if the link
2138− * requesting the update is the only one using it.
2139− */
2140−static const struct ieee80211_chan_req *
2141−ieee80211_chanctx_recheck(struct ieee80211_local *local,
2142− struct ieee80211_link_data *skip_link,
2143− struct ieee80211_chanctx *ctx,
2144− const struct ieee80211_chan_req *req,
2145− struct ieee80211_chan_req *tmp)
2146−{
2147− const struct ieee80211_chan_req *ret = req;
2148− struct ieee80211_chanctx_user_iter iter;
2149−
2150− lockdep_assert_wiphy(local->hw.wiphy);
2151−
2152− for_each_chanctx_user_all(local, ctx, &iter) {
2153− if (iter.link == skip_link)
2154− continue;
2155−
2156− ret = ieee80211_chanreq_compatible(ret, iter.chanreq, tmp);
2157− if (!ret)
2158− return NULL;
2159− }
2160−
2161− *tmp = *ret;
2162− return tmp;
2163−}
2164−
21652153 int ieee80211_link_change_chanreq(struct ieee80211_link_data *link,
21662154 const struct ieee80211_chan_req *chanreq,
21672155 u64 *changed)
@@ -2198,7 +2186,7 @@ int ieee80211_link_change_chanreq(struct ieee80211_link_data *link, · 30 unmodified lines
21982186
21992187 ctx = container_of(conf, struct ieee80211_chanctx, conf);
22002188
2201− compat = ieee80211_chanctx_recheck(local, link, ctx, chanreq, &tmp);
2189+ compat = _ieee80211_chanctx_compatible(local, link, ctx, chanreq, &tmp);
22022190 if (!compat)
22032191 return -EINVAL;
22042192
net/mac80211/debugfs.c+1−0
@@ -490,6 +490,7 @@ static const char *hw_flag_names[] = { · 489 unmodified lines
490490 FLAG(DISALLOW_PUNCTURING),
491491 FLAG(HANDLES_QUIET_CSA),
492492 FLAG(STRICT),
493+ FLAG(SUPPORTS_NDP_BLOCKACK),
493494 #undef FLAG
494495 };
495496
net/mac80211/eht.c+10−11
@@ -108,7 +108,7 @@ static void · 107 unmodified lines
108108 ieee80211_send_eml_op_mode_notif(struct ieee80211_sub_if_data *sdata,
109109 struct ieee80211_mgmt *req, int opt_len)
110110 {
111− int len = offsetofend(struct ieee80211_mgmt, u.action.u.eml_omn);
111+ int len = IEEE80211_MIN_ACTION_SIZE(eml_omn);
112112 struct ieee80211_local *local = sdata->local;
113113 struct ieee80211_mgmt *mgmt;
114114 struct sk_buff *skb;
@@ -127,16 +127,15 @@ ieee80211_send_eml_op_mode_notif(struct ieee80211_sub_if_data *sdata, · 12 unmodified lines
127127 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
128128
129129 mgmt->u.action.category = WLAN_CATEGORY_PROTECTED_EHT;
130− mgmt->u.action.u.eml_omn.action_code =
131− WLAN_PROTECTED_EHT_ACTION_EML_OP_MODE_NOTIF;
132− mgmt->u.action.u.eml_omn.dialog_token =
133− req->u.action.u.eml_omn.dialog_token;
134− mgmt->u.action.u.eml_omn.control = req->u.action.u.eml_omn.control &
130+ mgmt->u.action.action_code = WLAN_PROTECTED_EHT_ACTION_EML_OP_MODE_NOTIF;
131+ mgmt->u.action.eml_omn.dialog_token =
132+ req->u.action.eml_omn.dialog_token;
133+ mgmt->u.action.eml_omn.control = req->u.action.eml_omn.control &
135134 ~(IEEE80211_EML_CTRL_EMLSR_PARAM_UPDATE |
136135 IEEE80211_EML_CTRL_INDEV_COEX_ACT);
137136 /* Copy optional fields from the received notification frame */
138− memcpy(mgmt->u.action.u.eml_omn.variable,
139− req->u.action.u.eml_omn.variable, opt_len);
137+ memcpy(mgmt->u.action.eml_omn.variable,
138+ req->u.action.eml_omn.variable, opt_len);
140139
141140 ieee80211_tx_skb(sdata, skb);
142141 }
@@ -144,14 +143,14 @@ ieee80211_send_eml_op_mode_notif(struct ieee80211_sub_if_data *sdata, · 1 unmodified line
144143 void ieee80211_rx_eml_op_mode_notif(struct ieee80211_sub_if_data *sdata,
145144 struct sk_buff *skb)
146145 {
147− int len = offsetofend(struct ieee80211_mgmt, u.action.u.eml_omn);
146+ int len = IEEE80211_MIN_ACTION_SIZE(eml_omn);
148147 enum nl80211_iftype type = ieee80211_vif_type_p2p(&sdata->vif);
149148 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
150149 const struct wiphy_iftype_ext_capab *ift_ext_capa;
151150 struct ieee80211_mgmt *mgmt = (void *)skb->data;
152151 struct ieee80211_local *local = sdata->local;
153− u8 control = mgmt->u.action.u.eml_omn.control;
154− u8 *ptr = mgmt->u.action.u.eml_omn.variable;
152+ u8 control = mgmt->u.action.eml_omn.control;
153+ u8 *ptr = mgmt->u.action.eml_omn.variable;
155154 struct ieee80211_eml_params eml_params = {
156155 .link_id = status->link_id,
157156 .control = control,
net/mac80211/ht.c+20−17
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
1010 * Copyright 2007-2010, Intel Corporation
1111 * Copyright 2017 Intel Deutschland GmbH
12− * Copyright(c) 2020-2025 Intel Corporation
12+ * Copyright(c) 2020-2026 Intel Corporation
1313 */
1414
1515 #include <linux/ieee80211.h>
@@ -379,7 +379,7 @@ void ieee80211_ba_session_work(struct wiphy *wiphy, struct wiphy_work *work) · 363 unmodified lines
379379 sta->ampdu_mlme.tid_rx_manage_offl))
380380 __ieee80211_start_rx_ba_session(sta, 0, 0, 0, 1, tid,
381381 IEEE80211_MAX_AMPDU_BUF_HT,
382− false, true, 0);
382+ false, true, false, 0);
383383
384384 if (test_and_clear_bit(tid + IEEE80211_NUM_TIDS,
385385 sta->ampdu_mlme.tid_rx_manage_offl))
@@ -455,29 +455,32 @@ void ieee80211_ba_session_work(struct wiphy *wiphy, struct wiphy_work *work) · 69 unmodified lines
455455
456456 void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
457457 const u8 *da, u16 tid,
458− u16 initiator, u16 reason_code)
458+ u16 initiator, u16 reason_code,
459+ bool use_ndp)
459460 {
460461 struct ieee80211_local *local = sdata->local;
461462 struct sk_buff *skb;
462463 struct ieee80211_mgmt *mgmt;
463464 u16 params;
464465
465− skb = dev_alloc_skb(sizeof(*mgmt) + local->hw.extra_tx_headroom);
466+ skb = dev_alloc_skb(IEEE80211_MIN_ACTION_SIZE(delba) +
467+ local->hw.extra_tx_headroom);
466468 if (!skb)
467469 return;
468470
469471 skb_reserve(skb, local->hw.extra_tx_headroom);
470472 mgmt = ieee80211_mgmt_ba(skb, da, sdata);
471473
472− skb_put(skb, 1 + sizeof(mgmt->u.action.u.delba));
474+ skb_put(skb, 2 + sizeof(mgmt->u.action.delba));
473475
474476 mgmt->u.action.category = WLAN_CATEGORY_BACK;
475− mgmt->u.action.u.delba.action_code = WLAN_ACTION_DELBA;
477+ mgmt->u.action.action_code = use_ndp ?
478+ WLAN_ACTION_NDP_DELBA : WLAN_ACTION_DELBA;
476479 params = (u16)(initiator << 11); /* bit 11 initiator */
477480 params |= (u16)(tid << 12); /* bit 15:12 TID number */
478481
479− mgmt->u.action.u.delba.params = cpu_to_le16(params);
480− mgmt->u.action.u.delba.reason_code = cpu_to_le16(reason_code);
482+ mgmt->u.action.delba.params = cpu_to_le16(params);
483+ mgmt->u.action.delba.reason_code = cpu_to_le16(reason_code);
481484
482485 ieee80211_tx_skb(sdata, skb);
483486 }
@@ -489,14 +492,14 @@ void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata, · 5 unmodified lines
489492 u16 tid, params;
490493 u16 initiator;
491494
492− params = le16_to_cpu(mgmt->u.action.u.delba.params);
495+ params = le16_to_cpu(mgmt->u.action.delba.params);
493496 tid = (params & IEEE80211_DELBA_PARAM_TID_MASK) >> 12;
494497 initiator = (params & IEEE80211_DELBA_PARAM_INITIATOR_MASK) >> 11;
495498
496499 ht_dbg_ratelimited(sdata, "delba from %pM (%s) tid %d reason code %d\n",
497500 mgmt->sa, initiator ? "initiator" : "recipient",
498501 tid,
499− le16_to_cpu(mgmt->u.action.u.delba.reason_code));
502+ le16_to_cpu(mgmt->u.action.delba.reason_code));
500503
501504 if (initiator == WLAN_BACK_INITIATOR)
502505 __ieee80211_stop_rx_ba_session(sta, tid, WLAN_BACK_INITIATOR, 0,
@@ -530,20 +533,20 @@ int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata, · 27 unmodified lines
530533 struct ieee80211_tx_info *info;
531534 u8 status_link_id = link_id < 0 ? 0 : link_id;
532535
533− /* 27 = header + category + action + smps mode */
534− skb = dev_alloc_skb(27 + local->hw.extra_tx_headroom);
536+ skb = dev_alloc_skb(IEEE80211_MIN_ACTION_SIZE(ht_smps) +
537+ local->hw.extra_tx_headroom);
535538 if (!skb)
536539 return -ENOMEM;
537540
538541 skb_reserve(skb, local->hw.extra_tx_headroom);
539− action_frame = skb_put(skb, 27);
542+ action_frame = skb_put_zero(skb, IEEE80211_MIN_ACTION_SIZE(ht_smps));
540543 memcpy(action_frame->da, da, ETH_ALEN);
541544 memcpy(action_frame->sa, sdata->dev->dev_addr, ETH_ALEN);
542545 memcpy(action_frame->bssid, bssid, ETH_ALEN);
543546 action_frame->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
544547 IEEE80211_STYPE_ACTION);
545548 action_frame->u.action.category = WLAN_CATEGORY_HT;
546− action_frame->u.action.u.ht_smps.action = WLAN_HT_ACTION_SMPS;
549+ action_frame->u.action.action_code = WLAN_HT_ACTION_SMPS;
547550 switch (smps) {
548551 case IEEE80211_SMPS_AUTOMATIC:
549552 case IEEE80211_SMPS_NUM_MODES:
@@ -551,15 +554,15 @@ int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata, · 1 unmodified line
551554 smps = IEEE80211_SMPS_OFF;
552555 fallthrough;
553556 case IEEE80211_SMPS_OFF:
554− action_frame->u.action.u.ht_smps.smps_control =
557+ action_frame->u.action.ht_smps.smps_control =
555558 WLAN_HT_SMPS_CONTROL_DISABLED;
556559 break;
557560 case IEEE80211_SMPS_STATIC:
558− action_frame->u.action.u.ht_smps.smps_control =
561+ action_frame->u.action.ht_smps.smps_control =
559562 WLAN_HT_SMPS_CONTROL_STATIC;
560563 break;
561564 case IEEE80211_SMPS_DYNAMIC:
562− action_frame->u.action.u.ht_smps.smps_control =
565+ action_frame->u.action.ht_smps.smps_control =
563566 WLAN_HT_SMPS_CONTROL_DYNAMIC;
564567 break;
565568 }
net/mac80211/ibss.c+5−13
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 * Copyright 2009, Johannes Berg <johannes@sipsolutions.net>
1010 * Copyright 2013-2014 Intel Mobile Communications GmbH
1111 * Copyright(c) 2016 Intel Deutschland GmbH
12− * Copyright(c) 2018-2025 Intel Corporation
12+ * Copyright(c) 2018-2026 Intel Corporation
1313 */
1414
1515 #include <linux/delay.h>
@@ -888,19 +888,11 @@ ieee80211_rx_mgmt_spectrum_mgmt(struct ieee80211_sub_if_data *sdata, · 872 unmodified lines
888888 struct ieee80211_rx_status *rx_status,
889889 struct ieee802_11_elems *elems)
890890 {
891− int required_len;
892−
893− if (len < IEEE80211_MIN_ACTION_SIZE + 1)
891+ if (len < IEEE80211_MIN_ACTION_SIZE(chan_switch))
894892 return;
895893
896894 /* CSA is the only action we handle for now */
897− if (mgmt->u.action.u.measurement.action_code !=
898− WLAN_ACTION_SPCT_CHL_SWITCH)
899− return;
900−
901− required_len = IEEE80211_MIN_ACTION_SIZE +
902− sizeof(mgmt->u.action.u.chan_switch);
903− if (len < required_len)
895+ if (mgmt->u.action.action_code != WLAN_ACTION_SPCT_CHL_SWITCH)
904896 return;
905897
906898 if (!sdata->vif.bss_conf.csa_active)
@@ -1613,12 +1605,12 @@ void ieee80211_ibss_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, · 706 unmodified lines
16131605 case WLAN_CATEGORY_SPECTRUM_MGMT:
16141606 ies_len = skb->len -
16151607 offsetof(struct ieee80211_mgmt,
1616− u.action.u.chan_switch.variable);
1608+ u.action.chan_switch.variable);
16171609
16181610 if (ies_len < 0)
16191611 break;
16201612
1621− elems = ieee802_11_parse_elems(mgmt->u.action.u.chan_switch.variable,
1613+ elems = ieee802_11_parse_elems(mgmt->u.action.chan_switch.variable,
16221614 ies_len,
16231615 IEEE80211_FTYPE_MGMT |
16241616 IEEE80211_STYPE_ACTION,
net/mac80211/ieee80211_i.h+5−1
@@ -2190,7 +2190,8 @@ bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata, · 2189 unmodified lines
21902190 struct link_sta_info *link_sta);
21912191 void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
21922192 const u8 *da, u16 tid,
2193− u16 initiator, u16 reason_code);
2193+ u16 initiator, u16 reason_code,
2194+ bool use_ndp);
21942195 int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata,
21952196 enum ieee80211_smps_mode smps, const u8 *da,
21962197 const u8 *bssid, int link_id);
@@ -2206,6 +2207,7 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta, · 9 unmodified lines
22062207 u8 dialog_token, u16 timeout,
22072208 u16 start_seq_num, u16 ba_policy, u16 tid,
22082209 u16 buf_size, bool tx, bool auto_seq,
2210+ bool req_ndp,
22092211 const u8 addba_ext_data);
22102212 void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta,
22112213 enum ieee80211_agg_stop_reason reason);
@@ -2331,6 +2333,8 @@ void ieee80211_s1g_status_twt_action(struct ieee80211_sub_if_data *sdata, · 119 unmodified lines
23312333 void ieee80211_s1g_cap_to_sta_s1g_cap(struct ieee80211_sub_if_data *sdata,
23322334 const struct ieee80211_s1g_cap *s1g_cap_ie,
23332335 struct link_sta_info *link_sta);
2336+bool ieee80211_s1g_use_ndp_ba(const struct ieee80211_sub_if_data *sdata,
2337+ const struct sta_info *sta);
23342338
23352339 /* Spectrum management */
23362340 void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
net/mac80211/iface.c+12−9
@@ -1579,16 +1579,19 @@ static void ieee80211_iface_process_skb(struct ieee80211_local *local, · 1578 unmodified lines
15791579
15801580 sta = sta_info_get_bss(sdata, mgmt->sa);
15811581 if (sta) {
1582− switch (mgmt->u.action.u.addba_req.action_code) {
1582+ switch (mgmt->u.action.action_code) {
15831583 case WLAN_ACTION_ADDBA_REQ:
1584+ case WLAN_ACTION_NDP_ADDBA_REQ:
15841585 ieee80211_process_addba_request(local, sta,
15851586 mgmt, len);
15861587 break;
15871588 case WLAN_ACTION_ADDBA_RESP:
1589+ case WLAN_ACTION_NDP_ADDBA_RESP:
15881590 ieee80211_process_addba_resp(local, sta,
15891591 mgmt, len);
15901592 break;
15911593 case WLAN_ACTION_DELBA:
1594+ case WLAN_ACTION_NDP_DELBA:
15921595 ieee80211_process_delba(sdata, sta,
15931596 mgmt, len);
15941597 break;
@@ -1599,9 +1602,9 @@ static void ieee80211_iface_process_skb(struct ieee80211_local *local, · 4 unmodified lines
15991602 }
16001603 } else if (ieee80211_is_action(mgmt->frame_control) &&
16011604 mgmt->u.action.category == WLAN_CATEGORY_HT) {
1602− switch (mgmt->u.action.u.ht_smps.action) {
1605+ switch (mgmt->u.action.action_code) {
16031606 case WLAN_HT_ACTION_NOTIFY_CHANWIDTH: {
1604− u8 chanwidth = mgmt->u.action.u.ht_notify_cw.chanwidth;
1607+ u8 chanwidth = mgmt->u.action.ht_notify_cw.chanwidth;
16051608 struct ieee80211_rx_status *status;
16061609 struct link_sta_info *link_sta;
16071610 struct sta_info *sta;
@@ -1628,7 +1631,7 @@ static void ieee80211_iface_process_skb(struct ieee80211_local *local, · 20 unmodified lines
16281631 }
16291632 } else if (ieee80211_is_action(mgmt->frame_control) &&
16301633 mgmt->u.action.category == WLAN_CATEGORY_VHT) {
1631− switch (mgmt->u.action.u.vht_group_notif.action_code) {
1634+ switch (mgmt->u.action.action_code) {
16321635 case WLAN_VHT_ACTION_OPMODE_NOTIF: {
16331636 struct ieee80211_rx_status *status;
16341637 enum nl80211_band band;
@@ -1637,7 +1640,7 @@ static void ieee80211_iface_process_skb(struct ieee80211_local *local, · 2 unmodified lines
16371640
16381641 status = IEEE80211_SKB_RXCB(skb);
16391642 band = status->band;
1640− opmode = mgmt->u.action.u.vht_opmode_notif.operating_mode;
1643+ opmode = mgmt->u.action.vht_opmode_notif.operating_mode;
16411644
16421645 sta = sta_info_get_bss(sdata, mgmt->sa);
16431646
@@ -1658,7 +1661,7 @@ static void ieee80211_iface_process_skb(struct ieee80211_local *local, · 14 unmodified lines
16581661 }
16591662 } else if (ieee80211_is_action(mgmt->frame_control) &&
16601663 mgmt->u.action.category == WLAN_CATEGORY_S1G) {
1661− switch (mgmt->u.action.u.s1g.action_code) {
1664+ switch (mgmt->u.action.action_code) {
16621665 case WLAN_S1G_TWT_TEARDOWN:
16631666 case WLAN_S1G_TWT_SETUP:
16641667 ieee80211_s1g_rx_twt_action(sdata, skb);
@@ -1669,7 +1672,7 @@ static void ieee80211_iface_process_skb(struct ieee80211_local *local, · 4 unmodified lines
16691672 } else if (ieee80211_is_action(mgmt->frame_control) &&
16701673 mgmt->u.action.category == WLAN_CATEGORY_PROTECTED_EHT) {
16711674 if (sdata->vif.type == NL80211_IFTYPE_AP) {
1672− switch (mgmt->u.action.u.eml_omn.action_code) {
1675+ switch (mgmt->u.action.action_code) {
16731676 case WLAN_PROTECTED_EHT_ACTION_EML_OP_MODE_NOTIF:
16741677 ieee80211_rx_eml_op_mode_notif(sdata, skb);
16751678 break;
@@ -1677,7 +1680,7 @@ static void ieee80211_iface_process_skb(struct ieee80211_local *local, · 1 unmodified line
16771680 break;
16781681 }
16791682 } else if (sdata->vif.type == NL80211_IFTYPE_STATION) {
1680− switch (mgmt->u.action.u.ttlm_req.action_code) {
1683+ switch (mgmt->u.action.action_code) {
16811684 case WLAN_PROTECTED_EHT_ACTION_TTLM_REQ:
16821685 ieee80211_process_neg_ttlm_req(sdata, mgmt,
16831686 skb->len);
@@ -1765,7 +1768,7 @@ static void ieee80211_iface_process_status(struct ieee80211_sub_if_data *sdata, · 81 unmodified lines
17651768
17661769 if (ieee80211_is_action(mgmt->frame_control) &&
17671770 mgmt->u.action.category == WLAN_CATEGORY_S1G) {
1768− switch (mgmt->u.action.u.s1g.action_code) {
1771+ switch (mgmt->u.action.action_code) {
17691772 case WLAN_S1G_TWT_TEARDOWN:
17701773 case WLAN_S1G_TWT_SETUP:
17711774 ieee80211_s1g_status_twt_action(sdata, skb);
net/mac80211/main.c+15−3
@@ -1118,6 +1118,19 @@ ieee80211_ifcomb_check(const struct ieee80211_iface_combination *c, int n_comb) · 1117 unmodified lines
11181118 return true;
11191119 }
11201120
1121+static void ieee80211_create_default_chandef(struct cfg80211_chan_def *chandef,
1122+ struct ieee80211_channel *chan)
1123+{
1124+ *chandef = (struct cfg80211_chan_def) {
1125+ .chan = chan,
1126+ .width = chan->band == NL80211_BAND_S1GHZ ?
1127+ NL80211_CHAN_WIDTH_1 :
1128+ NL80211_CHAN_WIDTH_20_NOHT,
1129+ .center_freq1 = chan->center_freq,
1130+ .freq1_offset = chan->freq_offset,
1131+ };
1132+}
1133+
11211134 int ieee80211_register_hw(struct ieee80211_hw *hw)
11221135 {
11231136 struct ieee80211_local *local = hw_to_local(hw);
@@ -1261,9 +1274,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) · 137 unmodified lines
12611274 /* if none found then use the first anyway */
12621275 if (i == sband->n_channels)
12631276 i = 0;
1264− cfg80211_chandef_create(&dflt_chandef,
1265− &sband->channels[i],
1266− NL80211_CHAN_NO_HT);
1277+ ieee80211_create_default_chandef(&dflt_chandef,
1278+ &sband->channels[i]);
12671279 /* init channel we're on */
12681280 local->monitor_chanreq.oper = dflt_chandef;
12691281 if (local->emulate_chanctx) {
net/mac80211/mesh.c+6−8
@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0-only
22 /*
33 * Copyright (c) 2008, 2009 open80211s Ltd.
4− * Copyright (C) 2018 - 2025 Intel Corporation
4+ * Copyright (C) 2018-2026 Intel Corporation
55 * Authors: Luis Carlos Cobo <luisca@cozybit.com>
66 * Javier Cardona <javier@cozybit.com>
77 */
@@ -19,8 +19,7 @@ static struct kmem_cache *rm_cache; · 11 unmodified lines
1919
2020 bool mesh_action_is_path_sel(struct ieee80211_mgmt *mgmt)
2121 {
22− return (mgmt->u.action.u.mesh_action.action_code ==
23− WLAN_MESH_ACTION_HWMP_PATH_SELECTION);
22+ return mgmt->u.action.action_code == WLAN_MESH_ACTION_HWMP_PATH_SELECTION;
2423 }
2524
2625 void ieee80211s_init(void)
@@ -1618,13 +1617,12 @@ static void mesh_rx_csa_frame(struct ieee80211_sub_if_data *sdata, · 1591 unmodified lines
16181617 size_t baselen;
16191618 u8 *pos;
16201619
1621− if (mgmt->u.action.u.measurement.action_code !=
1622− WLAN_ACTION_SPCT_CHL_SWITCH)
1620+ if (mgmt->u.action.action_code != WLAN_ACTION_SPCT_CHL_SWITCH)
16231621 return;
16241622
1625− pos = mgmt->u.action.u.chan_switch.variable;
1623+ pos = mgmt->u.action.chan_switch.variable;
16261624 baselen = offsetof(struct ieee80211_mgmt,
1627− u.action.u.chan_switch.variable);
1625+ u.action.chan_switch.variable);
16281626 elems = ieee802_11_parse_elems(pos, len - baselen,
16291627 IEEE80211_FTYPE_MGMT |
16301628 IEEE80211_STYPE_ACTION,
@@ -1670,7 +1668,7 @@ static void ieee80211_mesh_rx_mgmt_action(struct ieee80211_sub_if_data *sdata, · 39 unmodified lines
16701668 {
16711669 switch (mgmt->u.action.category) {
16721670 case WLAN_CATEGORY_SELF_PROTECTED:
1673− switch (mgmt->u.action.u.self_prot.action_code) {
1671+ switch (mgmt->u.action.action_code) {
16741672 case WLAN_SP_MESH_PEERING_OPEN:
16751673 case WLAN_SP_MESH_PEERING_CLOSE:
16761674 case WLAN_SP_MESH_PEERING_CONFIRM:
net/mac80211/mesh_hwmp.c+8−12
@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0-only
22 /*
33 * Copyright (c) 2008, 2009 open80211s Ltd.
4− * Copyright (C) 2019, 2021-2023, 2025 Intel Corporation
4+ * Copyright (C) 2019, 2021-2023, 2025-2026 Intel Corporation
55 * Author: Luis Carlos Cobo <luisca@cozybit.com>
66 */
77
@@ -105,12 +105,11 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags, · 97 unmodified lines
105105 u32 lifetime, u32 metric, u32 preq_id,
106106 struct ieee80211_sub_if_data *sdata)
107107 {
108+ int hdr_len = IEEE80211_MIN_ACTION_SIZE(mesh_action);
108109 struct ieee80211_local *local = sdata->local;
109110 struct sk_buff *skb;
110111 struct ieee80211_mgmt *mgmt;
111112 u8 *pos, ie_len;
112− int hdr_len = offsetofend(struct ieee80211_mgmt,
113− u.action.u.mesh_action);
114113
115114 skb = dev_alloc_skb(local->tx_headroom +
116115 hdr_len +
@@ -127,8 +126,7 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags, · 10 unmodified lines
127126 /* BSSID == SA */
128127 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
129128 mgmt->u.action.category = WLAN_CATEGORY_MESH_ACTION;
130− mgmt->u.action.u.mesh_action.action_code =
131− WLAN_MESH_ACTION_HWMP_PATH_SELECTION;
129+ mgmt->u.action.action_code = WLAN_MESH_ACTION_HWMP_PATH_SELECTION;
132130
133131 switch (action) {
134132 case MPATH_PREQ:
@@ -237,13 +235,12 @@ int mesh_path_error_tx(struct ieee80211_sub_if_data *sdata, · 102 unmodified lines
237235 u8 ttl, const u8 *target, u32 target_sn,
238236 u16 target_rcode, const u8 *ra)
239237 {
238+ int hdr_len = IEEE80211_MIN_ACTION_SIZE(mesh_action);
240239 struct ieee80211_local *local = sdata->local;
241240 struct sk_buff *skb;
242241 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
243242 struct ieee80211_mgmt *mgmt;
244243 u8 *pos, ie_len;
245− int hdr_len = offsetofend(struct ieee80211_mgmt,
246− u.action.u.mesh_action);
247244
248245 if (time_before(jiffies, ifmsh->next_perr))
249246 return -EAGAIN;
@@ -265,8 +262,7 @@ int mesh_path_error_tx(struct ieee80211_sub_if_data *sdata, · 15 unmodified lines
265262 /* BSSID == SA */
266263 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
267264 mgmt->u.action.category = WLAN_CATEGORY_MESH_ACTION;
268− mgmt->u.action.u.mesh_action.action_code =
269− WLAN_MESH_ACTION_HWMP_PATH_SELECTION;
265+ mgmt->u.action.action_code = WLAN_MESH_ACTION_HWMP_PATH_SELECTION;
270266 ie_len = 15;
271267 pos = skb_put(skb, 2 + ie_len);
272268 *pos++ = WLAN_EID_PERR;
@@ -938,7 +934,7 @@ void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata, · 665 unmodified lines
938934 struct sta_info *sta;
939935
940936 /* need action_code */
941− if (len < IEEE80211_MIN_ACTION_SIZE + 1)
937+ if (len < IEEE80211_MIN_ACTION_SIZE(mesh_action))
942938 return;
943939
944940 rcu_read_lock();
@@ -949,8 +945,8 @@ void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata, · 4 unmodified lines
949945 }
950946 rcu_read_unlock();
951947
952− baselen = (u8 *) mgmt->u.action.u.mesh_action.variable - (u8 *) mgmt;
953− elems = ieee802_11_parse_elems(mgmt->u.action.u.mesh_action.variable,
948+ baselen = mgmt->u.action.mesh_action.variable - (u8 *)mgmt;
949+ elems = ieee802_11_parse_elems(mgmt->u.action.mesh_action.variable,
954950 len - baselen,
955951 IEEE80211_FTYPE_MGMT |
956952 IEEE80211_STYPE_ACTION,
net/mac80211/mesh_plink.c+10−11
@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0-only
22 /*
33 * Copyright (c) 2008, 2009 open80211s Ltd.
4− * Copyright (C) 2019, 2021-2025 Intel Corporation
4+ * Copyright (C) 2019, 2021-2026 Intel Corporation
55 * Author: Luis Carlos Cobo <luisca@cozybit.com>
66 */
77 #include <linux/gfp.h>
@@ -13,7 +13,7 @@ · 5 unmodified lines
1313 #include "rate.h"
1414 #include "mesh.h"
1515
16−#define PLINK_CNF_AID(mgmt) ((mgmt)->u.action.u.self_prot.variable + 2)
16+#define PLINK_CNF_AID(mgmt) ((mgmt)->u.action.self_prot.variable + 2)
1717 #define PLINK_GET_LLID(p) (p + 2)
1818 #define PLINK_GET_PLID(p) (p + 4)
1919
@@ -215,6 +215,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, · 195 unmodified lines
215215 enum ieee80211_self_protected_actioncode action,
216216 u8 *da, u16 llid, u16 plid, u16 reason)
217217 {
218+ int hdr_len = IEEE80211_MIN_ACTION_SIZE(self_prot);
218219 struct ieee80211_local *local = sdata->local;
219220 struct sk_buff *skb;
220221 struct ieee80211_tx_info *info;
@@ -223,7 +224,6 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, · 2 unmodified lines
223224 u16 peering_proto = 0;
224225 u8 *pos, ie_len = 4;
225226 u8 ie_len_he_cap, ie_len_eht_cap;
226− int hdr_len = offsetofend(struct ieee80211_mgmt, u.action.u.self_prot);
227227 int err = -ENOMEM;
228228
229229 ie_len_he_cap = ieee80211_ie_len_he_cap(sdata);
@@ -260,7 +260,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, · 30 unmodified lines
260260 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN);
261261 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
262262 mgmt->u.action.category = WLAN_CATEGORY_SELF_PROTECTED;
263− mgmt->u.action.u.self_prot.action_code = action;
263+ mgmt->u.action.action_code = action;
264264
265265 if (action != WLAN_SP_MESH_PEERING_CLOSE) {
266266 struct ieee80211_supported_band *sband;
@@ -1141,7 +1141,7 @@ mesh_process_plink_frame(struct ieee80211_sub_if_data *sdata, · 874 unmodified lines
11411141 return;
11421142 }
11431143
1144− ftype = mgmt->u.action.u.self_prot.action_code;
1144+ ftype = mgmt->u.action.action_code;
11451145 if ((ftype == WLAN_SP_MESH_PEERING_OPEN && ie_len != 4) ||
11461146 (ftype == WLAN_SP_MESH_PEERING_CONFIRM && ie_len != 6) ||
11471147 (ftype == WLAN_SP_MESH_PEERING_CLOSE && ie_len != 6
@@ -1224,8 +1224,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, · 76 unmodified lines
12241224 size_t baselen;
12251225 u8 *baseaddr;
12261226
1227− /* need action_code, aux */
1228− if (len < IEEE80211_MIN_ACTION_SIZE + 3)
1227+ /* need aux */
1228+ if (len < IEEE80211_MIN_ACTION_SIZE(self_prot) + 1)
12291229 return;
12301230
12311231 if (sdata->u.mesh.user_mpm)
@@ -1238,10 +1238,9 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, · 6 unmodified lines
12381238 return;
12391239 }
12401240
1241− baseaddr = mgmt->u.action.u.self_prot.variable;
1242− baselen = (u8 *) mgmt->u.action.u.self_prot.variable - (u8 *) mgmt;
1243− if (mgmt->u.action.u.self_prot.action_code ==
1244− WLAN_SP_MESH_PEERING_CONFIRM) {
1241+ baseaddr = mgmt->u.action.self_prot.variable;
1242+ baselen = mgmt->u.action.self_prot.variable - (u8 *)mgmt;
1243+ if (mgmt->u.action.action_code == WLAN_SP_MESH_PEERING_CONFIRM) {
12451244 baseaddr += 4;
12461245 baselen += 4;
12471246
net/mac80211/mlme.c+66−47
@@ -216,6 +216,24 @@ ieee80211_determine_ap_chan(struct ieee80211_sub_if_data *sdata, · 215 unmodified lines
216216 return IEEE80211_CONN_MODE_LEGACY;
217217 }
218218
219+ if (eht_oper && ieee80211_hw_check(&sdata->local->hw, STRICT)) {
220+ struct cfg80211_chan_def he_chandef = *chandef;
221+
222+ if (!ieee80211_chandef_he_6ghz_oper(sdata->local,
223+ he_oper, NULL,
224+ &he_chandef)) {
225+ sdata_info(sdata,
226+ "bad HE operation in EHT AP\n");
227+ return IEEE80211_CONN_MODE_LEGACY;
228+ }
229+
230+ if (!cfg80211_chandef_compatible(chandef,
231+ &he_chandef)) {
232+ sdata_info(sdata, "HE/EHT incompatible\n");
233+ return IEEE80211_CONN_MODE_LEGACY;
234+ }
235+ }
236+
219237 if (mode <= IEEE80211_CONN_MODE_EHT)
220238 return mode;
221239 goto check_uhr;
@@ -6721,7 +6739,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, · 6499 unmodified lines
67216739 sdata_info(sdata,
67226740 "RX %sssocResp from %pM (capab=0x%x status=%d aid=%d)\n",
67236741 reassoc ? "Rea" : "A", assoc_data->ap_addr,
6724− capab_info, status_code, (u16)(aid & ~(BIT(15) | BIT(14))));
6742+ capab_info, status_code, aid);
67256743
67266744 ifmgd->broken_ap = false;
67276745
@@ -7058,6 +7076,7 @@ static void ieee80211_ml_reconf_work(struct wiphy *wiphy, · 330 unmodified lines
70587076 container_of(work, struct ieee80211_sub_if_data,
70597077 u.mgd.ml_reconf_work.work);
70607078 u16 new_valid_links, new_active_links, new_dormant_links;
7079+ struct sta_info *sta;
70617080 int ret;
70627081
70637082 if (!sdata->u.mgd.removed_links)
@@ -7093,6 +7112,16 @@ static void ieee80211_ml_reconf_work(struct wiphy *wiphy, · 29 unmodified lines
70937112 }
70947113 }
70957114
7115+ sta = sta_info_get(sdata, sdata->vif.cfg.ap_addr);
7116+ if (sta) {
7117+ unsigned long removed_links = sdata->u.mgd.removed_links;
7118+ unsigned int link_id;
7119+
7120+ for_each_set_bit(link_id, &removed_links,
7121+ IEEE80211_MLD_MAX_NUM_LINKS)
7122+ ieee80211_sta_remove_link(sta, link_id);
7123+ }
7124+
70967125 new_dormant_links = sdata->vif.dormant_links & ~sdata->u.mgd.removed_links;
70977126
70987127 ret = ieee80211_vif_set_links(sdata, new_valid_links,
@@ -7957,7 +7986,7 @@ ieee80211_send_neg_ttlm_req(struct ieee80211_sub_if_data *sdata, · 858 unmodified lines
79577986 struct ieee80211_local *local = sdata->local;
79587987 struct ieee80211_mgmt *mgmt;
79597988 struct sk_buff *skb;
7960− int hdr_len = offsetofend(struct ieee80211_mgmt, u.action.u.ttlm_req);
7989+ int hdr_len = IEEE80211_MIN_ACTION_SIZE(ttlm_req);
79617990 int ttlm_max_len = 2 + 1 + sizeof(struct ieee80211_ttlm_elem) + 1 +
79627991 2 * 2 * IEEE80211_TTLM_NUM_TIDS;
79637992
@@ -7974,9 +8003,8 @@ ieee80211_send_neg_ttlm_req(struct ieee80211_sub_if_data *sdata, · 10 unmodified lines
79748003 memcpy(mgmt->bssid, sdata->vif.cfg.ap_addr, ETH_ALEN);
79758004
79768005 mgmt->u.action.category = WLAN_CATEGORY_PROTECTED_EHT;
7977− mgmt->u.action.u.ttlm_req.action_code =
7978− WLAN_PROTECTED_EHT_ACTION_TTLM_REQ;
7979− mgmt->u.action.u.ttlm_req.dialog_token = dialog_token;
8006+ mgmt->u.action.action_code = WLAN_PROTECTED_EHT_ACTION_TTLM_REQ;
8007+ mgmt->u.action.ttlm_req.dialog_token = dialog_token;
79808008 ieee80211_neg_ttlm_add_suggested_map(skb, neg_ttlm);
79818009 ieee80211_tx_skb(sdata, skb);
79828010 }
@@ -8026,7 +8054,7 @@ ieee80211_send_neg_ttlm_res(struct ieee80211_sub_if_data *sdata, · 43 unmodified lines
80268054 struct ieee80211_local *local = sdata->local;
80278055 struct ieee80211_mgmt *mgmt;
80288056 struct sk_buff *skb;
8029− int hdr_len = offsetofend(struct ieee80211_mgmt, u.action.u.ttlm_res);
8057+ int hdr_len = IEEE80211_MIN_ACTION_SIZE(ttlm_res);
80308058 int ttlm_max_len = 2 + 1 + sizeof(struct ieee80211_ttlm_elem) + 1 +
80318059 2 * 2 * IEEE80211_TTLM_NUM_TIDS;
80328060 u16 status_code;
@@ -8044,9 +8072,8 @@ ieee80211_send_neg_ttlm_res(struct ieee80211_sub_if_data *sdata, · 11 unmodified lines
80448072 memcpy(mgmt->bssid, sdata->vif.cfg.ap_addr, ETH_ALEN);
80458073
80468074 mgmt->u.action.category = WLAN_CATEGORY_PROTECTED_EHT;
8047− mgmt->u.action.u.ttlm_res.action_code =
8048− WLAN_PROTECTED_EHT_ACTION_TTLM_RES;
8049− mgmt->u.action.u.ttlm_res.dialog_token = dialog_token;
8075+ mgmt->u.action.action_code = WLAN_PROTECTED_EHT_ACTION_TTLM_RES;
8076+ mgmt->u.action.ttlm_res.dialog_token = dialog_token;
80508077 switch (ttlm_res) {
80518078 default:
80528079 WARN_ON(1);
@@ -8063,7 +8090,7 @@ ieee80211_send_neg_ttlm_res(struct ieee80211_sub_if_data *sdata, · 10 unmodified lines
80638090 break;
80648091 }
80658092
8066− mgmt->u.action.u.ttlm_res.status_code = cpu_to_le16(status_code);
8093+ mgmt->u.action.ttlm_res.status_code = cpu_to_le16(status_code);
80678094 ieee80211_tx_skb(sdata, skb);
80688095 }
80698096
@@ -8163,10 +8190,9 @@ void ieee80211_process_neg_ttlm_req(struct ieee80211_sub_if_data *sdata, · 93 unmodified lines
81638190 if (!ieee80211_vif_is_mld(&sdata->vif))
81648191 return;
81658192
8166− dialog_token = mgmt->u.action.u.ttlm_req.dialog_token;
8167− ies_len = len - offsetof(struct ieee80211_mgmt,
8168− u.action.u.ttlm_req.variable);
8169− elems = ieee802_11_parse_elems(mgmt->u.action.u.ttlm_req.variable,
8193+ dialog_token = mgmt->u.action.ttlm_req.dialog_token;
8194+ ies_len = len - IEEE80211_MIN_ACTION_SIZE(ttlm_req);
8195+ elems = ieee802_11_parse_elems(mgmt->u.action.ttlm_req.variable,
81708196 ies_len,
81718197 IEEE80211_FTYPE_MGMT |
81728198 IEEE80211_STYPE_ACTION,
@@ -8217,8 +8243,7 @@ void ieee80211_process_neg_ttlm_res(struct ieee80211_sub_if_data *sdata, · 44 unmodified lines
82178243 struct ieee80211_mgmt *mgmt, size_t len)
82188244 {
82198245 if (!ieee80211_vif_is_mld(&sdata->vif) ||
8220− mgmt->u.action.u.ttlm_req.dialog_token !=
8221− sdata->u.mgd.dialog_token_alloc)
8246+ mgmt->u.action.ttlm_res.dialog_token != sdata->u.mgd.dialog_token_alloc)
82228247 return;
82238248
82248249 wiphy_delayed_work_cancel(sdata->local->hw.wiphy,
@@ -8232,7 +8257,7 @@ void ieee80211_process_neg_ttlm_res(struct ieee80211_sub_if_data *sdata, · 7 unmodified lines
82328257 * This can be better implemented in the future, to handle request
82338258 * rejections.
82348259 */
8235− if (le16_to_cpu(mgmt->u.action.u.ttlm_res.status_code) != WLAN_STATUS_SUCCESS)
8260+ if (le16_to_cpu(mgmt->u.action.ttlm_res.status_code) != WLAN_STATUS_SUCCESS)
82368261 __ieee80211_disconnect(sdata);
82378262 }
82388263
@@ -8265,12 +8290,11 @@ static void ieee80211_teardown_ttlm_work(struct wiphy *wiphy, · 26 unmodified lines
82658290
82668291 void ieee80211_send_teardown_neg_ttlm(struct ieee80211_vif *vif)
82678292 {
8293+ int frame_len = IEEE80211_MIN_ACTION_SIZE(ttlm_tear_down);
82688294 struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
82698295 struct ieee80211_local *local = sdata->local;
82708296 struct ieee80211_mgmt *mgmt;
82718297 struct sk_buff *skb;
8272− int frame_len = offsetofend(struct ieee80211_mgmt,
8273− u.action.u.ttlm_tear_down);
82748298 struct ieee80211_tx_info *info;
82758299
82768300 skb = dev_alloc_skb(local->hw.extra_tx_headroom + frame_len);
@@ -8286,8 +8310,7 @@ void ieee80211_send_teardown_neg_ttlm(struct ieee80211_vif *vif) · 9 unmodified lines
82868310 memcpy(mgmt->bssid, sdata->vif.cfg.ap_addr, ETH_ALEN);
82878311
82888312 mgmt->u.action.category = WLAN_CATEGORY_PROTECTED_EHT;
8289− mgmt->u.action.u.ttlm_tear_down.action_code =
8290− WLAN_PROTECTED_EHT_ACTION_TTLM_TEARDOWN;
8313+ mgmt->u.action.action_code = WLAN_PROTECTED_EHT_ACTION_TTLM_TEARDOWN;
82918314
82928315 info = IEEE80211_SKB_CB(skb);
82938316 info->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
@@ -8370,13 +8393,13 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, · 76 unmodified lines
83708393 case WLAN_CATEGORY_SPECTRUM_MGMT:
83718394 ies_len = skb->len -
83728395 offsetof(struct ieee80211_mgmt,
8373− u.action.u.chan_switch.variable);
8396+ u.action.chan_switch.variable);
83748397
83758398 if (ies_len < 0)
83768399 break;
83778400
83788401 /* CSA IE cannot be overridden, no need for BSSID */
8379− elems = ieee802_11_parse_elems(mgmt->u.action.u.chan_switch.variable,
8402+ elems = ieee802_11_parse_elems(mgmt->u.action.chan_switch.variable,
83808403 ies_len,
83818404 IEEE80211_FTYPE_MGMT |
83828405 IEEE80211_STYPE_ACTION,
@@ -8398,7 +8421,7 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, · 15 unmodified lines
83988421 case WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION:
83998422 ies_len = skb->len -
84008423 offsetof(struct ieee80211_mgmt,
8401− u.action.u.ext_chan_switch.variable);
8424+ u.action.ext_chan_switch.variable);
84028425
84038426 if (ies_len < 0)
84048427 break;
@@ -8407,7 +8430,7 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, · 2 unmodified lines
84078430 * extended CSA IE can't be overridden, no need for
84088431 * BSSID
84098432 */
8410− elems = ieee802_11_parse_elems(mgmt->u.action.u.ext_chan_switch.variable,
8433+ elems = ieee802_11_parse_elems(mgmt->u.action.ext_chan_switch.variable,
84118434 ies_len,
84128435 IEEE80211_FTYPE_MGMT |
84138436 IEEE80211_STYPE_ACTION,
@@ -8424,7 +8447,7 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, · 10 unmodified lines
84248447
84258448 /* for the handling code pretend it was an IE */
84268449 elems->ext_chansw_ie =
8427− &mgmt->u.action.u.ext_chan_switch.data;
8450+ &mgmt->u.action.ext_chan_switch.data;
84288451
84298452 ieee80211_sta_process_chanswitch(link,
84308453 rx_status->mactime,
@@ -10426,25 +10449,25 @@ void ieee80211_process_ml_reconf_resp(struct ieee80211_sub_if_data *sdata, · 1995 unmodified lines
1042610449 u8 *pos;
1042710450
1042810451 if (!ieee80211_vif_is_mld(&sdata->vif) ||
10429− len < offsetofend(typeof(*mgmt), u.action.u.ml_reconf_resp) ||
10430− mgmt->u.action.u.ml_reconf_resp.dialog_token !=
10431− sdata->u.mgd.reconf.dialog_token ||
10452+ len < IEEE80211_MIN_ACTION_SIZE(ml_reconf_resp) ||
10453+ mgmt->u.action.ml_reconf_resp.dialog_token !=
10454+ sdata->u.mgd.reconf.dialog_token ||
1043210455 !sta_changed_links)
1043310456 return;
1043410457
10435− pos = mgmt->u.action.u.ml_reconf_resp.variable;
10436− len -= offsetofend(typeof(*mgmt), u.action.u.ml_reconf_resp);
10458+ pos = mgmt->u.action.ml_reconf_resp.variable;
10459+ len -= offsetofend(typeof(*mgmt), u.action.ml_reconf_resp);
1043710460
1043810461 /* each status duple is 3 octets */
10439− if (len < mgmt->u.action.u.ml_reconf_resp.count * 3) {
10462+ if (len < mgmt->u.action.ml_reconf_resp.count * 3) {
1044010463 sdata_info(sdata,
1044110464 "mlo: reconf: unexpected len=%zu, count=%u\n",
10442− len, mgmt->u.action.u.ml_reconf_resp.count);
10465+ len, mgmt->u.action.ml_reconf_resp.count);
1044310466 goto disconnect;
1044410467 }
1044510468
1044610469 link_mask = sta_changed_links;
10447− for (i = 0; i < mgmt->u.action.u.ml_reconf_resp.count; i++) {
10470+ for (i = 0; i < mgmt->u.action.ml_reconf_resp.count; i++) {
1044810471 u16 status = get_unaligned_le16(pos + 1);
1044910472
1045010473 link_id = *pos;
@@ -10729,8 +10752,7 @@ ieee80211_build_ml_reconf_req(struct ieee80211_sub_if_data *sdata, · 278 unmodified lines
1072910752 return NULL;
1073010753
1073110754 skb_reserve(skb, local->hw.extra_tx_headroom);
10732− mgmt = skb_put_zero(skb, offsetofend(struct ieee80211_mgmt,
10733− u.action.u.ml_reconf_req));
10755+ mgmt = skb_put_zero(skb, IEEE80211_MIN_ACTION_SIZE(ml_reconf_req));
1073410756
1073510757 /* Add the MAC header */
1073610758 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
@@ -10741,12 +10763,11 @@ ieee80211_build_ml_reconf_req(struct ieee80211_sub_if_data *sdata, · 4 unmodified lines
1074110763
1074210764 /* Add the action frame fixed fields */
1074310765 mgmt->u.action.category = WLAN_CATEGORY_PROTECTED_EHT;
10744− mgmt->u.action.u.ml_reconf_req.action_code =
10745− WLAN_PROTECTED_EHT_ACTION_LINK_RECONFIG_REQ;
10766+ mgmt->u.action.action_code = WLAN_PROTECTED_EHT_ACTION_LINK_RECONFIG_REQ;
1074610767
1074710768 /* allocate a dialog token and store it */
1074810769 sdata->u.mgd.reconf.dialog_token = ++sdata->u.mgd.dialog_token_alloc;
10749− mgmt->u.action.u.ml_reconf_req.dialog_token =
10770+ mgmt->u.action.ml_reconf_req.dialog_token =
1075010771 sdata->u.mgd.reconf.dialog_token;
1075110772
1075210773 /* Add the ML reconfiguration element and the common information */
@@ -11116,11 +11137,10 @@ static bool ieee80211_mgd_epcs_supp(struct ieee80211_sub_if_data *sdata) · 363 unmodified lines
1111611137
1111711138 int ieee80211_mgd_set_epcs(struct ieee80211_sub_if_data *sdata, bool enable)
1111811139 {
11140+ int frame_len = IEEE80211_MIN_ACTION_SIZE(epcs) + (enable ? 1 : 0);
1111911141 struct ieee80211_local *local = sdata->local;
1112011142 struct ieee80211_mgmt *mgmt;
1112111143 struct sk_buff *skb;
11122− int frame_len = offsetofend(struct ieee80211_mgmt,
11123− u.action.u.epcs) + (enable ? 1 : 0);
1112411144
1112511145 if (!ieee80211_mgd_epcs_supp(sdata))
1112611146 return -EINVAL;
@@ -11149,15 +11169,15 @@ int ieee80211_mgd_set_epcs(struct ieee80211_sub_if_data *sdata, bool enable) · 22 unmodified lines
1114911169
1115011170 mgmt->u.action.category = WLAN_CATEGORY_PROTECTED_EHT;
1115111171 if (enable) {
11152− u8 *pos = mgmt->u.action.u.epcs.variable;
11172+ u8 *pos = mgmt->u.action.epcs.variable;
1115311173
11154− mgmt->u.action.u.epcs.action_code =
11174+ mgmt->u.action.action_code =
1115511175 WLAN_PROTECTED_EHT_ACTION_EPCS_ENABLE_REQ;
1115611176
1115711177 *pos = ++sdata->u.mgd.dialog_token_alloc;
1115811178 sdata->u.mgd.epcs.dialog_token = *pos;
1115911179 } else {
11160− mgmt->u.action.u.epcs.action_code =
11180+ mgmt->u.action.action_code =
1116111181 WLAN_PROTECTED_EHT_ACTION_EPCS_ENABLE_TEARDOWN;
1116211182
1116311183 ieee80211_epcs_teardown(sdata);
@@ -11246,7 +11266,7 @@ void ieee80211_process_epcs_ena_resp(struct ieee80211_sub_if_data *sdata, · 82 unmodified lines
1124611266 return;
1124711267
1124811268 /* Handle dialog token and status code */
11249− pos = mgmt->u.action.u.epcs.variable;
11269+ pos = mgmt->u.action.epcs.variable;
1125011270 dialog_token = *pos;
1125111271 status_code = get_unaligned_le16(pos + 1);
1125211272
@@ -11268,8 +11288,7 @@ void ieee80211_process_epcs_ena_resp(struct ieee80211_sub_if_data *sdata, · 15 unmodified lines
1126811288 return;
1126911289
1127011290 pos += IEEE80211_EPCS_ENA_RESP_BODY_LEN;
11271− ies_len = len - offsetof(struct ieee80211_mgmt,
11272− u.action.u.epcs.variable) -
11291+ ies_len = len - IEEE80211_MIN_ACTION_SIZE(epcs) -
1127311292 IEEE80211_EPCS_ENA_RESP_BODY_LEN;
1127411293
1127511294 elems = ieee802_11_parse_elems(pos, ies_len,
net/mac80211/rx.c+60−74
@@ -274,7 +274,7 @@ static void ieee80211_handle_mu_mimo_mon(struct ieee80211_sub_if_data *sdata, · 273 unmodified lines
274274 if (!sdata)
275275 return;
276276
277− BUILD_BUG_ON(sizeof(action) != IEEE80211_MIN_ACTION_SIZE + 1);
277+ BUILD_BUG_ON(sizeof(action) != IEEE80211_MIN_ACTION_SIZE(action_code));
278278
279279 if (skb->len < rtap_space + sizeof(action) +
280280 VHT_MUMIMO_GROUPS_DATA_LEN)
@@ -1162,7 +1162,7 @@ static ieee80211_rx_result ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx) · 881 unmodified lines
11621162 u8 category;
11631163
11641164 /* make sure category field is present */
1165− if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE)
1165+ if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE(category))
11661166 return RX_DROP_U_RUNT_ACTION;
11671167
11681168 mgmt = (struct ieee80211_mgmt *)hdr;
@@ -1475,7 +1475,9 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx, · 306 unmodified lines
14751475 !test_and_set_bit(tid, rx->sta->ampdu_mlme.unexpected_agg))
14761476 ieee80211_send_delba(rx->sdata, rx->sta->sta.addr, tid,
14771477 WLAN_BACK_RECIPIENT,
1478− WLAN_REASON_QSTA_REQUIRE_SETUP);
1478+ WLAN_REASON_QSTA_REQUIRE_SETUP,
1479+ ieee80211_s1g_use_ndp_ba(rx->sdata,
1480+ rx->sta));
14791481 goto dont_reorder;
14801482 }
14811483
@@ -3372,7 +3374,9 @@ ieee80211_rx_h_ctrl(struct ieee80211_rx_data *rx, struct sk_buff_head *frames) · 1890 unmodified lines
33723374 !test_and_set_bit(tid, rx->sta->ampdu_mlme.unexpected_agg))
33733375 ieee80211_send_delba(rx->sdata, rx->sta->sta.addr, tid,
33743376 WLAN_BACK_RECIPIENT,
3375− WLAN_REASON_QSTA_REQUIRE_SETUP);
3377+ WLAN_REASON_QSTA_REQUIRE_SETUP,
3378+ ieee80211_s1g_use_ndp_ba(rx->sdata,
3379+ rx->sta));
33763380
33773381 tid_agg_rx = rcu_dereference(rx->sta->ampdu_mlme.tid_rx[tid]);
33783382 if (!tid_agg_rx)
@@ -3422,7 +3426,7 @@ static void ieee80211_process_sa_query_req(struct ieee80211_sub_if_data *sdata, · 43 unmodified lines
34223426 return;
34233427 }
34243428
3425− if (len < 24 + 1 + sizeof(resp->u.action.u.sa_query)) {
3429+ if (len < IEEE80211_MIN_ACTION_SIZE(sa_query)) {
34263430 /* Too short SA Query request frame */
34273431 return;
34283432 }
@@ -3432,17 +3436,16 @@ static void ieee80211_process_sa_query_req(struct ieee80211_sub_if_data *sdata, · 3 unmodified lines
34323436 return;
34333437
34343438 skb_reserve(skb, local->hw.extra_tx_headroom);
3435− resp = skb_put_zero(skb, 24);
3439+ resp = skb_put_zero(skb, IEEE80211_MIN_ACTION_SIZE(sa_query));
34363440 memcpy(resp->da, sdata->vif.cfg.ap_addr, ETH_ALEN);
34373441 memcpy(resp->sa, sdata->vif.addr, ETH_ALEN);
34383442 memcpy(resp->bssid, sdata->vif.cfg.ap_addr, ETH_ALEN);
34393443 resp->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
34403444 IEEE80211_STYPE_ACTION);
3441− skb_put(skb, 1 + sizeof(resp->u.action.u.sa_query));
34423445 resp->u.action.category = WLAN_CATEGORY_SA_QUERY;
3443− resp->u.action.u.sa_query.action = WLAN_ACTION_SA_QUERY_RESPONSE;
3444− memcpy(resp->u.action.u.sa_query.trans_id,
3445− mgmt->u.action.u.sa_query.trans_id,
3446+ resp->u.action.action_code = WLAN_ACTION_SA_QUERY_RESPONSE;
3447+ memcpy(resp->u.action.sa_query.trans_id,
3448+ mgmt->u.action.sa_query.trans_id,
34463449 WLAN_SA_QUERY_TR_ID_LEN);
34473450
34483451 ieee80211_tx_skb(sdata, skb);
@@ -3516,7 +3519,7 @@ ieee80211_rx_h_mgmt_check(struct ieee80211_rx_data *rx) · 67 unmodified lines
35163519
35173520 /* drop too small action frames */
35183521 if (ieee80211_is_action(mgmt->frame_control) &&
3519− rx->skb->len < IEEE80211_MIN_ACTION_SIZE)
3522+ rx->skb->len < IEEE80211_MIN_ACTION_SIZE(category))
35203523 return RX_DROP_U_RUNT_ACTION;
35213524
35223525 /* Drop non-broadcast Beacon frames */
@@ -3565,29 +3568,28 @@ ieee80211_process_rx_twt_action(struct ieee80211_rx_data *rx) · 42 unmodified lines
35653568 if (!rx->sta)
35663569 return false;
35673570
3568− switch (mgmt->u.action.u.s1g.action_code) {
3571+ switch (mgmt->u.action.action_code) {
35693572 case WLAN_S1G_TWT_SETUP: {
35703573 struct ieee80211_twt_setup *twt;
35713574
3572− if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE +
3573− 1 + /* action code */
3575+ if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE(action_code) +
35743576 sizeof(struct ieee80211_twt_setup) +
35753577 2 /* TWT req_type agrt */)
35763578 break;
35773579
3578− twt = (void *)mgmt->u.action.u.s1g.variable;
3580+ twt = (void *)mgmt->u.action.s1g.variable;
35793581 if (twt->element_id != WLAN_EID_S1G_TWT)
35803582 break;
35813583
3582− if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE +
3583− 4 + /* action code + token + tlv */
3584+ if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE(action_code) +
3585+ 3 + /* token + tlv */
35843586 twt->length)
35853587 break;
35863588
35873589 return true; /* queue the frame */
35883590 }
35893591 case WLAN_S1G_TWT_TEARDOWN:
3590− if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE + 2)
3592+ if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE(action_code) + 1)
35913593 break;
35923594
35933595 return true; /* queue the frame */
@@ -3632,10 +3634,10 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 38 unmodified lines
36323634 break;
36333635
36343636 /* verify action & smps_control/chanwidth are present */
3635− if (len < IEEE80211_MIN_ACTION_SIZE + 2)
3637+ if (len < IEEE80211_MIN_ACTION_SIZE(ht_smps))
36363638 goto invalid;
36373639
3638− switch (mgmt->u.action.u.ht_smps.action) {
3640+ switch (mgmt->u.action.action_code) {
36393641 case WLAN_HT_ACTION_SMPS: {
36403642 struct ieee80211_supported_band *sband;
36413643 enum ieee80211_smps_mode smps_mode;
@@ -3646,7 +3648,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 4 unmodified lines
36463648 goto handled;
36473649
36483650 /* convert to HT capability */
3649− switch (mgmt->u.action.u.ht_smps.smps_control) {
3651+ switch (mgmt->u.action.ht_smps.smps_control) {
36503652 case WLAN_HT_SMPS_CONTROL_DISABLED:
36513653 smps_mode = IEEE80211_SMPS_OFF;
36523654 break;
@@ -3679,7 +3681,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 26 unmodified lines
36793681 goto handled;
36803682 }
36813683 case WLAN_HT_ACTION_NOTIFY_CHANWIDTH: {
3682− u8 chanwidth = mgmt->u.action.u.ht_notify_cw.chanwidth;
3684+ u8 chanwidth = mgmt->u.action.ht_notify_cw.chanwidth;
36833685
36843686 if (chanwidth != IEEE80211_HT_CHANWIDTH_20MHZ &&
36853687 chanwidth != IEEE80211_HT_CHANWIDTH_ANY)
@@ -3699,7 +3701,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 13 unmodified lines
36993701 break;
37003702 case WLAN_CATEGORY_PUBLIC:
37013703 case WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION:
3702− if (len < IEEE80211_MIN_ACTION_SIZE + 1)
3704+ if (len < IEEE80211_MIN_ACTION_SIZE(action_code))
37033705 goto invalid;
37043706 if (sdata->vif.type != NL80211_IFTYPE_STATION)
37053707 break;
@@ -3707,11 +3709,10 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 1 unmodified line
37073709 break;
37083710 if (!ether_addr_equal(mgmt->bssid, sdata->deflink.u.mgd.bssid))
37093711 break;
3710− if (mgmt->u.action.u.ext_chan_switch.action_code !=
3712+ if (mgmt->u.action.action_code !=
37113713 WLAN_PUB_ACTION_EXT_CHANSW_ANN)
37123714 break;
3713− if (len < offsetof(struct ieee80211_mgmt,
3714− u.action.u.ext_chan_switch.variable))
3715+ if (len < IEEE80211_MIN_ACTION_SIZE(ext_chan_switch))
37153716 goto invalid;
37163717 goto queue;
37173718 case WLAN_CATEGORY_VHT:
@@ -3723,18 +3724,18 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 5 unmodified lines
37233724 break;
37243725
37253726 /* verify action code is present */
3726− if (len < IEEE80211_MIN_ACTION_SIZE + 1)
3727+ if (len < IEEE80211_MIN_ACTION_SIZE(action_code))
37273728 goto invalid;
37283729
3729− switch (mgmt->u.action.u.vht_opmode_notif.action_code) {
3730+ switch (mgmt->u.action.action_code) {
37303731 case WLAN_VHT_ACTION_OPMODE_NOTIF: {
37313732 /* verify opmode is present */
3732− if (len < IEEE80211_MIN_ACTION_SIZE + 2)
3733+ if (len < IEEE80211_MIN_ACTION_SIZE(vht_opmode_notif))
37333734 goto invalid;
37343735 goto queue;
37353736 }
37363737 case WLAN_VHT_ACTION_GROUPID_MGMT: {
3737− if (len < IEEE80211_MIN_ACTION_SIZE + 25)
3738+ if (len < IEEE80211_MIN_ACTION_SIZE(vht_group_notif))
37383739 goto invalid;
37393740 goto queue;
37403741 }
@@ -3751,23 +3752,23 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 10 unmodified lines
37513752 break;
37523753
37533754 /* verify action_code is present */
3754− if (len < IEEE80211_MIN_ACTION_SIZE + 1)
3755+ if (len < IEEE80211_MIN_ACTION_SIZE(action_code))
37553756 break;
37563757
3757− switch (mgmt->u.action.u.addba_req.action_code) {
3758+ switch (mgmt->u.action.action_code) {
37583759 case WLAN_ACTION_ADDBA_REQ:
3759− if (len < (IEEE80211_MIN_ACTION_SIZE +
3760− sizeof(mgmt->u.action.u.addba_req)))
3760+ case WLAN_ACTION_NDP_ADDBA_REQ:
3761+ if (len < IEEE80211_MIN_ACTION_SIZE(addba_req))
37613762 goto invalid;
37623763 break;
37633764 case WLAN_ACTION_ADDBA_RESP:
3764− if (len < (IEEE80211_MIN_ACTION_SIZE +
3765− sizeof(mgmt->u.action.u.addba_resp)))
3765+ case WLAN_ACTION_NDP_ADDBA_RESP:
3766+ if (len < IEEE80211_MIN_ACTION_SIZE(addba_resp))
37663767 goto invalid;
37673768 break;
37683769 case WLAN_ACTION_DELBA:
3769− if (len < (IEEE80211_MIN_ACTION_SIZE +
3770− sizeof(mgmt->u.action.u.delba)))
3770+ case WLAN_ACTION_NDP_DELBA:
3771+ if (len < IEEE80211_MIN_ACTION_SIZE(delba))
37713772 goto invalid;
37723773 break;
37733774 default:
@@ -3777,16 +3778,15 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 3 unmodified lines
37773778 goto queue;
37783779 case WLAN_CATEGORY_SPECTRUM_MGMT:
37793780 /* verify action_code is present */
3780− if (len < IEEE80211_MIN_ACTION_SIZE + 1)
3781+ if (len < IEEE80211_MIN_ACTION_SIZE(action_code))
37813782 break;
37823783
3783− switch (mgmt->u.action.u.measurement.action_code) {
3784+ switch (mgmt->u.action.action_code) {
37843785 case WLAN_ACTION_SPCT_MSR_REQ:
37853786 if (status->band != NL80211_BAND_5GHZ)
37863787 break;
37873788
3788− if (len < (IEEE80211_MIN_ACTION_SIZE +
3789− sizeof(mgmt->u.action.u.measurement)))
3789+ if (len < IEEE80211_MIN_ACTION_SIZE(measurement))
37903790 break;
37913791
37923792 if (sdata->vif.type != NL80211_IFTYPE_STATION)
@@ -3796,8 +3796,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 3 unmodified lines
37963796 goto handled;
37973797 case WLAN_ACTION_SPCT_CHL_SWITCH: {
37983798 u8 *bssid;
3799− if (len < (IEEE80211_MIN_ACTION_SIZE +
3800− sizeof(mgmt->u.action.u.chan_switch)))
3799+ if (len < IEEE80211_MIN_ACTION_SIZE(chan_switch))
38013800 break;
38023801
38033802 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
@@ -3822,11 +3821,10 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 18 unmodified lines
38223821 }
38233822 break;
38243823 case WLAN_CATEGORY_SELF_PROTECTED:
3825− if (len < (IEEE80211_MIN_ACTION_SIZE +
3826− sizeof(mgmt->u.action.u.self_prot.action_code)))
3824+ if (len < IEEE80211_MIN_ACTION_SIZE(self_prot))
38273825 break;
38283826
3829− switch (mgmt->u.action.u.self_prot.action_code) {
3827+ switch (mgmt->u.action.action_code) {
38303828 case WLAN_SP_MESH_PEERING_OPEN:
38313829 case WLAN_SP_MESH_PEERING_CLOSE:
38323830 case WLAN_SP_MESH_PEERING_CONFIRM:
@@ -3844,8 +3842,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 11 unmodified lines
38443842 }
38453843 break;
38463844 case WLAN_CATEGORY_MESH_ACTION:
3847− if (len < (IEEE80211_MIN_ACTION_SIZE +
3848− sizeof(mgmt->u.action.u.mesh_action.action_code)))
3845+ if (len < IEEE80211_MIN_ACTION_SIZE(action_code))
38493846 break;
38503847
38513848 if (!ieee80211_vif_is_mesh(&sdata->vif))
@@ -3855,11 +3852,10 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 3 unmodified lines
38553852 break;
38563853 goto queue;
38573854 case WLAN_CATEGORY_S1G:
3858− if (len < offsetofend(typeof(*mgmt),
3859− u.action.u.s1g.action_code))
3855+ if (len < IEEE80211_MIN_ACTION_SIZE(action_code))
38603856 break;
38613857
3862− switch (mgmt->u.action.u.s1g.action_code) {
3858+ switch (mgmt->u.action.action_code) {
38633859 case WLAN_S1G_TWT_SETUP:
38643860 case WLAN_S1G_TWT_TEARDOWN:
38653861 if (ieee80211_process_rx_twt_action(rx))
@@ -3870,33 +3866,29 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 4 unmodified lines
38703866 }
38713867 break;
38723868 case WLAN_CATEGORY_PROTECTED_EHT:
3873− if (len < offsetofend(typeof(*mgmt),
3874− u.action.u.ttlm_req.action_code))
3869+ if (len < IEEE80211_MIN_ACTION_SIZE(action_code))
38753870 break;
38763871
3877− switch (mgmt->u.action.u.ttlm_req.action_code) {
3872+ switch (mgmt->u.action.action_code) {
38783873 case WLAN_PROTECTED_EHT_ACTION_TTLM_REQ:
38793874 if (sdata->vif.type != NL80211_IFTYPE_STATION)
38803875 break;
38813876
3882− if (len < offsetofend(typeof(*mgmt),
3883− u.action.u.ttlm_req))
3877+ if (len < IEEE80211_MIN_ACTION_SIZE(ttlm_req))
38843878 goto invalid;
38853879 goto queue;
38863880 case WLAN_PROTECTED_EHT_ACTION_TTLM_RES:
38873881 if (sdata->vif.type != NL80211_IFTYPE_STATION)
38883882 break;
38893883
3890− if (len < offsetofend(typeof(*mgmt),
3891− u.action.u.ttlm_res))
3884+ if (len < IEEE80211_MIN_ACTION_SIZE(ttlm_res))
38923885 goto invalid;
38933886 goto queue;
38943887 case WLAN_PROTECTED_EHT_ACTION_TTLM_TEARDOWN:
38953888 if (sdata->vif.type != NL80211_IFTYPE_STATION)
38963889 break;
38973890
3898− if (len < offsetofend(typeof(*mgmt),
3899− u.action.u.ttlm_tear_down))
3891+ if (len < IEEE80211_MIN_ACTION_SIZE(ttlm_tear_down))
39003892 goto invalid;
39013893 goto queue;
39023894 case WLAN_PROTECTED_EHT_ACTION_LINK_RECONFIG_RESP:
@@ -3906,34 +3898,29 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 3 unmodified lines
39063898 /* The reconfiguration response action frame must
39073899 * least one 'Status Duple' entry (3 octets)
39083900 */
3909− if (len <
3910− offsetofend(typeof(*mgmt),
3911− u.action.u.ml_reconf_resp) + 3)
3901+ if (len < IEEE80211_MIN_ACTION_SIZE(ml_reconf_resp) + 3)
39123902 goto invalid;
39133903 goto queue;
39143904 case WLAN_PROTECTED_EHT_ACTION_EPCS_ENABLE_RESP:
39153905 if (sdata->vif.type != NL80211_IFTYPE_STATION)
39163906 break;
39173907
3918− if (len < offsetofend(typeof(*mgmt),
3919− u.action.u.epcs) +
3920− IEEE80211_EPCS_ENA_RESP_BODY_LEN)
3908+ if (len < IEEE80211_MIN_ACTION_SIZE(epcs) +
3909+ IEEE80211_EPCS_ENA_RESP_BODY_LEN)
39213910 goto invalid;
39223911 goto queue;
39233912 case WLAN_PROTECTED_EHT_ACTION_EPCS_ENABLE_TEARDOWN:
39243913 if (sdata->vif.type != NL80211_IFTYPE_STATION)
39253914 break;
39263915
3927− if (len < offsetofend(typeof(*mgmt),
3928− u.action.u.epcs))
3916+ if (len < IEEE80211_MIN_ACTION_SIZE(epcs))
39293917 goto invalid;
39303918 goto queue;
39313919 case WLAN_PROTECTED_EHT_ACTION_EML_OP_MODE_NOTIF:
39323920 if (sdata->vif.type != NL80211_IFTYPE_AP)
39333921 break;
39343922
3935− if (len < offsetofend(typeof(*mgmt),
3936− u.action.u.eml_omn))
3923+ if (len < IEEE80211_MIN_ACTION_SIZE(eml_omn))
39373924 goto invalid;
39383925 goto queue;
39393926 default:
@@ -4015,11 +4002,10 @@ ieee80211_rx_h_action_post_userspace(struct ieee80211_rx_data *rx) · 75 unmodified lines
40154002
40164003 switch (mgmt->u.action.category) {
40174004 case WLAN_CATEGORY_SA_QUERY:
4018− if (len < (IEEE80211_MIN_ACTION_SIZE +
4019− sizeof(mgmt->u.action.u.sa_query)))
4005+ if (len < IEEE80211_MIN_ACTION_SIZE(sa_query))
40204006 break;
40214007
4022− switch (mgmt->u.action.u.sa_query.action) {
4008+ switch (mgmt->u.action.action_code) {
40234009 case WLAN_ACTION_SA_QUERY_REQUEST:
40244010 if (sdata->vif.type != NL80211_IFTYPE_STATION)
40254011 break;
net/mac80211/s1g.c+22−14
@@ -2,7 +2,7 @@ · 1 unmodified line
22 /*
33 * S1G handling
44 * Copyright(c) 2020 Adapt-IP
5− * Copyright (C) 2023 Intel Corporation
5+ * Copyright (C) 2023, 2026 Intel Corporation
66 */
77 #include <linux/ieee80211.h>
88 #include <net/mac80211.h>
@@ -27,14 +27,14 @@ bool ieee80211_s1g_is_twt_setup(struct sk_buff *skb) · 18 unmodified lines
2727 if (likely(mgmt->u.action.category != WLAN_CATEGORY_S1G))
2828 return false;
2929
30− return mgmt->u.action.u.s1g.action_code == WLAN_S1G_TWT_SETUP;
30+ return mgmt->u.action.action_code == WLAN_S1G_TWT_SETUP;
3131 }
3232
3333 static void
3434 ieee80211_s1g_send_twt_setup(struct ieee80211_sub_if_data *sdata, const u8 *da,
3535 const u8 *bssid, struct ieee80211_twt_setup *twt)
3636 {
37− int len = IEEE80211_MIN_ACTION_SIZE + 4 + twt->length;
37+ int len = IEEE80211_MIN_ACTION_SIZE(s1g) + 3 + twt->length;
3838 struct ieee80211_local *local = sdata->local;
3939 struct ieee80211_mgmt *mgmt;
4040 struct sk_buff *skb;
@@ -52,8 +52,8 @@ ieee80211_s1g_send_twt_setup(struct ieee80211_sub_if_data *sdata, const u8 *da, · 11 unmodified lines
5252 memcpy(mgmt->bssid, bssid, ETH_ALEN);
5353
5454 mgmt->u.action.category = WLAN_CATEGORY_S1G;
55− mgmt->u.action.u.s1g.action_code = WLAN_S1G_TWT_SETUP;
56− memcpy(mgmt->u.action.u.s1g.variable, twt, 3 + twt->length);
55+ mgmt->u.action.action_code = WLAN_S1G_TWT_SETUP;
56+ memcpy(mgmt->u.action.s1g.variable, twt, 3 + twt->length);
5757
5858 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT |
5959 IEEE80211_TX_INTFL_MLME_CONN_TX |
@@ -71,12 +71,12 @@ ieee80211_s1g_send_twt_teardown(struct ieee80211_sub_if_data *sdata, · 11 unmodified lines
7171 u8 *id;
7272
7373 skb = dev_alloc_skb(local->hw.extra_tx_headroom +
74− IEEE80211_MIN_ACTION_SIZE + 2);
74+ IEEE80211_MIN_ACTION_SIZE(s1g) + 1);
7575 if (!skb)
7676 return;
7777
7878 skb_reserve(skb, local->hw.extra_tx_headroom);
79− mgmt = skb_put_zero(skb, IEEE80211_MIN_ACTION_SIZE + 2);
79+ mgmt = skb_put_zero(skb, IEEE80211_MIN_ACTION_SIZE(s1g) + 1);
8080 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
8181 IEEE80211_STYPE_ACTION);
8282 memcpy(mgmt->da, da, ETH_ALEN);
@@ -84,8 +84,8 @@ ieee80211_s1g_send_twt_teardown(struct ieee80211_sub_if_data *sdata, · 1 unmodified line
8484 memcpy(mgmt->bssid, bssid, ETH_ALEN);
8585
8686 mgmt->u.action.category = WLAN_CATEGORY_S1G;
87− mgmt->u.action.u.s1g.action_code = WLAN_S1G_TWT_TEARDOWN;
88− id = (u8 *)mgmt->u.action.u.s1g.variable;
87+ mgmt->u.action.action_code = WLAN_S1G_TWT_TEARDOWN;
88+ id = (u8 *)mgmt->u.action.s1g.variable;
8989 *id = flowid;
9090
9191 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT |
@@ -98,7 +98,7 @@ ieee80211_s1g_rx_twt_setup(struct ieee80211_sub_if_data *sdata, · 6 unmodified lines
9898 struct sta_info *sta, struct sk_buff *skb)
9999 {
100100 struct ieee80211_mgmt *mgmt = (void *)skb->data;
101− struct ieee80211_twt_setup *twt = (void *)mgmt->u.action.u.s1g.variable;
101+ struct ieee80211_twt_setup *twt = (void *)mgmt->u.action.s1g.variable;
102102 struct ieee80211_twt_params *twt_agrt = (void *)twt->params;
103103
104104 twt_agrt->req_type &= cpu_to_le16(~IEEE80211_TWT_REQTYPE_REQUEST);
@@ -128,7 +128,7 @@ ieee80211_s1g_rx_twt_teardown(struct ieee80211_sub_if_data *sdata, · 23 unmodified lines
128128 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data;
129129
130130 drv_twt_teardown_request(sdata->local, sdata, &sta->sta,
131− mgmt->u.action.u.s1g.variable[0]);
131+ mgmt->u.action.s1g.variable[0]);
132132 }
133133
134134 static void
@@ -136,7 +136,7 @@ ieee80211_s1g_tx_twt_setup_fail(struct ieee80211_sub_if_data *sdata, · 1 unmodified line
136136 struct sta_info *sta, struct sk_buff *skb)
137137 {
138138 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data;
139− struct ieee80211_twt_setup *twt = (void *)mgmt->u.action.u.s1g.variable;
139+ struct ieee80211_twt_setup *twt = (void *)mgmt->u.action.s1g.variable;
140140 struct ieee80211_twt_params *twt_agrt = (void *)twt->params;
141141 u8 flowid = le16_get_bits(twt_agrt->req_type,
142142 IEEE80211_TWT_REQTYPE_FLOWID);
@@ -160,7 +160,7 @@ void ieee80211_s1g_rx_twt_action(struct ieee80211_sub_if_data *sdata, · 17 unmodified lines
160160 if (!sta)
161161 return;
162162
163− switch (mgmt->u.action.u.s1g.action_code) {
163+ switch (mgmt->u.action.action_code) {
164164 case WLAN_S1G_TWT_SETUP:
165165 ieee80211_s1g_rx_twt_setup(sdata, sta, skb);
166166 break;
@@ -185,7 +185,7 @@ void ieee80211_s1g_status_twt_action(struct ieee80211_sub_if_data *sdata, · 18 unmodified lines
185185 if (!sta)
186186 return;
187187
188− switch (mgmt->u.action.u.s1g.action_code) {
188+ switch (mgmt->u.action.action_code) {
189189 case WLAN_S1G_TWT_SETUP:
190190 /* process failed twt setup frames */
191191 ieee80211_s1g_tx_twt_setup_fail(sdata, sta, skb);
@@ -220,3 +220,11 @@ void ieee80211_s1g_cap_to_sta_s1g_cap(struct ieee80211_sub_if_data *sdata, · 28 unmodified lines
220220
221221 ieee80211_sta_recalc_aggregates(&link_sta->sta->sta);
222222 }
223+
224+bool ieee80211_s1g_use_ndp_ba(const struct ieee80211_sub_if_data *sdata,
225+ const struct sta_info *sta)
226+{
227+ return sdata->vif.cfg.s1g &&
228+ ieee80211_hw_check(&sdata->local->hw, SUPPORTS_NDP_BLOCKACK) &&
229+ (sta && sta->sta.deflink.s1g_cap.s1g);
230+}
net/mac80211/spectmgmt.c+13−18
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
1010 * Copyright 2007-2008, Intel Corporation
1111 * Copyright 2008, Johannes Berg <johannes@sipsolutions.net>
12− * Copyright (C) 2018, 2020, 2022-2024 Intel Corporation
12+ * Copyright (C) 2018, 2020, 2022-2024, 2026 Intel Corporation
1313 */
1414
1515 #include <linux/ieee80211.h>
@@ -409,35 +409,30 @@ static void ieee80211_send_refuse_measurement_request(struct ieee80211_sub_if_da · 393 unmodified lines
409409 struct sk_buff *skb;
410410 struct ieee80211_mgmt *msr_report;
411411
412− skb = dev_alloc_skb(sizeof(*msr_report) + local->hw.extra_tx_headroom +
413− sizeof(struct ieee80211_msrment_ie));
412+ skb = dev_alloc_skb(IEEE80211_MIN_ACTION_SIZE(measurement) +
413+ local->hw.extra_tx_headroom);
414414 if (!skb)
415415 return;
416416
417417 skb_reserve(skb, local->hw.extra_tx_headroom);
418− msr_report = skb_put_zero(skb, 24);
418+ msr_report = skb_put_zero(skb, IEEE80211_MIN_ACTION_SIZE(measurement));
419419 memcpy(msr_report->da, da, ETH_ALEN);
420420 memcpy(msr_report->sa, sdata->vif.addr, ETH_ALEN);
421421 memcpy(msr_report->bssid, bssid, ETH_ALEN);
422422 msr_report->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
423423 IEEE80211_STYPE_ACTION);
424424
425− skb_put(skb, 1 + sizeof(msr_report->u.action.u.measurement));
426425 msr_report->u.action.category = WLAN_CATEGORY_SPECTRUM_MGMT;
427− msr_report->u.action.u.measurement.action_code =
428− WLAN_ACTION_SPCT_MSR_RPRT;
429− msr_report->u.action.u.measurement.dialog_token = dialog_token;
426+ msr_report->u.action.action_code = WLAN_ACTION_SPCT_MSR_RPRT;
430427
431− msr_report->u.action.u.measurement.element_id = WLAN_EID_MEASURE_REPORT;
432− msr_report->u.action.u.measurement.length =
428+ msr_report->u.action.measurement.dialog_token = dialog_token;
429+ msr_report->u.action.measurement.element_id = WLAN_EID_MEASURE_REPORT;
430+ msr_report->u.action.measurement.length =
433431 sizeof(struct ieee80211_msrment_ie);
434−
435− memset(&msr_report->u.action.u.measurement.msr_elem, 0,
436− sizeof(struct ieee80211_msrment_ie));
437− msr_report->u.action.u.measurement.msr_elem.token = request_ie->token;
438− msr_report->u.action.u.measurement.msr_elem.mode |=
432+ msr_report->u.action.measurement.msr_elem.token = request_ie->token;
433+ msr_report->u.action.measurement.msr_elem.mode |=
439434 IEEE80211_SPCT_MSR_RPRT_MODE_REFUSED;
440− msr_report->u.action.u.measurement.msr_elem.type = request_ie->type;
435+ msr_report->u.action.measurement.msr_elem.type = request_ie->type;
441436
442437 ieee80211_tx_skb(sdata, skb);
443438 }
@@ -454,7 +449,7 @@ void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, · 10 unmodified lines
454449 * TODO: Answer basic measurement as unmeasured
455450 */
456451 ieee80211_send_refuse_measurement_request(sdata,
457− &mgmt->u.action.u.measurement.msr_elem,
452+ &mgmt->u.action.measurement.msr_elem,
458453 mgmt->sa, mgmt->bssid,
459− mgmt->u.action.u.measurement.dialog_token);
454+ mgmt->u.action.measurement.dialog_token);
460455 }
net/mac80211/sta_info.h+2−1
@@ -171,6 +171,7 @@ struct sta_info; · 170 unmodified lines
171171 * @bar_pending: BAR needs to be re-sent
172172 * @amsdu: support A-MSDU within A-MDPU
173173 * @ssn: starting sequence number of the session
174+ * @ndp: this session is using NDP Block ACKs
174175 *
175176 * This structure's lifetime is managed by RCU, assignments to
176177 * the array holding it must hold the aggregation mutex.
@@ -199,6 +200,7 @@ struct tid_ampdu_tx { · 22 unmodified lines
199200 u16 failed_bar_ssn;
200201 bool bar_pending;
201202 bool amsdu;
203+ bool ndp;
202204 u8 tid;
203205 };
204206
@@ -510,7 +512,6 @@ struct ieee80211_fragment_cache { · 305 unmodified lines
510512 * during finalize
511513 * @debugfs_dir: debug filesystem directory dentry
512514 * @pub: public (driver visible) link STA data
513− * TODO Move other link params from sta_info as required for MLD operation
514515 */
515516 struct link_sta_info {
516517 u8 addr[ETH_ALEN];
net/mac80211/tdls.c+12−17
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 * Copyright 2014, Intel Corporation
77 * Copyright 2014 Intel Mobile Communications GmbH
88 * Copyright 2015 - 2016 Intel Deutschland GmbH
9− * Copyright (C) 2019, 2021-2025 Intel Corporation
9+ * Copyright (C) 2019, 2021-2026 Intel Corporation
1010 */
1111
1212 #include <linux/ieee80211.h>
@@ -879,28 +879,23 @@ ieee80211_prep_tdls_direct(struct wiphy *wiphy, struct net_device *dev, · 866 unmodified lines
879879 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
880880 struct ieee80211_mgmt *mgmt;
881881
882− mgmt = skb_put_zero(skb, 24);
882+ if (action_code != WLAN_PUB_ACTION_TDLS_DISCOVER_RES)
883+ return -EINVAL;
884+
885+ mgmt = skb_put_zero(skb, IEEE80211_MIN_ACTION_SIZE(tdls_discover_resp));
883886 memcpy(mgmt->da, peer, ETH_ALEN);
884887 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN);
885888 memcpy(mgmt->bssid, link->u.mgd.bssid, ETH_ALEN);
886889 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
887890 IEEE80211_STYPE_ACTION);
888891
889− switch (action_code) {
890− case WLAN_PUB_ACTION_TDLS_DISCOVER_RES:
891− skb_put(skb, 1 + sizeof(mgmt->u.action.u.tdls_discover_resp));
892− mgmt->u.action.category = WLAN_CATEGORY_PUBLIC;
893− mgmt->u.action.u.tdls_discover_resp.action_code =
894− WLAN_PUB_ACTION_TDLS_DISCOVER_RES;
895− mgmt->u.action.u.tdls_discover_resp.dialog_token =
896− dialog_token;
897− mgmt->u.action.u.tdls_discover_resp.capability =
898− cpu_to_le16(ieee80211_get_tdls_sta_capab(link,
899− status_code));
900− break;
901− default:
902− return -EINVAL;
903− }
892+ mgmt->u.action.category = WLAN_CATEGORY_PUBLIC;
893+ mgmt->u.action.action_code = WLAN_PUB_ACTION_TDLS_DISCOVER_RES;
894+
895+ mgmt->u.action.tdls_discover_resp.dialog_token = dialog_token;
896+ mgmt->u.action.tdls_discover_resp.capability =
897+ cpu_to_le16(ieee80211_get_tdls_sta_capab(link,
898+ status_code));
904899
905900 return 0;
906901 }
net/mac80211/trace.h+41−59
@@ -2,7 +2,7 @@ · 1 unmodified line
22 /*
33 * Portions of this file
44 * Copyright(c) 2016-2017 Intel Deutschland GmbH
5− * Copyright (C) 2018 - 2024 Intel Corporation
5+ * Copyright (C) 2018-2024, 2026 Intel Corporation
66 */
77
88 #if !defined(__MAC80211_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ)
@@ -37,64 +37,46 @@ · 28 unmodified lines
3737 #define VIF_PR_FMT " vif:%s(%d%s)"
3838 #define VIF_PR_ARG __get_str(vif_name), __entry->vif_type, __entry->p2p ? "/p2p" : ""
3939
40−#define CHANDEF_ENTRY __field(u32, control_freq) \
41− __field(u32, freq_offset) \
42− __field(u32, chan_width) \
43− __field(u32, center_freq1) \
44− __field(u32, freq1_offset) \
45− __field(u32, center_freq2)
46−#define CHANDEF_ASSIGN(c) \
47− __entry->control_freq = (c) ? ((c)->chan ? (c)->chan->center_freq : 0) : 0; \
48− __entry->freq_offset = (c) ? ((c)->chan ? (c)->chan->freq_offset : 0) : 0; \
49− __entry->chan_width = (c) ? (c)->width : 0; \
50− __entry->center_freq1 = (c) ? (c)->center_freq1 : 0; \
51− __entry->freq1_offset = (c) ? (c)->freq1_offset : 0; \
52− __entry->center_freq2 = (c) ? (c)->center_freq2 : 0;
53−#define CHANDEF_PR_FMT " chandef(%d.%03d MHz,width:%d,center: %d.%03d/%d MHz)"
54−#define CHANDEF_PR_ARG __entry->control_freq, __entry->freq_offset, __entry->chan_width, \
55− __entry->center_freq1, __entry->freq1_offset, __entry->center_freq2
56−
57−#define MIN_CHANDEF_ENTRY \
58− __field(u32, min_control_freq) \
59− __field(u32, min_freq_offset) \
60− __field(u32, min_chan_width) \
61− __field(u32, min_center_freq1) \
62− __field(u32, min_freq1_offset) \
63− __field(u32, min_center_freq2)
64−
65−#define MIN_CHANDEF_ASSIGN(c) \
66− __entry->min_control_freq = (c)->chan ? (c)->chan->center_freq : 0; \
67− __entry->min_freq_offset = (c)->chan ? (c)->chan->freq_offset : 0; \
68− __entry->min_chan_width = (c)->width; \
69− __entry->min_center_freq1 = (c)->center_freq1; \
70− __entry->min_freq1_offset = (c)->freq1_offset; \
71− __entry->min_center_freq2 = (c)->center_freq2;
72−#define MIN_CHANDEF_PR_FMT " mindef(%d.%03d MHz,width:%d,center: %d.%03d/%d MHz)"
73−#define MIN_CHANDEF_PR_ARG __entry->min_control_freq, __entry->min_freq_offset, \
74− __entry->min_chan_width, \
75− __entry->min_center_freq1, __entry->min_freq1_offset, \
76− __entry->min_center_freq2
77−
78−#define AP_CHANDEF_ENTRY \
79− __field(u32, ap_control_freq) \
80− __field(u32, ap_freq_offset) \
81− __field(u32, ap_chan_width) \
82− __field(u32, ap_center_freq1) \
83− __field(u32, ap_freq1_offset) \
84− __field(u32, ap_center_freq2)
85−
86−#define AP_CHANDEF_ASSIGN(c) \
87− __entry->ap_control_freq = (c)->chan ? (c)->chan->center_freq : 0;\
88− __entry->ap_freq_offset = (c)->chan ? (c)->chan->freq_offset : 0;\
89− __entry->ap_chan_width = (c)->chan ? (c)->width : 0; \
90− __entry->ap_center_freq1 = (c)->chan ? (c)->center_freq1 : 0; \
91− __entry->ap_freq1_offset = (c)->chan ? (c)->freq1_offset : 0; \
92− __entry->ap_center_freq2 = (c)->chan ? (c)->center_freq2 : 0;
93−#define AP_CHANDEF_PR_FMT " ap(%d.%03d MHz,width:%d,center: %d.%03d/%d MHz)"
94−#define AP_CHANDEF_PR_ARG __entry->ap_control_freq, __entry->ap_freq_offset, \
95− __entry->ap_chan_width, \
96− __entry->ap_center_freq1, __entry->ap_freq1_offset, \
97− __entry->ap_center_freq2
40+#define __CHANDEF_ENTRY(n) \
41+ __field(u32, n##control_freq) \
42+ __field(u32, n##freq_offset) \
43+ __field(u32, n##chan_width) \
44+ __field(u32, n##center_freq1) \
45+ __field(u32, n##freq1_offset) \
46+ __field(u32, n##center_freq2) \
47+ __field(u16, n##punctured)
48+#define __CHANDEF_ASSIGN(n, c) \
49+ __entry->n##control_freq = (c) && (c)->chan ? \
50+ (c)->chan->center_freq : 0; \
51+ __entry->n##freq_offset = (c) && (c)->chan ? \
52+ (c)->chan->freq_offset : 0; \
53+ __entry->n##chan_width = (c) ? (c)->width : 0; \
54+ __entry->n##center_freq1 = (c) ? (c)->center_freq1 : 0; \
55+ __entry->n##freq1_offset = (c) ? (c)->freq1_offset : 0; \
56+ __entry->n##center_freq2 = (c) ? (c)->center_freq2 : 0; \
57+ __entry->n##punctured = (c) ? (c)->punctured : 0;
58+#define __CHANDEF_PR_FMT(n) \
59+ " " #n "(%d.%03d MHz,width:%d,center: %d.%03d/%d MHz, punct:0x%x)"
60+#define __CHANDEF_PR_ARG(n) \
61+ __entry->n##control_freq, __entry->n##freq_offset, \
62+ __entry->n##chan_width, __entry->n##center_freq1, \
63+ __entry->n##freq1_offset, __entry->n##center_freq2, \
64+ __entry->n##punctured
65+
66+#define CHANDEF_ENTRY __CHANDEF_ENTRY()
67+#define CHANDEF_ASSIGN(c) __CHANDEF_ASSIGN(, c)
68+#define CHANDEF_PR_FMT __CHANDEF_PR_FMT(chandef)
69+#define CHANDEF_PR_ARG __CHANDEF_PR_ARG()
70+
71+#define MIN_CHANDEF_ENTRY __CHANDEF_ENTRY(min)
72+#define MIN_CHANDEF_ASSIGN(c) __CHANDEF_ASSIGN(min, c)
73+#define MIN_CHANDEF_PR_FMT __CHANDEF_PR_FMT(mindef)
74+#define MIN_CHANDEF_PR_ARG __CHANDEF_PR_ARG(min)
75+
76+#define AP_CHANDEF_ENTRY __CHANDEF_ENTRY(ap)
77+#define AP_CHANDEF_ASSIGN(c) __CHANDEF_ASSIGN(ap, c)
78+#define AP_CHANDEF_PR_FMT __CHANDEF_PR_FMT(ap)
79+#define AP_CHANDEF_PR_ARG __CHANDEF_PR_ARG(ap)
9880
9981 #define CHANCTX_ENTRY CHANDEF_ENTRY \
10082 MIN_CHANDEF_ENTRY \
net/mac80211/util.c+2−3
@@ -3766,12 +3766,11 @@ again: · 3765 unmodified lines
37663766 int ieee80211_send_action_csa(struct ieee80211_sub_if_data *sdata,
37673767 struct cfg80211_csa_settings *csa_settings)
37683768 {
3769+ int hdr_len = IEEE80211_MIN_ACTION_SIZE(chan_switch);
37693770 struct sk_buff *skb;
37703771 struct ieee80211_mgmt *mgmt;
37713772 struct ieee80211_local *local = sdata->local;
37723773 int freq;
3773− int hdr_len = offsetofend(struct ieee80211_mgmt,
3774− u.action.u.chan_switch);
37753774 u8 *pos;
37763775
37773776 if (sdata->vif.type != NL80211_IFTYPE_ADHOC &&
@@ -3800,7 +3799,7 @@ int ieee80211_send_action_csa(struct ieee80211_sub_if_data *sdata, · 22 unmodified lines
38003799 memcpy(mgmt->bssid, ifibss->bssid, ETH_ALEN);
38013800 }
38023801 mgmt->u.action.category = WLAN_CATEGORY_SPECTRUM_MGMT;
3803− mgmt->u.action.u.chan_switch.action_code = WLAN_ACTION_SPCT_CHL_SWITCH;
3802+ mgmt->u.action.action_code = WLAN_ACTION_SPCT_CHL_SWITCH;
38043803 pos = skb_put(skb, 5);
38053804 *pos++ = WLAN_EID_CHANNEL_SWITCH; /* EID */
38063805 *pos++ = 3; /* IE length */
net/mac80211/vht.c+5−5
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 *
55 * Portions of this file
66 * Copyright(c) 2015 - 2016 Intel Deutschland GmbH
7− * Copyright (C) 2018 - 2024 Intel Corporation
7+ * Copyright (C) 2018-2026 Intel Corporation
88 */
99
1010 #include <linux/ieee80211.h>
@@ -723,17 +723,17 @@ void ieee80211_process_mu_groups(struct ieee80211_sub_if_data *sdata, · 712 unmodified lines
723723 if (!link_conf->mu_mimo_owner)
724724 return;
725725
726− if (!memcmp(mgmt->u.action.u.vht_group_notif.position,
726+ if (!memcmp(mgmt->u.action.vht_group_notif.position,
727727 link_conf->mu_group.position, WLAN_USER_POSITION_LEN) &&
728− !memcmp(mgmt->u.action.u.vht_group_notif.membership,
728+ !memcmp(mgmt->u.action.vht_group_notif.membership,
729729 link_conf->mu_group.membership, WLAN_MEMBERSHIP_LEN))
730730 return;
731731
732732 memcpy(link_conf->mu_group.membership,
733− mgmt->u.action.u.vht_group_notif.membership,
733+ mgmt->u.action.vht_group_notif.membership,
734734 WLAN_MEMBERSHIP_LEN);
735735 memcpy(link_conf->mu_group.position,
736− mgmt->u.action.u.vht_group_notif.position,
736+ mgmt->u.action.vht_group_notif.position,
737737 WLAN_USER_POSITION_LEN);
738738
739739 ieee80211_link_info_change_notify(sdata, link,
net/wireless/chan.c+65−45
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 *
77 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
88 * Copyright 2013-2014 Intel Mobile Communications GmbH
9− * Copyright 2018-2025 Intel Corporation
9+ * Copyright 2018-2026 Intel Corporation
1010 */
1111
1212 #include <linux/export.h>
@@ -29,9 +29,11 @@ void cfg80211_chandef_create(struct cfg80211_chan_def *chandef, · 16 unmodified lines
2929
3030 *chandef = (struct cfg80211_chan_def) {
3131 .chan = chan,
32− .freq1_offset = chan->freq_offset,
3332 };
3433
34+ WARN_ON(chan->band == NL80211_BAND_60GHZ ||
35+ chan->band == NL80211_BAND_S1GHZ);
36+
3537 switch (chan_type) {
3638 case NL80211_CHAN_NO_HT:
3739 chandef->width = NL80211_CHAN_WIDTH_20_NOHT;
@@ -339,6 +341,58 @@ static bool cfg80211_valid_center_freq(u32 center, · 301 unmodified lines
339341 return (center - bw / 2 - 5945) % step == 0;
340342 }
341343
344+static bool
345+cfg80211_chandef_valid_control_freq(const struct cfg80211_chan_def *chandef,
346+ u32 control_freq)
347+{
348+ switch (chandef->width) {
349+ case NL80211_CHAN_WIDTH_5:
350+ case NL80211_CHAN_WIDTH_10:
351+ case NL80211_CHAN_WIDTH_20:
352+ case NL80211_CHAN_WIDTH_20_NOHT:
353+ case NL80211_CHAN_WIDTH_1:
354+ case NL80211_CHAN_WIDTH_2:
355+ case NL80211_CHAN_WIDTH_4:
356+ case NL80211_CHAN_WIDTH_8:
357+ case NL80211_CHAN_WIDTH_16:
358+ /* checked separately */
359+ break;
360+ case NL80211_CHAN_WIDTH_320:
361+ if (chandef->center_freq1 == control_freq + 150 ||
362+ chandef->center_freq1 == control_freq + 130 ||
363+ chandef->center_freq1 == control_freq + 110 ||
364+ chandef->center_freq1 == control_freq + 90 ||
365+ chandef->center_freq1 == control_freq - 90 ||
366+ chandef->center_freq1 == control_freq - 110 ||
367+ chandef->center_freq1 == control_freq - 130 ||
368+ chandef->center_freq1 == control_freq - 150)
369+ break;
370+ fallthrough;
371+ case NL80211_CHAN_WIDTH_160:
372+ if (chandef->center_freq1 == control_freq + 70 ||
373+ chandef->center_freq1 == control_freq + 50 ||
374+ chandef->center_freq1 == control_freq - 50 ||
375+ chandef->center_freq1 == control_freq - 70)
376+ break;
377+ fallthrough;
378+ case NL80211_CHAN_WIDTH_80P80:
379+ case NL80211_CHAN_WIDTH_80:
380+ if (chandef->center_freq1 == control_freq + 30 ||
381+ chandef->center_freq1 == control_freq - 30)
382+ break;
383+ fallthrough;
384+ case NL80211_CHAN_WIDTH_40:
385+ if (chandef->center_freq1 == control_freq + 10 ||
386+ chandef->center_freq1 == control_freq - 10)
387+ break;
388+ fallthrough;
389+ default:
390+ return false;
391+ }
392+
393+ return true;
394+}
395+
342396 bool cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef)
343397 {
344398 u32 control_freq, control_freq_khz, start_khz, end_khz;
@@ -351,6 +405,14 @@ bool cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef) · 6 unmodified lines
351405
352406 control_freq = chandef->chan->center_freq;
353407
408+ if (cfg80211_chandef_is_s1g(chandef) &&
409+ chandef->width != NL80211_CHAN_WIDTH_1 &&
410+ chandef->width != NL80211_CHAN_WIDTH_2 &&
411+ chandef->width != NL80211_CHAN_WIDTH_4 &&
412+ chandef->width != NL80211_CHAN_WIDTH_8 &&
413+ chandef->width != NL80211_CHAN_WIDTH_16)
414+ return false;
415+
354416 switch (chandef->width) {
355417 case NL80211_CHAN_WIDTH_5:
356418 case NL80211_CHAN_WIDTH_10:
@@ -393,50 +455,8 @@ bool cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef) · 36 unmodified lines
393455 break;
394456 }
395457
396− switch (chandef->width) {
397− case NL80211_CHAN_WIDTH_5:
398− case NL80211_CHAN_WIDTH_10:
399− case NL80211_CHAN_WIDTH_20:
400− case NL80211_CHAN_WIDTH_20_NOHT:
401− case NL80211_CHAN_WIDTH_1:
402− case NL80211_CHAN_WIDTH_2:
403− case NL80211_CHAN_WIDTH_4:
404− case NL80211_CHAN_WIDTH_8:
405− case NL80211_CHAN_WIDTH_16:
406− /* all checked above */
407− break;
408− case NL80211_CHAN_WIDTH_320:
409− if (chandef->center_freq1 == control_freq + 150 ||
410− chandef->center_freq1 == control_freq + 130 ||
411− chandef->center_freq1 == control_freq + 110 ||
412− chandef->center_freq1 == control_freq + 90 ||
413− chandef->center_freq1 == control_freq - 90 ||
414− chandef->center_freq1 == control_freq - 110 ||
415− chandef->center_freq1 == control_freq - 130 ||
416− chandef->center_freq1 == control_freq - 150)
417− break;
418− fallthrough;
419− case NL80211_CHAN_WIDTH_160:
420− if (chandef->center_freq1 == control_freq + 70 ||
421− chandef->center_freq1 == control_freq + 50 ||
422− chandef->center_freq1 == control_freq - 50 ||
423− chandef->center_freq1 == control_freq - 70)
424− break;
425− fallthrough;
426− case NL80211_CHAN_WIDTH_80P80:
427− case NL80211_CHAN_WIDTH_80:
428− if (chandef->center_freq1 == control_freq + 30 ||
429− chandef->center_freq1 == control_freq - 30)
430− break;
431− fallthrough;
432− case NL80211_CHAN_WIDTH_40:
433− if (chandef->center_freq1 == control_freq + 10 ||
434− chandef->center_freq1 == control_freq - 10)
435− break;
436− fallthrough;
437− default:
458+ if (!cfg80211_chandef_valid_control_freq(chandef, control_freq))
438459 return false;
439− }
440460
441461 if (!cfg80211_valid_center_freq(chandef->center_freq1, chandef->width))
442462 return false;
net/wireless/nl80211.c+24−13
@@ -339,7 +339,20 @@ static int validate_uhr_capa(const struct nlattr *attr, · 338 unmodified lines
339339 const u8 *data = nla_data(attr);
340340 unsigned int len = nla_len(attr);
341341
342− return ieee80211_uhr_capa_size_ok(data, len, false);
342+ if (!ieee80211_uhr_capa_size_ok(data, len, false))
343+ return -EINVAL;
344+ return 0;
345+}
346+
347+static int validate_uhr_operation(const struct nlattr *attr,
348+ struct netlink_ext_ack *extack)
349+{
350+ const u8 *data = nla_data(attr);
351+ unsigned int len = nla_len(attr);
352+
353+ if (!ieee80211_uhr_oper_size_ok(data, len, false))
354+ return -EINVAL;
355+ return 0;
343356 }
344357
345358 /* policy for the attributes */
@@ -947,6 +960,8 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { · 601 unmodified lines
947960 [NL80211_ATTR_UHR_CAPABILITY] =
948961 NLA_POLICY_VALIDATE_FN(NLA_BINARY, validate_uhr_capa, 255),
949962 [NL80211_ATTR_DISABLE_UHR] = { .type = NLA_FLAG },
963+ [NL80211_ATTR_UHR_OPERATION] =
964+ NLA_POLICY_VALIDATE_FN(NLA_BINARY, validate_uhr_operation),
950965 };
951966
952967 /* policy for the key attributes */
@@ -3619,6 +3634,9 @@ static int _nl80211_parse_chandef(struct cfg80211_registered_device *rdev, · 2666 unmodified lines
36193634 case NL80211_CHAN_HT20:
36203635 case NL80211_CHAN_HT40PLUS:
36213636 case NL80211_CHAN_HT40MINUS:
3637+ if (chandef->chan->band == NL80211_BAND_60GHZ ||
3638+ chandef->chan->band == NL80211_BAND_S1GHZ)
3639+ return -EINVAL;
36223640 cfg80211_chandef_create(chandef, chandef->chan,
36233641 chantype);
36243642 /* user input for center_freq is incorrect */
@@ -5825,7 +5843,7 @@ static int nl80211_parse_tx_bitrate_mask(struct genl_info *info, · 2200 unmodified lines
58255843 */
58265844 BUILD_BUG_ON(NL80211_MAX_SUPP_HT_RATES > IEEE80211_HT_MCS_MASK_LEN * 8);
58275845 nla_for_each_nested(tx_rates, attrs[attr], rem) {
5828− enum nl80211_band band = nla_type(tx_rates);
5846+ int band = nla_type(tx_rates);
58295847 int err;
58305848
58315849 if (band < 0 || band >= NUM_NL80211_BANDS)
@@ -6499,16 +6517,6 @@ static int nl80211_calculate_ap_params(struct cfg80211_ap_settings *params) · 667 unmodified lines
64996517 return -EINVAL;
65006518 }
65016519
6502− cap = cfg80211_find_ext_elem(WLAN_EID_EXT_UHR_OPER, ies, ies_len);
6503− if (cap) {
6504− if (!cap->datalen)
6505− return -EINVAL;
6506− params->uhr_oper = (void *)(cap->data + 1);
6507− if (!ieee80211_uhr_oper_size_ok((const u8 *)params->uhr_oper,
6508− cap->datalen - 1, true))
6509− return -EINVAL;
6510− }
6511−
65126520 return 0;
65136521 }
65146522
@@ -6950,6 +6958,9 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) · 435 unmodified lines
69506958 if (err)
69516959 goto out;
69526960
6961+ if (info->attrs[NL80211_ATTR_UHR_OPERATION])
6962+ params->uhr_oper = nla_data(info->attrs[NL80211_ATTR_UHR_OPERATION]);
6963+
69536964 err = nl80211_validate_ap_phy_operation(params);
69546965 if (err)
69556966 goto out;
@@ -10694,7 +10705,7 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info) · 3738 unmodified lines
1069410705 nla_for_each_nested(attr,
1069510706 info->attrs[NL80211_ATTR_SCAN_SUPP_RATES],
1069610707 tmp) {
10697− enum nl80211_band band = nla_type(attr);
10708+ int band = nla_type(attr);
1069810709
1069910710 if (band < 0 || band >= NUM_NL80211_BANDS) {
1070010711 err = -EINVAL;
net/wireless/of.c+1−12
@@ -1,17 +1,6 @@
1+// SPDX-License-Identifier: ISC
12 /*
23 * Copyright (C) 2017 Rafał Miłecki <rafal@milecki.pl>
3− *
4− * Permission to use, copy, modify, and/or distribute this software for any
5− * purpose with or without fee is hereby granted, provided that the above
6− * copyright notice and this permission notice appear in all copies.
7− *
8− * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9− * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10− * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11− * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12− * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13− * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14− * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
154 */
165
176 #include <linux/of.h>
net/wireless/radiotap.c+1−9
@@ -1,17 +1,9 @@
1+// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
12 /*
23 * Radiotap parser
34 *
45 * Copyright 2007 Andy Green <andy@warmcat.com>
56 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− *
11− * Alternatively, this software may be distributed under the terms of BSD
12− * license.
13− *
14− * See COPYING for more details.
157 */
168
179 #include <linux/kernel.h>
net/wireless/reg.c+1−12
@@ -1,3 +1,4 @@
1+// SPDX-License-Identifier: ISC
12 /*
23 * Copyright 2002-2005, Instant802 Networks, Inc.
34 * Copyright 2005-2006, Devicescape Software, Inc.
@@ -6,18 +7,6 @@ · 2 unmodified lines
67 * Copyright 2013-2014 Intel Mobile Communications GmbH
78 * Copyright 2017 Intel Deutschland GmbH
89 * Copyright (C) 2018 - 2026 Intel Corporation
9− *
10− * Permission to use, copy, modify, and/or distribute this software for any
11− * purpose with or without fee is hereby granted, provided that the above
12− * copyright notice and this permission notice appear in all copies.
13− *
14− * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15− * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16− * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
17− * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18− * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19− * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
20− * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2110 */
2211
2312
net/wireless/reg.h+1−12
@@ -1,3 +1,4 @@
1+/* SPDX-License-Identifier: ISC */
12 #ifndef __NET_WIRELESS_REG_H
23 #define __NET_WIRELESS_REG_H
34
@@ -6,18 +7,6 @@ · 2 unmodified lines
67 /*
78 * Copyright 2008-2011 Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
89 * Copyright (C) 2019, 2023 Intel Corporation
9− *
10− * Permission to use, copy, modify, and/or distribute this software for any
11− * purpose with or without fee is hereby granted, provided that the above
12− * copyright notice and this permission notice appear in all copies.
13− *
14− * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15− * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16− * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
17− * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18− * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19− * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
20− * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2110 */
2211
2312 enum ieee80211_regd_source {
net/wireless/trace.c+1−0
@@ -1,3 +1,4 @@
1+// SPDX-License-Identifier: GPL-2.0
12 #include <linux/module.h>
23
34 #ifndef __CHECKER__
net/wireless/wext-core.c+1−2
@@ -1,3 +1,4 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * This file implement the Wireless Extensions core API.
34 *
@@ -5,8 +6,6 @@ · 1 unmodified line
56 * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
67 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
78 * Copyright (C) 2024 Intel Corporation
8− *
9− * (As all part of the Linux kernel, this file is GPL)
109 */
1110 #include <linux/kernel.h>
1211 #include <linux/netdevice.h>
net/wireless/wext-priv.c+1−2
@@ -1,11 +1,10 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * This file implement the Wireless Extensions priv API.
34 *
45 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
56 * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
67 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
7− *
8− * (As all part of the Linux kernel, this file is GPL)
98 */
109 #include <linux/slab.h>
1110 #include <linux/wireless.h>
net/wireless/wext-proc.c+1−2
@@ -1,10 +1,9 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * This file implement the Wireless Extensions proc API.
34 *
45 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
56 * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
6− *
7− * (As all part of the Linux kernel, this file is GPL)
87 */
98
109 /*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t