Skip to contentSkip to conversation

cfg80211/mac80211: Add support for TID specific configuration

PATCH In review Tamizh Chelvam 3 participants 11 messages Jan 20, 2020 – Feb 24, 2020

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

v10 cover cfg80211/mac80211: Add support for TID specific configuration

From: Tamizh chelvam <[email protected]>

Add infrastructure to support per TID configurations like noack policy, retry count, AMPDU control(disable/enable), RTSCTS control(enable/disable) and TX rate mask configurations.
This will be useful for the driver which can supports data TID specific configuration rather than phy level configurations. Here NL80211_CMD_SET_TID_CONFIG added to support this operation by accepting TID configuration.
This command can accept STA mac addreess to make the configuration station specific rather than applying to all the connected stations to the netdev.
And this nested command configuration can accept multiple number of data TID specific configuration in a single command,
enum ieee80211_tid_conf_mask used to notify the driver that which configuration got modified for the TID.

Tamizh chelvam (6):
nl80211: Add NL command to support TID speicific configurations
nl80211: Add support to configure TID specific retry configuration
nl80211: Add support to configure TID specific AMPDU configuration
nl80211: Add support to configure TID specific RTSCTS configuration
nl80211: Add support to configure TID specific txrate configuration
mac80211: Add api to support configuring TID specific configuration

 include/net/cfg80211.h       |   65 ++++++++++
 include/net/mac80211.h       |   10 ++
 include/uapi/linux/nl80211.h |  140 +++++++++++++++++++++
 net/mac80211/cfg.c           |   56 +++++++++
 net/mac80211/driver-ops.h    |   27 ++++
 net/wireless/nl80211.c       |  287 +++++++++++++++++++++++++++++++++++++++---
 net/wireless/rdev-ops.h      |   24 ++++
 net/wireless/trace.h         |   37 ++++++
 8 files changed, 629 insertions(+), 17 deletions(-)

v10:
* Addressed Sergey comments.

v9:
* Modified to accept multiple TIDs.
* Splitted retry_short and retry_long as separate parameter
* Introduced new api to reset tid config

v8:
* Fixed enum typecast warning.

v7:
* Fixed compilation error and removed tid config variables from mac80211

v6:
* Addressed Johannes comments.

v5:
* Fixed possible memleak of 'tid_conf' in nl80211_set_tid_config.

v4:
* Fixed kbuild warnings.

v3:
* Modified "nl80211: Add netlink attribute to configure TID specific tx rate" patch to accept multiple TX rate configuration at a time.
* Modified noack and ampdu variable data type to int in
"mac80211: Add api to support configuring TID specific configuration" patch to store default configuration.
* Modified "ath10k: Add new api to support TID specific configuration" patch to handle default values for noack and ampdu. And added sta pointer sanity check in ath10k_mac_tid_bitrate_config function.
* Fixed "ath10k: Add extended TID configuration support" wmi command parameters assigned part.

v2:
* Added support to accept multiple TID configuration
* Added support to configure TX rate and RTSCTS control

Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v10 1/6 nl80211: Add NL command to support TID speicific configurations

From: Tamizh chelvam <[email protected]>

Add the new NL80211_CMD_SET_TID_CONFIG command to support data TID specific configuration. Per TID configuration is passed in the nested NL80211_ATTR_TID_CONFIG attribute.

This patch adds support to configure per TID noack policy through the NL80211_TID_CONFIG_ATTR_NOACK attribute.

---
 include/net/cfg80211.h       |   40 ++++++++++++
 include/uapi/linux/nl80211.h |   71 ++++++++++++++++++++
 net/wireless/nl80211.c       |  148 ++++++++++++++++++++++++++++++++++++++++++
 net/wireless/rdev-ops.h      |   24 +++++++
 net/wireless/trace.h         |   37 +++++++++++
 5 files changed, 320 insertions(+)
include/net/cfg80211.h +40 -0
index fa027d0..9b1415d 100644
@@ -624,6 +624,38 @@ struct cfg80211_chan_def {
 	struct ieee80211_edmg edmg;
 };
 
