Skip to contentSkip to conversation

mac80211: add support for ht_caps mcs rxmask override

RFC In review Cedric DEBARGE 2 participants 6 messages Feb 5, 2016 – Feb 23, 2016

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover mac80211: add support for ht_caps mcs rxmask override

This patchset allows the ht_caps mcs rxmask to be defined on the fly. It applies the given rxmask to all available bands.

This is actually limited to radio cards without internal rc.

Cedric DEBARGE (2):
cfg80211: add support for ht_caps mcs rxmask override
nl80211: add nl attribute to set ht_caps mcs rxmask override

 include/net/cfg80211.h       |  7 ++++++
 include/uapi/linux/nl80211.h |  5 +++++
 net/mac80211/cfg.c           | 48 +++++++++++++++++++++++++++++++++++++++
 net/mac80211/main.c          | 53 +++++++++++++++++++++++++++++++++++++-------
 net/wireless/nl80211.c       | 18 +++++++++++++++
 net/wireless/rdev-ops.h      | 11 +++++++++
 net/wireless/trace.h         | 15 +++++++++++++
 7 files changed, 149 insertions(+), 8 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

RFC 1/2 cfg80211: add support for ht_caps mcs rxmask override

Allows the ht_caps mcs rxmask to be defined on the fly. In this implementation, the given rxmask is applied to every band available.
This is only applicable for radio cards without internal rc.

---
 include/net/cfg80211.h |  7 +++++++
 net/mac80211/cfg.c     | 48 +++++++++++++++++++++++++++++++++++++++++++++
 net/mac80211/main.c    | 53 ++++++++++++++++++++++++++++++++++++++++++--------
 3 files changed, 100 insertions(+), 8 deletions(-)
