linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/3] nl80211: retrieve EHT capabilities in AP mode
@ 2022-03-23 22:54 Aloka Dixit
  2022-03-23 22:54 ` [PATCH v2 2/3] nl80211: retrieve EHT operation element " Aloka Dixit
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Aloka Dixit @ 2022-03-23 22:54 UTC (permalink / raw)
  To: johannes, linux-wireless
  Cc: Vikram Kandukuri, Aloka Dixit, Veerendranath Jakkam

From: Vikram Kandukuri <quic_vikram@quicinc.com>

Add support to retrieve the EHT capabilities element passed by
the userspace in the beacon template and store the pointer in
struct cfg80211_ap_settings to be used by MAC80211.

Signed-off-by: Vikram Kandukuri <quic_vikram@quicinc.com>
Co-developed-by: Aloka Dixit <quic_alokad@quicinc.com>
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
Co-developed-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
---
v2: Rebased on top of wireless-next git repository

 include/net/cfg80211.h | 2 ++
 net/wireless/nl80211.c | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 68713388b617..845db70a9473 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1285,6 +1285,7 @@ struct cfg80211_unsol_bcast_probe_resp {
  * @ht_cap: HT capabilities (or %NULL if HT isn't enabled)
  * @vht_cap: VHT capabilities (or %NULL if VHT isn't enabled)
  * @he_cap: HE capabilities (or %NULL if HE isn't enabled)
+ * @eht_cap: EHT capabilities (or %NULL if EHT isn't enabled)
  * @ht_required: stations must support HT
  * @vht_required: stations must support VHT
  * @twt_responder: Enable Target Wait Time
@@ -1322,6 +1323,7 @@ struct cfg80211_ap_settings {
 	const struct ieee80211_vht_cap *vht_cap;
 	const struct ieee80211_he_cap_elem *he_cap;
 	const struct ieee80211_he_operation *he_oper;
+	const struct ieee80211_eht_cap_elem *eht_cap;
 	bool ht_required, vht_required, he_required, sae_h2e_required;
 	bool twt_responder;
 	u32 flags;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index ee1c2b6b6971..71946ad89059 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5442,6 +5442,9 @@ static void nl80211_calculate_ap_params(struct cfg80211_ap_settings *params)
 	cap = cfg80211_find_ext_elem(WLAN_EID_EXT_HE_OPERATION, ies, ies_len);
 	if (cap && cap->datalen >= sizeof(*params->he_oper) + 1)
 		params->he_oper = (void *)(cap->data + 1);
+	cap = cfg80211_find_ext_elem(WLAN_EID_EXT_EHT_CAPABILITY, ies, ies_len);
+	if (cap && cap->datalen >= sizeof(*params->eht_cap) + 1)
+		params->eht_cap = (void *)(cap->data + 1);
 }
 
 static bool nl80211_get_ap_channel(struct cfg80211_registered_device *rdev,

base-commit: f5ba9781dde28f87d1e6db580ab63b308b5b5e1b
-- 
2.31.1


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

* [PATCH v2 2/3] nl80211: retrieve EHT operation element in AP mode
  2022-03-23 22:54 [PATCH v2 1/3] nl80211: retrieve EHT capabilities in AP mode Aloka Dixit
@ 2022-03-23 22:54 ` Aloka Dixit
  2022-05-04 11:34   ` Johannes Berg
  2022-03-23 22:54 ` [PATCH v2 3/3] mac80211: EHT operation element support " Aloka Dixit
  2022-05-04 11:34 ` [PATCH v2 1/3] nl80211: retrieve EHT capabilities " Johannes Berg
  2 siblings, 1 reply; 6+ messages in thread
From: Aloka Dixit @ 2022-03-23 22:54 UTC (permalink / raw)
  To: johannes, linux-wireless; +Cc: Aloka Dixit

Add support to retrieve the EHT operation element passed by
the userspace in the beacon template and store the pointer in
struct cfg80211_ap_settings to be used by MAC80211.

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
---
v2: Rebased on top of wireless-next git repository

 include/net/cfg80211.h | 2 ++
 net/wireless/nl80211.c | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 845db70a9473..45d676d0f61e 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1295,6 +1295,7 @@ struct cfg80211_unsol_bcast_probe_resp {
  * @he_obss_pd: OBSS Packet Detection settings
  * @he_bss_color: BSS Color settings
  * @he_oper: HE operation IE (or %NULL if HE isn't enabled)
+ * @eht_oper: EHT operation IE (or %NULL if EHT isn't enabled)
  * @fils_discovery: FILS discovery transmission parameters
  * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters
  * @mbssid_config: AP settings for multiple bssid
@@ -1324,6 +1325,7 @@ struct cfg80211_ap_settings {
 	const struct ieee80211_he_cap_elem *he_cap;
 	const struct ieee80211_he_operation *he_oper;
 	const struct ieee80211_eht_cap_elem *eht_cap;
+	const struct ieee80211_eht_operation *eht_oper;
 	bool ht_required, vht_required, he_required, sae_h2e_required;
 	bool twt_responder;
 	u32 flags;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 71946ad89059..c16d554a1819 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5445,6 +5445,9 @@ static void nl80211_calculate_ap_params(struct cfg80211_ap_settings *params)
 	cap = cfg80211_find_ext_elem(WLAN_EID_EXT_EHT_CAPABILITY, ies, ies_len);
 	if (cap && cap->datalen >= sizeof(*params->eht_cap) + 1)
 		params->eht_cap = (void *)(cap->data + 1);
+	cap = cfg80211_find_ext_elem(WLAN_EID_EXT_EHT_OPERATION, ies, ies_len);
+	if (cap && cap->datalen >= sizeof(*params->eht_oper) + 1)
+		params->eht_oper = (void *)(cap->data + 1);
 }
 
 static bool nl80211_get_ap_channel(struct cfg80211_registered_device *rdev,
-- 
2.31.1


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

* [PATCH v2 3/3] mac80211: EHT operation element support in AP mode
  2022-03-23 22:54 [PATCH v2 1/3] nl80211: retrieve EHT capabilities in AP mode Aloka Dixit
  2022-03-23 22:54 ` [PATCH v2 2/3] nl80211: retrieve EHT operation element " Aloka Dixit