+enum ieee80211_tid_conf_mask {
+	IEEE80211_TID_CONF_NOACK	= BIT(NL80211_TID_CONFIG_ATTR_NOACK),
+};
+
+/**
+ * struct ieee80211_tid_cfg - TID specific configuration
+ * @config_override: Flag to notify driver to reset TID configuration
+ *	of the peer.
+ * @tid: TID number
+ * @tid_conf_mask: bitmap indicating which parameter changed
+ *	see &enum ieee80211_tid_conf_mask
+ * @noack: noack configuration value for the TID
+ */
+struct ieee80211_tid_cfg {
+	bool config_override;
+	u8 tid;
+	u32 tid_conf_mask;
+	enum nl80211_tid_config noack;
+};
+
+/**
+ * struct ieee80211_tid_config - TID configuration
+ * @peer: Station's MAC address
+ * @n_tid_conf: Number of TID specific configurations to be applied
+ * @tid_conf: Configuration change info
+ */
+struct ieee80211_tid_config {
+	const u8 *peer;
+	u32 n_tid_conf;
+	struct ieee80211_tid_cfg tid_conf[];
+};
+
 /**
  * cfg80211_get_chandef_type - return old channel type from chandef
  * @chandef: the channel definition
@@ -3664,6 +3696,10 @@ struct cfg80211_update_owe_info {
  *
  * @probe_mesh_link: Probe direct Mesh peer's link quality by sending data frame
  *	and overrule HWMP path selection algorithm.
+ * @set_tid_config: TID specific configuration, this can be peer or BSS specific
+ *	This callback may sleep.
+ * @reset_tid_config: Reset TID specific configuration for the peer.
+ *	This callback may sleep.
  */
 struct cfg80211_ops {
 	int	(*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -3982,6 +4018,10 @@ struct cfg80211_ops {
 				   struct cfg80211_update_owe_info *owe_info);
 	int	(*probe_mesh_link)(struct wiphy *wiphy, struct net_device *dev,
 				   const u8 *buf, size_t len);
+	int     (*set_tid_config)(struct wiphy *wiphy, struct net_device *dev,
+				  struct ieee80211_tid_config *tid_conf);
+	int	(*reset_tid_config)(struct wiphy *wiphy, struct net_device *dev,
+				    const u8 *peer, u8 tid);
 };
 
 /*
include/uapi/linux/nl80211.h +71 -0

119 lines not on this page · raw message

net/wireless/nl80211.c +148 -0

172 lines not on this page · raw message

net/wireless/rdev-ops.h +24 -0
index e853a4f..582a617 100644
@@ -1299,4 +1299,28 @@ static inline int rdev_update_owe_info(struct cfg80211_registered_device *rdev,
 	return ret;
 }
 
+static inline int rdev_set_tid_config(struct cfg80211_registered_device *rdev,
+				      struct net_device *dev,
+				      struct ieee80211_tid_config *tid_conf)
+{
+	int ret;
+
+	trace_rdev_set_tid_config(&rdev->wiphy, dev, tid_conf);
+	ret = rdev->ops->set_tid_config(&rdev->wiphy, dev, tid_conf);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
+}
+
+static inline int rdev_reset_tid_config(struct cfg80211_registered_device *rdev,
+					struct net_device *dev, const u8 *peer,
+					u8 tid)
+{
+	int ret;
+
+	trace_rdev_reset_tid_config(&rdev->wiphy, dev, peer, tid);
+	ret = rdev->ops->reset_tid_config(&rdev->wiphy, dev, peer, tid);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
+}
+
 #endif /* __CFG80211_RDEV_OPS */
net/wireless/trace.h +37 -0
index d98ad2b..c2c188c 100644
@@ -3458,6 +3458,43 @@
 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(dest))
 );
 
+TRACE_EVENT(rdev_set_tid_config,
+	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
+		 struct ieee80211_tid_config *tid_conf),
+	TP_ARGS(wiphy, netdev, tid_conf),
+	TP_STRUCT__entry(
+		WIPHY_ENTRY
+		NETDEV_ENTRY
+		MAC_ENTRY(peer)
+	),
+	TP_fast_assign(
+		WIPHY_ASSIGN;
+		NETDEV_ASSIGN;
+		MAC_ASSIGN(peer, tid_conf->peer);
+	),
+	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: " MAC_PR_FMT,
+		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer))
+);
+
+TRACE_EVENT(rdev_reset_tid_config,
+	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
+		 const u8 *peer, u8 tid),
+	TP_ARGS(wiphy, netdev, peer, tid),
+	TP_STRUCT__entry(
+		WIPHY_ENTRY
+		NETDEV_ENTRY
+		MAC_ENTRY(peer)
+		__field(u8, tid)
+	),
+	TP_fast_assign(
+		WIPHY_ASSIGN;
+		NETDEV_ASSIGN;
+		MAC_ASSIGN(peer, peer);
+		__entry->tid = tid;
+	),
+	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: " MAC_PR_FMT ", tid: %u",
+		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer), __entry->tid)
+);
 #endif /* !__RDEV_OPS_TRACE || TRACE_HEADER_MULTI_READ */
 
 #undef TRACE_INCLUDE_PATH
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v10 2/6 nl80211: Add support to configure TID specific retry configuration

In reply to Tamizh Chelvam

From: Tamizh chelvam <[email protected]>

This patch adds support to configure per TID retry configuration through the NL80211_TID_CONFIG_ATTR_RETRY_SHORT and NL80211_TID_CONFIG_ATTR_RETRY_LONG attributes. This TID specific retry configuration will have more precedence than phy level configuration.

---
 include/net/cfg80211.h       |   12 ++++++++++++
 include/uapi/linux/nl80211.h |   27 +++++++++++++++++++++++++++
 net/wireless/nl80211.c       |   36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 75 insertions(+)
