2020-09-16 17:26:41

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH] iw: support HE rate configuration in 6 GHz band

Allow HE-MCS, HE-GI, HE-LTF in 6 GHz band as well and allow only
MCS rates in 6 GHz.

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
bitrate.c | 40 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 38 insertions(+), 2 deletions(-)

diff --git a/bitrate.c b/bitrate.c
index 70a23fb6ac83..460708a1dbea 100644
--- a/bitrate.c
+++ b/bitrate.c
@@ -156,22 +156,27 @@ static int handle_bitrates(struct nl80211_state *state,
bool have_ht_mcs_24 = false, have_ht_mcs_5 = false;
bool have_vht_mcs_24 = false, have_vht_mcs_5 = false;
bool have_he_mcs_24 = false, have_he_mcs_5 = false;
+ bool have_he_mcs_6 = false;
uint8_t ht_mcs_24[77], ht_mcs_5[77];
int n_ht_mcs_24 = 0, n_ht_mcs_5 = 0;
struct nl80211_txrate_vht txrate_vht_24 = {};
struct nl80211_txrate_vht txrate_vht_5 = {};
struct nl80211_txrate_he txrate_he_24 = {};
struct nl80211_txrate_he txrate_he_5 = {};
+ struct nl80211_txrate_he txrate_he_6 = {};
uint8_t *mcs = NULL;
int *n_mcs = NULL;
char *vht_argv_5[VHT_ARGC_MAX] = {}; char *vht_argv_24[VHT_ARGC_MAX] = {};
char *he_argv_5[VHT_ARGC_MAX] = {}; char *he_argv_24[VHT_ARGC_MAX] = {};
+ char *he_argv_6[VHT_ARGC_MAX] = {};
char **vht_argv = NULL, **he_argv = NULL;
int vht_argc_5 = 0; int vht_argc_24 = 0;
int he_argc_5 = 0; int he_argc_24 = 0;
+ int he_argc_6 = 0;
int *vht_argc = NULL, *he_argc = NULL;
int sgi_24 = 0, sgi_5 = 0, lgi_24 = 0, lgi_5 = 0;
int has_he_gi_24 = 0, has_he_gi_5 = 0, has_he_ltf_24 = 0, has_he_ltf_5 = 0;
+ int has_he_gi_6 = 0, has_he_ltf_6 = 0;
int he_gi = 0, he_ltf = 0;
char *he_gi_argv = NULL;

@@ -248,6 +253,13 @@ static int handle_bitrates(struct nl80211_state *state,
he_argv = he_argv_5;
he_argc = &he_argc_5;
have_he_mcs_5 = true;
+ } else if (strcmp(argv[i], "he-mcs-6") == 0) {
+ if (have_he_mcs_6)
+ return 1;
+ parser_state = S_HE;
+ he_argv = he_argv_6;
+ he_argc = &he_argc_6;
+ have_he_mcs_6 = true;
} else if (strcmp(argv[i], "sgi-2.4") == 0) {
sgi_24 = 1;
parser_state = S_GI;
@@ -266,12 +278,18 @@ static int handle_bitrates(struct nl80211_state *state,
} else if (strcmp(argv[i], "he-gi-5") == 0) {
has_he_gi_5 = 1;
parser_state = S_HE_GI;
+ } else if (strcmp(argv[i], "he-gi-6") == 0) {
+ has_he_gi_6 = 1;
+ parser_state = S_HE_GI;
} else if (strcmp(argv[i], "he-ltf-2.4") == 0) {
has_he_ltf_24 = 1;
parser_state = S_HE_LTF;
} else if (strcmp(argv[i], "he-ltf-5") == 0) {
has_he_ltf_5 = 1;
parser_state = S_HE_LTF;
+ } else if (strcmp(argv[i], "he-ltf-6") == 0) {
+ has_he_ltf_6 = 1;
+ parser_state = S_HE_LTF;
} else switch (parser_state) {
case S_LEGACY:
tmpd = strtod(argv[i], &end);
@@ -333,6 +351,10 @@ static int handle_bitrates(struct nl80211_state *state,
if (!setup_he(&txrate_he_5, he_argc_5, he_argv_5))
return -EINVAL;

+ if (have_he_mcs_6)
+ if (!setup_he(&txrate_he_6, he_argc_6, he_argv_6))
+ return -EINVAL;
+
if (sgi_5 && lgi_5)
return 1;

@@ -399,6 +421,20 @@ static int handle_bitrates(struct nl80211_state *state,
nla_nest_end(msg, nl_band);
}

+ if (have_he_mcs_6 || has_he_gi_6 || has_he_ltf_6) {
+ nl_band = nla_nest_start(msg, NL80211_BAND_6GHZ);
+ if (!nl_band)
+ goto nla_put_failure;
+ if (have_he_mcs_6)
+ nla_put(msg, NL80211_TXRATE_HE, sizeof(txrate_he_6),
+ &txrate_he_6);
+ if (has_he_gi_6)
+ nla_put_u8(msg, NL80211_TXRATE_HE_GI, he_gi);
+ if (has_he_ltf_6)
+ nla_put_u8(msg, NL80211_TXRATE_HE_LTF, he_ltf);
+ nla_nest_end(msg, nl_band);
+ }
+
nla_nest_end(msg, nl_rates);

return 0;
@@ -407,9 +443,9 @@ static int handle_bitrates(struct nl80211_state *state,
}

#define DESCR_LEGACY "[legacy-<2.4|5> <legacy rate in Mbps>*]"
-#define DESCR DESCR_LEGACY " [ht-mcs-<2.4|5> <MCS index>*] [vht-mcs-<2.4|5> [he-mcs-<2.4|5> <NSS:MCSx,MCSy... | NSS:MCSx-MCSy>*] [sgi-2.4|lgi-2.4] [sgi-5|lgi-5]"
+#define DESCR DESCR_LEGACY " [ht-mcs-<2.4|5> <MCS index>*] [vht-mcs-<2.4|5> [he-mcs-<2.4|5|6> <NSS:MCSx,MCSy... | NSS:MCSx-MCSy>*] [sgi-2.4|lgi-2.4] [sgi-5|lgi-5]"

-COMMAND(set, bitrates, "[legacy-<2.4|5> <legacy rate in Mbps>*] [ht-mcs-<2.4|5> <MCS index>*] [vht-mcs-<2.4|5> [he-mcs-<2.4|5> <NSS:MCSx,MCSy... | NSS:MCSx-MCSy>*] [sgi-2.4|lgi-2.4] [sgi-5|lgi-5] [he-gi-2.4:0.8/1.6/3.2] [he-gi-5:0.8/1.6/3.2] [he-ltf-2.4:1/2/4] [he-ltf-5:1/2/4]",
+COMMAND(set, bitrates, "[legacy-<2.4|5> <legacy rate in Mbps>*] [ht-mcs-<2.4|5> <MCS index>*] [vht-mcs-<2.4|5> [he-mcs-<2.4|5|6> <NSS:MCSx,MCSy... | NSS:MCSx-MCSy>*] [sgi-2.4|lgi-2.4] [sgi-5|lgi-5] [he-gi-<2.4|5|6> <0.8|1.6|3.2>] [he-ltf-<2.4|5|6> <1|2|4>]",
NL80211_CMD_SET_TX_BITRATE_MASK, 0, CIB_NETDEV, handle_bitrates,
"Sets up the specified rate masks.\n"
"Not passing any arguments would clear the existing mask (if any).");
--
2.7.4


2020-09-18 11:27:53

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] iw: support HE rate configuration in 6 GHz band

On Wed, 2020-09-16 at 10:14 -0700, Rajkumar Manoharan wrote:
> Allow HE-MCS, HE-GI, HE-LTF in 6 GHz band as well and allow only
> MCS rates in 6 GHz.

This doesn't apply at all, please respin.

Thanks,
johannes

2020-09-18 18:50:12

by Rajkumar Manoharan

[permalink] [raw]
Subject: Re: [PATCH] iw: support HE rate configuration in 6 GHz band

On 2020-09-18 04:25, Johannes Berg wrote:
> On Wed, 2020-09-16 at 10:14 -0700, Rajkumar Manoharan wrote:
>> Allow HE-MCS, HE-GI, HE-LTF in 6 GHz band as well and allow only
>> MCS rates in 6 GHz.
>
> This doesn't apply at all, please respin.
>
My bad. Forgot to mention that this change depends on "iw: add HE
rate/gi/ltf support".

https://patchwork.kernel.org/patch/11364395/

Rajkumar

2020-09-18 19:20:33

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] iw: support HE rate configuration in 6 GHz band

On Fri, 2020-09-18 at 11:49 -0700, Rajkumar Manoharan wrote:
> On 2020-09-18 04:25, Johannes Berg wrote:
> > On Wed, 2020-09-16 at 10:14 -0700, Rajkumar Manoharan wrote:
> > > Allow HE-MCS, HE-GI, HE-LTF in 6 GHz band as well and allow only
> > > MCS rates in 6 GHz.
> >
> > This doesn't apply at all, please respin.
> >
> My bad. Forgot to mention that this change depends on "iw: add HE
> rate/gi/ltf support".
>
> https://patchwork.kernel.org/patch/11364395/

Oh. But can I apply that? I think the kernel bits weren't there? But I
get confused with John's patch series'...

johannes

2020-09-18 20:03:34

by Rajkumar Manoharan

[permalink] [raw]
Subject: Re: [PATCH] iw: support HE rate configuration in 6 GHz band

On 2020-09-18 12:19, Johannes Berg wrote:
> On Fri, 2020-09-18 at 11:49 -0700, Rajkumar Manoharan wrote:
>> On 2020-09-18 04:25, Johannes Berg wrote:
>> > On Wed, 2020-09-16 at 10:14 -0700, Rajkumar Manoharan wrote:
>> > > Allow HE-MCS, HE-GI, HE-LTF in 6 GHz band as well and allow only
>> > > MCS rates in 6 GHz.
>> >
>> > This doesn't apply at all, please respin.
>> >
>> My bad. Forgot to mention that this change depends on "iw: add HE
>> rate/gi/ltf support".
>>
>> https://patchwork.kernel.org/patch/11364395/
>
> Oh. But can I apply that? I think the kernel bits weren't there? But I
> get confused with John's patch series'...
>
The kernel bits are available in mac80211-next. Thought you sync
nl80211.h from -next tree.
If so, you can apply John's patch as well as mine.

https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git/commit/include/uapi/linux/nl80211.h?id=eb89a6a6b7a1af2d9c8d83ee44fa67700d6337e7

Sorry if I confused you further. :)

Rajkumar

2020-09-28 12:39:53

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] iw: support HE rate configuration in 6 GHz band

On Fri, 2020-09-18 at 13:01 -0700, Rajkumar Manoharan wrote:
> On 2020-09-18 12:19, Johannes Berg wrote:
> > On Fri, 2020-09-18 at 11:49 -0700, Rajkumar Manoharan wrote:
> > > On 2020-09-18 04:25, Johannes Berg wrote:
> > > > On Wed, 2020-09-16 at 10:14 -0700, Rajkumar Manoharan wrote:
> > > > > Allow HE-MCS, HE-GI, HE-LTF in 6 GHz band as well and allow only
> > > > > MCS rates in 6 GHz.
> > > >
> > > > This doesn't apply at all, please respin.
> > > >
> > > My bad. Forgot to mention that this change depends on "iw: add HE
> > > rate/gi/ltf support".
> > >
> > > https://patchwork.kernel.org/patch/11364395/
> >
> > Oh. But can I apply that? I think the kernel bits weren't there? But I
> > get confused with John's patch series'...
> >
> The kernel bits are available in mac80211-next. Thought you sync
> nl80211.h from -next tree.

I do, usually.

> If so, you can apply John's patch as well as mine.
>
> https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git/commit/include/uapi/linux/nl80211.h?id=eb89a6a6b7a1af2d9c8d83ee44fa67700d6337e7
>
> Sorry if I confused you further. :)

Yeah, hmm. Can you just resend any patches please?

johannes