include/net/cfg80211.h +7 -0
index 9e1b24c..257404b 100644
@@ -2500,6 +2500,8 @@ struct cfg80211_qos_map {
  *	and returning to the base channel for communication with the AP.
  * @tdls_cancel_channel_switch: Stop channel-switching with a TDLS peer. Both
  *	peers must be on the base channel when the call completes.
+ *
+ * @set_htcap_rxmask: Override hardware capabilities for ht_caps mcs rxmask.
  */
 struct cfg80211_ops {
 	int	(*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2765,6 +2767,8 @@ struct cfg80211_ops {
 	void	(*tdls_cancel_channel_switch)(struct wiphy *wiphy,
 					      struct net_device *dev,
 					      const u8 *addr);
+
+	int (*set_htcap_rxmask)(struct wiphy *wiphy, uint8_t *rxmask);
 };
 
 /*
@@ -3121,6 +3125,8 @@ struct wiphy_vendor_command {
  *	wiphy is theirs, e.g. in global notifiers
  * @bands: information about bands/channels supported by this device
  *
+ * @init_bands: save of the originals information about bands.
+ *
  * @mgmt_stypes: bitmasks of frame subtypes that can be subscribed to or
  *	transmitted through nl80211, points to an array indexed by interface
  *	type
@@ -3266,6 +3272,7 @@ struct wiphy {
 	const void *privid;
 
 	struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS];
+	struct ieee80211_supported_band *init_bands[IEEE80211_NUM_BANDS];
 
 	/* Lets us get back the wiphy on the callback */
 	void (*reg_notifier)(struct wiphy *wiphy,
net/mac80211/cfg.c +48 -0

58 lines not on this page · raw message

net/mac80211/main.c +45 -8

98 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

RFC 2/2 nl80211: add nl attribute to set ht_caps mcs rxmask override

In reply to Cedric DEBARGE

This adds the NL80211_ATTR_WIPHY_HTCAP_RXMASK attribute to NL80211_CMD_SET_WIPHY in order for the user to specify the ht_caps mcs rxmask.

---
 include/uapi/linux/nl80211.h |  5 +++++
 net/wireless/nl80211.c       | 18 ++++++++++++++++++
 net/wireless/rdev-ops.h      | 11 +++++++++++
 net/wireless/trace.h         | 15 +++++++++++++++
 4 files changed, 49 insertions(+)
include/uapi/linux/nl80211.h +5 -0
index 7758969..50a53d8 100644
@@ -1794,6 +1794,9 @@ enum nl80211_commands {
  *	connecting to a PCP, and in %NL80211_CMD_START_AP to start
  *	a PCP instead of AP. Relevant for DMG networks only.
  *
+ * @NL80211_ATTR_WIPHY_HTCAP_RXMASK: Override hardware capabilities for ht_caps
+ *	mcs rxmask.
+ *
  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2170,6 +2173,8 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_PBSS,
 
+	NL80211_ATTR_WIPHY_HTCAP_RXMASK,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
net/wireless/nl80211.c +18 -0
index 268cb49..ef5ec8b 100644
@@ -402,6 +402,9 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
 	[NL80211_ATTR_SCHED_SCAN_DELAY] = { .type = NLA_U32 },
 	[NL80211_ATTR_REG_INDOOR] = { .type = NLA_FLAG },
 	[NL80211_ATTR_PBSS] = { .type = NLA_FLAG },
+	[NL80211_ATTR_WIPHY_HTCAP_RXMASK] = { .type = NLA_BINARY,
+					      .len = IEEE80211_HT_MCS_MASK_LEN
+	},
 };
 
 /* policy for the key attributes */
@@ -2243,6 +2246,21 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 			return result;
 	}
 
+	if (info->attrs[NL80211_ATTR_WIPHY_HTCAP_RXMASK]) {
+		u8 rxmask[IEEE80211_HT_MCS_MASK_LEN];
+
+		if (wdev)
+			return -EOPNOTSUPP;
+
+		memcpy(rxmask,
+		       nla_data(info->attrs[NL80211_ATTR_WIPHY_HTCAP_RXMASK]),
+		       IEEE80211_HT_MCS_MASK_LEN);
+
+		result = rdev_set_htcap_rxmask(rdev, rxmask);
+		if (result)
+			return result;
+	}
+
 	changed = 0;
 
 	if (info->attrs[NL80211_ATTR_WIPHY_RETRY_SHORT]) {
net/wireless/rdev-ops.h +11 -0
index 8ae0c04..488adb9 100644
@@ -1071,4 +1071,15 @@ rdev_set_coalesce(struct cfg80211_registered_device *rdev,
 	trace_rdev_return_int(&rdev->wiphy, ret);
 	return ret;
 }
+
+static inline int
+rdev_set_htcap_rxmask(struct cfg80211_registered_device *rdev, uint8_t *rxmask)
+{
+	int ret;
+
+	trace_rdev_set_htcap_rxmask(&rdev->wiphy, rxmask);
+	ret = rdev->ops->set_htcap_rxmask(&rdev->wiphy, rxmask);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
+}
 #endif /* __CFG80211_RDEV_OPS */
net/wireless/trace.h +15 -0
index 09b242b..d7c8c3c 100644
@@ -2120,6 +2120,21 @@ TRACE_EVENT(rdev_tdls_cancel_channel_switch,
 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(addr))
 );
 
+TRACE_EVENT(rdev_set_htcap_rxmask,
+	TP_PROTO(struct wiphy *wiphy, uint8_t *rxmask),
+	TP_ARGS(wiphy, rxmask),
+	TP_STRUCT__entry(
+		WIPHY_ENTRY
+		__array(uint8_t, rxmask, IEEE80211_HT_MCS_MASK_LEN)
+	),
+	TP_fast_assign(
+		WIPHY_ASSIGN;
+		memcpy(__entry->rxmask, rxmask, IEEE80211_HT_MCS_MASK_LEN);
+	),
+	TP_printk(WIPHY_PR_FMT ", %*ph",
+		  WIPHY_PR_ARG, IEEE80211_HT_MCS_MASK_LEN, &__entry->rxmask[0])
+);
+
 /*************************************************************
  *	     cfg80211 exported functions traces		     *
  *************************************************************/
Signature · 1 line
1.9.1
maintainer
#3 lore raw
In reply to Cedric DEBARGE

[reducing CC list]

Quoted 5 lines · Cedric DEBARGE

This patchset allows the ht_caps mcs rxmask to be defined on the fly. It applies the given rxmask to all available bands.

This is actually limited to radio cards without internal rc.

Curious. Ben Greear had suggested something that seems rather similar. What are you working on that you need this?

I think my comments to him apply to this too - see the thread at
http://thread.gmane.org/gmane.linux.kernel.wireless.general/143789

johannes

#4 lore raw
Quoted 1 line

What are you working on that you need this?

We are working on critical industrial networks where a specific (generally high) bandwidth is required.
Supressing low MCSs (that are not able to handle the desired bandwidth) allows us to be sure that the wireless link can sustain the requested bandwidth. If the radio conditions do not allow high enough MCSs, we prefer increase the AP density rather than not being able to communicate at the requested speed.

Quoted 2 lines

I think my comments to him apply to this too - see the thread at
http://thread.gmane.org/gmane.linux.kernel.wireless.general/143789

Thanks for the link, I didn't noticed Ben Grear's request.
According to the given patches, it seems the targeted goal is quite similar. So your comments also apply on my demand.

Anyway, thanks for your answer.

Cedric

maintainer
#5 lore raw
Quoted 10 lines · Cédric Debarge - ACKSYS
Quoted 1 line

What are you working on that you need this?

We are working on critical industrial networks where a specific (generally high) bandwidth is required.
Supressing low MCSs (that are not able to handle the desired bandwidth) allows us to be sure that the wireless link can sustain the requested bandwidth.
If the radio conditions do not allow high enough MCSs, we prefer increase the AP density rather than not being able to communicate at the requested speed.

Interesting. So are you saying that you're trying to disable the low(er) rates by not having the client systems advertise them, possibly because you can't manipulate the transmitter to not use them?

But that seems a bit strange, since basic/mandatory rates always need to be supported?

Quoted 6 lines
Quoted 2 lines

I think my comments to him apply to this too - see the thread at
http://thread.gmane.org/gmane.linux.kernel.wireless.general/143789

Thanks for the link, I didn't noticed Ben Grear's request. According to the given patches, it seems the targeted goal is quite similar. So your comments also apply on my demand.

It seems that your implementation is closer to what I was suggesting though :)

johannes