From faa597e44c08f69c4605e5d4a06fa0fbf1f1ac6f Mon Sep 17 00:00:00 2001 From: Rameshkumar Sundaram 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 --- 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, - " [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|320MHz] [beacons ] [block-tx]\n" - " [5|10|20|40|80|80+80|160|320] [ []] [beacons ] [block-tx]", + " [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|320MHz] [ru-puncturing-bitmap ] [beacons ] [block-tx]\n" + " [5|10|20|40|80|80+80|160|320] [ []] [ru-puncturing-bitmap ] [beacons ] [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, " [6G] [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|320MHz] [beacons ] [block-tx]", +COMMAND(switch, channel, " [6G] [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz|320MHz] [ru-puncturing-bitmap ] [beacons ] [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, " [[freq ]" +COMMAND(mesh, join, " [[freq [ru-puncturing-bitmap ]]" " [basic-rates ]], [mcast-rate ]" " [beacon-interval