include/net/cfg80211.h +12 -0
index 9b1415d..1c3d78a 100644
@@ -626,6 +626,10 @@ struct cfg80211_chan_def {
 
 enum ieee80211_tid_conf_mask {
 	IEEE80211_TID_CONF_NOACK	= BIT(NL80211_TID_CONFIG_ATTR_NOACK),
+	IEEE80211_TID_CONF_RETRY_SHORT	=
+				BIT(NL80211_TID_CONFIG_ATTR_RETRY_SHORT),
+	IEEE80211_TID_CONF_RETRY_LONG	=
+				BIT(NL80211_TID_CONFIG_ATTR_RETRY_LONG),
 };
 
 /**
@@ -636,12 +640,16 @@ enum ieee80211_tid_conf_mask {
  * @tid_conf_mask: bitmap indicating which parameter changed
  *	see &enum ieee80211_tid_conf_mask
  * @noack: noack configuration value for the TID
+ * @retry_long: retry count value
+ * @retry_short: retry count value
  */
 struct ieee80211_tid_cfg {
 	bool config_override;
 	u8 tid;
 	u32 tid_conf_mask;
 	enum nl80211_tid_config noack;
+	int retry_long;
+	int retry_short;
 };
 
 /**
@@ -4611,6 +4619,8 @@ struct cfg80211_pmsr_capabilities {
  *	@support_mbssid must be set for this to have any effect.
  *
  * @pmsr_capa: peer measurement capabilities
+ * @max_data_retry_count: Maximum limit can be configured as retry count
+ *	for a TID.
  */
 struct wiphy {
 	/* assign these fields before you register the wiphy */
@@ -4755,6 +4765,8 @@ struct wiphy {
 
 	const struct cfg80211_pmsr_capabilities *pmsr_capa;
 
+	u8 max_data_retry_count;
+
 	char priv[0] __aligned(NETDEV_ALIGN);
 };
 
include/uapi/linux/nl80211.h +27 -0
index b8d4721..e7cdca5 100644
@@ -2430,6 +2430,8 @@ enum nl80211_commands {
  *
  * @NL80211_ATTR_TID_CONFIG: TID specific configuration in a
  *	nested attribute with &enum nl80211_tid_config_attr sub-attributes.
+ * @NL80211_ATTR_MAX_RETRY_COUNT: The upper limit for the retry count
+ *	configuration that the driver can accept.
  *
  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
  * @NL80211_ATTR_MAX: highest attribute number currently defined
@@ -2898,6 +2900,7 @@ enum nl80211_attrs {
 	NL80211_ATTR_HE_BSS_COLOR,
 
 	NL80211_ATTR_TID_CONFIG,
+	NL80211_ATTR_MAX_RETRY_COUNT,
 
 	/* add attributes here, update the policy in nl80211.c */
 
@@ -4759,12 +4762,24 @@ enum nl80211_tid_config {
  * @NL80211_TID_CONFIG_ATTR_NOACK: Configure ack policy for the TID.
  *	specified in %NL80211_TID_CONFIG_ATTR_TID. see %enum nl80211_tid_config.
  *	Its type is u8.
+ * @NL80211_TID_CONFIG_ATTR_RETRY_SHORT: Number of retries used with data frame
+ *	transmission, user-space sets this configuration in
+ *	&NL80211_CMD_SET_TID_CONFIG. It is u8 type, min value is 1 and
+ *	the max value should be advertised by the driver through
+ *	max_data_retry_count.
+ * @NL80211_TID_CONFIG_ATTR_RETRY_LONG: Number of retries used with data frame
+ *	transmission, user-space sets this configuration in
+ *	&NL80211_CMD_SET_TID_CONFIG. Its type is u8, min value is 1 and
+ *	the max value should be advertised by the driver through
+ *	max_data_retry_count.
  */
 enum nl80211_tid_config_attr {
 	__NL80211_TID_CONFIG_ATTR_INVALID,
 	NL80211_TID_CONFIG_ATTR_OVERRIDE,
 	NL80211_TID_CONFIG_ATTR_TIDS,
 	NL80211_TID_CONFIG_ATTR_NOACK,
+	NL80211_TID_CONFIG_ATTR_RETRY_SHORT,
+	NL80211_TID_CONFIG_ATTR_RETRY_LONG,
 
 	/* keep last */
 	__NL80211_TID_CONFIG_ATTR_AFTER_LAST,
@@ -5593,6 +5608,14 @@ enum nl80211_feature_flags {
  *	policy functionality.
  * @NL80211_EXT_FEATURE_PER_STA_NOACK_CONFIG: Driver supports STA specific NoAck
  *	policy functionality.
+ * @NL80211_EXT_FEATURE_PER_TID_RETRY_SHORT_CONFIG: Driver supports per TID data
+ *	retry_short count functionality.
+ * @NL80211_EXT_FEATURE_PER_STA_RETRY_SHORT_CONFIG: Driver supports STA specific
+ *	data retry_long count functionality.
+ * @NL80211_EXT_FEATURE_PER_TID_RETRY_LONG_CONFIG: Driver supports per TID data
+ *	retry_long count functionality.
+ * @NL80211_EXT_FEATURE_PER_STA_RETRY_LONG_CONFIG: Driver supports STA specific
+ *	data retry_long count functionality.
  *
  * @NUM_NL80211_EXT_FEATURES: number of extended features.
  * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
@@ -5643,6 +5666,10 @@ enum nl80211_ext_feature_index {
 	NL80211_EXT_FEATURE_AQL,
 	NL80211_EXT_FEATURE_PER_TID_NOACK_CONFIG,
 	NL80211_EXT_FEATURE_PER_STA_NOACK_CONFIG,
+	NL80211_EXT_FEATURE_PER_TID_RETRY_SHORT_CONFIG,
+	NL80211_EXT_FEATURE_PER_STA_RETRY_SHORT_CONFIG,
+	NL80211_EXT_FEATURE_PER_TID_RETRY_LONG_CONFIG,
+	NL80211_EXT_FEATURE_PER_STA_RETRY_LONG_CONFIG,
 
 	/* add new features before the definition below */
 	NUM_NL80211_EXT_FEATURES,
net/wireless/nl80211.c +36 -0
index ed1a0f3..dcc4514a 100644
@@ -334,6 +334,8 @@ static int validate_ie_attr(const struct nlattr *attr,
 	[NL80211_TID_CONFIG_ATTR_TIDS] = { .type = NLA_U8 },
 	[NL80211_TID_CONFIG_ATTR_NOACK] =
 			NLA_POLICY_MAX(NLA_U8, NL80211_TID_CONFIG_DISABLE),
+	[NL80211_TID_CONFIG_ATTR_RETRY_SHORT] = NLA_POLICY_MIN(NLA_U8, 1),
+	[NL80211_TID_CONFIG_ATTR_RETRY_LONG] = NLA_POLICY_MIN(NLA_U8, 1),
 };
 
 const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
@@ -2461,6 +2463,12 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
 			    rdev->wiphy.akm_suites))
 			goto nla_put_failure;
 
+		if (rdev->wiphy.max_data_retry_count) {
+			if (nla_put_u8(msg, NL80211_ATTR_MAX_RETRY_COUNT,
+				       rdev->wiphy.max_data_retry_count))
+				goto nla_put_failure;
+		}
+
 		/* done */
 		state->split_start = 0;
 		break;
@@ -13920,6 +13928,34 @@ static int parse_tid_conf(struct cfg80211_registered_device *rdev,
 			nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_NOACK]);
 	}
 
+	if (attrs[NL80211_TID_CONFIG_ATTR_RETRY_SHORT]) {
+		err = nl80211_check_tid_config_support(rdev, extack, peer,
+						       attrs, tid_conf,
+						       RETRY_SHORT);
+		if (err)
+			return err;
+
+		tid_conf->retry_short =
+			nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_RETRY_SHORT]);
+
+		if (tid_conf->retry_short > rdev->wiphy.max_data_retry_count)
+			return -EINVAL;
+	}
+
+	if (attrs[NL80211_TID_CONFIG_ATTR_RETRY_LONG]) {
+		err = nl80211_check_tid_config_support(rdev, extack, peer,
+						       attrs, tid_conf,
+						       RETRY_LONG);
+		if (err)
+			return err;
+
+		tid_conf->retry_long =
+			nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_RETRY_LONG]);
+
+		if (tid_conf->retry_long > rdev->wiphy.max_data_retry_count)
+			return -EINVAL;
+	}
+
 	return 0;
 }
 
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH v10 3/6 nl80211: Add support to configure TID specific AMPDU configuration