@ 2022-03-23 22:54 ` Aloka Dixit
  2022-05-04 11:36   ` Johannes Berg
  2022-05-04 11:34 ` [PATCH v2 1/3] nl80211: retrieve EHT capabilities " Johannes Berg
  2 siblings, 1 reply; 6+ messages in thread
From: Aloka Dixit @ 2022-03-23 22:54 UTC (permalink / raw)
  To: johannes, linux-wireless; +Cc: Aloka Dixit

Add new parameters to struct ieee80211_bss_conf for EHT operation
element data in AP mode.

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
---
v2: Rebased on top of wireless-next git repository

 include/net/mac80211.h     |  7 +++++++
 net/mac80211/cfg.c         |  8 ++++++++
 net/mac80211/eht.c         | 11 +++++++++++
 net/mac80211/ieee80211_i.h |  2 ++
 4 files changed, 28 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 382ebb862ea8..b3ab1f7cc2fb 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -637,6 +637,8 @@ struct ieee80211_fils_discovery {
  * @tx_pwr_env_num: number of @tx_pwr_env.
  * @pwr_reduction: power constraint of BSS.
  * @eht_support: does this BSS support EHT
+ * @eht_oper: EHT operation information of the BSS (AP/Mesh) or of the AP we
+ *	are connected to (STA).
  */
 struct ieee80211_bss_conf {
 	const u8 *bssid;
@@ -712,6 +714,11 @@ struct ieee80211_bss_conf {
 	u8 tx_pwr_env_num;
 	u8 pwr_reduction;
 	bool eht_support;
+	struct {
+		u8 chan_width;
+		u8 ccfs;
+		u8 present_bm;
+	} eht_oper;
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index ba752539d1d9..01f3db0f20c6 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1177,6 +1177,14 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
 			changed |= BSS_CHANGED_HE_BSS_COLOR;
 	}
 
+	if (params->eht_cap && params->eht_oper) {
+		if (!sdata->vif.bss_conf.he_support)
+			return -EOPNOTSUPP;
+
+		sdata->vif.bss_conf.eht_support = true;
+		ieee80211_eht_op_ie_to_bss_conf(&sdata->vif, params->eht_oper);
+	}
+
 	if (sdata->vif.type == NL80211_IFTYPE_AP &&
 	    params->mbssid_config.tx_wdev) {
 		err = ieee80211_set_ap_mbssid_options(sdata,
diff --git a/net/mac80211/eht.c b/net/mac80211/eht.c
index 364ad0ef7692..243dfcfaf7b2 100644
--- a/net/mac80211/eht.c
+++ b/net/mac80211/eht.c
@@ -74,3 +74,14 @@ ieee80211_eht_cap_ie_to_sta_eht_cap(struct ieee80211_sub_if_data *sdata,
 	sta->cur_max_bandwidth = ieee80211_sta_cap_rx_bw(sta);
 	sta->sta.bandwidth = ieee80211_sta_cur_vht_bw(sta);
 }
+
+void ieee80211_eht_op_ie_to_bss_conf(struct ieee80211_vif *vif,
+				     const struct ieee80211_eht_operation *op_ie)
+{
+	if (!op_ie)
+		return;
+
+	vif->bss_conf.eht_oper.chan_width = op_ie->chan_width;
+	vif->bss_conf.eht_oper.ccfs = op_ie->ccfs;
+	vif->bss_conf.eht_oper.present_bm = op_ie->present_bm;
+}
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index d4a7ba4a8202..f6f5efa7d987 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2550,4 +2550,6 @@ ieee80211_eht_cap_ie_to_sta_eht_cap(struct ieee80211_sub_if_data *sdata,
 				    const u8 *he_cap_ie, u8 he_cap_len,
 				    const struct ieee80211_eht_cap_elem *eht_cap_ie_elem,
 				    u8 eht_cap_len, struct sta_info *sta);
+void ieee80211_eht_op_ie_to_bss_conf(struct ieee80211_vif *vif,
+				     const struct ieee80211_eht_operation *eht_op);
 #endif /* IEEE80211_I_H */
-- 
2.31.1


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

* Re: [PATCH v2 1/3] nl80211: retrieve EHT capabilities in AP mode
  2022-03-23 22:54 [PATCH v2 1/3] nl80211: retrieve EHT capabilities in AP mode Aloka Dixit
  2022-03-23 22:54 ` [PATCH v2 2/3] nl80211: retrieve EHT operation element " Aloka Dixit
  2022-03-23 22:54 ` [PATCH v2 3/3] mac80211: EHT operation element support " Aloka Dixit
@ 2022-05-04 11:34 ` Johannes Berg
  2 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2022-05-04 11:34 UTC (permalink / raw)
  To: Aloka Dixit, linux-wireless; +Cc: Vikram Kandukuri, Veerendranath Jakkam

