wlan-ap-Telecominfraproject/feeds/ipq95xx/iw/patches/609-05-iw-add-support-set-bitrate-command-for-each-link.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

58 lines
1.4 KiB
Diff

From 07d07d8f7f6c2b7f648d22d06db772e0ad006cf6 Mon Sep 17 00:00:00 2001
From: Aaradhana Sahu <quic_aarasahu@quicinc.com>
Date: Thu, 12 Jan 2023 16:36:37 +0530
Subject: [PATCH] iw: add support set bitrate command for each link
Add support for set bit rate by link id in multi-link operation.
command:
iw dev wlanX set bitrates -l <link_id> eht-mcs-<6/5/2.4>
<NSS:MCS0-MCS7/MCS9/MCS11/MCS13>
Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
---
bitrate.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/bitrate.c b/bitrate.c
index 571ebb4..24752be 100644
--- a/bitrate.c
+++ b/bitrate.c
@@ -199,7 +199,7 @@ int set_bitrates(struct nl_msg *msg,
enum nl80211_attrs attr)
{
struct nlattr *nl_rates, *nl_band;
- int i, ret = 0;
+ int i, index, ret = 0;
bool have_legacy_24 = false, have_legacy_5 = false;
uint8_t legacy_24[32], legacy_5[32];
int n_legacy_24 = 0, n_legacy_5 = 0;
@@ -266,7 +266,23 @@ int set_bitrates(struct nl_msg *msg,
S_EHT_LTF,
} parser_state = S_NONE;
- for (i = 0; i < argc; i++) {
+ if (!strcmp(argv[0], "-l")) {
+ unsigned int link_id;
+ char *endptr;
+
+ 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 {
+ index = 0;
+ }
+
+ for (i = index; i < argc; i++) {
char *end;
double tmpd;
long tmpl;
--
2.17.1