wlan-ap-Telecominfraproject/feeds/qca/iw/patches/604-iw-Add-support-to-set-static-puncturing-pattern.patch
John Crispin 008ca9618d
Some checks failed
Build OpenWrt/uCentral images / build (cig_wf186h) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf186w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf188n) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf189) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf196) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-a1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-b1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap102) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap104) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap105) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap111) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap112) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_3) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xe) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (indio_um-305ax) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sercomm_ap72tip) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630c-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-211g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-id2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-od2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr5018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018-v4) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax820) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax840) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap640) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap650) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap655) (push) Has been cancelled
Build OpenWrt/uCentral images / trigger-testing (push) Has been cancelled
Build OpenWrt/uCentral images / create-x64_vm-ami (push) Has been cancelled
ipq95xx: import ath12.4-cs kernel and drivers
Signed-off-by: John Crispin <john@phrozen.org>
2024-10-20 09:25:13 +02:00

138 lines
5.8 KiB
Diff

From faa597e44c08f69c4605e5d4a06fa0fbf1f1ac6f Mon Sep 17 00:00:00 2001
From: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Date: Wed, 25 May 2022 10:02:28 +0530
Subject: [PATCH] iw: Add support to set static puncturing pattern
Add new field 'ru-puncturing-bitmap' to all set frequency and
set channel iw commands to allow user to specify eht
ru puncturing bitmap for given interface.
RU puncturing bitmap (16 bits) where each bit corresponds to
a 20 MHz channel in the given bandwidth, bit 0 corresponding to the channel
with lowest frequency.
Bit set to 1 indicates that the channel is punctured, otherwise active.
Default value is 0 indicating that no channel is punctured.
Example:
Set channel/join mesh in channel 36 BW 80M with Punct pattern 2 (0x0002)
(Puncture secondary 20 of primary 40MHz):
- iw wlan2 set channel 36 80MHz ru-puncturing-bitmap 0x2
- iw dev wlan2 mesh join mesh_id freq 5180 80MHz ru-puncturing-bitmap 0x2 beacon-interval 1000
Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
---
interface.c | 6 +++---
iw.h | 1 +
mesh.c | 2 +-
phy.c | 8 ++++----
util.c | 9 +++++++++
5 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/interface.c b/interface.c
index 0881172..4d45667 100644
--- a/interface.c
+++ b/interface.c
@@ -768,11 +768,11 @@ static int handle_chan(struct nl80211_state *state, struct nl_msg *msg,
SECTION(switch);
COMMAND(switch, freq,
- "<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|320MHz] [beacons <count>] [block-tx]\n"
- "<control freq> [5|10|20|40|80|80+80|160|320] [<center1_freq> [<center2_freq>]] [beacons <count>] [block-tx]",
+ "<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|320MHz] [ru-puncturing-bitmap <bitmap>] [beacons <count>] [block-tx]\n"
+ "<control freq> [5|10|20|40|80|80+80|160|320] [<center1_freq> [<center2_freq>]] [ru-puncturing-bitmap <bitmap>] [beacons <count>] [block-tx]",
NL80211_CMD_CHANNEL_SWITCH, 0, CIB_NETDEV, handle_freq,
"Switch the operating channel by sending a channel switch announcement (CSA).");
-COMMAND(switch, channel, "<channel> [6G] [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|320MHz] [beacons <count>] [block-tx]",
+COMMAND(switch, channel, "<channel> [6G] [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|320MHz] [ru-puncturing-bitmap <bitmap>] [beacons <count>] [block-tx]",
NL80211_CMD_CHANNEL_SWITCH, 0, CIB_NETDEV, handle_chan,
"Switch the operating channel by sending a channel switch announcement (CSA)."
"6GHz channels expects '6G' in argument. Defaults to 5GHz or 2GHz channels");
diff --git a/iw.h b/iw.h
index 4983506..ce74dec 100644
--- a/iw.h
+++ b/iw.h
@@ -117,6 +117,7 @@ struct chandef {
unsigned int control_freq;
unsigned int center_freq1;
unsigned int center_freq2;
+ unsigned int ru_punct_bmap;
};
#define ARRAY_SIZE(ar) (sizeof(ar)/sizeof(ar[0]))
diff --git a/mesh.c b/mesh.c
index 0fb98a3..e8435b3 100644
--- a/mesh.c
+++ b/mesh.c
@@ -588,7 +588,7 @@ static int join_mesh(struct nl80211_state *state,
nla_put_failure:
return -ENOBUFS;
}
-COMMAND(mesh, join, "<mesh ID> [[freq <freq in MHz> <NOHT|HT20|HT40+|HT40-|80MHz>]"
+COMMAND(mesh, join, "<mesh ID> [[freq <freq in MHz> <NOHT|HT20|HT40+|HT40-|80MHz> [ru-puncturing-bitmap <bitmap>]]"
" [basic-rates <rate in Mbps,rate2,...>]], [mcast-rate <rate in Mbps>]"
" [beacon-interval <time in TUs>] [dtim-period <value>]"
" [vendor_sync on|off] [<param>=<value>]*",
diff --git a/phy.c b/phy.c
index 5b8043c..b03b06f 100644
--- a/phy.c
+++ b/phy.c
@@ -200,13 +200,13 @@ static int handle_freq(struct nl80211_state *state, struct nl_msg *msg,
COMMAND(set, freq,
"<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]\n"
- "<control freq> [5|10|20|40|80|80+80|160|320] [<center1_freq> [<center2_freq>]]",
+ "<control freq> [5|10|20|40|80|80+80|160|320] [<center1_freq> [<center2_freq>]] [ru-puncturing-bitmap <bitmap>]",
NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_freq,
"Set frequency/channel the hardware is using, including HT\n"
"configuration.");
COMMAND(set, freq,
"<freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]\n"
- "<control freq> [5|10|20|40|80|80+80|160|320] [<center1_freq> [<center2_freq>]]",
+ "<control freq> [5|10|20|40|80|80+80|160|320] [<center1_freq> [<center2_freq>]] [ru-puncturing-bitmap <bitmap>]",
NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_freq, NULL);
static int handle_chan(struct nl80211_state *state, struct nl_msg *msg,
@@ -222,9 +222,9 @@ static int handle_chan(struct nl80211_state *state, struct nl_msg *msg,
return put_chandef(msg, &chandef);
}
-COMMAND(set, channel, "<channel> [6G] [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz]",
+COMMAND(set, channel, "<channel> [6G] [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz] [ru-puncturing-bitmap <bitmap>]",
NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_chan, NULL);
-COMMAND(set, channel, "<channel> [6G] [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz] [6G]",
+COMMAND(set, channel, "<channel> [6G] [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|160MHz|320MHz] [6G] [ru-puncturing-bitmap <bitmap>]",
NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_chan, NULL);
diff --git a/util.c b/util.c
index 7b3bac1..ea51848 100644
--- a/util.c
+++ b/util.c
@@ -697,6 +697,11 @@ int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv,
res = parse_freqs(chandef, argc - 1, argv + 1, &_parsed);
out:
+ if (!res && (argc - _parsed) > 1 && strcmp(argv[_parsed], "ru-puncturing-bitmap") == 0) {
+ chandef->ru_punct_bmap = strtoul(argv[_parsed+1], &end, 0);
+ _parsed += 2;
+ }
+
/* Error out if parsed is NULL. */
if (!parsed && _parsed != argc)
return 1;
@@ -747,6 +752,10 @@ int put_chandef(struct nl_msg *msg, struct chandef *chandef)
NL80211_ATTR_CENTER_FREQ2,
chandef->center_freq2);
+ if (chandef->ru_punct_bmap)
+ NLA_PUT_U16(msg, NL80211_ATTR_RU_PUNCT_BITMAP,
+ chandef->ru_punct_bmap);
+
return 0;
nla_put_failure:
--
2.7.4