On Wed, 2022-03-23 at 15:54 -0700, Aloka Dixit wrote:
> From: Vikram Kandukuri <quic_vikram@quicinc.com>
> 
> Add support to retrieve the EHT capabilities element passed by
> the userspace in the beacon template and store the pointer in
> struct cfg80211_ap_settings to be used by MAC80211.


s/MAC80211/drivers/ I guess

> +	cap = cfg80211_find_ext_elem(WLAN_EID_EXT_EHT_CAPABILITY, ies, ies_len);
> +	if (cap && cap->datalen >= sizeof(*params->eht_cap) + 1)
> +		params->eht_cap = (void *)(cap->data + 1);
> 

Feels like this should be using ieee80211_eht_capa_size_ok() in some
way, since drivers would probably use it? Maybe even returning an error
to userspace if it's not OK?

johannes

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

* Re: [PATCH v2 2/3] nl80211: retrieve EHT operation element in AP mode
  2022-03-23 22:54 ` [PATCH v2 2/3] nl80211: retrieve EHT operation element " Aloka Dixit
@ 2022-05-04 11:34   ` Johannes Berg
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2022-05-04 11:34 UTC (permalink / raw)
  To: Aloka Dixit, linux-wireless

On Wed, 2022-03-23 at 15:54 -0700, Aloka Dixit wrote:
> Add support to retrieve the EHT operation element passed by
> the userspace in the beacon template and store the pointer in
> struct cfg80211_ap_settings to be used by MAC80211.
> 

Same comments on this (though with ieee80211_eht_oper_size_ok)?

Maybe we don't do that for HE today, but that's rather a bug?

johannes

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

* Re: [PATCH v2 3/3] mac80211: EHT operation element support in AP mode
  2022-03-23 22:54 ` [PATCH v2 3/3] mac80211: EHT operation element support " Aloka Dixit
@ 2022-05-04 11:36   ` Johannes Berg
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2022-05-04 11:36 UTC (permalink / raw)
  To: Aloka Dixit, linux-wireless

On Wed, 2022-03-23 at 15:54 -0700, Aloka Dixit wrote:
> 
> +	struct {
> +		u8 chan_width;
> +		u8 ccfs;
> +		u8 present_bm;
> +	} eht_oper;
> 

I don't see how this patch makes any sense.

chan_width/ccfs is already configured as part of the chanctx.

And present_bm is useless on its own?

johannes

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

end of thread, other threads:[~2022-05-04 11:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-23 22:54 [PATCH v2 1/3] nl80211: retrieve EHT capabilities in AP mode Aloka Dixit
2022-03-23 22:54 ` [PATCH v2 2/3] nl80211: retrieve EHT operation element " Aloka Dixit
2022-05-04 11:34   ` Johannes Berg
2022-03-23 22:54 ` [PATCH v2 3/3] mac80211: EHT operation element support " Aloka Dixit
2022-05-04 11:36   ` Johannes Berg
2022-05-04 11:34 ` [PATCH v2 1/3] nl80211: retrieve EHT capabilities " Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).