All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nl80211: Add HE UL MU fixed rate setting
@ 2020-05-28 22:43 Muna Sinada
  2020-08-03  9:21 ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Muna Sinada @ 2020-05-28 22:43 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Muna Sinada

This patch adds nl80211 definitions, policies and parsing code required
to pass HE UL MU fixed rate settings.

Signed-off-by: Muna Sinada <msinada@codeaurora.org>
---
 include/net/cfg80211.h       | 1 +
 include/uapi/linux/nl80211.h | 2 ++
 net/wireless/nl80211.c       | 9 +++++++++
 3 files changed, 12 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 96bf879c049b..a6cc2c8a8c92 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1039,6 +1039,7 @@ struct cfg80211_bitrate_mask {
 		enum nl80211_txrate_gi gi;
 		enum nl80211_he_gi he_gi;
 		enum nl80211_he_ltf he_ltf;
+		u16 he_ul_mcs[NL80211_HE_NSS_MAX];
 	} control[NUM_NL80211_BANDS];
 };
 
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 69e2cf22a329..e418c6be9494 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -4685,6 +4685,7 @@ enum nl80211_key_attributes {
  *	see &struct nl80211_txrate_he
  * @NL80211_TXRATE_HE_GI: configure HE GI, 0.8us, 1.6us and 3.2us.
  * @NL80211_TXRATE_HE_LTF: configure HE LTF, 1XLTF, 2XLTF and 4XLTF.
+ * @NL80211_TXRATE_HE_UL: HE MCS rates of connected HE STA for uplink traffic.
  * @__NL80211_TXRATE_AFTER_LAST: internal
  * @NL80211_TXRATE_MAX: highest TX rate attribute
  */
@@ -4697,6 +4698,7 @@ enum nl80211_tx_rate_attributes {
 	NL80211_TXRATE_HE,
 	NL80211_TXRATE_HE_GI,
 	NL80211_TXRATE_HE_LTF,
+	NL80211_TXRATE_HE_UL,
 
 	/* keep last */
 	__NL80211_TXRATE_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 33f1ad127e8f..b057168941c9 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4467,6 +4467,10 @@ static const struct nla_policy nl80211_txattr_policy[NL80211_TXRATE_MAX + 1] = {
 	[NL80211_TXRATE_HE_LTF] = NLA_POLICY_RANGE(NLA_U8,
 						   NL80211_RATE_INFO_HE_1XLTF,
 						   NL80211_RATE_INFO_HE_4XLTF),
+	[NL80211_TXRATE_HE_UL] = {
+		.type = NLA_EXACT_LEN,
+		.len = sizeof(struct nl80211_txrate_he),
+	},
 };
 
 static int nl80211_parse_tx_bitrate_mask(struct genl_info *info,
@@ -4575,6 +4579,11 @@ static int nl80211_parse_tx_bitrate_mask(struct genl_info *info,
 		if (tb[NL80211_TXRATE_HE_LTF])
 			mask->control[band].he_ltf =
 				nla_get_u8(tb[NL80211_TXRATE_HE_LTF]);
+		if (tb[NL80211_TXRATE_HE_UL] &&
+		    !he_set_mcs_mask(info, sband,
+				     nla_data(tb[NL80211_TXRATE_HE_UL]),
+				     mask->control[band].he_ul_mcs))
+			return -EINVAL;
 
 		if (mask->control[band].legacy == 0) {
 			/* don't allow empty legacy rates if HT or VHT
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] nl80211: Add HE UL MU fixed rate setting
  2020-05-28 22:43 [PATCH] nl80211: Add HE UL MU fixed rate setting Muna Sinada
@ 2020-08-03  9:21 ` Johannes Berg
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2020-08-03  9:21 UTC (permalink / raw)
  To: Muna Sinada; +Cc: linux-wireless

On Thu, 2020-05-28 at 15:43 -0700, Muna Sinada wrote:
> This patch adds nl80211 definitions, policies and parsing code required
> to pass HE UL MU fixed rate settings.

This seems to apply now, but doesn't compile. Also,

>  	[NL80211_TXRATE_HE_LTF] = NLA_POLICY_RANGE(NLA_U8,
>  						   NL80211_RATE_INFO_HE_1XLTF,
>  						   NL80211_RATE_INFO_HE_4XLTF),
> +	[NL80211_TXRATE_HE_UL] = {
> +		.type = NLA_EXACT_LEN,
> +		.len = sizeof(struct nl80211_txrate_he),
> +	},

Please modernize that (there's a macro).

> +		if (tb[NL80211_TXRATE_HE_UL] &&
> +		    !he_set_mcs_mask(info, sband,
> +				     nla_data(tb[NL80211_TXRATE_HE_UL]),
> +				     mask->control[band].he_ul_mcs))
> +			return -EINVAL;

And please add an netlink extack error message here.

johannes


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nl80211: Add HE UL MU fixed rate setting
  2020-05-28  8:49 Muna Sinada
@ 2020-05-28 21:27 ` Rajkumar Manoharan
  0 siblings, 0 replies; 4+ messages in thread
From: Rajkumar Manoharan @ 2020-05-28 21:27 UTC (permalink / raw)
  To: Muna Sinada; +Cc: ath11k

On 2020-05-28 01:49, Muna Sinada wrote:
> This patch adds nl80211 definitions, policies and parsing code required
> to pass HE UL MU fixed rate settings.
> 
> Signed-off-by: Muna Sinada <msinada@codeaurora.org>
> ---
>  include/net/cfg80211.h       | 1 +
>  include/uapi/linux/nl80211.h | 2 ++
>  net/wireless/nl80211.c       | 9 +++++++++
>  3 files changed, 12 insertions(+)
> 
Please post all cfg80211/mac80211 changes CCd to linux-wireless and 
addressing Johannes.

-Rajkumar

_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] nl80211: Add HE UL MU fixed rate setting
@ 2020-05-28  8:49 Muna Sinada
  2020-05-28 21:27 ` Rajkumar Manoharan
  0 siblings, 1 reply; 4+ messages in thread
From: Muna Sinada @ 2020-05-28  8:49 UTC (permalink / raw)
  To: ath11k; +Cc: Muna Sinada

This patch adds nl80211 definitions, policies and parsing code required
to pass HE UL MU fixed rate settings.

Signed-off-by: Muna Sinada <msinada@codeaurora.org>
---
 include/net/cfg80211.h       | 1 +
 include/uapi/linux/nl80211.h | 2 ++
 net/wireless/nl80211.c       | 9 +++++++++
 3 files changed, 12 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 96bf879c049b..a6cc2c8a8c92 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1039,6 +1039,7 @@ struct cfg80211_bitrate_mask {
 		enum nl80211_txrate_gi gi;
 		enum nl80211_he_gi he_gi;
 		enum nl80211_he_ltf he_ltf;
+		u16 he_ul_mcs[NL80211_HE_NSS_MAX];
 	} control[NUM_NL80211_BANDS];
 };
 
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 69e2cf22a329..e418c6be9494 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -4685,6 +4685,7 @@ enum nl80211_key_attributes {
  *	see &struct nl80211_txrate_he
  * @NL80211_TXRATE_HE_GI: configure HE GI, 0.8us, 1.6us and 3.2us.
  * @NL80211_TXRATE_HE_LTF: configure HE LTF, 1XLTF, 2XLTF and 4XLTF.
+ * @NL80211_TXRATE_HE_UL: HE MCS rates of connected HE STA for uplink traffic.
  * @__NL80211_TXRATE_AFTER_LAST: internal
  * @NL80211_TXRATE_MAX: highest TX rate attribute
  */
@@ -4697,6 +4698,7 @@ enum nl80211_tx_rate_attributes {
 	NL80211_TXRATE_HE,
 	NL80211_TXRATE_HE_GI,
 	NL80211_TXRATE_HE_LTF,
+	NL80211_TXRATE_HE_UL,
 
 	/* keep last */
 	__NL80211_TXRATE_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 33f1ad127e8f..b057168941c9 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4467,6 +4467,10 @@ static const struct nla_policy nl80211_txattr_policy[NL80211_TXRATE_MAX + 1] = {
 	[NL80211_TXRATE_HE_LTF] = NLA_POLICY_RANGE(NLA_U8,
 						   NL80211_RATE_INFO_HE_1XLTF,
 						   NL80211_RATE_INFO_HE_4XLTF),
+	[NL80211_TXRATE_HE_UL] = {
+		.type = NLA_EXACT_LEN,
+		.len = sizeof(struct nl80211_txrate_he),
+	},
 };
 
 static int nl80211_parse_tx_bitrate_mask(struct genl_info *info,
@@ -4575,6 +4579,11 @@ static int nl80211_parse_tx_bitrate_mask(struct genl_info *info,
 		if (tb[NL80211_TXRATE_HE_LTF])
 			mask->control[band].he_ltf =
 				nla_get_u8(tb[NL80211_TXRATE_HE_LTF]);
+		if (tb[NL80211_TXRATE_HE_UL] &&
+		    !he_set_mcs_mask(info, sband,
+				     nla_data(tb[NL80211_TXRATE_HE_UL]),
+				     mask->control[band].he_ul_mcs))
+			return -EINVAL;
 
 		if (mask->control[band].legacy == 0) {
 			/* don't allow empty legacy rates if HT or VHT
-- 
2.7.4


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-03  9:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28 22:43 [PATCH] nl80211: Add HE UL MU fixed rate setting Muna Sinada
2020-08-03  9:21 ` Johannes Berg
  -- strict thread matches above, loose matches on Subject: below --
2020-05-28  8:49 Muna Sinada
2020-05-28 21:27 ` Rajkumar Manoharan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.