All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cfg80211: add support to configure HE MCS for beacon rate
@ 2020-09-15  4:19 Rajkumar Manoharan
  2020-09-18 12:05 ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Rajkumar Manoharan @ 2020-09-15  4:19 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Rajkumar Manoharan

This allows an option to configure a single HE MCS beacon tx rate.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
---
 include/uapi/linux/nl80211.h |  9 +++++++--
 net/wireless/nl80211.c       | 22 ++++++++++++++++++++--
 2 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 0584e0d349f0..4041b92791f1 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1750,8 +1750,9 @@ enum nl80211_commands {
  *	specify just a single bitrate, which is to be used for the beacon.
  *	The driver must also specify support for this with the extended
  *	features NL80211_EXT_FEATURE_BEACON_RATE_LEGACY,
- *	NL80211_EXT_FEATURE_BEACON_RATE_HT and
- *	NL80211_EXT_FEATURE_BEACON_RATE_VHT.
+ *	NL80211_EXT_FEATURE_BEACON_RATE_HT,
+ *	NL80211_EXT_FEATURE_BEACON_RATE_VHT and
+ *	NL80211_EXT_FEATURE_BEACON_RATE_HE.
  *
  * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
  *	at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
@@ -5852,6 +5853,9 @@ enum nl80211_feature_flags {
  * @NL80211_EXT_FEATURE_SAE_OFFLOAD_AP: Device wants to do SAE authentication
  *	in AP mode (SAE password is passed as part of the start AP command).
  *
+ * @NL80211_EXT_FEATURE_BEACON_RATE_HE: Driver supports beacon rate
+ *	configuration (AP/mesh) with HE rates.
+ *
  * @NUM_NL80211_EXT_FEATURES: number of extended features.
  * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
  */
@@ -5910,6 +5914,7 @@ enum nl80211_ext_feature_index {
 	NL80211_EXT_FEATURE_OPERATING_CHANNEL_VALIDATION,
 	NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK,
 	NL80211_EXT_FEATURE_SAE_OFFLOAD_AP,
+	NL80211_EXT_FEATURE_BEACON_RATE_HE,
 
 	/* add new features before the definition below */
 	NUM_NL80211_EXT_FEATURES,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 201d029687cc..d54fb579a9b3 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4663,7 +4663,7 @@ static int validate_beacon_tx_rate(struct cfg80211_registered_device *rdev,
 				   enum nl80211_band band,
 				   struct cfg80211_bitrate_mask *beacon_rate)
 {
-	u32 count_ht, count_vht, i;
+	u32 count_ht, count_vht, count_he, i;
 	u32 rate = beacon_rate->control[band].legacy;
 
 	/* Allow only one rate */
@@ -4696,7 +4696,21 @@ static int validate_beacon_tx_rate(struct cfg80211_registered_device *rdev,
 			return -EINVAL;
 	}
 
-	if ((count_ht && count_vht) || (!rate && !count_ht && !count_vht))
+	count_he = 0;
+	for (i = 0; i < NL80211_HE_NSS_MAX; i++) {
+		if (hweight16(beacon_rate->control[band].he_mcs[i]) > 1) {
+			return -EINVAL;
+		} else if (beacon_rate->control[band].he_mcs[i]) {
+			count_he++;
+			if (count_he > 1)
+				return -EINVAL;
+		}
+		if (count_he && rate)
+			return -EINVAL;
+	}
+
+	if ((count_ht && count_vht && count_he) ||
+	    (!rate && !count_ht && !count_vht && !count_he))
 		return -EINVAL;
 
 	if (rate &&
@@ -4711,6 +4725,10 @@ static int validate_beacon_tx_rate(struct cfg80211_registered_device *rdev,
 	    !wiphy_ext_feature_isset(&rdev->wiphy,
 				     NL80211_EXT_FEATURE_BEACON_RATE_VHT))
 		return -EINVAL;
+	if (count_he &&
+	    !wiphy_ext_feature_isset(&rdev->wiphy,
+				     NL80211_EXT_FEATURE_BEACON_RATE_HE))
+		return -EINVAL;
 
 	return 0;
 }
-- 
2.7.4


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

* Re: [PATCH] cfg80211: add support to configure HE MCS for beacon rate
  2020-09-15  4:19 [PATCH] cfg80211: add support to configure HE MCS for beacon rate Rajkumar Manoharan
@ 2020-09-18 12:05 ` Johannes Berg
  2020-10-03  9:30   ` Rajkumar Manoharan
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2020-09-18 12:05 UTC (permalink / raw)
  To: Rajkumar Manoharan; +Cc: linux-wireless

On Mon, 2020-09-14 at 21:19 -0700, Rajkumar Manoharan wrote:
> This allows an option to configure a single HE MCS beacon tx rate.

This breaks the ap_beacon_rate_legacy2 hwsim test but I'm not sure why,
please check.

johannes


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

* Re: [PATCH] cfg80211: add support to configure HE MCS for beacon rate
  2020-09-18 12:05 ` Johannes Berg
@ 2020-10-03  9:30   ` Rajkumar Manoharan
  2020-10-03 10:38     ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Rajkumar Manoharan @ 2020-10-03  9:30 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On 2020-09-18 05:05, Johannes Berg wrote:
> On Mon, 2020-09-14 at 21:19 -0700, Rajkumar Manoharan wrote:
>> This allows an option to configure a single HE MCS beacon tx rate.
> 
> This breaks the ap_beacon_rate_legacy2 hwsim test but I'm not sure why,
> please check.
> 
Ah... Thanks for reporting... Hostapd has to clear VHT/HE rates while 
setting
legacy beacon tx rate. Otherwise the default he_mcs is filled and 
causing hwsim failure.
Posted a fix[1] for review.

Rajkumar

[1] 
http://patchwork.ozlabs.org/project/hostap/patch/1601717108-1030-1-git-send-email-rmanohar@codeaurora.org/

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

* Re: [PATCH] cfg80211: add support to configure HE MCS for beacon rate
  2020-10-03  9:30   ` Rajkumar Manoharan
@ 2020-10-03 10:38     ` Johannes Berg
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2020-10-03 10:38 UTC (permalink / raw)
  To: Rajkumar Manoharan; +Cc: linux-wireless

On Sat, 2020-10-03 at 02:30 -0700, Rajkumar Manoharan wrote:
> On 2020-09-18 05:05, Johannes Berg wrote:
> > On Mon, 2020-09-14 at 21:19 -0700, Rajkumar Manoharan wrote:
> > > This allows an option to configure a single HE MCS beacon tx rate.
> > 
> > This breaks the ap_beacon_rate_legacy2 hwsim test but I'm not sure why,
> > please check.
> > 
> Ah... Thanks for reporting... Hostapd has to clear VHT/HE rates while 
> setting
> legacy beacon tx rate. Otherwise the default he_mcs is filled and 
> causing hwsim failure.
> Posted a fix[1] for review.

Not sure that makes sense to me - why wouldn't the kernel side just
default to "no HE MCS" if the attribute isn't present at all?!?

johannes


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

end of thread, other threads:[~2020-10-03 10:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15  4:19 [PATCH] cfg80211: add support to configure HE MCS for beacon rate Rajkumar Manoharan
2020-09-18 12:05 ` Johannes Berg
2020-10-03  9:30   ` Rajkumar Manoharan
2020-10-03 10:38     ` Johannes Berg

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.