mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-01 11:36:49 +00:00
323e249ce8
This updates mac80211 to version 6.1.97-1. This code is based on Linux 6.1.97 and contains all fixes included in the upstream wireless subsystem from that kernel version. This includes many bugfixes and also some security fixes. The removed patches are already integrated in upstream Linux 6.1.97 or in backports. The following patches were integrated in upstream Linux: ath11k/0013-wifi-ath11k-synchronize-ath11k_mac_he_gi_to_nl80211_.patch ath11k/0035-wifi-ath11k-Use-platform_get_irq-to-get-the-interrup.patch ath11k/0036-wifi-ath11k-fix-SAC-bug-on-peer-addition-with-sta-ba.patch ath11k/0047-wifi-ath11k-fix-deinitialization-of-firmware-resourc.patch ath11k/0053-wifi-ath11k-fix-writing-to-unintended-memory-region.patch ath11k/0060-wifi-ath11k-Ignore-frags-from-uninitialized-peer-in-.patch ath11k/0065-wifi-ath11k-fix-tx-status-reporting-in-encap-offload.patch ath11k/0067-wifi-ath11k-Fix-SKB-corruption-in-REO-destination-ri.patch ath11k/0069-wifi-ath11k-fix-registration-of-6Ghz-only-phy-withou.patch ath11k/0080-wifi-ath11k-add-support-default-regdb-while-searchin.patch ath11k/0085-wifi-ath11k-fix-memory-leak-in-WMI-firmware-stats.patch ath11k/0086-wifi-ath11k-Add-missing-check-for-ioremap.patch ath11k/0096-wifi-ath11k-fix-boot-failure-with-one-MSI-vector.patch subsys/337-wifi-mac80211-fix-race-condition-on-enabling-fast-xm.patch The following patches were integrated in upstream backports: ath11k/901-wifi-ath11k-pci-fix-compilation-in-5.16-and-older.patch build/080-resv_start_op.patch build/110-backport_napi_build_skb.patch The following files are missing in backports, we do not have to remove them any more. Some were already missing before some were removed in this update: include/linux/cordic.h include/linux/crc8.h include/linux/eeprom_93cx6.h include/linux/wl12xx.h include/net/ieee80211.h backport-include/linux/bcm47xx_nvram.h include/linux/ath9k_platform.h include/net/bluetooth/ backports ships a dummy Mediatek wed header for older kernel versions. We backported the feature in our kernel, remove the dummy header: backport-include/linux/soc/mediatek/mtk_wed.h Remove header files for subsystems used form the mainline kernel: include/trace/events/qrtr.h include/net/rsi_91x.h backport-include/linux/platform_data/brcmnand.h Link: https://github.com/openwrt/openwrt/pull/15827 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
170 lines
6.1 KiB
Diff
170 lines
6.1 KiB
Diff
From d7c1a9a0ed180d8884798ce97afe7283622a484f Mon Sep 17 00:00:00 2001
|
|
From: Aloka Dixit <quic_alokad@quicinc.com>
|
|
Date: Mon, 30 Jan 2023 16:12:25 -0800
|
|
Subject: [PATCH] wifi: nl80211: validate and configure puncturing bitmap
|
|
|
|
- New feature flag, NL80211_EXT_FEATURE_PUNCT, to advertise
|
|
driver support for preamble puncturing in AP mode.
|
|
- New attribute, NL80211_ATTR_PUNCT_BITMAP, to receive a puncturing
|
|
bitmap from the userspace during AP bring up (NL80211_CMD_START_AP)
|
|
and channel switch (NL80211_CMD_CHANNEL_SWITCH) operations. Each bit
|
|
corresponds to a 20 MHz channel in the operating bandwidth, lowest
|
|
bit for the lowest channel. Bit set to 1 indicates that the channel
|
|
is punctured. Higher 16 bits are reserved.
|
|
- New members added to structures cfg80211_ap_settings and
|
|
cfg80211_csa_settings to propagate the bitmap to the driver after
|
|
validation.
|
|
|
|
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
|
|
Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
|
|
Link: https://lore.kernel.org/r/20230131001227.25014-3-quic_alokad@quicinc.com
|
|
[move validation against 0xffff into policy]
|
|
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
|
---
|
|
include/net/cfg80211.h | 8 ++++++++
|
|
include/uapi/linux/nl80211.h | 11 +++++++++++
|
|
net/wireless/nl80211.c | 32 ++++++++++++++++++++++++++++++++
|
|
3 files changed, 51 insertions(+)
|
|
|
|
--- a/include/net/cfg80211.h
|
|
+++ b/include/net/cfg80211.h
|
|
@@ -1333,6 +1333,9 @@ struct cfg80211_unsol_bcast_probe_resp {
|
|
* @fils_discovery: FILS discovery transmission parameters
|
|
* @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters
|
|
* @mbssid_config: AP settings for multiple bssid
|
|
+ * @punct_bitmap: Preamble puncturing bitmap. Each bit represents
|
|
+ * a 20 MHz channel, lowest bit corresponding to the lowest channel.
|
|
+ * Bit set to 1 indicates that the channel is punctured.
|
|
*/
|
|
struct cfg80211_ap_settings {
|
|
struct cfg80211_chan_def chandef;
|
|
@@ -1367,6 +1370,7 @@ struct cfg80211_ap_settings {
|
|
struct cfg80211_fils_discovery fils_discovery;
|
|
struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp;
|
|
struct cfg80211_mbssid_config mbssid_config;
|
|
+ u16 punct_bitmap;
|
|
};
|
|
|
|
/**
|
|
@@ -1384,6 +1388,9 @@ struct cfg80211_ap_settings {
|
|
* @radar_required: whether radar detection is required on the new channel
|
|
* @block_tx: whether transmissions should be blocked while changing
|
|
* @count: number of beacons until switch
|
|
+ * @punct_bitmap: Preamble puncturing bitmap. Each bit represents
|
|
+ * a 20 MHz channel, lowest bit corresponding to the lowest channel.
|
|
+ * Bit set to 1 indicates that the channel is punctured.
|
|
*/
|
|
struct cfg80211_csa_settings {
|
|
struct cfg80211_chan_def chandef;
|
|
@@ -1396,6 +1403,7 @@ struct cfg80211_csa_settings {
|
|
bool radar_required;
|
|
bool block_tx;
|
|
u8 count;
|
|
+ u16 punct_bitmap;
|
|
};
|
|
|
|
/**
|
|
--- a/include/uapi/linux/nl80211.h
|
|
+++ b/include/uapi/linux/nl80211.h
|
|
@@ -2751,6 +2751,12 @@ enum nl80211_commands {
|
|
* the incoming frame RX timestamp.
|
|
* @NL80211_ATTR_TD_BITMAP: Transition Disable bitmap, for subsequent
|
|
* (re)associations.
|
|
+ *
|
|
+ * @NL80211_ATTR_PUNCT_BITMAP: (u32) Preamble puncturing bitmap, lowest
|
|
+ * bit corresponds to the lowest 20 MHz channel. Each bit set to 1
|
|
+ * indicates that the sub-channel is punctured. Higher 16 bits are
|
|
+ * reserved.
|
|
+ *
|
|
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
|
|
* @NL80211_ATTR_MAX: highest attribute number currently defined
|
|
* @__NL80211_ATTR_AFTER_LAST: internal use
|
|
@@ -3280,6 +3286,8 @@ enum nl80211_attrs {
|
|
NL80211_ATTR_RX_HW_TIMESTAMP,
|
|
NL80211_ATTR_TD_BITMAP,
|
|
|
|
+ NL80211_ATTR_PUNCT_BITMAP,
|
|
+
|
|
/* add attributes here, update the policy in nl80211.c */
|
|
|
|
__NL80211_ATTR_AFTER_LAST,
|
|
@@ -6294,6 +6302,8 @@ enum nl80211_feature_flags {
|
|
* might apply, e.g. no scans in progress, no offchannel operations
|
|
* in progress, and no active connections.
|
|
*
|
|
+ * @NL80211_EXT_FEATURE_PUNCT: Driver supports preamble puncturing in AP mode.
|
|
+ *
|
|
* @NUM_NL80211_EXT_FEATURES: number of extended features.
|
|
* @MAX_NL80211_EXT_FEATURES: highest extended feature index.
|
|
*/
|
|
@@ -6362,6 +6372,7 @@ enum nl80211_ext_feature_index {
|
|
NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD,
|
|
NL80211_EXT_FEATURE_RADAR_BACKGROUND,
|
|
NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE,
|
|
+ NL80211_EXT_FEATURE_PUNCT,
|
|
|
|
/* add new features before the definition below */
|
|
NUM_NL80211_EXT_FEATURES,
|
|
--- a/net/wireless/nl80211.c
|
|
+++ b/net/wireless/nl80211.c
|
|
@@ -819,6 +819,7 @@ static const struct nla_policy nl80211_p
|
|
[NL80211_ATTR_MLD_ADDR] = NLA_POLICY_EXACT_LEN(ETH_ALEN),
|
|
[NL80211_ATTR_MLO_SUPPORT] = { .type = NLA_FLAG },
|
|
[NL80211_ATTR_MAX_NUM_AKM_SUITES] = { .type = NLA_REJECT },
|
|
+ [NL80211_ATTR_PUNCT_BITMAP] = NLA_POLICY_RANGE(NLA_U8, 0, 0xffff),
|
|
};
|
|
|
|
/* policy for the key attributes */
|
|
@@ -3187,6 +3188,21 @@ static bool nl80211_can_set_dev_channel(
|
|
wdev->iftype == NL80211_IFTYPE_P2P_GO;
|
|
}
|
|
|
|
+static int nl80211_parse_punct_bitmap(struct cfg80211_registered_device *rdev,
|
|
+ struct genl_info *info,
|
|
+ const struct cfg80211_chan_def *chandef,
|
|
+ u16 *punct_bitmap)
|
|
+{
|
|
+ if (!wiphy_ext_feature_isset(&rdev->wiphy, NL80211_EXT_FEATURE_PUNCT))
|
|
+ return -EINVAL;
|
|
+
|
|
+ *punct_bitmap = nla_get_u32(info->attrs[NL80211_ATTR_PUNCT_BITMAP]);
|
|
+ if (!cfg80211_valid_disable_subchannel_bitmap(punct_bitmap, chandef))
|
|
+ return -EINVAL;
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
int nl80211_parse_chandef(struct cfg80211_registered_device *rdev,
|
|
struct genl_info *info,
|
|
struct cfg80211_chan_def *chandef)
|
|
@@ -5938,6 +5954,14 @@ static int nl80211_start_ap(struct sk_bu
|
|
goto out;
|
|
}
|
|
|
|
+ if (info->attrs[NL80211_ATTR_PUNCT_BITMAP]) {
|
|
+ err = nl80211_parse_punct_bitmap(rdev, info,
|
|
+ ¶ms->chandef,
|
|
+ ¶ms->punct_bitmap);
|
|
+ if (err)
|
|
+ goto out;
|
|
+ }
|
|
+
|
|
if (!cfg80211_reg_can_beacon_relax(&rdev->wiphy, ¶ms->chandef,
|
|
wdev->iftype)) {
|
|
err = -EINVAL;
|
|
@@ -10076,6 +10100,14 @@ skip_beacons:
|
|
if (info->attrs[NL80211_ATTR_CH_SWITCH_BLOCK_TX])
|
|
params.block_tx = true;
|
|
|
|
+ if (info->attrs[NL80211_ATTR_PUNCT_BITMAP]) {
|
|
+ err = nl80211_parse_punct_bitmap(rdev, info,
|
|
+ ¶ms.chandef,
|
|
+ ¶ms.punct_bitmap);
|
|
+ if (err)
|
|
+ goto free;
|
|
+ }
|
|
+
|
|
wdev_lock(wdev);
|
|
err = rdev_channel_switch(rdev, dev, ¶ms);
|
|
wdev_unlock(wdev);
|