In reply to Tamizh Chelvam

From: Tamizh chelvam <[email protected]>

This patch adds support to configure per TID AMPDU control configuration to enable/disable aggregation through the NL80211_TID_CONFIG_ATTR_AMPDU_CTRL attribute.

---
 include/net/cfg80211.h       |    4 ++++
 include/uapi/linux/nl80211.h |    9 +++++++++
 net/wireless/nl80211.c       |   13 +++++++++++++
 3 files changed, 26 insertions(+)
include/net/cfg80211.h +4 -0
index 1c3d78a..6575031 100644
@@ -630,6 +630,8 @@ enum ieee80211_tid_conf_mask {
 				BIT(NL80211_TID_CONFIG_ATTR_RETRY_SHORT),
 	IEEE80211_TID_CONF_RETRY_LONG	=
 				BIT(NL80211_TID_CONFIG_ATTR_RETRY_LONG),
+	IEEE80211_TID_CONF_AMPDU	=
+				BIT(NL80211_TID_CONFIG_ATTR_AMPDU_CTRL),
 };
 
 /**
@@ -642,6 +644,7 @@ enum ieee80211_tid_conf_mask {
  * @noack: noack configuration value for the TID
  * @retry_long: retry count value
  * @retry_short: retry count value
+ * @ampdu: Enable/Disable aggregation
  */
 struct ieee80211_tid_cfg {
 	bool config_override;
@@ -650,6 +653,7 @@ struct ieee80211_tid_cfg {
 	enum nl80211_tid_config noack;
 	int retry_long;
 	int retry_short;
+	enum nl80211_tid_config ampdu;
 };
 
 /**
include/uapi/linux/nl80211.h +9 -0
index e7cdca5..9814794 100644
@@ -4772,6 +4772,8 @@ enum nl80211_tid_config {
  *	&NL80211_CMD_SET_TID_CONFIG. Its type is u8, min value is 1 and
  *	the max value should be advertised by the driver through
  *	max_data_retry_count.
+ * @NL80211_TID_CONFIG_ATTR_AMPDU_CTRL: Enable/Disable aggregation for the TID
+ *	specified in %NL80211_TID_CONFIG_ATTR_TIDS. Its type is u8,
  */
 enum nl80211_tid_config_attr {
 	__NL80211_TID_CONFIG_ATTR_INVALID,
@@ -4780,6 +4782,7 @@ enum nl80211_tid_config_attr {
 	NL80211_TID_CONFIG_ATTR_NOACK,
 	NL80211_TID_CONFIG_ATTR_RETRY_SHORT,
 	NL80211_TID_CONFIG_ATTR_RETRY_LONG,
+	NL80211_TID_CONFIG_ATTR_AMPDU_CTRL,
 
 	/* keep last */
 	__NL80211_TID_CONFIG_ATTR_AFTER_LAST,
@@ -5616,6 +5619,10 @@ enum nl80211_feature_flags {
  *	retry_long count functionality.
  * @NL80211_EXT_FEATURE_PER_STA_RETRY_LONG_CONFIG: Driver supports STA specific
  *	data retry_long count functionality.
+ * @NL80211_EXT_FEATURE_PER_TID_AMPDU_CTRL_CONFIG: Driver supports TID specific
+ *	aggregation control(enable/disable).
+ * @NL80211_EXT_FEATURE_PER_STA_AMPDU_CTRL_CONFIG: Driver supports per STA
+ *	specific TID aggregation control(enable/disable).
  *
  * @NUM_NL80211_EXT_FEATURES: number of extended features.
  * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
@@ -5670,6 +5677,8 @@ enum nl80211_ext_feature_index {
 	NL80211_EXT_FEATURE_PER_STA_RETRY_SHORT_CONFIG,
 	NL80211_EXT_FEATURE_PER_TID_RETRY_LONG_CONFIG,
 	NL80211_EXT_FEATURE_PER_STA_RETRY_LONG_CONFIG,
+	NL80211_EXT_FEATURE_PER_TID_AMPDU_CTRL_CONFIG,
+	NL80211_EXT_FEATURE_PER_STA_AMPDU_CTRL_CONFIG,
 
 	/* add new features before the definition below */
 	NUM_NL80211_EXT_FEATURES,
net/wireless/nl80211.c +13 -0
index dcc4514a..3138412 100644
@@ -336,6 +336,8 @@ static int validate_ie_attr(const struct nlattr *attr,
 			NLA_POLICY_MAX(NLA_U8, NL80211_TID_CONFIG_DISABLE),
 	[NL80211_TID_CONFIG_ATTR_RETRY_SHORT] = NLA_POLICY_MIN(NLA_U8, 1),
 	[NL80211_TID_CONFIG_ATTR_RETRY_LONG] = NLA_POLICY_MIN(NLA_U8, 1),
+	[NL80211_TID_CONFIG_ATTR_AMPDU_CTRL] =
+			NLA_POLICY_MAX(NLA_U8, NL80211_TID_CONFIG_DISABLE),
 };
 
 const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
@@ -13956,6 +13958,17 @@ static int parse_tid_conf(struct cfg80211_registered_device *rdev,
 			return -EINVAL;
 	}
 
+	if (attrs[NL80211_TID_CONFIG_ATTR_AMPDU_CTRL]) {
+		err = nl80211_check_tid_config_support(rdev, extack, peer,
+						       attrs, tid_conf,
+						       AMPDU_CTRL);
+		if (err)
+			return err;
+
+		tid_conf->ampdu =
+			nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_AMPDU_CTRL]);
+	}
+
 	return 0;
 }
 
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH v10 4/6 nl80211: Add support to configure TID specific RTSCTS configuration

In reply to Tamizh Chelvam

From: Tamizh chelvam <[email protected]>

This patch adds support to configure per TID RTSCTS control configuration to enable/disable through the NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL attribute.

---
 include/net/cfg80211.h       |    4 ++++
 include/uapi/linux/nl80211.h |    9 +++++++++
 net/wireless/nl80211.c       |   13 +++++++++++++
 3 files changed, 26 insertions(+)
include/net/cfg80211.h +4 -0
index 6575031..80fd868 100644
@@ -632,6 +632,8 @@ enum ieee80211_tid_conf_mask {
 				BIT(NL80211_TID_CONFIG_ATTR_RETRY_LONG),
 	IEEE80211_TID_CONF_AMPDU	=
 				BIT(NL80211_TID_CONFIG_ATTR_AMPDU_CTRL),
+	IEEE80211_TID_CONF_RTSCTS	=
+				BIT(NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL),
 };
 
 /**
@@ -645,6 +647,7 @@ enum ieee80211_tid_conf_mask {
  * @retry_long: retry count value
  * @retry_short: retry count value
  * @ampdu: Enable/Disable aggregation
+ * @rtscts: Enable/Disable RTS/CTS
  */
 struct ieee80211_tid_cfg {
 	bool config_override;
@@ -654,6 +657,7 @@ struct ieee80211_tid_cfg {
 	int retry_long;
 	int retry_short;
 	enum nl80211_tid_config ampdu;
+	enum nl80211_tid_config rtscts;
 };
 
 /**
include/uapi/linux/nl80211.h +9 -0
index 9814794..63f89cb 100644
@@ -4774,6 +4774,8 @@ enum nl80211_tid_config {
  *	max_data_retry_count.
  * @NL80211_TID_CONFIG_ATTR_AMPDU_CTRL: Enable/Disable aggregation for the TID
  *	specified in %NL80211_TID_CONFIG_ATTR_TIDS. Its type is u8,
+ * @NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL: Enable/Disable RTS_CTS for the TID
+ *	specified in %%NL80211_TID_CONFIG_ATTR_TIDS. It is u8 type.
  */
 enum nl80211_tid_config_attr {
 	__NL80211_TID_CONFIG_ATTR_INVALID,
@@ -4783,6 +4785,7 @@ enum nl80211_tid_config_attr {
 	NL80211_TID_CONFIG_ATTR_RETRY_SHORT,
 	NL80211_TID_CONFIG_ATTR_RETRY_LONG,
 	NL80211_TID_CONFIG_ATTR_AMPDU_CTRL,
+	NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL,
 
 	/* keep last */
 	__NL80211_TID_CONFIG_ATTR_AFTER_LAST,
@@ -5623,6 +5626,10 @@ enum nl80211_feature_flags {
  *	aggregation control(enable/disable).
  * @NL80211_EXT_FEATURE_PER_STA_AMPDU_CTRL_CONFIG: Driver supports per STA
  *	specific TID aggregation control(enable/disable).
+ * @NL80211_EXT_FEATURE_PER_TID_RTSCTS_CTRL_CONFIG: Driver supports TID specific
+ *	RTS_CTS control(enable/disable).
+ * @NL80211_EXT_FEATURE_PER_STA_RTSCTS_CTRL_CONFIG: Driver supports STA specific
+ *	RTS_CTS control(enable/disable).
  *
  * @NUM_NL80211_EXT_FEATURES: number of extended features.
  * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
@@ -5679,6 +5686,8 @@ enum nl80211_ext_feature_index {
 	NL80211_EXT_FEATURE_PER_STA_RETRY_LONG_CONFIG,
 	NL80211_EXT_FEATURE_PER_TID_AMPDU_CTRL_CONFIG,
 	NL80211_EXT_FEATURE_PER_STA_AMPDU_CTRL_CONFIG,
+	NL80211_EXT_FEATURE_PER_TID_RTSCTS_CTRL_CONFIG,
+	NL80211_EXT_FEATURE_PER_STA_RTSCTS_CTRL_CONFIG,
 
 	/* add new features before the definition below */
 	NUM_NL80211_EXT_FEATURES,
net/wireless/nl80211.c +13 -0
index 3138412..0b987c3 100644
@@ -338,6 +338,8 @@ static int validate_ie_attr(const struct nlattr *attr,
 	[NL80211_TID_CONFIG_ATTR_RETRY_LONG] = NLA_POLICY_MIN(NLA_U8, 1),
 	[NL80211_TID_CONFIG_ATTR_AMPDU_CTRL] =
 			NLA_POLICY_MAX(NLA_U8, NL80211_TID_CONFIG_DISABLE),
+	[NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL] =
+			NLA_POLICY_MAX(NLA_U8, NL80211_TID_CONFIG_DISABLE),
 };
 
 const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
@@ -13969,6 +13971,17 @@ static int parse_tid_conf(struct cfg80211_registered_device *rdev,
 			nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_AMPDU_CTRL]);
 	}
 
+	if (attrs[NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL]) {
+		err = nl80211_check_tid_config_support(rdev, extack, peer,
+						       attrs, tid_conf,
+						       RTSCTS_CTRL);
+		if (err)
+			return err;
+
+		tid_conf->rtscts =
+			nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL]);
+	}
+
 	return 0;
 }
 
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH v10 5/6 nl80211: Add support to configure TID specific txrate configuration

In reply to Tamizh Chelvam

From: Tamizh chelvam <[email protected]>

This patch adds support to configure per TID txrate configuration configuration through the NL80211_TID_CONFIG_ATTR_TX_RATE_TYPE and NL80211_TID_CONFIG_ATTR_TX_RATE
attribute. TX bitrate mask values passed
in NL80211_ATTR_TX_RATES attribute and NL80211_TID_CONFIG_ATTR_TX_RATES attribute will have types of the TX rate should be applied. This uses nl80211_parse_tx_bitrate_mask to validate and calculate the bitrate mask.

---
 include/net/cfg80211.h       |    5 +++
 include/uapi/linux/nl80211.h |   24 +++++++++++++
 net/wireless/nl80211.c       |   77 ++++++++++++++++++++++++++++++++----------
 3 files changed, 89 insertions(+), 17 deletions(-)
include/net/cfg80211.h +5 -0
index 80fd868..58363e6 100644
@@ -634,6 +634,7 @@ enum ieee80211_tid_conf_mask {
 				BIT(NL80211_TID_CONFIG_ATTR_AMPDU_CTRL),
 	IEEE80211_TID_CONF_RTSCTS	=
 				BIT(NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL),
+	IEEE80211_TID_CONF_TX_BITRATE	= BIT(NL80211_TID_CONFIG_ATTR_TX_RATE),
 };
 
 /**
@@ -648,6 +649,8 @@ enum ieee80211_tid_conf_mask {
  * @retry_short: retry count value
  * @ampdu: Enable/Disable aggregation
  * @rtscts: Enable/Disable RTS/CTS
+ * @txrate_type: TX bitrate mask type
+ * @mask: bitrate to be applied for the TID
  */
 struct ieee80211_tid_cfg {
 	bool config_override;
@@ -658,6 +661,8 @@ struct ieee80211_tid_cfg {
 	int retry_short;
 	enum nl80211_tid_config ampdu;
 	enum nl80211_tid_config rtscts;
+	enum nl80211_tx_rate_setting txrate_type;
+	struct cfg80211_bitrate_mask *mask;
 };
 
 /**
include/uapi/linux/nl80211.h +24 -0
index 63f89cb..0db55d7 100644
@@ -4741,6 +4741,18 @@ enum nl80211_tx_power_setting {
 };
 
 /**
+ * enum nl80211_tx_rate_setting - TX rate configuration type
+ * @NL80211_TX_RATE_AUTOMATIC: automatically determine TX rate
+ * @NL80211_TX_RATE_LIMITED: limit the TX rate by the TX rate parameter
+ * @NL80211_TX_RATE_FIXED: fix TX rate to the TX rate parameter
+ */
+enum nl80211_tx_rate_setting {
+	NL80211_TX_RATE_AUTOMATIC,
+	NL80211_TX_RATE_LIMITED,
+	NL80211_TX_RATE_FIXED,
+};
+
+/**
  * enum nl80211_tid_config - TID config state
  * @NL80211_TID_CONFIG_ENABLE: Enable config for the TID
  * @NL80211_TID_CONFIG_DISABLE: Disable config for the TID
@@ -4776,6 +4788,10 @@ enum nl80211_tid_config {
  *	specified in %NL80211_TID_CONFIG_ATTR_TIDS. Its type is u8,
  * @NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL: Enable/Disable RTS_CTS for the TID
  *	specified in %%NL80211_TID_CONFIG_ATTR_TIDS. It is u8 type.
+ * @NL80211_TID_CONFIG_ATTR_TX_RATE: Data frame TX rate mask should be applied
+ *	with the parameters passed through %NL80211_ATTR_TX_RATES. This
+ *	configuration is per TID, TID is specified with
+ *	%NL80211_TID_CONFIG_ATTR_TIDS.
  */
 enum nl80211_tid_config_attr {
 	__NL80211_TID_CONFIG_ATTR_INVALID,
@@ -4786,6 +4802,8 @@ enum nl80211_tid_config_attr {
 	NL80211_TID_CONFIG_ATTR_RETRY_LONG,
 	NL80211_TID_CONFIG_ATTR_AMPDU_CTRL,
 	NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL,
+	NL80211_TID_CONFIG_ATTR_TX_RATE_TYPE,
+	NL80211_TID_CONFIG_ATTR_TX_RATE,
 
 	/* keep last */
 	__NL80211_TID_CONFIG_ATTR_AFTER_LAST,
@@ -5630,6 +5648,10 @@ enum nl80211_feature_flags {
  *	RTS_CTS control(enable/disable).
  * @NL80211_EXT_FEATURE_PER_STA_RTSCTS_CTRL_CONFIG: Driver supports STA specific
  *	RTS_CTS control(enable/disable).
+ * @NL80211_EXT_FEATURE_PER_TID_TX_RATE_CONFIG: Driver supports TID specific
+ *	TX bitrate configuration.
+ * @NL80211_EXT_FEATURE_PER_STA_TX_RATE_CONFIG: Driver supports STA specific
+ *	TX bitrate configuration.
  *
  * @NUM_NL80211_EXT_FEATURES: number of extended features.
  * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
@@ -5688,6 +5710,8 @@ enum nl80211_ext_feature_index {
 	NL80211_EXT_FEATURE_PER_STA_AMPDU_CTRL_CONFIG,
 	NL80211_EXT_FEATURE_PER_TID_RTSCTS_CTRL_CONFIG,
 	NL80211_EXT_FEATURE_PER_STA_RTSCTS_CTRL_CONFIG,
+	NL80211_EXT_FEATURE_PER_TID_TX_RATE_CONFIG,
+	NL80211_EXT_FEATURE_PER_STA_TX_RATE_CONFIG,
 
 	/* add new features before the definition below */
 	NUM_NL80211_EXT_FEATURES,
net/wireless/nl80211.c +60 -17

132 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#6 lore raw

PATCH v10 6/6 mac80211: Add api to support configuring TID specific configuration

In reply to Tamizh Chelvam

From: Tamizh chelvam <[email protected]>

Implement drv_set_tid_config api to allow TID specific configuration and drv_reset_tid_config api to reset peer specific TID configuration. This per-TID onfiguration will be applied for all the connected stations when MAC is NULL.

---
 include/net/mac80211.h    |   10 ++++++++
 net/mac80211/cfg.c        |   56 +++++++++++++++++++++++++++++++++++++++++++++
 net/mac80211/driver-ops.h |   27 ++++++++++++++++++++++
 3 files changed, 93 insertions(+)
include/net/mac80211.h +10 -0
index 6d4ea71..cd57d2d 100644
@@ -3777,6 +3777,9 @@ enum ieee80211_reconfig_type {
  *
  * @start_pmsr: start peer measurement (e.g. FTM) (this call can sleep)
  * @abort_pmsr: abort peer measurement (this call can sleep)
+ * @set_tid_config: Apply TID specific configurations. This callback may sleep.
+ * @reset_tid_config: Reset TID specific configuration for the peer.
+ *	This callback may sleep.
  */
 struct ieee80211_ops {
 	void (*tx)(struct ieee80211_hw *hw,
@@ -4081,6 +4084,13 @@ struct ieee80211_ops {
 			  struct cfg80211_pmsr_request *request);
 	void (*abort_pmsr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 			   struct cfg80211_pmsr_request *request);
+	int (*set_tid_config)(struct ieee80211_hw *hw,
+			      struct ieee80211_vif *vif,
+			      struct ieee80211_sta *sta,
+			      struct ieee80211_tid_config *tid_conf);
+	int (*reset_tid_config)(struct ieee80211_hw *hw,
+				struct ieee80211_vif *vif,
+				struct ieee80211_sta *sta, u8 tid);
 };
 
 /**
net/mac80211/cfg.c +56 -0

66 lines not on this page · raw message

net/mac80211/driver-ops.h +27 -0
index 2c9b3eb8..dcbd105 100644
@@ -1358,4 +1358,31 @@ static inline void drv_del_nan_func(struct ieee80211_local *local,
 	trace_drv_return_void(local);
 }
 
+static inline int drv_set_tid_config(struct ieee80211_local *local,
+				     struct ieee80211_sub_if_data *sdata,
+				     struct ieee80211_sta *sta,
+				     struct ieee80211_tid_config *tid_conf)
+{
+	int ret;
+
+	might_sleep();
+	ret = local->ops->set_tid_config(&local->hw, &sdata->vif, sta,
+					 tid_conf);
+	trace_drv_return_int(local, ret);
+
+	return ret;
+}
+
+static inline int drv_reset_tid_config(struct ieee80211_local *local,
+				       struct ieee80211_sub_if_data *sdata,
+				       struct ieee80211_sta *sta, u8 tid)
+{
+	int ret;
+
+	might_sleep();
+	ret = local->ops->reset_tid_config(&local->hw, &sdata->vif, sta, tid);
+	trace_drv_return_int(local, ret);
+
+	return ret;
+}
 #endif /* __MAC80211_DRIVER_OPS */
Signature · 1 line
1.7.9.5
Reviewed-by on the v10 series
#7 lore raw
In reply to Tamizh Chelvam
Quoted 23 lines

Add infrastructure to support per TID configurations like noack policy, retry count, AMPDU control(disable/enable), RTSCTS control(enable/disable) and TX rate mask configurations.
This will be useful for the driver which can supports data TID specific configuration rather than phy level configurations. Here NL80211_CMD_SET_TID_CONFIG added to support this operation by accepting TID configuration.
This command can accept STA mac addreess to make the configuration station specific rather than applying to all the connected stations to the netdev.
And this nested command configuration can accept multiple number of data TID specific configuration in a single command,
enum ieee80211_tid_conf_mask used to notify the driver that which configuration got modified for the TID.

Tamizh chelvam (6):
nl80211: Add NL command to support TID speicific configurations
nl80211: Add support to configure TID specific retry configuration
nl80211: Add support to configure TID specific AMPDU configuration
nl80211: Add support to configure TID specific RTSCTS configuration
nl80211: Add support to configure TID specific txrate configuration
mac80211: Add api to support configuring TID specific configuration

Quoted 9 lines
 include/net/cfg80211.h       |   65 ++++++++++
 include/net/mac80211.h       |   10 ++
 include/uapi/linux/nl80211.h |  140 +++++++++++++++++++++
 net/mac80211/cfg.c           |   56 +++++++++
 net/mac80211/driver-ops.h    |   27 ++++
 net/wireless/nl80211.c       |  287 +++++++++++++++++++++++++++++++++++++++---
 net/wireless/rdev-ops.h      |   24 ++++
 net/wireless/trace.h         |   37 ++++++
 8 files changed, 629 insertions(+), 17 deletions(-)

Hello Tamizh,

Thanks for you fixes and patience! The last two versions look pretty good to me.

Regards,
Sergey

#8 lore raw
Quoted 34 lines · Sergey Matyukevich
Quoted 23 lines

Add infrastructure to support per TID configurations like noack policy, retry count, AMPDU control(disable/enable), RTSCTS control(enable/disable) and TX rate mask configurations.
This will be useful for the driver which can supports data TID specific configuration rather than phy level configurations. Here NL80211_CMD_SET_TID_CONFIG added to support this operation by accepting TID configuration.
This command can accept STA mac addreess to make the configuration station specific rather than applying to all the connected stations to the netdev.
And this nested command configuration can accept multiple number of data TID specific configuration in a single command,
enum ieee80211_tid_conf_mask used to notify the driver that which configuration got modified for the TID.

Tamizh chelvam (6):
nl80211: Add NL command to support TID speicific configurations
nl80211: Add support to configure TID specific retry configuration
nl80211: Add support to configure TID specific AMPDU configuration
nl80211: Add support to configure TID specific RTSCTS configuration
nl80211: Add support to configure TID specific txrate configuration
mac80211: Add api to support configuring TID specific configuration

Quoted 10 lines
 include/net/cfg80211.h       |   65 ++++++++++
 include/net/mac80211.h       |   10 ++
 include/uapi/linux/nl80211.h |  140 +++++++++++++++++++++
 net/mac80211/cfg.c           |   56 +++++++++
 net/mac80211/driver-ops.h    |   27 ++++
 net/wireless/nl80211.c       |  287 
+++++++++++++++++++++++++++++++++++++++---
 net/wireless/rdev-ops.h      |   24 ++++
 net/wireless/trace.h         |   37 ++++++
 8 files changed, 629 insertions(+), 17 deletions(-)
Quoted 7 lines

Hello Tamizh,

Thanks for you fixes and patience! The last two versions look pretty good to me.

Sergey,

Thanks for your continuous support in reviewing this patchset:)

Thanks,
Tamizh.

maintainer
#9 lore raw
In reply to Tamizh Chelvam

Hi,

I've finally applied most of this.

However, I made some significant changes to how the feature is advertised to userspace to simplify the code; I also made some other changes all over, please check the patch I inserted in the middle and the rebase of the others.

I also didn't apply the last patch so please respin that with the new code, but I don't like the fact that the driver needs to free the buffer there - please find a different solution for that.

johannes

maintainer
#10 lore raw
Quoted 10 lines · Johannes Berg

Hi,

I've finally applied most of this.

However, I made some significant changes to how the feature is advertised to userspace to simplify the code; I also made some other changes all over, please check the patch I inserted in the middle and the rebase of the others.

I also didn't apply the last patch

Oops, I meant patch 5, the last of the new features.

johannes