wlan-ap-Telecominfraproject/feeds/ipq95xx/iw/patches/609-06-iw-add-support-for-rts-threshold-command-for-MLO.patch
John Crispin 460050a114 ipq50xx: add CIF WF-198 support
Signed-off-by: John Crispin <john@phrozen.org>
2024-02-28 18:56:21 +01:00

76 lines
1.8 KiB
Diff

From f253847b35ea0d11526f27d7f4d931beab87d59f Mon Sep 17 00:00:00 2001
From: Aaradhana Sahu <quic_aarasahu@quicinc.com>
Date: Fri, 10 Feb 2023 15:47:48 +0530
Subject: [PATCH] iw: add support for rts threshold command for MLO
Add support for set rts threshold command according to
each link id for multi-link operation.
command:
iw dev wlan# set rts -l <link_id> <rts threshold|off>
Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
---
phy.c | 36 ++++++++++++++++++++++++++++++------
1 file changed, 30 insertions(+), 6 deletions(-)
--- a/phy.c
+++ b/phy.c
@@ -444,19 +444,40 @@ static int handle_rts(struct nl80211_sta
int argc, char **argv,
enum id_input id)
{
- unsigned int rts;
+ unsigned int rts, link_id;
+ int index = 0;
+ char *endptr;
- if (argc != 1)
+ if (!argc) {
return 1;
+ } else if (argc == 3) {
+ if (!strcmp(argv[0], "-l")) {
+ link_id = strtol(argv[1], &endptr, 10);
+
+ if (*endptr)
+ return 1;
+
+ if (link_id <= MAX_MLD_LINK) {
+ NLA_PUT_U8(msg, NL80211_ATTR_MLO_LINK_ID,
+ link_id);
+ index = 2;
+ }
+ } else {
+ printf("Invalid parameter: %s\n", argv[0]);
+ return 1;
+ }
+ }
- if (strcmp("off", argv[0]) == 0)
+ if (strcmp("off", argv[index]) == 0) {
rts = -1;
- else {
+ } else {
char *end;
- if (!*argv[0])
+ if (!*argv[index])
return 1;
- rts = strtoul(argv[0], &end, 10);
+
+ rts = strtoul(argv[index], &end, 10);
+
if (*end != '\0')
return 1;
}
@@ -470,6 +491,9 @@ static int handle_rts(struct nl80211_sta
COMMAND(set, rts, "<rts threshold|off>",
NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_rts,
"Set rts threshold.");
+COMMAND(set, rts, "[-l] <link_id> <rts threshold|off>",
+ NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_rts,
+ "Set rts threshold.");
static int handle_retry(struct nl80211_state *state,
struct nl_msg *msg,