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 ... ====================
Unified · Split
| @@ -6288,10 +6288,10 @@ static int ath11k_mac_mgmt_action_frame_fill_elem_data(struct ath11k_vif *arvif, · 6287 unmodified lines | ||
| 6288 | 6288 | lockdep_assert_held(&ar->conf_mutex); |
| 6289 | 6289 | |
| 6290 | 6290 | /* make sure category field is present */ |
| 6291 | − if (skb->len < IEEE80211_MIN_ACTION_SIZE) | |
| 6291 | + if (skb->len < IEEE80211_MIN_ACTION_SIZE(category)) | |
| 6292 | 6292 | return -EINVAL; |
| 6293 | 6293 | |
| 6294 | − remaining_len = skb->len - IEEE80211_MIN_ACTION_SIZE; | |
| 6294 | + remaining_len = skb->len - IEEE80211_MIN_ACTION_SIZE(category); | |
| 6295 | 6295 | has_protected = ieee80211_has_protected(hdr->frame_control); |
| 6296 | 6296 | |
| 6297 | 6297 | /* In case of SW crypto and hdr protected (PMF), packet will already be encrypted, |
| @@ -9119,10 +9119,10 @@ static int ath12k_mac_mgmt_action_frame_fill_elem_data(struct ath12k_link_vif *a · 9118 unmodified lines | ||
| 9119 | 9119 | lockdep_assert_wiphy(wiphy); |
| 9120 | 9120 | |
| 9121 | 9121 | /* make sure category field is present */ |
| 9122 | − if (skb->len < IEEE80211_MIN_ACTION_SIZE) | |
| 9122 | + if (skb->len < IEEE80211_MIN_ACTION_SIZE(category)) | |
| 9123 | 9123 | return -EINVAL; |
| 9124 | 9124 | |
| 9125 | − remaining_len = skb->len - IEEE80211_MIN_ACTION_SIZE; | |
| 9125 | + remaining_len = skb->len - IEEE80211_MIN_ACTION_SIZE(category); | |
| 9126 | 9126 | has_protected = ieee80211_has_protected(hdr->frame_control); |
| 9127 | 9127 | |
| 9128 | 9128 | /* In case of SW crypto and hdr protected (PMF), packet will already be encrypted, |
| @@ -104,7 +104,7 @@ static bool ath12k_is_addba_resp_action_code(struct ieee80211_mgmt *mgmt) · 103 unmodified lines | ||
| 104 | 104 | if (mgmt->u.action.category != WLAN_CATEGORY_BACK) |
| 105 | 105 | return false; |
| 106 | 106 | |
| 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) | |
| 108 | 108 | return false; |
| 109 | 109 | |
| 110 | 110 | return true; |
| @@ -2440,13 +2440,11 @@ static int at76_probe(struct usb_interface *interface, · 2439 unmodified lines | ||
| 2440 | 2440 | struct mib_fw_version *fwv; |
| 2441 | 2441 | int board_type = (int)id->driver_info; |
| 2442 | 2442 | |
| 2443 | − udev = usb_get_dev(interface_to_usbdev(interface)); | |
| 2443 | + udev = interface_to_usbdev(interface); | |
| 2444 | 2444 | |
| 2445 | 2445 | fwv = kmalloc_obj(*fwv); |
| 2446 | − if (!fwv) { | |
| 2447 | − ret = -ENOMEM; | |
| 2448 | − goto exit; | |
| 2449 | − } | |
| 2446 | + if (!fwv) | |
| 2447 | + return -ENOMEM; | |
| 2450 | 2448 | |
| 2451 | 2449 | /* Load firmware into kernel memory */ |
| 2452 | 2450 | fwe = at76_load_firmware(udev, board_type); |
| @@ -2534,8 +2532,7 @@ static int at76_probe(struct usb_interface *interface, · 81 unmodified lines | ||
| 2534 | 2532 | |
| 2535 | 2533 | exit: |
| 2536 | 2534 | kfree(fwv); |
| 2537 | − if (ret < 0) | |
| 2538 | − usb_put_dev(udev); | |
| 2535 | + | |
| 2539 | 2536 | return ret; |
| 2540 | 2537 | } |
| 2541 | 2538 | |
| @@ -2552,7 +2549,6 @@ static void at76_disconnect(struct usb_interface *interface) · 10 unmodified lines | ||
| 2552 | 2549 | |
| 2553 | 2550 | wiphy_info(priv->hw->wiphy, "disconnecting\n"); |
| 2554 | 2551 | at76_delete_device(priv); |
| 2555 | − usb_put_dev(interface_to_usbdev(interface)); | |
| 2556 | 2552 | dev_info(&interface->dev, "disconnected\n"); |
| 2557 | 2553 | } |
| 2558 | 2554 | |
| @@ -6566,19 +6566,19 @@ static void b43_nphy_op_software_rfkill(struct b43_wldev *dev, · 6565 unmodified lines | ||
| 6566 | 6566 | |
| 6567 | 6567 | b43_radio_mask(dev, 0x09, ~0x2); |
| 6568 | 6568 | |
| 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); | |
| 6582 | 6582 | } |
| 6583 | 6583 | } else { |
| 6584 | 6584 | if (phy->rev >= 19) { |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause |
| 2 | 2 | /* |
| 3 | − * Copyright (C) 2025 Intel Corporation | |
| 3 | + * Copyright (C) 2025-2026 Intel Corporation | |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | #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 | ||
| 116 | 116 | u8 skb_dialog_token; |
| 117 | 117 | |
| 118 | 118 | 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; | |
| 120 | 120 | else |
| 121 | − skb_dialog_token = mgmt->u.action.u.ftm.dialog_token; | |
| 121 | + skb_dialog_token = mgmt->u.action.ftm.dialog_token; | |
| 122 | 122 | |
| 123 | 123 | if ((ether_addr_equal(mgmt->sa, addr) || |
| 124 | 124 | ether_addr_equal(mgmt->da, addr)) && |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause |
| 2 | 2 | /* |
| 3 | 3 | * Copyright (C) 2015-2017 Intel Deutschland GmbH |
| 4 | − * Copyright (C) 2018-2025 Intel Corporation | |
| 4 | + * Copyright (C) 2018-2026 Intel Corporation | |
| 5 | 5 | */ |
| 6 | 6 | #include <linux/etherdevice.h> |
| 7 | 7 | #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 | ||
| 1409 | 1409 | struct iwl_mvm_loc_entry *entry; |
| 1410 | 1410 | const u8 *ies, *lci, *civic, *msr_ie; |
| 1411 | 1411 | 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); | |
| 1414 | 1413 | static const u8 rprt_type_lci = IEEE80211_SPCT_MSR_RPRT_TYPE_LCI; |
| 1415 | 1414 | static const u8 rprt_type_civic = IEEE80211_SPCT_MSR_RPRT_TYPE_CIVIC; |
| 1416 | 1415 | |
| @@ -1419,7 +1418,7 @@ void iwl_mvm_ftm_lc_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) · 2 unmodified lines | ||
| 1419 | 1418 | |
| 1420 | 1419 | lockdep_assert_held(&mvm->mutex); |
| 1421 | 1420 | |
| 1422 | − ies = mgmt->u.action.u.ftm.variable; | |
| 1421 | + ies = mgmt->u.action.ftm.variable; | |
| 1423 | 1422 | ies_len = len - baselen; |
| 1424 | 1423 | |
| 1425 | 1424 | msr_ie = cfg80211_find_ie_match(WLAN_EID_MEASURE_REPORT, ies, ies_len, |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause |
| 2 | 2 | /* |
| 3 | − * Copyright (C) 2022 Intel Corporation | |
| 3 | + * Copyright (C) 2022, 2026 Intel Corporation | |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | #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 | ||
| 18 | 18 | u8 skb_dialog_token; |
| 19 | 19 | |
| 20 | 20 | 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; | |
| 22 | 22 | else |
| 23 | − skb_dialog_token = mgmt->u.action.u.ftm.dialog_token; | |
| 23 | + skb_dialog_token = mgmt->u.action.ftm.dialog_token; | |
| 24 | 24 | |
| 25 | 25 | if ((ether_addr_equal(mgmt->sa, addr) || |
| 26 | 26 | ether_addr_equal(mgmt->da, addr)) && |
| @@ -114,8 +114,8 @@ static void if_usb_write_bulk_callback(struct urb *urb) · 113 unmodified lines | ||
| 114 | 114 | static void if_usb_free(struct if_usb_card *cardp) |
| 115 | 115 | { |
| 116 | 116 | /* 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); | |
| 119 | 119 | |
| 120 | 120 | usb_free_urb(cardp->tx_urb); |
| 121 | 121 | cardp->tx_urb = NULL; |
| @@ -221,6 +221,9 @@ static int if_usb_probe(struct usb_interface *intf, · 99 unmodified lines | ||
| 221 | 221 | udev->descriptor.bDeviceSubClass, |
| 222 | 222 | udev->descriptor.bDeviceProtocol); |
| 223 | 223 | |
| 224 | + init_usb_anchor(&cardp->rx_submitted); | |
| 225 | + init_usb_anchor(&cardp->tx_submitted); | |
| 226 | + | |
| 224 | 227 | for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { |
| 225 | 228 | endpoint = &iface_desc->endpoint[i].desc; |
| 226 | 229 | if (usb_endpoint_is_bulk_in(endpoint)) { |
| @@ -276,7 +279,6 @@ static int if_usb_probe(struct usb_interface *intf, · 49 unmodified lines | ||
| 276 | 279 | |
| 277 | 280 | cardp->boot2_version = udev->descriptor.bcdDevice; |
| 278 | 281 | |
| 279 | − usb_get_dev(udev); | |
| 280 | 282 | usb_set_intfdata(intf, cardp); |
| 281 | 283 | |
| 282 | 284 | 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 | ||
| 287 | 289 | return 0; |
| 288 | 290 | |
| 289 | 291 | err_get_fw: |
| 290 | − usb_put_dev(udev); | |
| 291 | 292 | lbs_remove_card(priv); |
| 292 | 293 | err_add_card: |
| 293 | 294 | if_usb_reset_device(cardp); |
| @@ -321,7 +322,6 @@ static void if_usb_disconnect(struct usb_interface *intf) · 27 unmodified lines | ||
| 321 | 322 | kfree(cardp); |
| 322 | 323 | |
| 323 | 324 | usb_set_intfdata(intf, NULL); |
| 324 | − usb_put_dev(interface_to_usbdev(intf)); | |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | /** |
| @@ -426,7 +426,12 @@ static int usb_tx_block(struct if_usb_card *cardp, uint8_t *payload, uint16_t nb · 98 unmodified lines | ||
| 426 | 426 | goto tx_ret; |
| 427 | 427 | } |
| 428 | 428 | |
| 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 | + } | |
| 430 | 435 | |
| 431 | 436 | usb_fill_bulk_urb(cardp->tx_urb, cardp->udev, |
| 432 | 437 | 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 | ||
| 435 | 440 | |
| 436 | 441 | cardp->tx_urb->transfer_flags |= URB_ZERO_PACKET; |
| 437 | 442 | |
| 443 | + usb_anchor_urb(cardp->tx_urb, &cardp->tx_submitted); | |
| 438 | 444 | if ((ret = usb_submit_urb(cardp->tx_urb, GFP_ATOMIC))) { |
| 439 | 445 | lbs_deb_usbd(&cardp->udev->dev, "usb_submit_urb failed: %d\n", ret); |
| 446 | + usb_unanchor_urb(cardp->tx_urb); | |
| 440 | 447 | } else { |
| 441 | 448 | lbs_deb_usb2(&cardp->udev->dev, "usb_submit_urb success\n"); |
| 442 | 449 | ret = 0; |
| @@ -467,8 +474,10 @@ static int __if_usb_submit_rx_urb(struct if_usb_card *cardp, · 24 unmodified lines | ||
| 467 | 474 | cardp); |
| 468 | 475 | |
| 469 | 476 | 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); | |
| 470 | 478 | if ((ret = usb_submit_urb(cardp->rx_urb, GFP_ATOMIC))) { |
| 471 | 479 | lbs_deb_usbd(&cardp->udev->dev, "Submit Rx URB failed: %d\n", ret); |
| 480 | + usb_unanchor_urb(cardp->rx_urb); | |
| 472 | 481 | kfree_skb(skb); |
| 473 | 482 | cardp->rx_skb = NULL; |
| 474 | 483 | ret = -1; |
| @@ -838,8 +847,8 @@ static void if_usb_prog_firmware(struct lbs_private *priv, int ret, · 363 unmodified lines | ||
| 838 | 847 | } |
| 839 | 848 | |
| 840 | 849 | /* 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); | |
| 843 | 852 | |
| 844 | 853 | cardp->fwlastblksent = 0; |
| 845 | 854 | cardp->fwdnldover = 0; |
| @@ -869,8 +878,8 @@ restart: · 23 unmodified lines | ||
| 869 | 878 | if (cardp->bootcmdresp == BOOT_CMD_RESP_NOT_SUPPORTED) { |
| 870 | 879 | /* Return to normal operation */ |
| 871 | 880 | 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); | |
| 874 | 883 | if (if_usb_submit_rx_urb(cardp) < 0) |
| 875 | 884 | ret = -EIO; |
| 876 | 885 | goto done; |
| @@ -900,7 +909,7 @@ restart: · 23 unmodified lines | ||
| 900 | 909 | wait_event_interruptible(cardp->fw_wq, cardp->surprise_removed || cardp->fwdnldover); |
| 901 | 910 | |
| 902 | 911 | timer_delete_sync(&cardp->fw_timeout); |
| 903 | − usb_kill_urb(cardp->rx_urb); | |
| 912 | + usb_kill_anchored_urbs(&cardp->rx_submitted); | |
| 904 | 913 | |
| 905 | 914 | if (!cardp->fwdnldover) { |
| 906 | 915 | 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 | ||
| 960 | 969 | goto out; |
| 961 | 970 | |
| 962 | 971 | /* 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); | |
| 965 | 974 | |
| 966 | 975 | out: |
| 967 | 976 | return ret; |
| @@ -48,6 +48,9 @@ struct if_usb_card { · 47 unmodified lines | ||
| 48 | 48 | struct urb *rx_urb, *tx_urb; |
| 49 | 49 | struct lbs_private *priv; |
| 50 | 50 | |
| 51 | + struct usb_anchor rx_submitted; | |
| 52 | + struct usb_anchor tx_submitted; | |
| 53 | + | |
| 51 | 54 | struct sk_buff *rx_skb; |
| 52 | 55 | |
| 53 | 56 | uint8_t ep_in; |
| @@ -223,7 +223,6 @@ static int if_usb_probe(struct usb_interface *intf, · 222 unmodified lines | ||
| 223 | 223 | if (!priv) |
| 224 | 224 | goto dealloc; |
| 225 | 225 | |
| 226 | − usb_get_dev(udev); | |
| 227 | 226 | usb_set_intfdata(intf, cardp); |
| 228 | 227 | |
| 229 | 228 | return 0; |
| @@ -258,7 +257,6 @@ static void if_usb_disconnect(struct usb_interface *intf) · 28 unmodified lines | ||
| 258 | 257 | kfree(cardp); |
| 259 | 258 | |
| 260 | 259 | usb_set_intfdata(intf, NULL); |
| 261 | − usb_put_dev(interface_to_usbdev(intf)); | |
| 262 | 260 | |
| 263 | 261 | lbtf_deb_leave(LBTF_DEB_MAIN); |
| 264 | 262 | } |
| @@ -755,16 +755,12 @@ mwifiex_construct_tdls_action_frame(struct mwifiex_private *priv, · 754 unmodified lines | ||
| 755 | 755 | switch (action_code) { |
| 756 | 756 | case WLAN_PUB_ACTION_TDLS_DISCOVER_RES: |
| 757 | 757 | /* 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; | |
| 760 | 759 | skb_put(skb, extra); |
| 761 | 760 | 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); | |
| 768 | 764 | /* move back for addr4 */ |
| 769 | 765 | memmove(pos + ETH_ALEN, &mgmt->u.action, extra); |
| 770 | 766 | /* init address 4 */ |
| @@ -520,8 +520,6 @@ static int mwifiex_usb_probe(struct usb_interface *intf, · 519 unmodified lines | ||
| 520 | 520 | return ret; |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | − usb_get_dev(udev); | |
| 524 | − | |
| 525 | 523 | return 0; |
| 526 | 524 | } |
| 527 | 525 | |
| @@ -666,8 +664,6 @@ static void mwifiex_usb_disconnect(struct usb_interface *intf) · 138 unmodified lines | ||
| 666 | 664 | mwifiex_dbg(adapter, FATAL, |
| 667 | 665 | "%s: removing card\n", __func__); |
| 668 | 666 | mwifiex_remove_card(adapter); |
| 669 | − | |
| 670 | − usb_put_dev(interface_to_usbdev(intf)); | |
| 671 | 667 | } |
| 672 | 668 | |
| 673 | 669 | static void mwifiex_usb_coredump(struct device *dev) |
| @@ -1985,9 +1985,9 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, · 1984 unmodified lines | ||
| 1985 | 1985 | */ |
| 1986 | 1986 | if (unlikely(ieee80211_is_action(wh->frame_control) && |
| 1987 | 1987 | 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 && | |
| 1989 | 1989 | 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); | |
| 1991 | 1991 | tid = (capab & IEEE80211_ADDBA_PARAM_TID_MASK) >> 2; |
| 1992 | 1992 | index = mwl8k_tid_queue_mapping(tid); |
| 1993 | 1993 | } |
| @@ -413,10 +413,10 @@ mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi, · 412 unmodified lines | ||
| 413 | 413 | u32 val; |
| 414 | 414 | |
| 415 | 415 | 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) && | |
| 417 | 417 | 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); | |
| 420 | 420 | |
| 421 | 421 | txwi[5] |= cpu_to_le32(MT_TXD5_ADD_BA); |
| 422 | 422 | tid = (capab >> 2) & IEEE80211_QOS_CTL_TID_MASK; |
| @@ -668,9 +668,9 @@ mt7925_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi, · 667 unmodified lines | ||
| 668 | 668 | u32 val; |
| 669 | 669 | |
| 670 | 670 | if (ieee80211_is_action(fc) && |
| 671 | − skb->len >= IEEE80211_MIN_ACTION_SIZE + 1 && | |
| 671 | + skb->len >= IEEE80211_MIN_ACTION_SIZE(action_code) && | |
| 672 | 672 | 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) | |
| 674 | 674 | tid = MT_TX_ADDBA; |
| 675 | 675 | else if (ieee80211_is_mgmt(hdr->frame_control)) |
| 676 | 676 | tid = MT_TX_NORMAL; |
| @@ -800,9 +800,9 @@ mt7996_mac_write_txwi_80211(struct mt7996_dev *dev, __le32 *txwi, · 799 unmodified lines | ||
| 800 | 800 | u32 val; |
| 801 | 801 | |
| 802 | 802 | if (ieee80211_is_action(fc) && |
| 803 | − skb->len >= IEEE80211_MIN_ACTION_SIZE + 1 && | |
| 803 | + skb->len >= IEEE80211_MIN_ACTION_SIZE(action_code) && | |
| 804 | 804 | 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) { | |
| 806 | 806 | if (is_mt7990(&dev->mt76)) |
| 807 | 807 | txwi[6] |= cpu_to_le32(FIELD_PREP(MT_TXD6_TID_ADDBA, tid)); |
| 808 | 808 | else |
| @@ -452,8 +452,8 @@ int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *vif, · 451 unmodified lines | ||
| 452 | 452 | void *qdev_vif; |
| 453 | 453 | int ret; |
| 454 | 454 | |
| 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); | |
| 457 | 457 | if (!dev) |
| 458 | 458 | return -ENOMEM; |
| 459 | 459 | |
| @@ -802,14 +802,12 @@ int rt2x00usb_probe(struct usb_interface *usb_intf, · 801 unmodified lines | ||
| 802 | 802 | struct rt2x00_dev *rt2x00dev; |
| 803 | 803 | int retval; |
| 804 | 804 | |
| 805 | − usb_dev = usb_get_dev(usb_dev); | |
| 806 | 805 | usb_reset_device(usb_dev); |
| 807 | 806 | |
| 808 | 807 | hw = ieee80211_alloc_hw(sizeof(struct rt2x00_dev), ops->hw); |
| 809 | 808 | if (!hw) { |
| 810 | 809 | rt2x00_probe_err("Failed to allocate hardware\n"); |
| 811 | − retval = -ENOMEM; | |
| 812 | − goto exit_put_device; | |
| 810 | + return -ENOMEM; | |
| 813 | 811 | } |
| 814 | 812 | |
| 815 | 813 | usb_set_intfdata(usb_intf, hw); |
| @@ -851,10 +849,6 @@ exit_free_reg: · 35 unmodified lines | ||
| 851 | 849 | |
| 852 | 850 | exit_free_device: |
| 853 | 851 | ieee80211_free_hw(hw); |
| 854 | − | |
| 855 | −exit_put_device: | |
| 856 | − usb_put_dev(usb_dev); | |
| 857 | − | |
| 858 | 852 | usb_set_intfdata(usb_intf, NULL); |
| 859 | 853 | |
| 860 | 854 | return retval; |
| @@ -873,11 +867,7 @@ void rt2x00usb_disconnect(struct usb_interface *usb_intf) · 12 unmodified lines | ||
| 873 | 867 | rt2x00usb_free_reg(rt2x00dev); |
| 874 | 868 | ieee80211_free_hw(hw); |
| 875 | 869 | |
| 876 | − /* | |
| 877 | − * Free the USB device data. | |
| 878 | − */ | |
| 879 | 870 | usb_set_intfdata(usb_intf, NULL); |
| 880 | − usb_put_dev(interface_to_usbdev(usb_intf)); | |
| 881 | 871 | } |
| 882 | 872 | EXPORT_SYMBOL_GPL(rt2x00usb_disconnect); |
| 883 | 873 | |
| @@ -5146,10 +5146,10 @@ static void rtl8xxxu_dump_action(struct device *dev, · 5145 unmodified lines | ||
| 5146 | 5146 | if (!(rtl8xxxu_debug & RTL8XXXU_DEBUG_ACTION)) |
| 5147 | 5147 | return; |
| 5148 | 5148 | |
| 5149 | − switch (mgmt->u.action.u.addba_resp.action_code) { | |
| 5149 | + switch (mgmt->u.action.action_code) { | |
| 5150 | 5150 | 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); | |
| 5153 | 5153 | dev_info(dev, "WLAN_ACTION_ADDBA_RESP: " |
| 5154 | 5154 | "timeout %i, tid %02x, buf_size %02x, policy %02x, " |
| 5155 | 5155 | "status %02x\n", |
| @@ -5157,11 +5157,11 @@ static void rtl8xxxu_dump_action(struct device *dev, · 1 unmodified line | ||
| 5157 | 5157 | (cap & IEEE80211_ADDBA_PARAM_TID_MASK) >> 2, |
| 5158 | 5158 | (cap & IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK) >> 6, |
| 5159 | 5159 | (cap >> 1) & 0x1, |
| 5160 | − le16_to_cpu(mgmt->u.action.u.addba_resp.status)); | |
| 5160 | + le16_to_cpu(mgmt->u.action.addba_resp.status)); | |
| 5161 | 5161 | break; |
| 5162 | 5162 | 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); | |
| 5165 | 5165 | dev_info(dev, "WLAN_ACTION_ADDBA_REQ: " |
| 5166 | 5166 | "timeout %i, tid %02x, buf_size %02x, policy %02x\n", |
| 5167 | 5167 | timeout, |
| @@ -5171,7 +5171,7 @@ static void rtl8xxxu_dump_action(struct device *dev, · 3 unmodified lines | ||
| 5171 | 5171 | break; |
| 5172 | 5172 | default: |
| 5173 | 5173 | dev_info(dev, "action frame %02x\n", |
| 5174 | − mgmt->u.action.u.addba_resp.action_code); | |
| 5174 | + mgmt->u.action.action_code); | |
| 5175 | 5175 | break; |
| 5176 | 5176 | } |
| 5177 | 5177 | } |
| @@ -1409,7 +1409,7 @@ bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) · 1408 unmodified lines | ||
| 1409 | 1409 | sta_entry = |
| 1410 | 1410 | (struct rtl_sta_info *)sta->drv_priv; |
| 1411 | 1411 | capab = |
| 1412 | − le16_to_cpu(mgmt->u.action.u.addba_req.capab); | |
| 1412 | + le16_to_cpu(mgmt->u.action.addba_req.capab); | |
| 1413 | 1413 | tid = (capab & |
| 1414 | 1414 | IEEE80211_ADDBA_PARAM_TID_MASK) >> 2; |
| 1415 | 1415 | if (tid >= MAX_TID_COUNT) { |
| @@ -2392,35 +2392,35 @@ static struct sk_buff *rtl_make_smps_action(struct ieee80211_hw *hw, · 976 unmodified lines | ||
| 2392 | 2392 | struct sk_buff *skb; |
| 2393 | 2393 | struct ieee80211_mgmt *action_frame; |
| 2394 | 2394 | |
| 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); | |
| 2397 | 2397 | if (!skb) |
| 2398 | 2398 | return NULL; |
| 2399 | 2399 | |
| 2400 | 2400 | 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)); | |
| 2402 | 2402 | memcpy(action_frame->da, da, ETH_ALEN); |
| 2403 | 2403 | memcpy(action_frame->sa, rtlefuse->dev_addr, ETH_ALEN); |
| 2404 | 2404 | memcpy(action_frame->bssid, bssid, ETH_ALEN); |
| 2405 | 2405 | action_frame->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | |
| 2406 | 2406 | IEEE80211_STYPE_ACTION); |
| 2407 | 2407 | 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; | |
| 2409 | 2409 | switch (smps) { |
| 2410 | 2410 | case IEEE80211_SMPS_AUTOMATIC:/* 0 */ |
| 2411 | 2411 | case IEEE80211_SMPS_NUM_MODES:/* 4 */ |
| 2412 | 2412 | WARN_ON(1); |
| 2413 | 2413 | fallthrough; |
| 2414 | 2414 | 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 = | |
| 2416 | 2416 | WLAN_HT_SMPS_CONTROL_DISABLED;/* 0 */ |
| 2417 | 2417 | break; |
| 2418 | 2418 | 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 = | |
| 2420 | 2420 | WLAN_HT_SMPS_CONTROL_STATIC;/* 1 */ |
| 2421 | 2421 | break; |
| 2422 | 2422 | 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 = | |
| 2424 | 2424 | WLAN_HT_SMPS_CONTROL_DYNAMIC;/* 3 */ |
| 2425 | 2425 | break; |
| 2426 | 2426 | } |
| @@ -2519,25 +2519,25 @@ struct sk_buff *rtl_make_del_ba(struct ieee80211_hw *hw, · 92 unmodified lines | ||
| 2519 | 2519 | struct ieee80211_mgmt *action_frame; |
| 2520 | 2520 | u16 params; |
| 2521 | 2521 | |
| 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); | |
| 2524 | 2524 | if (!skb) |
| 2525 | 2525 | return NULL; |
| 2526 | 2526 | |
| 2527 | 2527 | 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)); | |
| 2529 | 2529 | memcpy(action_frame->sa, sa, ETH_ALEN); |
| 2530 | 2530 | memcpy(action_frame->da, rtlefuse->dev_addr, ETH_ALEN); |
| 2531 | 2531 | memcpy(action_frame->bssid, bssid, ETH_ALEN); |
| 2532 | 2532 | action_frame->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | |
| 2533 | 2533 | IEEE80211_STYPE_ACTION); |
| 2534 | 2534 | 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; | |
| 2536 | 2536 | params = (u16)(1 << 11); /* bit 11 initiator */ |
| 2537 | 2537 | params |= (u16)(tid << 12); /* bit 15:12 TID number */ |
| 2538 | 2538 | |
| 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 = | |
| 2541 | 2541 | cpu_to_le16(WLAN_REASON_QSTA_TIMEOUT); |
| 2542 | 2542 | |
| 2543 | 2543 | return skb; |
| @@ -507,7 +507,7 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) · 506 unmodified lines | ||
| 507 | 507 | if (ieee80211_is_action(fc)) { |
| 508 | 508 | struct ieee80211_mgmt *action_frame = |
| 509 | 509 | (struct ieee80211_mgmt *)skb->data; |
| 510 | − if (action_frame->u.action.u.ht_smps.action == | |
| 510 | + if (action_frame->u.action.action_code == | |
| 511 | 511 | WLAN_HT_ACTION_SMPS) { |
| 512 | 512 | dev_kfree_skb(skb); |
| 513 | 513 | goto tx_status_ok; |
| @@ -325,6 +325,22 @@ void rsi_mac80211_detach(struct rsi_hw *adapter) · 324 unmodified lines | ||
| 325 | 325 | } |
| 326 | 326 | EXPORT_SYMBOL_GPL(rsi_mac80211_detach); |
| 327 | 327 | |
| 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 | + | |
| 328 | 344 | /** |
| 329 | 345 | * rsi_indicate_tx_status() - This function indicates the transmit status. |
| 330 | 346 | * @adapter: Pointer to the adapter structure. |
| @@ -422,7 +438,6 @@ static void rsi_mac80211_stop(struct ieee80211_hw *hw, bool suspend) · 91 unmodified lines | ||
| 422 | 438 | rsi_dbg(ERR_ZONE, "===> Interface DOWN <===\n"); |
| 423 | 439 | mutex_lock(&common->mutex); |
| 424 | 440 | common->iface_down = true; |
| 425 | − wiphy_rfkill_stop_polling(hw->wiphy); | |
| 426 | 441 | |
| 427 | 442 | /* Block all rx frames */ |
| 428 | 443 | rsi_send_rx_filter_frame(common, 0xffff); |
| @@ -877,6 +877,8 @@ static void rsi_disconnect(struct usb_interface *pfunction) · 876 unmodified lines | ||
| 877 | 877 | if (!adapter) |
| 878 | 878 | return; |
| 879 | 879 | |
| 880 | + rsi_mac80211_rfkill_exit(adapter); | |
| 881 | + | |
| 880 | 882 | rsi_mac80211_detach(adapter); |
| 881 | 883 | |
| 882 | 884 | if (IS_ENABLED(CONFIG_RSI_COEX) && adapter->priv->coex_mode > 1 && |
| @@ -79,6 +79,7 @@ static inline int rsi_kill_thread(struct rsi_thread *handle) · 78 unmodified lines | ||
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | void rsi_mac80211_detach(struct rsi_hw *hw); |
| 82 | +void rsi_mac80211_rfkill_exit(struct rsi_hw *hw); | |
| 82 | 83 | u16 rsi_get_connected_channel(struct ieee80211_vif *vif); |
| 83 | 84 | struct rsi_hw *rsi_91x_init(u16 oper_mode); |
| 84 | 85 | void rsi_91x_deinit(struct rsi_hw *adapter); |
| @@ -21,14 +21,14 @@ static void wfx_rx_handle_ba(struct wfx_vif *wvif, struct ieee80211_mgmt *mgmt) · 20 unmodified lines | ||
| 21 | 21 | if (wfx_api_older_than(wvif->wdev, 3, 6)) |
| 22 | 22 | return; |
| 23 | 23 | |
| 24 | − switch (mgmt->u.action.u.addba_req.action_code) { | |
| 24 | + switch (mgmt->u.action.action_code) { | |
| 25 | 25 | 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); | |
| 27 | 27 | tid = (params & IEEE80211_ADDBA_PARAM_TID_MASK) >> 2; |
| 28 | 28 | ieee80211_start_rx_ba_session_offl(vif, mgmt->sa, tid); |
| 29 | 29 | break; |
| 30 | 30 | 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); | |
| 32 | 32 | tid = (params & IEEE80211_DELBA_PARAM_TID_MASK) >> 12; |
| 33 | 33 | ieee80211_stop_rx_ba_session_offl(vif, mgmt->sa, tid); |
| 34 | 34 | 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 | ||
| 80 | 80 | */ |
| 81 | 81 | if (ieee80211_is_action(frame->frame_control) && |
| 82 | 82 | mgmt->u.action.category == WLAN_CATEGORY_BACK && |
| 83 | − skb->len > IEEE80211_MIN_ACTION_SIZE) { | |
| 83 | + skb->len > IEEE80211_MIN_ACTION_SIZE(action_code)) { | |
| 84 | 84 | wfx_rx_handle_ba(wvif, mgmt); |
| 85 | 85 | goto drop; |
| 86 | 86 | } |
| @@ -36,6 +36,8 @@ · 35 unmodified lines | ||
| 36 | 36 | #include <linux/virtio.h> |
| 37 | 37 | #include <linux/virtio_ids.h> |
| 38 | 38 | #include <linux/virtio_config.h> |
| 39 | +#include <linux/uaccess.h> | |
| 40 | +#include <linux/string.h> | |
| 39 | 41 | #include "mac80211_hwsim.h" |
| 40 | 42 | |
| 41 | 43 | #define WARN_QUEUE 100 |
| @@ -1203,6 +1205,65 @@ static const struct file_operations hwsim_background_cac_ops = { · 1161 unmodified lines | ||
| 1203 | 1205 | .llseek = default_llseek, |
| 1204 | 1206 | }; |
| 1205 | 1207 | |
| 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 | + | |
| 1206 | 1267 | static int hwsim_fops_group_read(void *dat, u64 *val) |
| 1207 | 1268 | { |
| 1208 | 1269 | struct mac80211_hwsim_data *data = dat; |
| @@ -5950,6 +6011,9 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, · 4741 unmodified lines | ||
| 5950 | 6011 | debugfs_create_file("dfs_background_cac", 0200, |
| 5951 | 6012 | data->debugfs, |
| 5952 | 6013 | data, &hwsim_background_cac_ops); |
| 6014 | + debugfs_create_file("simulate_incumbent_signal_interference", 0200, | |
| 6015 | + data->debugfs, | |
| 6016 | + data, &hwsim_simulate_incumbent_signal_fops); | |
| 5953 | 6017 | |
| 5954 | 6018 | if (param->pmsr_capa) { |
| 5955 | 6019 | data->pmsr_capa = *param->pmsr_capa; |
| @@ -251,8 +251,8 @@ struct ieee80211_eht_operation_info { · 250 unmodified lines | ||
| 251 | 251 | #define IEEE80211_EHT_PHY_CAP5_SUPP_EXTRA_EHT_LTF 0x40 |
| 252 | 252 | #define IEEE80211_EHT_PHY_CAP6_MAX_NUM_SUPP_EHT_LTF_MASK 0x07 |
| 253 | 253 | |
| 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 | |
| 256 | 256 | #define IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_320MHZ 0x40 |
| 257 | 257 | #define IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_MASK 0x78 |
| 258 | 258 | #define IEEE80211_EHT_PHY_CAP6_EHT_DUP_6GHZ_SUPP 0x80 |
| @@ -281,6 +281,9 @@ enum ieee80211_back_actioncode { · 280 unmodified lines | ||
| 281 | 281 | WLAN_ACTION_ADDBA_REQ = 0, |
| 282 | 282 | WLAN_ACTION_ADDBA_RESP = 1, |
| 283 | 283 | WLAN_ACTION_DELBA = 2, |
| 284 | + WLAN_ACTION_NDP_ADDBA_REQ = 128, | |
| 285 | + WLAN_ACTION_NDP_ADDBA_RESP = 129, | |
| 286 | + WLAN_ACTION_NDP_DELBA = 130, | |
| 284 | 287 | }; |
| 285 | 288 | |
| 286 | 289 | /* BACK (block-ack) parties */ |
| @@ -12,8 +12,8 @@ · 11 unmodified lines | ||
| 12 | 12 | |
| 13 | 13 | #define IEEE80211_UHR_OPER_PARAMS_DPS_ENA 0x0001 |
| 14 | 14 | #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 | |
| 17 | 17 | |
| 18 | 18 | struct ieee80211_uhr_operation { |
| 19 | 19 | __le16 params; |
| @@ -1046,31 +1046,28 @@ struct ieee80211_mgmt { · 1045 unmodified lines | ||
| 1046 | 1046 | } __packed probe_resp; |
| 1047 | 1047 | struct { |
| 1048 | 1048 | u8 category; |
| 1049 | + u8 action_code; | |
| 1049 | 1050 | union { |
| 1050 | 1051 | struct { |
| 1051 | − u8 action_code; | |
| 1052 | 1052 | u8 dialog_token; |
| 1053 | 1053 | u8 status_code; |
| 1054 | 1054 | u8 variable[]; |
| 1055 | 1055 | } __packed wme_action; |
| 1056 | 1056 | struct{ |
| 1057 | − u8 action_code; | |
| 1057 | + u8 no_fixed_fields[0]; | |
| 1058 | 1058 | u8 variable[]; |
| 1059 | 1059 | } __packed chan_switch; |
| 1060 | 1060 | struct{ |
| 1061 | − u8 action_code; | |
| 1062 | 1061 | struct ieee80211_ext_chansw_ie data; |
| 1063 | 1062 | u8 variable[]; |
| 1064 | 1063 | } __packed ext_chan_switch; |
| 1065 | 1064 | struct{ |
| 1066 | − u8 action_code; | |
| 1067 | 1065 | u8 dialog_token; |
| 1068 | 1066 | u8 element_id; |
| 1069 | 1067 | u8 length; |
| 1070 | 1068 | struct ieee80211_msrment_ie msr_elem; |
| 1071 | 1069 | } __packed measurement; |
| 1072 | 1070 | struct{ |
| 1073 | − u8 action_code; | |
| 1074 | 1071 | u8 dialog_token; |
| 1075 | 1072 | __le16 capab; |
| 1076 | 1073 | __le16 timeout; |
| @@ -1079,7 +1076,6 @@ struct ieee80211_mgmt { · 2 unmodified lines | ||
| 1079 | 1076 | u8 variable[]; |
| 1080 | 1077 | } __packed addba_req; |
| 1081 | 1078 | struct{ |
| 1082 | − u8 action_code; | |
| 1083 | 1079 | u8 dialog_token; |
| 1084 | 1080 | __le16 status; |
| 1085 | 1081 | __le16 capab; |
| @@ -1088,54 +1084,45 @@ struct ieee80211_mgmt { · 2 unmodified lines | ||
| 1088 | 1084 | u8 variable[]; |
| 1089 | 1085 | } __packed addba_resp; |
| 1090 | 1086 | struct{ |
| 1091 | − u8 action_code; | |
| 1092 | 1087 | __le16 params; |
| 1093 | 1088 | __le16 reason_code; |
| 1094 | 1089 | } __packed delba; |
| 1095 | 1090 | struct { |
| 1096 | − u8 action_code; | |
| 1091 | + u8 no_fixed_fields[0]; | |
| 1097 | 1092 | u8 variable[]; |
| 1098 | 1093 | } __packed self_prot; |
| 1099 | 1094 | struct{ |
| 1100 | − u8 action_code; | |
| 1095 | + u8 no_fixed_fields[0]; | |
| 1101 | 1096 | u8 variable[]; |
| 1102 | 1097 | } __packed mesh_action; |
| 1103 | 1098 | struct { |
| 1104 | − u8 action; | |
| 1105 | 1099 | u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; |
| 1106 | 1100 | } __packed sa_query; |
| 1107 | 1101 | struct { |
| 1108 | − u8 action; | |
| 1109 | 1102 | u8 smps_control; |
| 1110 | 1103 | } __packed ht_smps; |
| 1111 | 1104 | struct { |
| 1112 | − u8 action_code; | |
| 1113 | 1105 | u8 chanwidth; |
| 1114 | 1106 | } __packed ht_notify_cw; |
| 1115 | 1107 | struct { |
| 1116 | − u8 action_code; | |
| 1117 | 1108 | u8 dialog_token; |
| 1118 | 1109 | __le16 capability; |
| 1119 | 1110 | u8 variable[]; |
| 1120 | 1111 | } __packed tdls_discover_resp; |
| 1121 | 1112 | struct { |
| 1122 | − u8 action_code; | |
| 1123 | 1113 | u8 operating_mode; |
| 1124 | 1114 | } __packed vht_opmode_notif; |
| 1125 | 1115 | struct { |
| 1126 | − u8 action_code; | |
| 1127 | 1116 | u8 membership[WLAN_MEMBERSHIP_LEN]; |
| 1128 | 1117 | u8 position[WLAN_USER_POSITION_LEN]; |
| 1129 | 1118 | } __packed vht_group_notif; |
| 1130 | 1119 | struct { |
| 1131 | − u8 action_code; | |
| 1132 | 1120 | u8 dialog_token; |
| 1133 | 1121 | u8 tpc_elem_id; |
| 1134 | 1122 | u8 tpc_elem_length; |
| 1135 | 1123 | struct ieee80211_tpc_report_ie tpc; |
| 1136 | 1124 | } __packed tpc_report; |
| 1137 | 1125 | struct { |
| 1138 | − u8 action_code; | |
| 1139 | 1126 | u8 dialog_token; |
| 1140 | 1127 | u8 follow_up; |
| 1141 | 1128 | u8 tod[6]; |
| @@ -1145,11 +1132,10 @@ struct ieee80211_mgmt { · 3 unmodified lines | ||
| 1145 | 1132 | u8 variable[]; |
| 1146 | 1133 | } __packed ftm; |
| 1147 | 1134 | struct { |
| 1148 | − u8 action_code; | |
| 1135 | + u8 no_fixed_fields[0]; | |
| 1149 | 1136 | u8 variable[]; |
| 1150 | 1137 | } __packed s1g; |
| 1151 | 1138 | struct { |
| 1152 | − u8 action_code; | |
| 1153 | 1139 | u8 dialog_token; |
| 1154 | 1140 | u8 follow_up; |
| 1155 | 1141 | u32 tod; |
| @@ -1158,41 +1144,37 @@ struct ieee80211_mgmt { · 2 unmodified lines | ||
| 1158 | 1144 | u8 max_toa_error; |
| 1159 | 1145 | } __packed wnm_timing_msr; |
| 1160 | 1146 | struct { |
| 1161 | − u8 action_code; | |
| 1162 | 1147 | u8 dialog_token; |
| 1163 | 1148 | u8 variable[]; |
| 1164 | 1149 | } __packed ttlm_req; |
| 1165 | 1150 | struct { |
| 1166 | − u8 action_code; | |
| 1167 | 1151 | u8 dialog_token; |
| 1168 | 1152 | __le16 status_code; |
| 1169 | 1153 | u8 variable[]; |
| 1170 | 1154 | } __packed ttlm_res; |
| 1171 | 1155 | struct { |
| 1172 | − u8 action_code; | |
| 1156 | + u8 no_fixed_fields[0]; | |
| 1157 | + /* no variable fields either */ | |
| 1173 | 1158 | } __packed ttlm_tear_down; |
| 1174 | 1159 | struct { |
| 1175 | − u8 action_code; | |
| 1176 | 1160 | u8 dialog_token; |
| 1177 | 1161 | u8 variable[]; |
| 1178 | 1162 | } __packed ml_reconf_req; |
| 1179 | 1163 | struct { |
| 1180 | − u8 action_code; | |
| 1181 | 1164 | u8 dialog_token; |
| 1182 | 1165 | u8 count; |
| 1183 | 1166 | u8 variable[]; |
| 1184 | 1167 | } __packed ml_reconf_resp; |
| 1185 | 1168 | struct { |
| 1186 | − u8 action_code; | |
| 1169 | + u8 no_fixed_fields[0]; | |
| 1187 | 1170 | u8 variable[]; |
| 1188 | 1171 | } __packed epcs; |
| 1189 | 1172 | struct { |
| 1190 | − u8 action_code; | |
| 1191 | 1173 | u8 dialog_token; |
| 1192 | 1174 | u8 control; |
| 1193 | 1175 | u8 variable[]; |
| 1194 | 1176 | } __packed eml_omn; |
| 1195 | − } u; | |
| 1177 | + }; | |
| 1196 | 1178 | } __packed action; |
| 1197 | 1179 | DECLARE_FLEX_ARRAY(u8, body); /* Generic frame body */ |
| 1198 | 1180 | } u; |
| @@ -1210,8 +1192,7 @@ struct ieee80211_mgmt { · 11 unmodified lines | ||
| 1210 | 1192 | |
| 1211 | 1193 | #define BSS_MEMBERSHIP_SELECTOR_MIN BSS_MEMBERSHIP_SELECTOR_UHR_PHY |
| 1212 | 1194 | |
| 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) | |
| 1215 | 1196 | |
| 1216 | 1197 | |
| 1217 | 1198 | /* Management MIC information element (IEEE 802.11w) for CMAC */ |
| @@ -1501,6 +1482,8 @@ enum ieee80211_statuscode { · 283 unmodified lines | ||
| 1501 | 1482 | WLAN_STATUS_REJECT_DSE_BAND = 96, |
| 1502 | 1483 | WLAN_STATUS_DENIED_WITH_SUGGESTED_BAND_AND_CHANNEL = 99, |
| 1503 | 1484 | WLAN_STATUS_DENIED_DUE_TO_SPECTRUM_MANAGEMENT = 103, |
| 1485 | + /* 802.11ah */ | |
| 1486 | + WLAN_STATUS_REJECTED_NDP_BLOCK_ACK_SUGGESTED = 109, | |
| 1504 | 1487 | /* 802.11ai */ |
| 1505 | 1488 | WLAN_STATUS_FILS_AUTHENTICATION_FAILURE = 112, |
| 1506 | 1489 | WLAN_STATUS_UNKNOWN_AUTHENTICATION_SERVER = 113, |
| @@ -2391,7 +2374,7 @@ static inline bool ieee80211_is_bufferable_mmpdu(struct sk_buff *skb) · 884 unmodified lines | ||
| 2391 | 2374 | if (!ieee80211_is_action(fc)) |
| 2392 | 2375 | return false; |
| 2393 | 2376 | |
| 2394 | − if (skb->len < offsetofend(typeof(*mgmt), u.action.u.ftm.action_code)) | |
| 2377 | + if (skb->len < IEEE80211_MIN_ACTION_SIZE(action_code)) | |
| 2395 | 2378 | return true; |
| 2396 | 2379 | |
| 2397 | 2380 | /* 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 | ||
| 2400 | 2383 | mgmt->u.action.category != WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION) |
| 2401 | 2384 | return true; |
| 2402 | 2385 | |
| 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) | |
| 2405 | 2388 | return false; |
| 2406 | 2389 | |
| 2407 | 2390 | return true; |
| @@ -2451,7 +2434,7 @@ static inline bool _ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr) · 43 unmodified lines | ||
| 2451 | 2434 | */ |
| 2452 | 2435 | static inline bool ieee80211_is_robust_mgmt_frame(struct sk_buff *skb) |
| 2453 | 2436 | { |
| 2454 | − if (skb->len < IEEE80211_MIN_ACTION_SIZE) | |
| 2437 | + if (skb->len < IEEE80211_MIN_ACTION_SIZE(category)) | |
| 2455 | 2438 | return false; |
| 2456 | 2439 | return _ieee80211_is_robust_mgmt_frame((void *)skb->data); |
| 2457 | 2440 | } |
| @@ -2467,7 +2450,7 @@ static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr, · 9 unmodified lines | ||
| 2467 | 2450 | { |
| 2468 | 2451 | struct ieee80211_mgmt *mgmt = (void *)hdr; |
| 2469 | 2452 | |
| 2470 | − if (len < IEEE80211_MIN_ACTION_SIZE) | |
| 2453 | + if (len < IEEE80211_MIN_ACTION_SIZE(category)) | |
| 2471 | 2454 | return false; |
| 2472 | 2455 | if (!ieee80211_is_action(hdr->frame_control)) |
| 2473 | 2456 | return false; |
| @@ -2485,13 +2468,14 @@ static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr, · 11 unmodified lines | ||
| 2485 | 2468 | static inline bool |
| 2486 | 2469 | ieee80211_is_protected_dual_of_public_action(struct sk_buff *skb) |
| 2487 | 2470 | { |
| 2471 | + struct ieee80211_mgmt *mgmt = (void *)skb->data; | |
| 2488 | 2472 | u8 action; |
| 2489 | 2473 | |
| 2490 | 2474 | 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)) | |
| 2492 | 2476 | return false; |
| 2493 | 2477 | |
| 2494 | − action = *(u8 *)(skb->data + IEEE80211_MIN_ACTION_SIZE); | |
| 2478 | + action = mgmt->u.action.action_code; | |
| 2495 | 2479 | |
| 2496 | 2480 | return action != WLAN_PUB_ACTION_20_40_BSS_COEX && |
| 2497 | 2481 | 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 | ||
| 2530 | 2514 | */ |
| 2531 | 2515 | static inline bool ieee80211_is_group_privacy_action(struct sk_buff *skb) |
| 2532 | 2516 | { |
| 2533 | − if (skb->len < IEEE80211_MIN_ACTION_SIZE) | |
| 2517 | + if (skb->len < IEEE80211_MIN_ACTION_SIZE(category)) | |
| 2534 | 2518 | return false; |
| 2535 | 2519 | return _ieee80211_is_group_privacy_action((void *)skb->data); |
| 2536 | 2520 | } |
| @@ -2626,8 +2610,7 @@ static inline bool ieee80211_action_contains_tpc(struct sk_buff *skb) · 89 unmodified lines | ||
| 2626 | 2610 | if (!ieee80211_is_action(mgmt->frame_control)) |
| 2627 | 2611 | return false; |
| 2628 | 2612 | |
| 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)) | |
| 2631 | 2614 | return false; |
| 2632 | 2615 | |
| 2633 | 2616 | /* |
| @@ -2646,12 +2629,11 @@ static inline bool ieee80211_action_contains_tpc(struct sk_buff *skb) · 12 unmodified lines | ||
| 2646 | 2629 | return false; |
| 2647 | 2630 | |
| 2648 | 2631 | /* 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) | |
| 2651 | 2633 | return false; |
| 2652 | 2634 | |
| 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 != | |
| 2655 | 2637 | sizeof(struct ieee80211_tpc_report_ie)) |
| 2656 | 2638 | return false; |
| 2657 | 2639 | |
| @@ -2667,16 +2649,15 @@ static inline bool ieee80211_is_timing_measurement(struct sk_buff *skb) · 9 unmodified lines | ||
| 2667 | 2649 | { |
| 2668 | 2650 | struct ieee80211_mgmt *mgmt = (void *)skb->data; |
| 2669 | 2651 | |
| 2670 | − if (skb->len < IEEE80211_MIN_ACTION_SIZE) | |
| 2652 | + if (skb->len < IEEE80211_MIN_ACTION_SIZE(wnm_timing_msr)) | |
| 2671 | 2653 | return false; |
| 2672 | 2654 | |
| 2673 | 2655 | if (!ieee80211_is_action(mgmt->frame_control)) |
| 2674 | 2656 | return false; |
| 2675 | 2657 | |
| 2676 | 2658 | 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) | |
| 2680 | 2661 | return true; |
| 2681 | 2662 | |
| 2682 | 2663 | return false; |
| @@ -2691,15 +2672,13 @@ static inline bool ieee80211_is_ftm(struct sk_buff *skb) · 8 unmodified lines | ||
| 2691 | 2672 | { |
| 2692 | 2673 | struct ieee80211_mgmt *mgmt = (void *)skb->data; |
| 2693 | 2674 | |
| 2694 | − if (!ieee80211_is_public_action((void *)mgmt, skb->len)) | |
| 2675 | + if (skb->len < IEEE80211_MIN_ACTION_SIZE(ftm)) | |
| 2695 | 2676 | return false; |
| 2696 | 2677 | |
| 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; | |
| 2701 | 2680 | |
| 2702 | − return false; | |
| 2681 | + return mgmt->u.action.action_code == WLAN_PUB_ACTION_FTM_RESPONSE; | |
| 2703 | 2682 | } |
| 2704 | 2683 | |
| 2705 | 2684 | struct element { |
| @@ -2913,6 +2913,9 @@ struct ieee80211_txq { · 2912 unmodified lines | ||
| 2913 | 2913 | * HW flag so drivers can opt in according to their own control, e.g. in |
| 2914 | 2914 | * testing. |
| 2915 | 2915 | * |
| 2916 | + * @IEEE80211_HW_SUPPORTS_NDP_BLOCKACK: HW can transmit/receive S1G NDP | |
| 2917 | + * BlockAck frames. | |
| 2918 | + * | |
| 2916 | 2919 | * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays |
| 2917 | 2920 | */ |
| 2918 | 2921 | enum ieee80211_hw_flags { |
| @@ -2973,6 +2976,7 @@ enum ieee80211_hw_flags { · 54 unmodified lines | ||
| 2973 | 2976 | IEEE80211_HW_DISALLOW_PUNCTURING, |
| 2974 | 2977 | IEEE80211_HW_HANDLES_QUIET_CSA, |
| 2975 | 2978 | IEEE80211_HW_STRICT, |
| 2979 | + IEEE80211_HW_SUPPORTS_NDP_BLOCKACK, | |
| 2976 | 2980 | |
| 2977 | 2981 | /* keep last, obviously */ |
| 2978 | 2982 | NUM_IEEE80211_HW_FLAGS |
| @@ -3001,6 +3001,10 @@ enum nl80211_commands { · 3000 unmodified lines | ||
| 3001 | 3001 | * interference detection is not performed on these sub-channels, their |
| 3002 | 3002 | * corresponding bits are consistently set to zero. |
| 3003 | 3003 | * |
| 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 | + * | |
| 3004 | 3008 | * @NUM_NL80211_ATTR: total number of nl80211_attrs available |
| 3005 | 3009 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
| 3006 | 3010 | * @__NL80211_ATTR_AFTER_LAST: internal use |
| @@ -3576,6 +3580,8 @@ enum nl80211_attrs { · 569 unmodified lines | ||
| 3576 | 3580 | |
| 3577 | 3581 | NL80211_ATTR_INCUMBENT_SIGNAL_INTERFERENCE_BITMAP, |
| 3578 | 3582 | |
| 3583 | + NL80211_ATTR_UHR_OPERATION, | |
| 3584 | + | |
| 3579 | 3585 | /* add attributes here, update the policy in nl80211.c */ |
| 3580 | 3586 | |
| 3581 | 3587 | __NL80211_ATTR_AFTER_LAST, |
| @@ -9,7 +9,7 @@ · 8 unmodified lines | ||
| 9 | 9 | * Copyright 2007, Michael Wu <flamingice@sourmilk.net> |
| 10 | 10 | * Copyright 2007-2010, Intel Corporation |
| 11 | 11 | * Copyright(c) 2015-2017 Intel Deutschland GmbH |
| 12 | − * Copyright (C) 2018-2025 Intel Corporation | |
| 12 | + * Copyright (C) 2018-2026 Intel Corporation | |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | /** |
| @@ -94,7 +94,8 @@ void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, · 78 unmodified lines | ||
| 94 | 94 | /* check if this is a self generated aggregation halt */ |
| 95 | 95 | if (initiator == WLAN_BACK_RECIPIENT && tx) |
| 96 | 96 | 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)); | |
| 98 | 99 | |
| 99 | 100 | /* |
| 100 | 101 | * 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 | ||
| 240 | 241 | struct sk_buff *skb; |
| 241 | 242 | struct ieee80211_mgmt *mgmt; |
| 242 | 243 | bool amsdu = ieee80211_hw_check(&local->hw, SUPPORTS_AMSDU_IN_AMPDU); |
| 244 | + bool use_ndp = ieee80211_s1g_use_ndp_ba(sdata, sta); | |
| 243 | 245 | u16 capab; |
| 244 | 246 | |
| 245 | 247 | 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 | ||
| 251 | 253 | skb_reserve(skb, local->hw.extra_tx_headroom); |
| 252 | 254 | mgmt = ieee80211_mgmt_ba(skb, da, sdata); |
| 253 | 255 | |
| 254 | − skb_put(skb, 1 + sizeof(mgmt->u.action.u.addba_resp)); | |
| 256 | + skb_put(skb, 2 + sizeof(mgmt->u.action.addba_resp)); | |
| 255 | 257 | 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; | |
| 258 | 262 | |
| 259 | 263 | capab = u16_encode_bits(amsdu, IEEE80211_ADDBA_PARAM_AMSDU_MASK); |
| 260 | 264 | capab |= u16_encode_bits(policy, IEEE80211_ADDBA_PARAM_POLICY_MASK); |
| 261 | 265 | capab |= u16_encode_bits(tid, IEEE80211_ADDBA_PARAM_TID_MASK); |
| 262 | 266 | capab |= u16_encode_bits(buf_size, IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK); |
| 263 | 267 | |
| 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); | |
| 267 | 271 | |
| 268 | 272 | if (sta->sta.valid_links || sta->sta.deflink.he_cap.has_he) |
| 269 | 273 | 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 | ||
| 275 | 279 | u8 dialog_token, u16 timeout, |
| 276 | 280 | u16 start_seq_num, u16 ba_policy, u16 tid, |
| 277 | 281 | u16 buf_size, bool tx, bool auto_seq, |
| 282 | + bool req_ndp, | |
| 278 | 283 | const u8 addba_ext_data) |
| 279 | 284 | { |
| 280 | 285 | struct ieee80211_local *local = sta->sdata->local; |
| @@ -300,6 +305,18 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta, · 19 unmodified lines | ||
| 300 | 305 | goto end; |
| 301 | 306 | } |
| 302 | 307 | |
| 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 | + | |
| 303 | 320 | if (!sta->sta.valid_links && |
| 304 | 321 | !sta->sta.deflink.ht_cap.ht_supported && |
| 305 | 322 | !sta->sta.deflink.he_cap.has_he && |
| @@ -473,31 +490,33 @@ void ieee80211_process_addba_request(struct ieee80211_local *local, · 167 unmodified lines | ||
| 473 | 490 | struct ieee80211_mgmt *mgmt, |
| 474 | 491 | size_t len) |
| 475 | 492 | { |
| 493 | + bool req_ndp = mgmt->u.action.action_code == WLAN_ACTION_NDP_ADDBA_REQ; | |
| 476 | 494 | u16 capab, tid, timeout, ba_policy, buf_size, start_seq_num; |
| 477 | 495 | u8 dialog_token, addba_ext_data; |
| 478 | 496 | |
| 479 | 497 | /* 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); | |
| 482 | 500 | 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; | |
| 484 | 502 | |
| 485 | − capab = le16_to_cpu(mgmt->u.action.u.addba_req.capab); | |
| 503 | + capab = le16_to_cpu(mgmt->u.action.addba_req.capab); | |
| 486 | 504 | ba_policy = (capab & IEEE80211_ADDBA_PARAM_POLICY_MASK) >> 1; |
| 487 | 505 | tid = (capab & IEEE80211_ADDBA_PARAM_TID_MASK) >> 2; |
| 488 | 506 | buf_size = (capab & IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK) >> 6; |
| 489 | 507 | |
| 490 | 508 | addba_ext_data = |
| 491 | 509 | ieee80211_retrieve_addba_ext_data(sta, |
| 492 | − mgmt->u.action.u.addba_req.variable, | |
| 510 | + mgmt->u.action.addba_req.variable, | |
| 493 | 511 | len - |
| 494 | 512 | offsetof(typeof(*mgmt), |
| 495 | − u.action.u.addba_req.variable), | |
| 513 | + u.action.addba_req.variable), | |
| 496 | 514 | &buf_size); |
| 497 | 515 | |
| 498 | 516 | __ieee80211_start_rx_ba_session(sta, dialog_token, timeout, |
| 499 | 517 | 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); | |
| 501 | 520 | } |
| 502 | 521 | |
| 503 | 522 | void ieee80211_manage_rx_ba_offl(struct ieee80211_vif *vif, |
| @@ -9,7 +9,7 @@ · 8 unmodified lines | ||
| 9 | 9 | * Copyright 2007, Michael Wu <flamingice@sourmilk.net> |
| 10 | 10 | * Copyright 2007-2010, Intel Corporation |
| 11 | 11 | * Copyright(c) 2015-2017 Intel Deutschland GmbH |
| 12 | − * Copyright (C) 2018 - 2024 Intel Corporation | |
| 12 | + * Copyright (C) 2018-2026 Intel Corporation | |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | #include <linux/ieee80211.h> |
| @@ -60,7 +60,7 @@ · 44 unmodified lines | ||
| 60 | 60 | |
| 61 | 61 | static void ieee80211_send_addba_request(struct sta_info *sta, u16 tid, |
| 62 | 62 | u8 dialog_token, u16 start_seq_num, |
| 63 | − u16 agg_size, u16 timeout) | |
| 63 | + u16 agg_size, u16 timeout, bool ndp) | |
| 64 | 64 | { |
| 65 | 65 | struct ieee80211_sub_if_data *sdata = sta->sdata; |
| 66 | 66 | 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 | ||
| 68 | 68 | struct ieee80211_mgmt *mgmt; |
| 69 | 69 | u16 capab; |
| 70 | 70 | |
| 71 | − skb = dev_alloc_skb(sizeof(*mgmt) + | |
| 71 | + skb = dev_alloc_skb(IEEE80211_MIN_ACTION_SIZE(addba_req) + | |
| 72 | 72 | 2 + sizeof(struct ieee80211_addba_ext_ie) + |
| 73 | 73 | local->hw.extra_tx_headroom); |
| 74 | 74 | if (!skb) |
| @@ -77,21 +77,22 @@ static void ieee80211_send_addba_request(struct sta_info *sta, u16 tid, · 2 unmodified lines | ||
| 77 | 77 | skb_reserve(skb, local->hw.extra_tx_headroom); |
| 78 | 78 | mgmt = ieee80211_mgmt_ba(skb, sta->sta.addr, sdata); |
| 79 | 79 | |
| 80 | − skb_put(skb, 1 + sizeof(mgmt->u.action.u.addba_req)); | |
| 80 | + skb_put(skb, 2 + sizeof(mgmt->u.action.addba_req)); | |
| 81 | 81 | |
| 82 | 82 | 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; | |
| 84 | 85 | |
| 85 | − mgmt->u.action.u.addba_req.dialog_token = dialog_token; | |
| 86 | + mgmt->u.action.addba_req.dialog_token = dialog_token; | |
| 86 | 87 | capab = IEEE80211_ADDBA_PARAM_AMSDU_MASK; |
| 87 | 88 | capab |= IEEE80211_ADDBA_PARAM_POLICY_MASK; |
| 88 | 89 | capab |= u16_encode_bits(tid, IEEE80211_ADDBA_PARAM_TID_MASK); |
| 89 | 90 | capab |= u16_encode_bits(agg_size, IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK); |
| 90 | 91 | |
| 91 | − mgmt->u.action.u.addba_req.capab = cpu_to_le16(capab); | |
| 92 | + mgmt->u.action.addba_req.capab = cpu_to_le16(capab); | |
| 92 | 93 | |
| 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 = | |
| 95 | 96 | cpu_to_le16(start_seq_num << 4); |
| 96 | 97 | |
| 97 | 98 | 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 | ||
| 484 | 485 | |
| 485 | 486 | /* send AddBA request */ |
| 486 | 487 | 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); | |
| 488 | 490 | |
| 489 | 491 | WARN_ON(test_and_set_bit(HT_AGG_STATE_SENT_ADDBA, &tid_tx->state)); |
| 490 | 492 | } |
| @@ -521,6 +523,7 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid) · 30 unmodified lines | ||
| 521 | 523 | */ |
| 522 | 524 | synchronize_net(); |
| 523 | 525 | |
| 526 | + tid_tx->ndp = ieee80211_s1g_use_ndp_ba(sdata, sta); | |
| 524 | 527 | params.ssn = sta->tid_seq[tid] >> 4; |
| 525 | 528 | ret = drv_ampdu_action(local, sdata, ¶ms); |
| 526 | 529 | tid_tx->ssn = params.ssn; |
| @@ -940,7 +943,9 @@ void ieee80211_stop_tx_ba_cb(struct sta_info *sta, int tid, · 413 unmodified lines | ||
| 940 | 943 | |
| 941 | 944 | if (send_delba) |
| 942 | 945 | 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); | |
| 944 | 949 | } |
| 945 | 950 | |
| 946 | 951 | 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 | ||
| 978 | 983 | |
| 979 | 984 | lockdep_assert_wiphy(sta->local->hw.wiphy); |
| 980 | 985 | |
| 981 | − capab = le16_to_cpu(mgmt->u.action.u.addba_resp.capab); | |
| 986 | + capab = le16_to_cpu(mgmt->u.action.addba_resp.capab); | |
| 982 | 987 | amsdu = capab & IEEE80211_ADDBA_PARAM_AMSDU_MASK; |
| 983 | 988 | tid = u16_get_bits(capab, IEEE80211_ADDBA_PARAM_TID_MASK); |
| 984 | 989 | buf_size = u16_get_bits(capab, IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK); |
| 985 | 990 | |
| 986 | 991 | ieee80211_retrieve_addba_ext_data(sta, |
| 987 | − mgmt->u.action.u.addba_resp.variable, | |
| 992 | + mgmt->u.action.addba_resp.variable, | |
| 988 | 993 | len - offsetof(typeof(*mgmt), |
| 989 | − u.action.u.addba_resp.variable), | |
| 994 | + u.action.addba_resp.variable), | |
| 990 | 995 | &buf_size); |
| 991 | 996 | |
| 992 | 997 | 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 | ||
| 999 | 1004 | if (!tid_tx) |
| 1000 | 1005 | return; |
| 1001 | 1006 | |
| 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) { | |
| 1003 | 1008 | ht_dbg(sta->sdata, "wrong addBA response token, %pM tid %d\n", |
| 1004 | 1009 | sta->sta.addr, tid); |
| 1005 | 1010 | return; |
| @@ -1029,7 +1034,7 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, · 23 unmodified lines | ||
| 1029 | 1034 | * is set to 0, the Buffer Size subfield is set to a value |
| 1030 | 1035 | * of at least 1. |
| 1031 | 1036 | */ |
| 1032 | − if (le16_to_cpu(mgmt->u.action.u.addba_resp.status) | |
| 1037 | + if (le16_to_cpu(mgmt->u.action.addba_resp.status) | |
| 1033 | 1038 | == WLAN_STATUS_SUCCESS && buf_size) { |
| 1034 | 1039 | if (test_and_set_bit(HT_AGG_STATE_RESPONSE_RECEIVED, |
| 1035 | 1040 | &tid_tx->state)) { |
| @@ -1046,7 +1051,7 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, · 10 unmodified lines | ||
| 1046 | 1051 | sta->ampdu_mlme.addba_req_num[tid] = 0; |
| 1047 | 1052 | |
| 1048 | 1053 | tid_tx->timeout = |
| 1049 | − le16_to_cpu(mgmt->u.action.u.addba_resp.timeout); | |
| 1054 | + le16_to_cpu(mgmt->u.action.addba_resp.timeout); | |
| 1050 | 1055 | |
| 1051 | 1056 | if (tid_tx->timeout) { |
| 1052 | 1057 | mod_timer(&tid_tx->session_timer, |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0-only |
| 2 | 2 | /* |
| 3 | 3 | * mac80211 - channel management |
| 4 | − * Copyright 2020 - 2025 Intel Corporation | |
| 4 | + * Copyright 2020-2026 Intel Corporation | |
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | 7 | #include <linux/nl80211.h> |
| @@ -239,26 +239,47 @@ ieee80211_chanreq_compatible(const struct ieee80211_chan_req *a, · 231 unmodified lines | ||
| 239 | 239 | return tmp; |
| 240 | 240 | } |
| 241 | 241 | |
| 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 | + */ | |
| 242 | 249 | 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) | |
| 246 | 255 | { |
| 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; | |
| 249 | 258 | |
| 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 | + } | |
| 254 | 269 | |
| 255 | − ret = ieee80211_chanreq_compatible(tmp, req, &tmp2); | |
| 256 | − if (!ret) | |
| 257 | − return NULL; | |
| 258 | 270 | *tmp = *ret; |
| 259 | 271 | return tmp; |
| 260 | 272 | } |
| 261 | 273 | |
| 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 | + | |
| 262 | 283 | static const struct ieee80211_chan_req * |
| 263 | 284 | ieee80211_chanctx_reserved_chanreq(struct ieee80211_local *local, |
| 264 | 285 | struct ieee80211_chanctx *ctx, |
| @@ -756,7 +777,8 @@ ieee80211_find_chanctx(struct ieee80211_local *local, · 491 unmodified lines | ||
| 756 | 777 | if (ctx->mode == IEEE80211_CHANCTX_EXCLUSIVE) |
| 757 | 778 | continue; |
| 758 | 779 | |
| 759 | − compat = ieee80211_chanctx_compatible(ctx, chanreq, &tmp); | |
| 780 | + compat = ieee80211_chanctx_compatible(local, ctx, chanreq, | |
| 781 | + &tmp); | |
| 760 | 782 | if (!compat) |
| 761 | 783 | continue; |
| 762 | 784 | |
| @@ -2128,40 +2150,6 @@ int ieee80211_link_use_reserved_context(struct ieee80211_link_data *link) · 1365 unmodified lines | ||
| 2128 | 2150 | return 0; |
| 2129 | 2151 | } |
| 2130 | 2152 | |
| 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 | − | |
| 2165 | 2153 | int ieee80211_link_change_chanreq(struct ieee80211_link_data *link, |
| 2166 | 2154 | const struct ieee80211_chan_req *chanreq, |
| 2167 | 2155 | u64 *changed) |
| @@ -2198,7 +2186,7 @@ int ieee80211_link_change_chanreq(struct ieee80211_link_data *link, · 30 unmodified lines | ||
| 2198 | 2186 | |
| 2199 | 2187 | ctx = container_of(conf, struct ieee80211_chanctx, conf); |
| 2200 | 2188 | |
| 2201 | − compat = ieee80211_chanctx_recheck(local, link, ctx, chanreq, &tmp); | |
| 2189 | + compat = _ieee80211_chanctx_compatible(local, link, ctx, chanreq, &tmp); | |
| 2202 | 2190 | if (!compat) |
| 2203 | 2191 | return -EINVAL; |
| 2204 | 2192 | |
| @@ -490,6 +490,7 @@ static const char *hw_flag_names[] = { · 489 unmodified lines | ||
| 490 | 490 | FLAG(DISALLOW_PUNCTURING), |
| 491 | 491 | FLAG(HANDLES_QUIET_CSA), |
| 492 | 492 | FLAG(STRICT), |
| 493 | + FLAG(SUPPORTS_NDP_BLOCKACK), | |
| 493 | 494 | #undef FLAG |
| 494 | 495 | }; |
| 495 | 496 | |
| @@ -108,7 +108,7 @@ static void · 107 unmodified lines | ||
| 108 | 108 | ieee80211_send_eml_op_mode_notif(struct ieee80211_sub_if_data *sdata, |
| 109 | 109 | struct ieee80211_mgmt *req, int opt_len) |
| 110 | 110 | { |
| 111 | − int len = offsetofend(struct ieee80211_mgmt, u.action.u.eml_omn); | |
| 111 | + int len = IEEE80211_MIN_ACTION_SIZE(eml_omn); | |
| 112 | 112 | struct ieee80211_local *local = sdata->local; |
| 113 | 113 | struct ieee80211_mgmt *mgmt; |
| 114 | 114 | struct sk_buff *skb; |
| @@ -127,16 +127,15 @@ ieee80211_send_eml_op_mode_notif(struct ieee80211_sub_if_data *sdata, · 12 unmodified lines | ||
| 127 | 127 | memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); |
| 128 | 128 | |
| 129 | 129 | 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 & | |
| 135 | 134 | ~(IEEE80211_EML_CTRL_EMLSR_PARAM_UPDATE | |
| 136 | 135 | IEEE80211_EML_CTRL_INDEV_COEX_ACT); |
| 137 | 136 | /* 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); | |
| 140 | 139 | |
| 141 | 140 | ieee80211_tx_skb(sdata, skb); |
| 142 | 141 | } |
| @@ -144,14 +143,14 @@ ieee80211_send_eml_op_mode_notif(struct ieee80211_sub_if_data *sdata, · 1 unmodified line | ||
| 144 | 143 | void ieee80211_rx_eml_op_mode_notif(struct ieee80211_sub_if_data *sdata, |
| 145 | 144 | struct sk_buff *skb) |
| 146 | 145 | { |
| 147 | − int len = offsetofend(struct ieee80211_mgmt, u.action.u.eml_omn); | |
| 146 | + int len = IEEE80211_MIN_ACTION_SIZE(eml_omn); | |
| 148 | 147 | enum nl80211_iftype type = ieee80211_vif_type_p2p(&sdata->vif); |
| 149 | 148 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); |
| 150 | 149 | const struct wiphy_iftype_ext_capab *ift_ext_capa; |
| 151 | 150 | struct ieee80211_mgmt *mgmt = (void *)skb->data; |
| 152 | 151 | 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; | |
| 155 | 154 | struct ieee80211_eml_params eml_params = { |
| 156 | 155 | .link_id = status->link_id, |
| 157 | 156 | .control = control, |
| @@ -9,7 +9,7 @@ · 8 unmodified lines | ||
| 9 | 9 | * Copyright 2007, Michael Wu <flamingice@sourmilk.net> |
| 10 | 10 | * Copyright 2007-2010, Intel Corporation |
| 11 | 11 | * Copyright 2017 Intel Deutschland GmbH |
| 12 | − * Copyright(c) 2020-2025 Intel Corporation | |
| 12 | + * Copyright(c) 2020-2026 Intel Corporation | |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | #include <linux/ieee80211.h> |
| @@ -379,7 +379,7 @@ void ieee80211_ba_session_work(struct wiphy *wiphy, struct wiphy_work *work) · 363 unmodified lines | ||
| 379 | 379 | sta->ampdu_mlme.tid_rx_manage_offl)) |
| 380 | 380 | __ieee80211_start_rx_ba_session(sta, 0, 0, 0, 1, tid, |
| 381 | 381 | IEEE80211_MAX_AMPDU_BUF_HT, |
| 382 | − false, true, 0); | |
| 382 | + false, true, false, 0); | |
| 383 | 383 | |
| 384 | 384 | if (test_and_clear_bit(tid + IEEE80211_NUM_TIDS, |
| 385 | 385 | 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 | ||
| 455 | 455 | |
| 456 | 456 | void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata, |
| 457 | 457 | const u8 *da, u16 tid, |
| 458 | − u16 initiator, u16 reason_code) | |
| 458 | + u16 initiator, u16 reason_code, | |
| 459 | + bool use_ndp) | |
| 459 | 460 | { |
| 460 | 461 | struct ieee80211_local *local = sdata->local; |
| 461 | 462 | struct sk_buff *skb; |
| 462 | 463 | struct ieee80211_mgmt *mgmt; |
| 463 | 464 | u16 params; |
| 464 | 465 | |
| 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); | |
| 466 | 468 | if (!skb) |
| 467 | 469 | return; |
| 468 | 470 | |
| 469 | 471 | skb_reserve(skb, local->hw.extra_tx_headroom); |
| 470 | 472 | mgmt = ieee80211_mgmt_ba(skb, da, sdata); |
| 471 | 473 | |
| 472 | − skb_put(skb, 1 + sizeof(mgmt->u.action.u.delba)); | |
| 474 | + skb_put(skb, 2 + sizeof(mgmt->u.action.delba)); | |
| 473 | 475 | |
| 474 | 476 | 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; | |
| 476 | 479 | params = (u16)(initiator << 11); /* bit 11 initiator */ |
| 477 | 480 | params |= (u16)(tid << 12); /* bit 15:12 TID number */ |
| 478 | 481 | |
| 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); | |
| 481 | 484 | |
| 482 | 485 | ieee80211_tx_skb(sdata, skb); |
| 483 | 486 | } |
| @@ -489,14 +492,14 @@ void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata, · 5 unmodified lines | ||
| 489 | 492 | u16 tid, params; |
| 490 | 493 | u16 initiator; |
| 491 | 494 | |
| 492 | − params = le16_to_cpu(mgmt->u.action.u.delba.params); | |
| 495 | + params = le16_to_cpu(mgmt->u.action.delba.params); | |
| 493 | 496 | tid = (params & IEEE80211_DELBA_PARAM_TID_MASK) >> 12; |
| 494 | 497 | initiator = (params & IEEE80211_DELBA_PARAM_INITIATOR_MASK) >> 11; |
| 495 | 498 | |
| 496 | 499 | ht_dbg_ratelimited(sdata, "delba from %pM (%s) tid %d reason code %d\n", |
| 497 | 500 | mgmt->sa, initiator ? "initiator" : "recipient", |
| 498 | 501 | tid, |
| 499 | − le16_to_cpu(mgmt->u.action.u.delba.reason_code)); | |
| 502 | + le16_to_cpu(mgmt->u.action.delba.reason_code)); | |
| 500 | 503 | |
| 501 | 504 | if (initiator == WLAN_BACK_INITIATOR) |
| 502 | 505 | __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 | ||
| 530 | 533 | struct ieee80211_tx_info *info; |
| 531 | 534 | u8 status_link_id = link_id < 0 ? 0 : link_id; |
| 532 | 535 | |
| 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); | |
| 535 | 538 | if (!skb) |
| 536 | 539 | return -ENOMEM; |
| 537 | 540 | |
| 538 | 541 | 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)); | |
| 540 | 543 | memcpy(action_frame->da, da, ETH_ALEN); |
| 541 | 544 | memcpy(action_frame->sa, sdata->dev->dev_addr, ETH_ALEN); |
| 542 | 545 | memcpy(action_frame->bssid, bssid, ETH_ALEN); |
| 543 | 546 | action_frame->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | |
| 544 | 547 | IEEE80211_STYPE_ACTION); |
| 545 | 548 | 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; | |
| 547 | 550 | switch (smps) { |
| 548 | 551 | case IEEE80211_SMPS_AUTOMATIC: |
| 549 | 552 | case IEEE80211_SMPS_NUM_MODES: |
| @@ -551,15 +554,15 @@ int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata, · 1 unmodified line | ||
| 551 | 554 | smps = IEEE80211_SMPS_OFF; |
| 552 | 555 | fallthrough; |
| 553 | 556 | case IEEE80211_SMPS_OFF: |
| 554 | − action_frame->u.action.u.ht_smps.smps_control = | |
| 557 | + action_frame->u.action.ht_smps.smps_control = | |
| 555 | 558 | WLAN_HT_SMPS_CONTROL_DISABLED; |
| 556 | 559 | break; |
| 557 | 560 | case IEEE80211_SMPS_STATIC: |
| 558 | − action_frame->u.action.u.ht_smps.smps_control = | |
| 561 | + action_frame->u.action.ht_smps.smps_control = | |
| 559 | 562 | WLAN_HT_SMPS_CONTROL_STATIC; |
| 560 | 563 | break; |
| 561 | 564 | case IEEE80211_SMPS_DYNAMIC: |
| 562 | − action_frame->u.action.u.ht_smps.smps_control = | |
| 565 | + action_frame->u.action.ht_smps.smps_control = | |
| 563 | 566 | WLAN_HT_SMPS_CONTROL_DYNAMIC; |
| 564 | 567 | break; |
| 565 | 568 | } |
| @@ -9,7 +9,7 @@ · 8 unmodified lines | ||
| 9 | 9 | * Copyright 2009, Johannes Berg <johannes@sipsolutions.net> |
| 10 | 10 | * Copyright 2013-2014 Intel Mobile Communications GmbH |
| 11 | 11 | * Copyright(c) 2016 Intel Deutschland GmbH |
| 12 | − * Copyright(c) 2018-2025 Intel Corporation | |
| 12 | + * Copyright(c) 2018-2026 Intel Corporation | |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | #include <linux/delay.h> |
| @@ -888,19 +888,11 @@ ieee80211_rx_mgmt_spectrum_mgmt(struct ieee80211_sub_if_data *sdata, · 872 unmodified lines | ||
| 888 | 888 | struct ieee80211_rx_status *rx_status, |
| 889 | 889 | struct ieee802_11_elems *elems) |
| 890 | 890 | { |
| 891 | − int required_len; | |
| 892 | − | |
| 893 | − if (len < IEEE80211_MIN_ACTION_SIZE + 1) | |
| 891 | + if (len < IEEE80211_MIN_ACTION_SIZE(chan_switch)) | |
| 894 | 892 | return; |
| 895 | 893 | |
| 896 | 894 | /* 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) | |
| 904 | 896 | return; |
| 905 | 897 | |
| 906 | 898 | 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 | ||
| 1613 | 1605 | case WLAN_CATEGORY_SPECTRUM_MGMT: |
| 1614 | 1606 | ies_len = skb->len - |
| 1615 | 1607 | offsetof(struct ieee80211_mgmt, |
| 1616 | − u.action.u.chan_switch.variable); | |
| 1608 | + u.action.chan_switch.variable); | |
| 1617 | 1609 | |
| 1618 | 1610 | if (ies_len < 0) |
| 1619 | 1611 | break; |
| 1620 | 1612 | |
| 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, | |
| 1622 | 1614 | ies_len, |
| 1623 | 1615 | IEEE80211_FTYPE_MGMT | |
| 1624 | 1616 | IEEE80211_STYPE_ACTION, |
| @@ -2190,7 +2190,8 @@ bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata, · 2189 unmodified lines | ||
| 2190 | 2190 | struct link_sta_info *link_sta); |
| 2191 | 2191 | void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata, |
| 2192 | 2192 | const u8 *da, u16 tid, |
| 2193 | − u16 initiator, u16 reason_code); | |
| 2193 | + u16 initiator, u16 reason_code, | |
| 2194 | + bool use_ndp); | |
| 2194 | 2195 | int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata, |
| 2195 | 2196 | enum ieee80211_smps_mode smps, const u8 *da, |
| 2196 | 2197 | const u8 *bssid, int link_id); |
| @@ -2206,6 +2207,7 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta, · 9 unmodified lines | ||
| 2206 | 2207 | u8 dialog_token, u16 timeout, |
| 2207 | 2208 | u16 start_seq_num, u16 ba_policy, u16 tid, |
| 2208 | 2209 | u16 buf_size, bool tx, bool auto_seq, |
| 2210 | + bool req_ndp, | |
| 2209 | 2211 | const u8 addba_ext_data); |
| 2210 | 2212 | void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta, |
| 2211 | 2213 | 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 | ||
| 2331 | 2333 | void ieee80211_s1g_cap_to_sta_s1g_cap(struct ieee80211_sub_if_data *sdata, |
| 2332 | 2334 | const struct ieee80211_s1g_cap *s1g_cap_ie, |
| 2333 | 2335 | 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); | |
| 2334 | 2338 | |
| 2335 | 2339 | /* Spectrum management */ |
| 2336 | 2340 | void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, |
| @@ -1579,16 +1579,19 @@ static void ieee80211_iface_process_skb(struct ieee80211_local *local, · 1578 unmodified lines | ||
| 1579 | 1579 | |
| 1580 | 1580 | sta = sta_info_get_bss(sdata, mgmt->sa); |
| 1581 | 1581 | if (sta) { |
| 1582 | − switch (mgmt->u.action.u.addba_req.action_code) { | |
| 1582 | + switch (mgmt->u.action.action_code) { | |
| 1583 | 1583 | case WLAN_ACTION_ADDBA_REQ: |
| 1584 | + case WLAN_ACTION_NDP_ADDBA_REQ: | |
| 1584 | 1585 | ieee80211_process_addba_request(local, sta, |
| 1585 | 1586 | mgmt, len); |
| 1586 | 1587 | break; |
| 1587 | 1588 | case WLAN_ACTION_ADDBA_RESP: |
| 1589 | + case WLAN_ACTION_NDP_ADDBA_RESP: | |
| 1588 | 1590 | ieee80211_process_addba_resp(local, sta, |
| 1589 | 1591 | mgmt, len); |
| 1590 | 1592 | break; |
| 1591 | 1593 | case WLAN_ACTION_DELBA: |
| 1594 | + case WLAN_ACTION_NDP_DELBA: | |
| 1592 | 1595 | ieee80211_process_delba(sdata, sta, |
| 1593 | 1596 | mgmt, len); |
| 1594 | 1597 | break; |
| @@ -1599,9 +1602,9 @@ static void ieee80211_iface_process_skb(struct ieee80211_local *local, · 4 unmodified lines | ||
| 1599 | 1602 | } |
| 1600 | 1603 | } else if (ieee80211_is_action(mgmt->frame_control) && |
| 1601 | 1604 | mgmt->u.action.category == WLAN_CATEGORY_HT) { |
| 1602 | − switch (mgmt->u.action.u.ht_smps.action) { | |
| 1605 | + switch (mgmt->u.action.action_code) { | |
| 1603 | 1606 | 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; | |
| 1605 | 1608 | struct ieee80211_rx_status *status; |
| 1606 | 1609 | struct link_sta_info *link_sta; |
| 1607 | 1610 | struct sta_info *sta; |
| @@ -1628,7 +1631,7 @@ static void ieee80211_iface_process_skb(struct ieee80211_local *local, · 20 unmodified lines | ||
| 1628 | 1631 | } |
| 1629 | 1632 | } else if (ieee80211_is_action(mgmt->frame_control) && |
| 1630 | 1633 | 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) { | |
| 1632 | 1635 | case WLAN_VHT_ACTION_OPMODE_NOTIF: { |
| 1633 | 1636 | struct ieee80211_rx_status *status; |
| 1634 | 1637 | enum nl80211_band band; |
| @@ -1637,7 +1640,7 @@ static void ieee80211_iface_process_skb(struct ieee80211_local *local, · 2 unmodified lines | ||
| 1637 | 1640 | |
| 1638 | 1641 | status = IEEE80211_SKB_RXCB(skb); |
| 1639 | 1642 | band = status->band; |
| 1640 | − opmode = mgmt->u.action.u.vht_opmode_notif.operating_mode; | |
| 1643 | + opmode = mgmt->u.action.vht_opmode_notif.operating_mode; | |
| 1641 | 1644 | |
| 1642 | 1645 | sta = sta_info_get_bss(sdata, mgmt->sa); |
| 1643 | 1646 | |
| @@ -1658,7 +1661,7 @@ static void ieee80211_iface_process_skb(struct ieee80211_local *local, · 14 unmodified lines | ||
| 1658 | 1661 | } |
| 1659 | 1662 | } else if (ieee80211_is_action(mgmt->frame_control) && |
| 1660 | 1663 | mgmt->u.action.category == WLAN_CATEGORY_S1G) { |
| 1661 | − switch (mgmt->u.action.u.s1g.action_code) { | |
| 1664 | + switch (mgmt->u.action.action_code) { | |
| 1662 | 1665 | case WLAN_S1G_TWT_TEARDOWN: |
| 1663 | 1666 | case WLAN_S1G_TWT_SETUP: |
| 1664 | 1667 | ieee80211_s1g_rx_twt_action(sdata, skb); |
| @@ -1669,7 +1672,7 @@ static void ieee80211_iface_process_skb(struct ieee80211_local *local, · 4 unmodified lines | ||
| 1669 | 1672 | } else if (ieee80211_is_action(mgmt->frame_control) && |
| 1670 | 1673 | mgmt->u.action.category == WLAN_CATEGORY_PROTECTED_EHT) { |
| 1671 | 1674 | if (sdata->vif.type == NL80211_IFTYPE_AP) { |
| 1672 | − switch (mgmt->u.action.u.eml_omn.action_code) { | |
| 1675 | + switch (mgmt->u.action.action_code) { | |
| 1673 | 1676 | case WLAN_PROTECTED_EHT_ACTION_EML_OP_MODE_NOTIF: |
| 1674 | 1677 | ieee80211_rx_eml_op_mode_notif(sdata, skb); |
| 1675 | 1678 | break; |
| @@ -1677,7 +1680,7 @@ static void ieee80211_iface_process_skb(struct ieee80211_local *local, · 1 unmodified line | ||
| 1677 | 1680 | break; |
| 1678 | 1681 | } |
| 1679 | 1682 | } 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) { | |
| 1681 | 1684 | case WLAN_PROTECTED_EHT_ACTION_TTLM_REQ: |
| 1682 | 1685 | ieee80211_process_neg_ttlm_req(sdata, mgmt, |
| 1683 | 1686 | skb->len); |
| @@ -1765,7 +1768,7 @@ static void ieee80211_iface_process_status(struct ieee80211_sub_if_data *sdata, · 81 unmodified lines | ||
| 1765 | 1768 | |
| 1766 | 1769 | if (ieee80211_is_action(mgmt->frame_control) && |
| 1767 | 1770 | mgmt->u.action.category == WLAN_CATEGORY_S1G) { |
| 1768 | − switch (mgmt->u.action.u.s1g.action_code) { | |
| 1771 | + switch (mgmt->u.action.action_code) { | |
| 1769 | 1772 | case WLAN_S1G_TWT_TEARDOWN: |
| 1770 | 1773 | case WLAN_S1G_TWT_SETUP: |
| 1771 | 1774 | ieee80211_s1g_status_twt_action(sdata, skb); |
| @@ -1118,6 +1118,19 @@ ieee80211_ifcomb_check(const struct ieee80211_iface_combination *c, int n_comb) · 1117 unmodified lines | ||
| 1118 | 1118 | return true; |
| 1119 | 1119 | } |
| 1120 | 1120 | |
| 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 | + | |
| 1121 | 1134 | int ieee80211_register_hw(struct ieee80211_hw *hw) |
| 1122 | 1135 | { |
| 1123 | 1136 | struct ieee80211_local *local = hw_to_local(hw); |
| @@ -1261,9 +1274,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) · 137 unmodified lines | ||
| 1261 | 1274 | /* if none found then use the first anyway */ |
| 1262 | 1275 | if (i == sband->n_channels) |
| 1263 | 1276 | 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]); | |
| 1267 | 1279 | /* init channel we're on */ |
| 1268 | 1280 | local->monitor_chanreq.oper = dflt_chandef; |
| 1269 | 1281 | if (local->emulate_chanctx) { |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0-only |
| 2 | 2 | /* |
| 3 | 3 | * Copyright (c) 2008, 2009 open80211s Ltd. |
| 4 | − * Copyright (C) 2018 - 2025 Intel Corporation | |
| 4 | + * Copyright (C) 2018-2026 Intel Corporation | |
| 5 | 5 | * Authors: Luis Carlos Cobo <luisca@cozybit.com> |
| 6 | 6 | * Javier Cardona <javier@cozybit.com> |
| 7 | 7 | */ |
| @@ -19,8 +19,7 @@ static struct kmem_cache *rm_cache; · 11 unmodified lines | ||
| 19 | 19 | |
| 20 | 20 | bool mesh_action_is_path_sel(struct ieee80211_mgmt *mgmt) |
| 21 | 21 | { |
| 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; | |
| 24 | 23 | } |
| 25 | 24 | |
| 26 | 25 | void ieee80211s_init(void) |
| @@ -1618,13 +1617,12 @@ static void mesh_rx_csa_frame(struct ieee80211_sub_if_data *sdata, · 1591 unmodified lines | ||
| 1618 | 1617 | size_t baselen; |
| 1619 | 1618 | u8 *pos; |
| 1620 | 1619 | |
| 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) | |
| 1623 | 1621 | return; |
| 1624 | 1622 | |
| 1625 | − pos = mgmt->u.action.u.chan_switch.variable; | |
| 1623 | + pos = mgmt->u.action.chan_switch.variable; | |
| 1626 | 1624 | baselen = offsetof(struct ieee80211_mgmt, |
| 1627 | − u.action.u.chan_switch.variable); | |
| 1625 | + u.action.chan_switch.variable); | |
| 1628 | 1626 | elems = ieee802_11_parse_elems(pos, len - baselen, |
| 1629 | 1627 | IEEE80211_FTYPE_MGMT | |
| 1630 | 1628 | IEEE80211_STYPE_ACTION, |
| @@ -1670,7 +1668,7 @@ static void ieee80211_mesh_rx_mgmt_action(struct ieee80211_sub_if_data *sdata, · 39 unmodified lines | ||
| 1670 | 1668 | { |
| 1671 | 1669 | switch (mgmt->u.action.category) { |
| 1672 | 1670 | case WLAN_CATEGORY_SELF_PROTECTED: |
| 1673 | − switch (mgmt->u.action.u.self_prot.action_code) { | |
| 1671 | + switch (mgmt->u.action.action_code) { | |
| 1674 | 1672 | case WLAN_SP_MESH_PEERING_OPEN: |
| 1675 | 1673 | case WLAN_SP_MESH_PEERING_CLOSE: |
| 1676 | 1674 | case WLAN_SP_MESH_PEERING_CONFIRM: |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0-only |
| 2 | 2 | /* |
| 3 | 3 | * 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 | |
| 5 | 5 | * Author: Luis Carlos Cobo <luisca@cozybit.com> |
| 6 | 6 | */ |
| 7 | 7 | |
| @@ -105,12 +105,11 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags, · 97 unmodified lines | ||
| 105 | 105 | u32 lifetime, u32 metric, u32 preq_id, |
| 106 | 106 | struct ieee80211_sub_if_data *sdata) |
| 107 | 107 | { |
| 108 | + int hdr_len = IEEE80211_MIN_ACTION_SIZE(mesh_action); | |
| 108 | 109 | struct ieee80211_local *local = sdata->local; |
| 109 | 110 | struct sk_buff *skb; |
| 110 | 111 | struct ieee80211_mgmt *mgmt; |
| 111 | 112 | u8 *pos, ie_len; |
| 112 | − int hdr_len = offsetofend(struct ieee80211_mgmt, | |
| 113 | − u.action.u.mesh_action); | |
| 114 | 113 | |
| 115 | 114 | skb = dev_alloc_skb(local->tx_headroom + |
| 116 | 115 | hdr_len + |
| @@ -127,8 +126,7 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags, · 10 unmodified lines | ||
| 127 | 126 | /* BSSID == SA */ |
| 128 | 127 | memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); |
| 129 | 128 | 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; | |
| 132 | 130 | |
| 133 | 131 | switch (action) { |
| 134 | 132 | case MPATH_PREQ: |
| @@ -237,13 +235,12 @@ int mesh_path_error_tx(struct ieee80211_sub_if_data *sdata, · 102 unmodified lines | ||
| 237 | 235 | u8 ttl, const u8 *target, u32 target_sn, |
| 238 | 236 | u16 target_rcode, const u8 *ra) |
| 239 | 237 | { |
| 238 | + int hdr_len = IEEE80211_MIN_ACTION_SIZE(mesh_action); | |
| 240 | 239 | struct ieee80211_local *local = sdata->local; |
| 241 | 240 | struct sk_buff *skb; |
| 242 | 241 | struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; |
| 243 | 242 | struct ieee80211_mgmt *mgmt; |
| 244 | 243 | u8 *pos, ie_len; |
| 245 | − int hdr_len = offsetofend(struct ieee80211_mgmt, | |
| 246 | − u.action.u.mesh_action); | |
| 247 | 244 | |
| 248 | 245 | if (time_before(jiffies, ifmsh->next_perr)) |
| 249 | 246 | return -EAGAIN; |
| @@ -265,8 +262,7 @@ int mesh_path_error_tx(struct ieee80211_sub_if_data *sdata, · 15 unmodified lines | ||
| 265 | 262 | /* BSSID == SA */ |
| 266 | 263 | memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); |
| 267 | 264 | 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; | |
| 270 | 266 | ie_len = 15; |
| 271 | 267 | pos = skb_put(skb, 2 + ie_len); |
| 272 | 268 | *pos++ = WLAN_EID_PERR; |
| @@ -938,7 +934,7 @@ void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata, · 665 unmodified lines | ||
| 938 | 934 | struct sta_info *sta; |
| 939 | 935 | |
| 940 | 936 | /* need action_code */ |
| 941 | − if (len < IEEE80211_MIN_ACTION_SIZE + 1) | |
| 937 | + if (len < IEEE80211_MIN_ACTION_SIZE(mesh_action)) | |
| 942 | 938 | return; |
| 943 | 939 | |
| 944 | 940 | rcu_read_lock(); |
| @@ -949,8 +945,8 @@ void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata, · 4 unmodified lines | ||
| 949 | 945 | } |
| 950 | 946 | rcu_read_unlock(); |
| 951 | 947 | |
| 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, | |
| 954 | 950 | len - baselen, |
| 955 | 951 | IEEE80211_FTYPE_MGMT | |
| 956 | 952 | IEEE80211_STYPE_ACTION, |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0-only |
| 2 | 2 | /* |
| 3 | 3 | * Copyright (c) 2008, 2009 open80211s Ltd. |
| 4 | − * Copyright (C) 2019, 2021-2025 Intel Corporation | |
| 4 | + * Copyright (C) 2019, 2021-2026 Intel Corporation | |
| 5 | 5 | * Author: Luis Carlos Cobo <luisca@cozybit.com> |
| 6 | 6 | */ |
| 7 | 7 | #include <linux/gfp.h> |
| @@ -13,7 +13,7 @@ · 5 unmodified lines | ||
| 13 | 13 | #include "rate.h" |
| 14 | 14 | #include "mesh.h" |
| 15 | 15 | |
| 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) | |
| 17 | 17 | #define PLINK_GET_LLID(p) (p + 2) |
| 18 | 18 | #define PLINK_GET_PLID(p) (p + 4) |
| 19 | 19 | |
| @@ -215,6 +215,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, · 195 unmodified lines | ||
| 215 | 215 | enum ieee80211_self_protected_actioncode action, |
| 216 | 216 | u8 *da, u16 llid, u16 plid, u16 reason) |
| 217 | 217 | { |
| 218 | + int hdr_len = IEEE80211_MIN_ACTION_SIZE(self_prot); | |
| 218 | 219 | struct ieee80211_local *local = sdata->local; |
| 219 | 220 | struct sk_buff *skb; |
| 220 | 221 | struct ieee80211_tx_info *info; |
| @@ -223,7 +224,6 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, · 2 unmodified lines | ||
| 223 | 224 | u16 peering_proto = 0; |
| 224 | 225 | u8 *pos, ie_len = 4; |
| 225 | 226 | u8 ie_len_he_cap, ie_len_eht_cap; |
| 226 | − int hdr_len = offsetofend(struct ieee80211_mgmt, u.action.u.self_prot); | |
| 227 | 227 | int err = -ENOMEM; |
| 228 | 228 | |
| 229 | 229 | 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 | ||
| 260 | 260 | memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); |
| 261 | 261 | memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); |
| 262 | 262 | 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; | |
| 264 | 264 | |
| 265 | 265 | if (action != WLAN_SP_MESH_PEERING_CLOSE) { |
| 266 | 266 | struct ieee80211_supported_band *sband; |
| @@ -1141,7 +1141,7 @@ mesh_process_plink_frame(struct ieee80211_sub_if_data *sdata, · 874 unmodified lines | ||
| 1141 | 1141 | return; |
| 1142 | 1142 | } |
| 1143 | 1143 | |
| 1144 | − ftype = mgmt->u.action.u.self_prot.action_code; | |
| 1144 | + ftype = mgmt->u.action.action_code; | |
| 1145 | 1145 | if ((ftype == WLAN_SP_MESH_PEERING_OPEN && ie_len != 4) || |
| 1146 | 1146 | (ftype == WLAN_SP_MESH_PEERING_CONFIRM && ie_len != 6) || |
| 1147 | 1147 | (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 | ||
| 1224 | 1224 | size_t baselen; |
| 1225 | 1225 | u8 *baseaddr; |
| 1226 | 1226 | |
| 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) | |
| 1229 | 1229 | return; |
| 1230 | 1230 | |
| 1231 | 1231 | if (sdata->u.mesh.user_mpm) |
| @@ -1238,10 +1238,9 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, · 6 unmodified lines | ||
| 1238 | 1238 | return; |
| 1239 | 1239 | } |
| 1240 | 1240 | |
| 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) { | |
| 1245 | 1244 | baseaddr += 4; |
| 1246 | 1245 | baselen += 4; |
| 1247 | 1246 | |
| @@ -216,6 +216,24 @@ ieee80211_determine_ap_chan(struct ieee80211_sub_if_data *sdata, · 215 unmodified lines | ||
| 216 | 216 | return IEEE80211_CONN_MODE_LEGACY; |
| 217 | 217 | } |
| 218 | 218 | |
| 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 | + | |
| 219 | 237 | if (mode <= IEEE80211_CONN_MODE_EHT) |
| 220 | 238 | return mode; |
| 221 | 239 | goto check_uhr; |
| @@ -6721,7 +6739,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, · 6499 unmodified lines | ||
| 6721 | 6739 | sdata_info(sdata, |
| 6722 | 6740 | "RX %sssocResp from %pM (capab=0x%x status=%d aid=%d)\n", |
| 6723 | 6741 | reassoc ? "Rea" : "A", assoc_data->ap_addr, |
| 6724 | − capab_info, status_code, (u16)(aid & ~(BIT(15) | BIT(14)))); | |
| 6742 | + capab_info, status_code, aid); | |
| 6725 | 6743 | |
| 6726 | 6744 | ifmgd->broken_ap = false; |
| 6727 | 6745 | |
| @@ -7058,6 +7076,7 @@ static void ieee80211_ml_reconf_work(struct wiphy *wiphy, · 330 unmodified lines | ||
| 7058 | 7076 | container_of(work, struct ieee80211_sub_if_data, |
| 7059 | 7077 | u.mgd.ml_reconf_work.work); |
| 7060 | 7078 | u16 new_valid_links, new_active_links, new_dormant_links; |
| 7079 | + struct sta_info *sta; | |
| 7061 | 7080 | int ret; |
| 7062 | 7081 | |
| 7063 | 7082 | if (!sdata->u.mgd.removed_links) |
| @@ -7093,6 +7112,16 @@ static void ieee80211_ml_reconf_work(struct wiphy *wiphy, · 29 unmodified lines | ||
| 7093 | 7112 | } |
| 7094 | 7113 | } |
| 7095 | 7114 | |
| 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 | + | |
| 7096 | 7125 | new_dormant_links = sdata->vif.dormant_links & ~sdata->u.mgd.removed_links; |
| 7097 | 7126 | |
| 7098 | 7127 | 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 | ||
| 7957 | 7986 | struct ieee80211_local *local = sdata->local; |
| 7958 | 7987 | struct ieee80211_mgmt *mgmt; |
| 7959 | 7988 | 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); | |
| 7961 | 7990 | int ttlm_max_len = 2 + 1 + sizeof(struct ieee80211_ttlm_elem) + 1 + |
| 7962 | 7991 | 2 * 2 * IEEE80211_TTLM_NUM_TIDS; |
| 7963 | 7992 | |
| @@ -7974,9 +8003,8 @@ ieee80211_send_neg_ttlm_req(struct ieee80211_sub_if_data *sdata, · 10 unmodified lines | ||
| 7974 | 8003 | memcpy(mgmt->bssid, sdata->vif.cfg.ap_addr, ETH_ALEN); |
| 7975 | 8004 | |
| 7976 | 8005 | 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; | |
| 7980 | 8008 | ieee80211_neg_ttlm_add_suggested_map(skb, neg_ttlm); |
| 7981 | 8009 | ieee80211_tx_skb(sdata, skb); |
| 7982 | 8010 | } |
| @@ -8026,7 +8054,7 @@ ieee80211_send_neg_ttlm_res(struct ieee80211_sub_if_data *sdata, · 43 unmodified lines | ||
| 8026 | 8054 | struct ieee80211_local *local = sdata->local; |
| 8027 | 8055 | struct ieee80211_mgmt *mgmt; |
| 8028 | 8056 | 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); | |
| 8030 | 8058 | int ttlm_max_len = 2 + 1 + sizeof(struct ieee80211_ttlm_elem) + 1 + |
| 8031 | 8059 | 2 * 2 * IEEE80211_TTLM_NUM_TIDS; |
| 8032 | 8060 | u16 status_code; |
| @@ -8044,9 +8072,8 @@ ieee80211_send_neg_ttlm_res(struct ieee80211_sub_if_data *sdata, · 11 unmodified lines | ||
| 8044 | 8072 | memcpy(mgmt->bssid, sdata->vif.cfg.ap_addr, ETH_ALEN); |
| 8045 | 8073 | |
| 8046 | 8074 | 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; | |
| 8050 | 8077 | switch (ttlm_res) { |
| 8051 | 8078 | default: |
| 8052 | 8079 | WARN_ON(1); |
| @@ -8063,7 +8090,7 @@ ieee80211_send_neg_ttlm_res(struct ieee80211_sub_if_data *sdata, · 10 unmodified lines | ||
| 8063 | 8090 | break; |
| 8064 | 8091 | } |
| 8065 | 8092 | |
| 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); | |
| 8067 | 8094 | ieee80211_tx_skb(sdata, skb); |
| 8068 | 8095 | } |
| 8069 | 8096 | |
| @@ -8163,10 +8190,9 @@ void ieee80211_process_neg_ttlm_req(struct ieee80211_sub_if_data *sdata, · 93 unmodified lines | ||
| 8163 | 8190 | if (!ieee80211_vif_is_mld(&sdata->vif)) |
| 8164 | 8191 | return; |
| 8165 | 8192 | |
| 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, | |
| 8170 | 8196 | ies_len, |
| 8171 | 8197 | IEEE80211_FTYPE_MGMT | |
| 8172 | 8198 | IEEE80211_STYPE_ACTION, |
| @@ -8217,8 +8243,7 @@ void ieee80211_process_neg_ttlm_res(struct ieee80211_sub_if_data *sdata, · 44 unmodified lines | ||
| 8217 | 8243 | struct ieee80211_mgmt *mgmt, size_t len) |
| 8218 | 8244 | { |
| 8219 | 8245 | 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) | |
| 8222 | 8247 | return; |
| 8223 | 8248 | |
| 8224 | 8249 | 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 | ||
| 8232 | 8257 | * This can be better implemented in the future, to handle request |
| 8233 | 8258 | * rejections. |
| 8234 | 8259 | */ |
| 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) | |
| 8236 | 8261 | __ieee80211_disconnect(sdata); |
| 8237 | 8262 | } |
| 8238 | 8263 | |
| @@ -8265,12 +8290,11 @@ static void ieee80211_teardown_ttlm_work(struct wiphy *wiphy, · 26 unmodified lines | ||
| 8265 | 8290 | |
| 8266 | 8291 | void ieee80211_send_teardown_neg_ttlm(struct ieee80211_vif *vif) |
| 8267 | 8292 | { |
| 8293 | + int frame_len = IEEE80211_MIN_ACTION_SIZE(ttlm_tear_down); | |
| 8268 | 8294 | struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); |
| 8269 | 8295 | struct ieee80211_local *local = sdata->local; |
| 8270 | 8296 | struct ieee80211_mgmt *mgmt; |
| 8271 | 8297 | struct sk_buff *skb; |
| 8272 | − int frame_len = offsetofend(struct ieee80211_mgmt, | |
| 8273 | − u.action.u.ttlm_tear_down); | |
| 8274 | 8298 | struct ieee80211_tx_info *info; |
| 8275 | 8299 | |
| 8276 | 8300 | 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 | ||
| 8286 | 8310 | memcpy(mgmt->bssid, sdata->vif.cfg.ap_addr, ETH_ALEN); |
| 8287 | 8311 | |
| 8288 | 8312 | 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; | |
| 8291 | 8314 | |
| 8292 | 8315 | info = IEEE80211_SKB_CB(skb); |
| 8293 | 8316 | 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 | ||
| 8370 | 8393 | case WLAN_CATEGORY_SPECTRUM_MGMT: |
| 8371 | 8394 | ies_len = skb->len - |
| 8372 | 8395 | offsetof(struct ieee80211_mgmt, |
| 8373 | − u.action.u.chan_switch.variable); | |
| 8396 | + u.action.chan_switch.variable); | |
| 8374 | 8397 | |
| 8375 | 8398 | if (ies_len < 0) |
| 8376 | 8399 | break; |
| 8377 | 8400 | |
| 8378 | 8401 | /* 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, | |
| 8380 | 8403 | ies_len, |
| 8381 | 8404 | IEEE80211_FTYPE_MGMT | |
| 8382 | 8405 | IEEE80211_STYPE_ACTION, |
| @@ -8398,7 +8421,7 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, · 15 unmodified lines | ||
| 8398 | 8421 | case WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION: |
| 8399 | 8422 | ies_len = skb->len - |
| 8400 | 8423 | offsetof(struct ieee80211_mgmt, |
| 8401 | − u.action.u.ext_chan_switch.variable); | |
| 8424 | + u.action.ext_chan_switch.variable); | |
| 8402 | 8425 | |
| 8403 | 8426 | if (ies_len < 0) |
| 8404 | 8427 | break; |
| @@ -8407,7 +8430,7 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, · 2 unmodified lines | ||
| 8407 | 8430 | * extended CSA IE can't be overridden, no need for |
| 8408 | 8431 | * BSSID |
| 8409 | 8432 | */ |
| 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, | |
| 8411 | 8434 | ies_len, |
| 8412 | 8435 | IEEE80211_FTYPE_MGMT | |
| 8413 | 8436 | IEEE80211_STYPE_ACTION, |
| @@ -8424,7 +8447,7 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, · 10 unmodified lines | ||
| 8424 | 8447 | |
| 8425 | 8448 | /* for the handling code pretend it was an IE */ |
| 8426 | 8449 | elems->ext_chansw_ie = |
| 8427 | − &mgmt->u.action.u.ext_chan_switch.data; | |
| 8450 | + &mgmt->u.action.ext_chan_switch.data; | |
| 8428 | 8451 | |
| 8429 | 8452 | ieee80211_sta_process_chanswitch(link, |
| 8430 | 8453 | rx_status->mactime, |
| @@ -10426,25 +10449,25 @@ void ieee80211_process_ml_reconf_resp(struct ieee80211_sub_if_data *sdata, · 1995 unmodified lines | ||
| 10426 | 10449 | u8 *pos; |
| 10427 | 10450 | |
| 10428 | 10451 | 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 || | |
| 10432 | 10455 | !sta_changed_links) |
| 10433 | 10456 | return; |
| 10434 | 10457 | |
| 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); | |
| 10437 | 10460 | |
| 10438 | 10461 | /* 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) { | |
| 10440 | 10463 | sdata_info(sdata, |
| 10441 | 10464 | "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); | |
| 10443 | 10466 | goto disconnect; |
| 10444 | 10467 | } |
| 10445 | 10468 | |
| 10446 | 10469 | 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++) { | |
| 10448 | 10471 | u16 status = get_unaligned_le16(pos + 1); |
| 10449 | 10472 | |
| 10450 | 10473 | link_id = *pos; |
| @@ -10729,8 +10752,7 @@ ieee80211_build_ml_reconf_req(struct ieee80211_sub_if_data *sdata, · 278 unmodified lines | ||
| 10729 | 10752 | return NULL; |
| 10730 | 10753 | |
| 10731 | 10754 | 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)); | |
| 10734 | 10756 | |
| 10735 | 10757 | /* Add the MAC header */ |
| 10736 | 10758 | 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 | ||
| 10741 | 10763 | |
| 10742 | 10764 | /* Add the action frame fixed fields */ |
| 10743 | 10765 | 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; | |
| 10746 | 10767 | |
| 10747 | 10768 | /* allocate a dialog token and store it */ |
| 10748 | 10769 | 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 = | |
| 10750 | 10771 | sdata->u.mgd.reconf.dialog_token; |
| 10751 | 10772 | |
| 10752 | 10773 | /* 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 | ||
| 11116 | 11137 | |
| 11117 | 11138 | int ieee80211_mgd_set_epcs(struct ieee80211_sub_if_data *sdata, bool enable) |
| 11118 | 11139 | { |
| 11140 | + int frame_len = IEEE80211_MIN_ACTION_SIZE(epcs) + (enable ? 1 : 0); | |
| 11119 | 11141 | struct ieee80211_local *local = sdata->local; |
| 11120 | 11142 | struct ieee80211_mgmt *mgmt; |
| 11121 | 11143 | struct sk_buff *skb; |
| 11122 | − int frame_len = offsetofend(struct ieee80211_mgmt, | |
| 11123 | − u.action.u.epcs) + (enable ? 1 : 0); | |
| 11124 | 11144 | |
| 11125 | 11145 | if (!ieee80211_mgd_epcs_supp(sdata)) |
| 11126 | 11146 | return -EINVAL; |
| @@ -11149,15 +11169,15 @@ int ieee80211_mgd_set_epcs(struct ieee80211_sub_if_data *sdata, bool enable) · 22 unmodified lines | ||
| 11149 | 11169 | |
| 11150 | 11170 | mgmt->u.action.category = WLAN_CATEGORY_PROTECTED_EHT; |
| 11151 | 11171 | if (enable) { |
| 11152 | − u8 *pos = mgmt->u.action.u.epcs.variable; | |
| 11172 | + u8 *pos = mgmt->u.action.epcs.variable; | |
| 11153 | 11173 | |
| 11154 | − mgmt->u.action.u.epcs.action_code = | |
| 11174 | + mgmt->u.action.action_code = | |
| 11155 | 11175 | WLAN_PROTECTED_EHT_ACTION_EPCS_ENABLE_REQ; |
| 11156 | 11176 | |
| 11157 | 11177 | *pos = ++sdata->u.mgd.dialog_token_alloc; |
| 11158 | 11178 | sdata->u.mgd.epcs.dialog_token = *pos; |
| 11159 | 11179 | } else { |
| 11160 | − mgmt->u.action.u.epcs.action_code = | |
| 11180 | + mgmt->u.action.action_code = | |
| 11161 | 11181 | WLAN_PROTECTED_EHT_ACTION_EPCS_ENABLE_TEARDOWN; |
| 11162 | 11182 | |
| 11163 | 11183 | ieee80211_epcs_teardown(sdata); |
| @@ -11246,7 +11266,7 @@ void ieee80211_process_epcs_ena_resp(struct ieee80211_sub_if_data *sdata, · 82 unmodified lines | ||
| 11246 | 11266 | return; |
| 11247 | 11267 | |
| 11248 | 11268 | /* Handle dialog token and status code */ |
| 11249 | − pos = mgmt->u.action.u.epcs.variable; | |
| 11269 | + pos = mgmt->u.action.epcs.variable; | |
| 11250 | 11270 | dialog_token = *pos; |
| 11251 | 11271 | status_code = get_unaligned_le16(pos + 1); |
| 11252 | 11272 | |
| @@ -11268,8 +11288,7 @@ void ieee80211_process_epcs_ena_resp(struct ieee80211_sub_if_data *sdata, · 15 unmodified lines | ||
| 11268 | 11288 | return; |
| 11269 | 11289 | |
| 11270 | 11290 | 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) - | |
| 11273 | 11292 | IEEE80211_EPCS_ENA_RESP_BODY_LEN; |
| 11274 | 11293 | |
| 11275 | 11294 | elems = ieee802_11_parse_elems(pos, ies_len, |
| @@ -274,7 +274,7 @@ static void ieee80211_handle_mu_mimo_mon(struct ieee80211_sub_if_data *sdata, · 273 unmodified lines | ||
| 274 | 274 | if (!sdata) |
| 275 | 275 | return; |
| 276 | 276 | |
| 277 | − BUILD_BUG_ON(sizeof(action) != IEEE80211_MIN_ACTION_SIZE + 1); | |
| 277 | + BUILD_BUG_ON(sizeof(action) != IEEE80211_MIN_ACTION_SIZE(action_code)); | |
| 278 | 278 | |
| 279 | 279 | if (skb->len < rtap_space + sizeof(action) + |
| 280 | 280 | 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 | ||
| 1162 | 1162 | u8 category; |
| 1163 | 1163 | |
| 1164 | 1164 | /* 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)) | |
| 1166 | 1166 | return RX_DROP_U_RUNT_ACTION; |
| 1167 | 1167 | |
| 1168 | 1168 | mgmt = (struct ieee80211_mgmt *)hdr; |
| @@ -1475,7 +1475,9 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx, · 306 unmodified lines | ||
| 1475 | 1475 | !test_and_set_bit(tid, rx->sta->ampdu_mlme.unexpected_agg)) |
| 1476 | 1476 | ieee80211_send_delba(rx->sdata, rx->sta->sta.addr, tid, |
| 1477 | 1477 | 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)); | |
| 1479 | 1481 | goto dont_reorder; |
| 1480 | 1482 | } |
| 1481 | 1483 | |
| @@ -3372,7 +3374,9 @@ ieee80211_rx_h_ctrl(struct ieee80211_rx_data *rx, struct sk_buff_head *frames) · 1890 unmodified lines | ||
| 3372 | 3374 | !test_and_set_bit(tid, rx->sta->ampdu_mlme.unexpected_agg)) |
| 3373 | 3375 | ieee80211_send_delba(rx->sdata, rx->sta->sta.addr, tid, |
| 3374 | 3376 | 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)); | |
| 3376 | 3380 | |
| 3377 | 3381 | tid_agg_rx = rcu_dereference(rx->sta->ampdu_mlme.tid_rx[tid]); |
| 3378 | 3382 | if (!tid_agg_rx) |
| @@ -3422,7 +3426,7 @@ static void ieee80211_process_sa_query_req(struct ieee80211_sub_if_data *sdata, · 43 unmodified lines | ||
| 3422 | 3426 | return; |
| 3423 | 3427 | } |
| 3424 | 3428 | |
| 3425 | − if (len < 24 + 1 + sizeof(resp->u.action.u.sa_query)) { | |
| 3429 | + if (len < IEEE80211_MIN_ACTION_SIZE(sa_query)) { | |
| 3426 | 3430 | /* Too short SA Query request frame */ |
| 3427 | 3431 | return; |
| 3428 | 3432 | } |
| @@ -3432,17 +3436,16 @@ static void ieee80211_process_sa_query_req(struct ieee80211_sub_if_data *sdata, · 3 unmodified lines | ||
| 3432 | 3436 | return; |
| 3433 | 3437 | |
| 3434 | 3438 | 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)); | |
| 3436 | 3440 | memcpy(resp->da, sdata->vif.cfg.ap_addr, ETH_ALEN); |
| 3437 | 3441 | memcpy(resp->sa, sdata->vif.addr, ETH_ALEN); |
| 3438 | 3442 | memcpy(resp->bssid, sdata->vif.cfg.ap_addr, ETH_ALEN); |
| 3439 | 3443 | resp->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | |
| 3440 | 3444 | IEEE80211_STYPE_ACTION); |
| 3441 | − skb_put(skb, 1 + sizeof(resp->u.action.u.sa_query)); | |
| 3442 | 3445 | 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, | |
| 3446 | 3449 | WLAN_SA_QUERY_TR_ID_LEN); |
| 3447 | 3450 | |
| 3448 | 3451 | ieee80211_tx_skb(sdata, skb); |
| @@ -3516,7 +3519,7 @@ ieee80211_rx_h_mgmt_check(struct ieee80211_rx_data *rx) · 67 unmodified lines | ||
| 3516 | 3519 | |
| 3517 | 3520 | /* drop too small action frames */ |
| 3518 | 3521 | if (ieee80211_is_action(mgmt->frame_control) && |
| 3519 | − rx->skb->len < IEEE80211_MIN_ACTION_SIZE) | |
| 3522 | + rx->skb->len < IEEE80211_MIN_ACTION_SIZE(category)) | |
| 3520 | 3523 | return RX_DROP_U_RUNT_ACTION; |
| 3521 | 3524 | |
| 3522 | 3525 | /* Drop non-broadcast Beacon frames */ |
| @@ -3565,29 +3568,28 @@ ieee80211_process_rx_twt_action(struct ieee80211_rx_data *rx) · 42 unmodified lines | ||
| 3565 | 3568 | if (!rx->sta) |
| 3566 | 3569 | return false; |
| 3567 | 3570 | |
| 3568 | − switch (mgmt->u.action.u.s1g.action_code) { | |
| 3571 | + switch (mgmt->u.action.action_code) { | |
| 3569 | 3572 | case WLAN_S1G_TWT_SETUP: { |
| 3570 | 3573 | struct ieee80211_twt_setup *twt; |
| 3571 | 3574 | |
| 3572 | − if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE + | |
| 3573 | − 1 + /* action code */ | |
| 3575 | + if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE(action_code) + | |
| 3574 | 3576 | sizeof(struct ieee80211_twt_setup) + |
| 3575 | 3577 | 2 /* TWT req_type agrt */) |
| 3576 | 3578 | break; |
| 3577 | 3579 | |
| 3578 | − twt = (void *)mgmt->u.action.u.s1g.variable; | |
| 3580 | + twt = (void *)mgmt->u.action.s1g.variable; | |
| 3579 | 3581 | if (twt->element_id != WLAN_EID_S1G_TWT) |
| 3580 | 3582 | break; |
| 3581 | 3583 | |
| 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 */ | |
| 3584 | 3586 | twt->length) |
| 3585 | 3587 | break; |
| 3586 | 3588 | |
| 3587 | 3589 | return true; /* queue the frame */ |
| 3588 | 3590 | } |
| 3589 | 3591 | 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) | |
| 3591 | 3593 | break; |
| 3592 | 3594 | |
| 3593 | 3595 | return true; /* queue the frame */ |
| @@ -3632,10 +3634,10 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 38 unmodified lines | ||
| 3632 | 3634 | break; |
| 3633 | 3635 | |
| 3634 | 3636 | /* verify action & smps_control/chanwidth are present */ |
| 3635 | − if (len < IEEE80211_MIN_ACTION_SIZE + 2) | |
| 3637 | + if (len < IEEE80211_MIN_ACTION_SIZE(ht_smps)) | |
| 3636 | 3638 | goto invalid; |
| 3637 | 3639 | |
| 3638 | − switch (mgmt->u.action.u.ht_smps.action) { | |
| 3640 | + switch (mgmt->u.action.action_code) { | |
| 3639 | 3641 | case WLAN_HT_ACTION_SMPS: { |
| 3640 | 3642 | struct ieee80211_supported_band *sband; |
| 3641 | 3643 | enum ieee80211_smps_mode smps_mode; |
| @@ -3646,7 +3648,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 4 unmodified lines | ||
| 3646 | 3648 | goto handled; |
| 3647 | 3649 | |
| 3648 | 3650 | /* convert to HT capability */ |
| 3649 | − switch (mgmt->u.action.u.ht_smps.smps_control) { | |
| 3651 | + switch (mgmt->u.action.ht_smps.smps_control) { | |
| 3650 | 3652 | case WLAN_HT_SMPS_CONTROL_DISABLED: |
| 3651 | 3653 | smps_mode = IEEE80211_SMPS_OFF; |
| 3652 | 3654 | break; |
| @@ -3679,7 +3681,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 26 unmodified lines | ||
| 3679 | 3681 | goto handled; |
| 3680 | 3682 | } |
| 3681 | 3683 | 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; | |
| 3683 | 3685 | |
| 3684 | 3686 | if (chanwidth != IEEE80211_HT_CHANWIDTH_20MHZ && |
| 3685 | 3687 | chanwidth != IEEE80211_HT_CHANWIDTH_ANY) |
| @@ -3699,7 +3701,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 13 unmodified lines | ||
| 3699 | 3701 | break; |
| 3700 | 3702 | case WLAN_CATEGORY_PUBLIC: |
| 3701 | 3703 | case WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION: |
| 3702 | − if (len < IEEE80211_MIN_ACTION_SIZE + 1) | |
| 3704 | + if (len < IEEE80211_MIN_ACTION_SIZE(action_code)) | |
| 3703 | 3705 | goto invalid; |
| 3704 | 3706 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
| 3705 | 3707 | break; |
| @@ -3707,11 +3709,10 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 1 unmodified line | ||
| 3707 | 3709 | break; |
| 3708 | 3710 | if (!ether_addr_equal(mgmt->bssid, sdata->deflink.u.mgd.bssid)) |
| 3709 | 3711 | break; |
| 3710 | − if (mgmt->u.action.u.ext_chan_switch.action_code != | |
| 3712 | + if (mgmt->u.action.action_code != | |
| 3711 | 3713 | WLAN_PUB_ACTION_EXT_CHANSW_ANN) |
| 3712 | 3714 | 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)) | |
| 3715 | 3716 | goto invalid; |
| 3716 | 3717 | goto queue; |
| 3717 | 3718 | case WLAN_CATEGORY_VHT: |
| @@ -3723,18 +3724,18 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 5 unmodified lines | ||
| 3723 | 3724 | break; |
| 3724 | 3725 | |
| 3725 | 3726 | /* verify action code is present */ |
| 3726 | − if (len < IEEE80211_MIN_ACTION_SIZE + 1) | |
| 3727 | + if (len < IEEE80211_MIN_ACTION_SIZE(action_code)) | |
| 3727 | 3728 | goto invalid; |
| 3728 | 3729 | |
| 3729 | − switch (mgmt->u.action.u.vht_opmode_notif.action_code) { | |
| 3730 | + switch (mgmt->u.action.action_code) { | |
| 3730 | 3731 | case WLAN_VHT_ACTION_OPMODE_NOTIF: { |
| 3731 | 3732 | /* verify opmode is present */ |
| 3732 | − if (len < IEEE80211_MIN_ACTION_SIZE + 2) | |
| 3733 | + if (len < IEEE80211_MIN_ACTION_SIZE(vht_opmode_notif)) | |
| 3733 | 3734 | goto invalid; |
| 3734 | 3735 | goto queue; |
| 3735 | 3736 | } |
| 3736 | 3737 | case WLAN_VHT_ACTION_GROUPID_MGMT: { |
| 3737 | − if (len < IEEE80211_MIN_ACTION_SIZE + 25) | |
| 3738 | + if (len < IEEE80211_MIN_ACTION_SIZE(vht_group_notif)) | |
| 3738 | 3739 | goto invalid; |
| 3739 | 3740 | goto queue; |
| 3740 | 3741 | } |
| @@ -3751,23 +3752,23 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 10 unmodified lines | ||
| 3751 | 3752 | break; |
| 3752 | 3753 | |
| 3753 | 3754 | /* verify action_code is present */ |
| 3754 | − if (len < IEEE80211_MIN_ACTION_SIZE + 1) | |
| 3755 | + if (len < IEEE80211_MIN_ACTION_SIZE(action_code)) | |
| 3755 | 3756 | break; |
| 3756 | 3757 | |
| 3757 | − switch (mgmt->u.action.u.addba_req.action_code) { | |
| 3758 | + switch (mgmt->u.action.action_code) { | |
| 3758 | 3759 | 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)) | |
| 3761 | 3762 | goto invalid; |
| 3762 | 3763 | break; |
| 3763 | 3764 | 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)) | |
| 3766 | 3767 | goto invalid; |
| 3767 | 3768 | break; |
| 3768 | 3769 | 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)) | |
| 3771 | 3772 | goto invalid; |
| 3772 | 3773 | break; |
| 3773 | 3774 | default: |
| @@ -3777,16 +3778,15 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 3 unmodified lines | ||
| 3777 | 3778 | goto queue; |
| 3778 | 3779 | case WLAN_CATEGORY_SPECTRUM_MGMT: |
| 3779 | 3780 | /* verify action_code is present */ |
| 3780 | − if (len < IEEE80211_MIN_ACTION_SIZE + 1) | |
| 3781 | + if (len < IEEE80211_MIN_ACTION_SIZE(action_code)) | |
| 3781 | 3782 | break; |
| 3782 | 3783 | |
| 3783 | − switch (mgmt->u.action.u.measurement.action_code) { | |
| 3784 | + switch (mgmt->u.action.action_code) { | |
| 3784 | 3785 | case WLAN_ACTION_SPCT_MSR_REQ: |
| 3785 | 3786 | if (status->band != NL80211_BAND_5GHZ) |
| 3786 | 3787 | break; |
| 3787 | 3788 | |
| 3788 | − if (len < (IEEE80211_MIN_ACTION_SIZE + | |
| 3789 | − sizeof(mgmt->u.action.u.measurement))) | |
| 3789 | + if (len < IEEE80211_MIN_ACTION_SIZE(measurement)) | |
| 3790 | 3790 | break; |
| 3791 | 3791 | |
| 3792 | 3792 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
| @@ -3796,8 +3796,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 3 unmodified lines | ||
| 3796 | 3796 | goto handled; |
| 3797 | 3797 | case WLAN_ACTION_SPCT_CHL_SWITCH: { |
| 3798 | 3798 | 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)) | |
| 3801 | 3800 | break; |
| 3802 | 3801 | |
| 3803 | 3802 | if (sdata->vif.type != NL80211_IFTYPE_STATION && |
| @@ -3822,11 +3821,10 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 18 unmodified lines | ||
| 3822 | 3821 | } |
| 3823 | 3822 | break; |
| 3824 | 3823 | 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)) | |
| 3827 | 3825 | break; |
| 3828 | 3826 | |
| 3829 | − switch (mgmt->u.action.u.self_prot.action_code) { | |
| 3827 | + switch (mgmt->u.action.action_code) { | |
| 3830 | 3828 | case WLAN_SP_MESH_PEERING_OPEN: |
| 3831 | 3829 | case WLAN_SP_MESH_PEERING_CLOSE: |
| 3832 | 3830 | case WLAN_SP_MESH_PEERING_CONFIRM: |
| @@ -3844,8 +3842,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 11 unmodified lines | ||
| 3844 | 3842 | } |
| 3845 | 3843 | break; |
| 3846 | 3844 | 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)) | |
| 3849 | 3846 | break; |
| 3850 | 3847 | |
| 3851 | 3848 | if (!ieee80211_vif_is_mesh(&sdata->vif)) |
| @@ -3855,11 +3852,10 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 3 unmodified lines | ||
| 3855 | 3852 | break; |
| 3856 | 3853 | goto queue; |
| 3857 | 3854 | 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)) | |
| 3860 | 3856 | break; |
| 3861 | 3857 | |
| 3862 | − switch (mgmt->u.action.u.s1g.action_code) { | |
| 3858 | + switch (mgmt->u.action.action_code) { | |
| 3863 | 3859 | case WLAN_S1G_TWT_SETUP: |
| 3864 | 3860 | case WLAN_S1G_TWT_TEARDOWN: |
| 3865 | 3861 | if (ieee80211_process_rx_twt_action(rx)) |
| @@ -3870,33 +3866,29 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 4 unmodified lines | ||
| 3870 | 3866 | } |
| 3871 | 3867 | break; |
| 3872 | 3868 | 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)) | |
| 3875 | 3870 | break; |
| 3876 | 3871 | |
| 3877 | − switch (mgmt->u.action.u.ttlm_req.action_code) { | |
| 3872 | + switch (mgmt->u.action.action_code) { | |
| 3878 | 3873 | case WLAN_PROTECTED_EHT_ACTION_TTLM_REQ: |
| 3879 | 3874 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
| 3880 | 3875 | break; |
| 3881 | 3876 | |
| 3882 | − if (len < offsetofend(typeof(*mgmt), | |
| 3883 | − u.action.u.ttlm_req)) | |
| 3877 | + if (len < IEEE80211_MIN_ACTION_SIZE(ttlm_req)) | |
| 3884 | 3878 | goto invalid; |
| 3885 | 3879 | goto queue; |
| 3886 | 3880 | case WLAN_PROTECTED_EHT_ACTION_TTLM_RES: |
| 3887 | 3881 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
| 3888 | 3882 | break; |
| 3889 | 3883 | |
| 3890 | − if (len < offsetofend(typeof(*mgmt), | |
| 3891 | − u.action.u.ttlm_res)) | |
| 3884 | + if (len < IEEE80211_MIN_ACTION_SIZE(ttlm_res)) | |
| 3892 | 3885 | goto invalid; |
| 3893 | 3886 | goto queue; |
| 3894 | 3887 | case WLAN_PROTECTED_EHT_ACTION_TTLM_TEARDOWN: |
| 3895 | 3888 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
| 3896 | 3889 | break; |
| 3897 | 3890 | |
| 3898 | − if (len < offsetofend(typeof(*mgmt), | |
| 3899 | − u.action.u.ttlm_tear_down)) | |
| 3891 | + if (len < IEEE80211_MIN_ACTION_SIZE(ttlm_tear_down)) | |
| 3900 | 3892 | goto invalid; |
| 3901 | 3893 | goto queue; |
| 3902 | 3894 | case WLAN_PROTECTED_EHT_ACTION_LINK_RECONFIG_RESP: |
| @@ -3906,34 +3898,29 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 3 unmodified lines | ||
| 3906 | 3898 | /* The reconfiguration response action frame must |
| 3907 | 3899 | * least one 'Status Duple' entry (3 octets) |
| 3908 | 3900 | */ |
| 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) | |
| 3912 | 3902 | goto invalid; |
| 3913 | 3903 | goto queue; |
| 3914 | 3904 | case WLAN_PROTECTED_EHT_ACTION_EPCS_ENABLE_RESP: |
| 3915 | 3905 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
| 3916 | 3906 | break; |
| 3917 | 3907 | |
| 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) | |
| 3921 | 3910 | goto invalid; |
| 3922 | 3911 | goto queue; |
| 3923 | 3912 | case WLAN_PROTECTED_EHT_ACTION_EPCS_ENABLE_TEARDOWN: |
| 3924 | 3913 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
| 3925 | 3914 | break; |
| 3926 | 3915 | |
| 3927 | − if (len < offsetofend(typeof(*mgmt), | |
| 3928 | − u.action.u.epcs)) | |
| 3916 | + if (len < IEEE80211_MIN_ACTION_SIZE(epcs)) | |
| 3929 | 3917 | goto invalid; |
| 3930 | 3918 | goto queue; |
| 3931 | 3919 | case WLAN_PROTECTED_EHT_ACTION_EML_OP_MODE_NOTIF: |
| 3932 | 3920 | if (sdata->vif.type != NL80211_IFTYPE_AP) |
| 3933 | 3921 | break; |
| 3934 | 3922 | |
| 3935 | − if (len < offsetofend(typeof(*mgmt), | |
| 3936 | − u.action.u.eml_omn)) | |
| 3923 | + if (len < IEEE80211_MIN_ACTION_SIZE(eml_omn)) | |
| 3937 | 3924 | goto invalid; |
| 3938 | 3925 | goto queue; |
| 3939 | 3926 | default: |
| @@ -4015,11 +4002,10 @@ ieee80211_rx_h_action_post_userspace(struct ieee80211_rx_data *rx) · 75 unmodified lines | ||
| 4015 | 4002 | |
| 4016 | 4003 | switch (mgmt->u.action.category) { |
| 4017 | 4004 | 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)) | |
| 4020 | 4006 | break; |
| 4021 | 4007 | |
| 4022 | − switch (mgmt->u.action.u.sa_query.action) { | |
| 4008 | + switch (mgmt->u.action.action_code) { | |
| 4023 | 4009 | case WLAN_ACTION_SA_QUERY_REQUEST: |
| 4024 | 4010 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
| 4025 | 4011 | break; |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | /* |
| 3 | 3 | * S1G handling |
| 4 | 4 | * Copyright(c) 2020 Adapt-IP |
| 5 | − * Copyright (C) 2023 Intel Corporation | |
| 5 | + * Copyright (C) 2023, 2026 Intel Corporation | |
| 6 | 6 | */ |
| 7 | 7 | #include <linux/ieee80211.h> |
| 8 | 8 | #include <net/mac80211.h> |
| @@ -27,14 +27,14 @@ bool ieee80211_s1g_is_twt_setup(struct sk_buff *skb) · 18 unmodified lines | ||
| 27 | 27 | if (likely(mgmt->u.action.category != WLAN_CATEGORY_S1G)) |
| 28 | 28 | return false; |
| 29 | 29 | |
| 30 | − return mgmt->u.action.u.s1g.action_code == WLAN_S1G_TWT_SETUP; | |
| 30 | + return mgmt->u.action.action_code == WLAN_S1G_TWT_SETUP; | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | static void |
| 34 | 34 | ieee80211_s1g_send_twt_setup(struct ieee80211_sub_if_data *sdata, const u8 *da, |
| 35 | 35 | const u8 *bssid, struct ieee80211_twt_setup *twt) |
| 36 | 36 | { |
| 37 | − int len = IEEE80211_MIN_ACTION_SIZE + 4 + twt->length; | |
| 37 | + int len = IEEE80211_MIN_ACTION_SIZE(s1g) + 3 + twt->length; | |
| 38 | 38 | struct ieee80211_local *local = sdata->local; |
| 39 | 39 | struct ieee80211_mgmt *mgmt; |
| 40 | 40 | 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 | ||
| 52 | 52 | memcpy(mgmt->bssid, bssid, ETH_ALEN); |
| 53 | 53 | |
| 54 | 54 | 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); | |
| 57 | 57 | |
| 58 | 58 | IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT | |
| 59 | 59 | IEEE80211_TX_INTFL_MLME_CONN_TX | |
| @@ -71,12 +71,12 @@ ieee80211_s1g_send_twt_teardown(struct ieee80211_sub_if_data *sdata, · 11 unmodified lines | ||
| 71 | 71 | u8 *id; |
| 72 | 72 | |
| 73 | 73 | skb = dev_alloc_skb(local->hw.extra_tx_headroom + |
| 74 | − IEEE80211_MIN_ACTION_SIZE + 2); | |
| 74 | + IEEE80211_MIN_ACTION_SIZE(s1g) + 1); | |
| 75 | 75 | if (!skb) |
| 76 | 76 | return; |
| 77 | 77 | |
| 78 | 78 | 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); | |
| 80 | 80 | mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | |
| 81 | 81 | IEEE80211_STYPE_ACTION); |
| 82 | 82 | memcpy(mgmt->da, da, ETH_ALEN); |
| @@ -84,8 +84,8 @@ ieee80211_s1g_send_twt_teardown(struct ieee80211_sub_if_data *sdata, · 1 unmodified line | ||
| 84 | 84 | memcpy(mgmt->bssid, bssid, ETH_ALEN); |
| 85 | 85 | |
| 86 | 86 | 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; | |
| 89 | 89 | *id = flowid; |
| 90 | 90 | |
| 91 | 91 | 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 | ||
| 98 | 98 | struct sta_info *sta, struct sk_buff *skb) |
| 99 | 99 | { |
| 100 | 100 | 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; | |
| 102 | 102 | struct ieee80211_twt_params *twt_agrt = (void *)twt->params; |
| 103 | 103 | |
| 104 | 104 | 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 | ||
| 128 | 128 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data; |
| 129 | 129 | |
| 130 | 130 | drv_twt_teardown_request(sdata->local, sdata, &sta->sta, |
| 131 | − mgmt->u.action.u.s1g.variable[0]); | |
| 131 | + mgmt->u.action.s1g.variable[0]); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | static void |
| @@ -136,7 +136,7 @@ ieee80211_s1g_tx_twt_setup_fail(struct ieee80211_sub_if_data *sdata, · 1 unmodified line | ||
| 136 | 136 | struct sta_info *sta, struct sk_buff *skb) |
| 137 | 137 | { |
| 138 | 138 | 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; | |
| 140 | 140 | struct ieee80211_twt_params *twt_agrt = (void *)twt->params; |
| 141 | 141 | u8 flowid = le16_get_bits(twt_agrt->req_type, |
| 142 | 142 | IEEE80211_TWT_REQTYPE_FLOWID); |
| @@ -160,7 +160,7 @@ void ieee80211_s1g_rx_twt_action(struct ieee80211_sub_if_data *sdata, · 17 unmodified lines | ||
| 160 | 160 | if (!sta) |
| 161 | 161 | return; |
| 162 | 162 | |
| 163 | − switch (mgmt->u.action.u.s1g.action_code) { | |
| 163 | + switch (mgmt->u.action.action_code) { | |
| 164 | 164 | case WLAN_S1G_TWT_SETUP: |
| 165 | 165 | ieee80211_s1g_rx_twt_setup(sdata, sta, skb); |
| 166 | 166 | break; |
| @@ -185,7 +185,7 @@ void ieee80211_s1g_status_twt_action(struct ieee80211_sub_if_data *sdata, · 18 unmodified lines | ||
| 185 | 185 | if (!sta) |
| 186 | 186 | return; |
| 187 | 187 | |
| 188 | − switch (mgmt->u.action.u.s1g.action_code) { | |
| 188 | + switch (mgmt->u.action.action_code) { | |
| 189 | 189 | case WLAN_S1G_TWT_SETUP: |
| 190 | 190 | /* process failed twt setup frames */ |
| 191 | 191 | 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 | ||
| 220 | 220 | |
| 221 | 221 | ieee80211_sta_recalc_aggregates(&link_sta->sta->sta); |
| 222 | 222 | } |
| 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 | +} | |
| @@ -9,7 +9,7 @@ · 8 unmodified lines | ||
| 9 | 9 | * Copyright 2007, Michael Wu <flamingice@sourmilk.net> |
| 10 | 10 | * Copyright 2007-2008, Intel Corporation |
| 11 | 11 | * 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 | |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | #include <linux/ieee80211.h> |
| @@ -409,35 +409,30 @@ static void ieee80211_send_refuse_measurement_request(struct ieee80211_sub_if_da · 393 unmodified lines | ||
| 409 | 409 | struct sk_buff *skb; |
| 410 | 410 | struct ieee80211_mgmt *msr_report; |
| 411 | 411 | |
| 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); | |
| 414 | 414 | if (!skb) |
| 415 | 415 | return; |
| 416 | 416 | |
| 417 | 417 | 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)); | |
| 419 | 419 | memcpy(msr_report->da, da, ETH_ALEN); |
| 420 | 420 | memcpy(msr_report->sa, sdata->vif.addr, ETH_ALEN); |
| 421 | 421 | memcpy(msr_report->bssid, bssid, ETH_ALEN); |
| 422 | 422 | msr_report->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | |
| 423 | 423 | IEEE80211_STYPE_ACTION); |
| 424 | 424 | |
| 425 | − skb_put(skb, 1 + sizeof(msr_report->u.action.u.measurement)); | |
| 426 | 425 | 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; | |
| 430 | 427 | |
| 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 = | |
| 433 | 431 | 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 |= | |
| 439 | 434 | 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; | |
| 441 | 436 | |
| 442 | 437 | ieee80211_tx_skb(sdata, skb); |
| 443 | 438 | } |
| @@ -454,7 +449,7 @@ void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, · 10 unmodified lines | ||
| 454 | 449 | * TODO: Answer basic measurement as unmeasured |
| 455 | 450 | */ |
| 456 | 451 | ieee80211_send_refuse_measurement_request(sdata, |
| 457 | − &mgmt->u.action.u.measurement.msr_elem, | |
| 452 | + &mgmt->u.action.measurement.msr_elem, | |
| 458 | 453 | mgmt->sa, mgmt->bssid, |
| 459 | − mgmt->u.action.u.measurement.dialog_token); | |
| 454 | + mgmt->u.action.measurement.dialog_token); | |
| 460 | 455 | } |
| @@ -171,6 +171,7 @@ struct sta_info; · 170 unmodified lines | ||
| 171 | 171 | * @bar_pending: BAR needs to be re-sent |
| 172 | 172 | * @amsdu: support A-MSDU within A-MDPU |
| 173 | 173 | * @ssn: starting sequence number of the session |
| 174 | + * @ndp: this session is using NDP Block ACKs | |
| 174 | 175 | * |
| 175 | 176 | * This structure's lifetime is managed by RCU, assignments to |
| 176 | 177 | * the array holding it must hold the aggregation mutex. |
| @@ -199,6 +200,7 @@ struct tid_ampdu_tx { · 22 unmodified lines | ||
| 199 | 200 | u16 failed_bar_ssn; |
| 200 | 201 | bool bar_pending; |
| 201 | 202 | bool amsdu; |
| 203 | + bool ndp; | |
| 202 | 204 | u8 tid; |
| 203 | 205 | }; |
| 204 | 206 | |
| @@ -510,7 +512,6 @@ struct ieee80211_fragment_cache { · 305 unmodified lines | ||
| 510 | 512 | * during finalize |
| 511 | 513 | * @debugfs_dir: debug filesystem directory dentry |
| 512 | 514 | * @pub: public (driver visible) link STA data |
| 513 | − * TODO Move other link params from sta_info as required for MLD operation | |
| 514 | 515 | */ |
| 515 | 516 | struct link_sta_info { |
| 516 | 517 | u8 addr[ETH_ALEN]; |
| @@ -6,7 +6,7 @@ · 5 unmodified lines | ||
| 6 | 6 | * Copyright 2014, Intel Corporation |
| 7 | 7 | * Copyright 2014 Intel Mobile Communications GmbH |
| 8 | 8 | * Copyright 2015 - 2016 Intel Deutschland GmbH |
| 9 | − * Copyright (C) 2019, 2021-2025 Intel Corporation | |
| 9 | + * Copyright (C) 2019, 2021-2026 Intel Corporation | |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | #include <linux/ieee80211.h> |
| @@ -879,28 +879,23 @@ ieee80211_prep_tdls_direct(struct wiphy *wiphy, struct net_device *dev, · 866 unmodified lines | ||
| 879 | 879 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
| 880 | 880 | struct ieee80211_mgmt *mgmt; |
| 881 | 881 | |
| 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)); | |
| 883 | 886 | memcpy(mgmt->da, peer, ETH_ALEN); |
| 884 | 887 | memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); |
| 885 | 888 | memcpy(mgmt->bssid, link->u.mgd.bssid, ETH_ALEN); |
| 886 | 889 | mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | |
| 887 | 890 | IEEE80211_STYPE_ACTION); |
| 888 | 891 | |
| 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)); | |
| 904 | 899 | |
| 905 | 900 | return 0; |
| 906 | 901 | } |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | /* |
| 3 | 3 | * Portions of this file |
| 4 | 4 | * Copyright(c) 2016-2017 Intel Deutschland GmbH |
| 5 | − * Copyright (C) 2018 - 2024 Intel Corporation | |
| 5 | + * Copyright (C) 2018-2024, 2026 Intel Corporation | |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | #if !defined(__MAC80211_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ) |
| @@ -37,64 +37,46 @@ · 28 unmodified lines | ||
| 37 | 37 | #define VIF_PR_FMT " vif:%s(%d%s)" |
| 38 | 38 | #define VIF_PR_ARG __get_str(vif_name), __entry->vif_type, __entry->p2p ? "/p2p" : "" |
| 39 | 39 | |
| 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) | |
| 98 | 80 | |
| 99 | 81 | #define CHANCTX_ENTRY CHANDEF_ENTRY \ |
| 100 | 82 | MIN_CHANDEF_ENTRY \ |
| @@ -3766,12 +3766,11 @@ again: · 3765 unmodified lines | ||
| 3766 | 3766 | int ieee80211_send_action_csa(struct ieee80211_sub_if_data *sdata, |
| 3767 | 3767 | struct cfg80211_csa_settings *csa_settings) |
| 3768 | 3768 | { |
| 3769 | + int hdr_len = IEEE80211_MIN_ACTION_SIZE(chan_switch); | |
| 3769 | 3770 | struct sk_buff *skb; |
| 3770 | 3771 | struct ieee80211_mgmt *mgmt; |
| 3771 | 3772 | struct ieee80211_local *local = sdata->local; |
| 3772 | 3773 | int freq; |
| 3773 | − int hdr_len = offsetofend(struct ieee80211_mgmt, | |
| 3774 | − u.action.u.chan_switch); | |
| 3775 | 3774 | u8 *pos; |
| 3776 | 3775 | |
| 3777 | 3776 | 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 | ||
| 3800 | 3799 | memcpy(mgmt->bssid, ifibss->bssid, ETH_ALEN); |
| 3801 | 3800 | } |
| 3802 | 3801 | 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; | |
| 3804 | 3803 | pos = skb_put(skb, 5); |
| 3805 | 3804 | *pos++ = WLAN_EID_CHANNEL_SWITCH; /* EID */ |
| 3806 | 3805 | *pos++ = 3; /* IE length */ |
| @@ -4,7 +4,7 @@ · 3 unmodified lines | ||
| 4 | 4 | * |
| 5 | 5 | * Portions of this file |
| 6 | 6 | * Copyright(c) 2015 - 2016 Intel Deutschland GmbH |
| 7 | − * Copyright (C) 2018 - 2024 Intel Corporation | |
| 7 | + * Copyright (C) 2018-2026 Intel Corporation | |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | #include <linux/ieee80211.h> |
| @@ -723,17 +723,17 @@ void ieee80211_process_mu_groups(struct ieee80211_sub_if_data *sdata, · 712 unmodified lines | ||
| 723 | 723 | if (!link_conf->mu_mimo_owner) |
| 724 | 724 | return; |
| 725 | 725 | |
| 726 | − if (!memcmp(mgmt->u.action.u.vht_group_notif.position, | |
| 726 | + if (!memcmp(mgmt->u.action.vht_group_notif.position, | |
| 727 | 727 | 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, | |
| 729 | 729 | link_conf->mu_group.membership, WLAN_MEMBERSHIP_LEN)) |
| 730 | 730 | return; |
| 731 | 731 | |
| 732 | 732 | memcpy(link_conf->mu_group.membership, |
| 733 | − mgmt->u.action.u.vht_group_notif.membership, | |
| 733 | + mgmt->u.action.vht_group_notif.membership, | |
| 734 | 734 | WLAN_MEMBERSHIP_LEN); |
| 735 | 735 | memcpy(link_conf->mu_group.position, |
| 736 | − mgmt->u.action.u.vht_group_notif.position, | |
| 736 | + mgmt->u.action.vht_group_notif.position, | |
| 737 | 737 | WLAN_USER_POSITION_LEN); |
| 738 | 738 | |
| 739 | 739 | ieee80211_link_info_change_notify(sdata, link, |
| @@ -6,7 +6,7 @@ · 5 unmodified lines | ||
| 6 | 6 | * |
| 7 | 7 | * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> |
| 8 | 8 | * Copyright 2013-2014 Intel Mobile Communications GmbH |
| 9 | − * Copyright 2018-2025 Intel Corporation | |
| 9 | + * Copyright 2018-2026 Intel Corporation | |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | #include <linux/export.h> |
| @@ -29,9 +29,11 @@ void cfg80211_chandef_create(struct cfg80211_chan_def *chandef, · 16 unmodified lines | ||
| 29 | 29 | |
| 30 | 30 | *chandef = (struct cfg80211_chan_def) { |
| 31 | 31 | .chan = chan, |
| 32 | − .freq1_offset = chan->freq_offset, | |
| 33 | 32 | }; |
| 34 | 33 | |
| 34 | + WARN_ON(chan->band == NL80211_BAND_60GHZ || | |
| 35 | + chan->band == NL80211_BAND_S1GHZ); | |
| 36 | + | |
| 35 | 37 | switch (chan_type) { |
| 36 | 38 | case NL80211_CHAN_NO_HT: |
| 37 | 39 | chandef->width = NL80211_CHAN_WIDTH_20_NOHT; |
| @@ -339,6 +341,58 @@ static bool cfg80211_valid_center_freq(u32 center, · 301 unmodified lines | ||
| 339 | 341 | return (center - bw / 2 - 5945) % step == 0; |
| 340 | 342 | } |
| 341 | 343 | |
| 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 | + | |
| 342 | 396 | bool cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef) |
| 343 | 397 | { |
| 344 | 398 | 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 | ||
| 351 | 405 | |
| 352 | 406 | control_freq = chandef->chan->center_freq; |
| 353 | 407 | |
| 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 | + | |
| 354 | 416 | switch (chandef->width) { |
| 355 | 417 | case NL80211_CHAN_WIDTH_5: |
| 356 | 418 | case NL80211_CHAN_WIDTH_10: |
| @@ -393,50 +455,8 @@ bool cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef) · 36 unmodified lines | ||
| 393 | 455 | break; |
| 394 | 456 | } |
| 395 | 457 | |
| 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)) | |
| 438 | 459 | return false; |
| 439 | − } | |
| 440 | 460 | |
| 441 | 461 | if (!cfg80211_valid_center_freq(chandef->center_freq1, chandef->width)) |
| 442 | 462 | return false; |
| @@ -339,7 +339,20 @@ static int validate_uhr_capa(const struct nlattr *attr, · 338 unmodified lines | ||
| 339 | 339 | const u8 *data = nla_data(attr); |
| 340 | 340 | unsigned int len = nla_len(attr); |
| 341 | 341 | |
| 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; | |
| 343 | 356 | } |
| 344 | 357 | |
| 345 | 358 | /* policy for the attributes */ |
| @@ -947,6 +960,8 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { · 601 unmodified lines | ||
| 947 | 960 | [NL80211_ATTR_UHR_CAPABILITY] = |
| 948 | 961 | NLA_POLICY_VALIDATE_FN(NLA_BINARY, validate_uhr_capa, 255), |
| 949 | 962 | [NL80211_ATTR_DISABLE_UHR] = { .type = NLA_FLAG }, |
| 963 | + [NL80211_ATTR_UHR_OPERATION] = | |
| 964 | + NLA_POLICY_VALIDATE_FN(NLA_BINARY, validate_uhr_operation), | |
| 950 | 965 | }; |
| 951 | 966 | |
| 952 | 967 | /* policy for the key attributes */ |
| @@ -3619,6 +3634,9 @@ static int _nl80211_parse_chandef(struct cfg80211_registered_device *rdev, · 2666 unmodified lines | ||
| 3619 | 3634 | case NL80211_CHAN_HT20: |
| 3620 | 3635 | case NL80211_CHAN_HT40PLUS: |
| 3621 | 3636 | case NL80211_CHAN_HT40MINUS: |
| 3637 | + if (chandef->chan->band == NL80211_BAND_60GHZ || | |
| 3638 | + chandef->chan->band == NL80211_BAND_S1GHZ) | |
| 3639 | + return -EINVAL; | |
| 3622 | 3640 | cfg80211_chandef_create(chandef, chandef->chan, |
| 3623 | 3641 | chantype); |
| 3624 | 3642 | /* 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 | ||
| 5825 | 5843 | */ |
| 5826 | 5844 | BUILD_BUG_ON(NL80211_MAX_SUPP_HT_RATES > IEEE80211_HT_MCS_MASK_LEN * 8); |
| 5827 | 5845 | 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); | |
| 5829 | 5847 | int err; |
| 5830 | 5848 | |
| 5831 | 5849 | 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 | ||
| 6499 | 6517 | return -EINVAL; |
| 6500 | 6518 | } |
| 6501 | 6519 | |
| 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 | − | |
| 6512 | 6520 | return 0; |
| 6513 | 6521 | } |
| 6514 | 6522 | |
| @@ -6950,6 +6958,9 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) · 435 unmodified lines | ||
| 6950 | 6958 | if (err) |
| 6951 | 6959 | goto out; |
| 6952 | 6960 | |
| 6961 | + if (info->attrs[NL80211_ATTR_UHR_OPERATION]) | |
| 6962 | + params->uhr_oper = nla_data(info->attrs[NL80211_ATTR_UHR_OPERATION]); | |
| 6963 | + | |
| 6953 | 6964 | err = nl80211_validate_ap_phy_operation(params); |
| 6954 | 6965 | if (err) |
| 6955 | 6966 | goto out; |
| @@ -10694,7 +10705,7 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info) · 3738 unmodified lines | ||
| 10694 | 10705 | nla_for_each_nested(attr, |
| 10695 | 10706 | info->attrs[NL80211_ATTR_SCAN_SUPP_RATES], |
| 10696 | 10707 | tmp) { |
| 10697 | − enum nl80211_band band = nla_type(attr); | |
| 10708 | + int band = nla_type(attr); | |
| 10698 | 10709 | |
| 10699 | 10710 | if (band < 0 || band >= NUM_NL80211_BANDS) { |
| 10700 | 10711 | err = -EINVAL; |
| @@ -1,17 +1,6 @@ | ||
| 1 | +// SPDX-License-Identifier: ISC | |
| 1 | 2 | /* |
| 2 | 3 | * 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. | |
| 15 | 4 | */ |
| 16 | 5 | |
| 17 | 6 | #include <linux/of.h> |
| @@ -1,17 +1,9 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause | |
| 1 | 2 | /* |
| 2 | 3 | * Radiotap parser |
| 3 | 4 | * |
| 4 | 5 | * Copyright 2007 Andy Green <andy@warmcat.com> |
| 5 | 6 | * 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. | |
| 15 | 7 | */ |
| 16 | 8 | |
| 17 | 9 | #include <linux/kernel.h> |
| @@ -1,3 +1,4 @@ | ||
| 1 | +// SPDX-License-Identifier: ISC | |
| 1 | 2 | /* |
| 2 | 3 | * Copyright 2002-2005, Instant802 Networks, Inc. |
| 3 | 4 | * Copyright 2005-2006, Devicescape Software, Inc. |
| @@ -6,18 +7,6 @@ · 2 unmodified lines | ||
| 6 | 7 | * Copyright 2013-2014 Intel Mobile Communications GmbH |
| 7 | 8 | * Copyright 2017 Intel Deutschland GmbH |
| 8 | 9 | * 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. | |
| 21 | 10 | */ |
| 22 | 11 | |
| 23 | 12 | |
| @@ -1,3 +1,4 @@ | ||
| 1 | +/* SPDX-License-Identifier: ISC */ | |
| 1 | 2 | #ifndef __NET_WIRELESS_REG_H |
| 2 | 3 | #define __NET_WIRELESS_REG_H |
| 3 | 4 | |
| @@ -6,18 +7,6 @@ · 2 unmodified lines | ||
| 6 | 7 | /* |
| 7 | 8 | * Copyright 2008-2011 Luis R. Rodriguez <mcgrof@qca.qualcomm.com> |
| 8 | 9 | * 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. | |
| 21 | 10 | */ |
| 22 | 11 | |
| 23 | 12 | enum ieee80211_regd_source { |
| @@ -1,3 +1,4 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | #include <linux/module.h> |
| 2 | 3 | |
| 3 | 4 | #ifndef __CHECKER__ |
| @@ -1,3 +1,4 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | 3 | * This file implement the Wireless Extensions core API. |
| 3 | 4 | * |
| @@ -5,8 +6,6 @@ · 1 unmodified line | ||
| 5 | 6 | * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved. |
| 6 | 7 | * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> |
| 7 | 8 | * Copyright (C) 2024 Intel Corporation |
| 8 | − * | |
| 9 | − * (As all part of the Linux kernel, this file is GPL) | |
| 10 | 9 | */ |
| 11 | 10 | #include <linux/kernel.h> |
| 12 | 11 | #include <linux/netdevice.h> |
| @@ -1,11 +1,10 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | 3 | * This file implement the Wireless Extensions priv API. |
| 3 | 4 | * |
| 4 | 5 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> |
| 5 | 6 | * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved. |
| 6 | 7 | * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> |
| 7 | − * | |
| 8 | − * (As all part of the Linux kernel, this file is GPL) | |
| 9 | 8 | */ |
| 10 | 9 | #include <linux/slab.h> |
| 11 | 10 | #include <linux/wireless.h> |
| @@ -1,10 +1,9 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 1 | 2 | /* |
| 2 | 3 | * This file implement the Wireless Extensions proc API. |
| 3 | 4 | * |
| 4 | 5 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> |
| 5 | 6 | * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved. |
| 6 | − * | |
| 7 | − * (As all part of the Linux kernel, this file is GPL) | |
| 8 | 7 | */ |
| 9 | 8 | |
| 10 | 9 | /* |