Linux-Wireless Archive on lore.kernel.org
 help / Atom feed
* [PATCH] mac80211: allow overriding HT STBC capabilities
@ 2019-01-08 20:31 Sergey Matyukevich
  2019-01-14  9:09 ` Sergey Matyukevich
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Matyukevich @ 2019-01-08 20:31 UTC (permalink / raw)
  To: linux-wireless, Johannes Berg; +Cc: Jouni Malinen, Sergey Matyukevich

From: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>

Allow user to override STBC configuration for Rx and Tx spatial streams.
In practice RX/TX STBC settings can be modified using appropriate
options in wpa_supplicant configuration file:
  tx_stbc=-1..1
  rx_stbc=-1..3

This functionality has been added to wpa_supplicant in commit cdeea70f59d0.

In FullMAC case these STBC options are passed to drivers by cfg80211
connect callback in fields of cfg80211_connect_params structure.
However for mac80211 drivers, e.g. for mac80211_hwsim,
overrides for STBC settings are ignored.

The reason why RX/TX STBC capabilities are not modified for mac80211
drivers is as follows. All drivers need to specify supported HT/VHT
overrides explicitly: see ht_capa_mod_mask and vht_capa_mod_mask fields
of wiphy structure. Only supported overrides will be passed to drivers by
cfg80211_connect and cfg80211_mlme_assoc operations: see bitwise 'AND'
performed by cfg80211_oper_and_ht_capa and cfg80211_oper_and_vht_capa.

This commit adds RX/TX STBC HT capabilities to mac80211_ht_capa_mod_mask,
allowing their modifications, as well as applies requested STBC
modifications in function ieee80211_apply_htcap_overrides.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
---
 net/mac80211/ht.c   | 8 ++++++++
 net/mac80211/main.c | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index f849ea814993..e03c46ac8e4d 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -107,6 +107,14 @@ void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
 	__check_htcap_enable(ht_capa, ht_capa_mask, ht_cap,
 			     IEEE80211_HT_CAP_40MHZ_INTOLERANT);
 
+	/* Allow user to enable TX STBC bit  */
+	__check_htcap_enable(ht_capa, ht_capa_mask, ht_cap,
+			     IEEE80211_HT_CAP_TX_STBC);
+
+	/* Allow user to configure RX STBC bits */
+	if (ht_capa_mask->cap_info & IEEE80211_HT_CAP_RX_STBC)
+		ht_cap->cap |= ht_capa->cap_info & IEEE80211_HT_CAP_RX_STBC;
+
 	/* Allow user to decrease AMPDU factor */
 	if (ht_capa_mask->ampdu_params_info &
 	    IEEE80211_HT_AMPDU_PARM_FACTOR) {
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 87a729926734..1114ee217bd6 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -478,6 +478,8 @@ static const struct ieee80211_ht_cap mac80211_ht_capa_mod_mask = {
 				IEEE80211_HT_CAP_MAX_AMSDU |
 				IEEE80211_HT_CAP_SGI_20 |
 				IEEE80211_HT_CAP_SGI_40 |
+				IEEE80211_HT_CAP_TX_STBC |
+				IEEE80211_HT_CAP_RX_STBC |
 				IEEE80211_HT_CAP_LDPC_CODING |
 				IEEE80211_HT_CAP_40MHZ_INTOLERANT),
 	.mcs = {
-- 
2.20.1


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

* Re: [PATCH] mac80211: allow overriding HT STBC capabilities
  2019-01-08 20:31 [PATCH] mac80211: allow overriding HT STBC capabilities Sergey Matyukevich
@ 2019-01-14  9:09 ` Sergey Matyukevich
  0 siblings, 0 replies; 2+ messages in thread
From: Sergey Matyukevich @ 2019-01-14  9:09 UTC (permalink / raw)
  To: Sergey Matyukevich; +Cc: linux-wireless, Johannes Berg, Jouni Malinen

> From: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
> 
> Allow user to override STBC configuration for Rx and Tx spatial streams.
> In practice RX/TX STBC settings can be modified using appropriate
> options in wpa_supplicant configuration file:
>   tx_stbc=-1..1
>   rx_stbc=-1..3
> 
> This functionality has been added to wpa_supplicant in commit cdeea70f59d0.
> 
> In FullMAC case these STBC options are passed to drivers by cfg80211
> connect callback in fields of cfg80211_connect_params structure.
> However for mac80211 drivers, e.g. for mac80211_hwsim,
> overrides for STBC settings are ignored.

...

> Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
> ---
>  net/mac80211/ht.c   | 8 ++++++++
>  net/mac80211/main.c | 2 ++
>  2 files changed, 10 insertions(+)

FWIW, the accompanying RFC patch extending STBC tests in hwsim hostapd test
suite has been posted to hostapd mailing list:

http://lists.infradead.org/pipermail/hostap/2019-January/039274.html

Regards,
Sergey

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-08 20:31 [PATCH] mac80211: allow overriding HT STBC capabilities Sergey Matyukevich
2019-01-14  9:09 ` Sergey Matyukevich

Linux-Wireless Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wireless/0 linux-wireless/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wireless linux-wireless/ https://lore.kernel.org/linux-wireless \
		linux-wireless@vger.kernel.org linux-wireless@archiver.kernel.org
	public-inbox-index linux-wireless


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-wireless


AGPL code for this site: git clone https://public-inbox.org/ public-inbox