diff mbox series

[PATCHv7,5/6] nl80211: Add netlink attribute to configure TID specific tx rate

Message ID 1572674870-23517-6-git-send-email-tamizhr@codeaurora.org (mailing list archive)
State Superseded
Delegated to: Johannes Berg
Headers show
Series cfg80211/mac80211: Add support for TID specific configuration | expand

Commit Message

Tamizh chelvam Nov. 2, 2019, 6:07 a.m. UTC
Introduce NL80211_TID_CONFIG_ATTR_TX_RATES in nl80211_tid_attr_config
to accept data TID specific TX bitrate configuration
through NL80211_CMD_SET_TID_CONFIG command. TID for which the
this configuration is to be applied is passed in
NL80211_TID_CONFIG_ATTR_TID 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. When the user-space wants this configuration peer specific
rather than being applied for all the connected stations,
MAC address of the peer can be passed in NL80211_ATTR_MAC attribute.

Driver supporting this feature should advertise
NL80211_EXT_FEATURE_PER_TID_TX_BITRATE_MASK and supporting per-STA data TID
TX bitrate configuration should advertise
NL80211_EXT_FEATURE_PER_STA_TX_BITRATE_MASK.

Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
---
 include/net/cfg80211.h       |    5 +++
 include/uapi/linux/nl80211.h |   39 +++++++++++++++++++++
 net/wireless/nl80211.c       |   79 +++++++++++++++++++++++++++++++++---------
 3 files changed, 106 insertions(+), 17 deletions(-)

Comments

Nathan Chancellor Nov. 3, 2019, 5:17 a.m. UTC | #1
Hi Tamizh,

On Sat, Nov 02, 2019 at 11:37:49AM +0530, Tamizh chelvam wrote:
> Introduce NL80211_TID_CONFIG_ATTR_TX_RATES in nl80211_tid_attr_config
> to accept data TID specific TX bitrate configuration
> through NL80211_CMD_SET_TID_CONFIG command. TID for which the
> this configuration is to be applied is passed in
> NL80211_TID_CONFIG_ATTR_TID 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. When the user-space wants this configuration peer specific
> rather than being applied for all the connected stations,
> MAC address of the peer can be passed in NL80211_ATTR_MAC attribute.
> 
> Driver supporting this feature should advertise
> NL80211_EXT_FEATURE_PER_TID_TX_BITRATE_MASK and supporting per-STA data TID
> TX bitrate configuration should advertise
> NL80211_EXT_FEATURE_PER_STA_TX_BITRATE_MASK.
> 
> Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>

Below is a report from the 0day team doing clang builds for us, please
take a look at it when you get a chance. Mixing enums like this usually
means the code is not using the enums properly; if it is intentional,
consider explicitly casting the enum to eliminate the warning.

Cheers,
Nathan

On Sun, Nov 03, 2019 at 11:14:10AM +0800, kbuild test robot wrote:
> CC: kbuild-all@lists.01.org
> In-Reply-To: <1572674870-23517-6-git-send-email-tamizhr@codeaurora.org>
> References: <1572674870-23517-6-git-send-email-tamizhr@codeaurora.org>
> TO: Tamizh chelvam <tamizhr@codeaurora.org>
> CC: johannes@sipsolutions.net
> CC: linux-wireless@vger.kernel.org, Tamizh chelvam <tamizhr@codeaurora.org>
> 
> Hi Tamizh,
> 
> Thank you for the patch! Perhaps something to improve:
> 
> [auto build test WARNING on mac80211-next/master]
> [also build test WARNING on v5.4-rc5 next-20191031]
> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
> 
> url:    https://github.com/0day-ci/linux/commits/Tamizh-chelvam/nl80211-New-netlink-command-for-TID-specific-configuration/20191103-092741
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
> config: arm64-defconfig (attached as .config)
> compiler: clang version 10.0.0 (git://gitmirror/llvm_project 97725707f488d3f00f94d4c4f2d9e193c302b23c)
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=arm64 
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> 
> All warnings (new ones prefixed by >>):
> 
> >> net/wireless/nl80211.c:13912:11: warning: implicit conversion from enumeration type 'enum nl80211_tid_config_attr' to different enumeration type 'enum nl80211_attrs' [-Wenum-conversion]
>                            attr = NL80211_TID_CONFIG_ATTR_TX_RATES;
>                                 ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    1 warning generated.
> 
> vim +13912 net/wireless/nl80211.c
> 
>  13805	
>  13806	static int parse_tid_conf(struct cfg80211_registered_device *rdev,
>  13807				  struct nlattr *attrs[],
>  13808				  struct ieee80211_tid_cfg *tid_conf,
>  13809				  struct genl_info *info, const u8 *peer)
>  13810	{
>  13811		struct netlink_ext_ack *extack = info->extack;
>  13812		int err;
>  13813	
>  13814		tid_conf->tid = nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_TID]);
>  13815		if (attrs[NL80211_TID_CONFIG_ATTR_NOACK]) {
>  13816			err = nl80211_check_tid_config_support(rdev, extack, peer,
>  13817					attrs[NL80211_TID_CONFIG_ATTR_NOACK],
>  13818					NL80211_EXT_FEATURE_PER_TID_NOACK_CONFIG,
>  13819					NL80211_EXT_FEATURE_PER_STA_NOACK_CONFIG);
>  13820			if (err)
>  13821				return err;
>  13822	
>  13823			tid_conf->tid_conf_mask |= IEEE80211_TID_CONF_NOACK;
>  13824			tid_conf->noack =
>  13825				nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_NOACK]);
>  13826		}
>  13827	
>  13828		if (nla_get_flag(attrs[NL80211_TID_CONFIG_ATTR_RETRY])) {
>  13829			err = nl80211_check_tid_config_support(rdev, extack, peer,
>  13830					attrs[NL80211_TID_CONFIG_ATTR_RETRY],
>  13831					NL80211_EXT_FEATURE_PER_TID_RETRY_CONFIG,
>  13832					NL80211_EXT_FEATURE_PER_STA_RETRY_CONFIG);
>  13833			if (err)
>  13834				return err;
>  13835	
>  13836			tid_conf->tid_conf_mask |= IEEE80211_TID_CONF_RETRY;
>  13837			if (attrs[NL80211_TID_CONFIG_ATTR_RETRY_SHORT]) {
>  13838				tid_conf->retry_short =
>  13839				nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_RETRY_SHORT]);
>  13840				if (tid_conf->retry_short >
>  13841						rdev->wiphy.max_data_retry_count)
>  13842					return -EINVAL;
>  13843			} else {
>  13844				/* Use driver default retry count or VIF specific
>  13845				 * retry count
>  13846				 */
>  13847				tid_conf->retry_short = -1;
>  13848			}
>  13849	
>  13850			if (attrs[NL80211_TID_CONFIG_ATTR_RETRY_LONG]) {
>  13851				tid_conf->retry_long =
>  13852				nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_RETRY_LONG]);
>  13853				if (tid_conf->retry_long >
>  13854						rdev->wiphy.max_data_retry_count)
>  13855					return -EINVAL;
>  13856			} else {
>  13857				/* Use driver default retry count or VIF specific
>  13858				 * retry count
>  13859				 */
>  13860				tid_conf->retry_long = -1;
>  13861			}
>  13862		}
>  13863	
>  13864		if (attrs[NL80211_TID_CONFIG_ATTR_AMPDU_CTRL]) {
>  13865			err = nl80211_check_tid_config_support(rdev, extack, peer,
>  13866					attrs[NL80211_TID_CONFIG_ATTR_AMPDU_CTRL],
>  13867					NL80211_EXT_FEATURE_PER_TID_AMPDU_CTRL,
>  13868					NL80211_EXT_FEATURE_PER_STA_AMPDU_CTRL);
>  13869			if (err)
>  13870				return err;
>  13871	
>  13872			tid_conf->tid_conf_mask |= IEEE80211_TID_CONF_AMPDU;
>  13873			tid_conf->ampdu =
>  13874				nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_AMPDU_CTRL]);
>  13875		}
>  13876	
>  13877		if (attrs[NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL]) {
>  13878			err = nl80211_check_tid_config_support(rdev, extack, peer,
>  13879					attrs[NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL],
>  13880					NL80211_EXT_FEATURE_PER_TID_RTSCTS_CTRL,
>  13881					NL80211_EXT_FEATURE_PER_STA_RTSCTS_CTRL);
>  13882			if (err)
>  13883				return err;
>  13884	
>  13885			tid_conf->tid_conf_mask |= IEEE80211_TID_CONF_RTSCTS;
>  13886			tid_conf->rtscts =
>  13887				nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL]);
>  13888		}
>  13889	
>  13890		if (attrs[NL80211_TID_CONFIG_ATTR_TX_RATES_TYPE]) {
>  13891			int idx;
>  13892			enum nl80211_attrs attr;
>  13893	
>  13894			err = nl80211_check_tid_config_support(rdev, extack, peer,
>  13895					attrs[NL80211_TID_CONFIG_ATTR_TX_RATES_TYPE],
>  13896					NL80211_EXT_FEATURE_PER_TID_TX_BITRATE_MASK,
>  13897					NL80211_EXT_FEATURE_PER_STA_TX_BITRATE_MASK);
>  13898			if (err)
>  13899				return err;
>  13900	
>  13901			idx = NL80211_TID_CONFIG_ATTR_TX_RATES_TYPE;
>  13902			tid_conf->txrate_type = nla_get_u8(attrs[idx]);
>  13903	
>  13904			tid_conf->tid_conf_mask |= IEEE80211_TID_CONF_TX_BITRATE;
>  13905			if (tid_conf->txrate_type != NL80211_TX_RATE_AUTOMATIC) {
>  13906				tid_conf->mask =
>  13907					kzalloc(sizeof(struct cfg80211_bitrate_mask),
>  13908						GFP_KERNEL);
>  13909				if (!tid_conf->mask)
>  13910					return -ENOMEM;
>  13911	
>  13912				attr = NL80211_TID_CONFIG_ATTR_TX_RATES;
>  13913				err = nl80211_parse_tx_bitrate_mask(info, attrs, attr,
>  13914								    tid_conf->mask);
>  13915				if (err) {
>  13916					kfree(tid_conf->mask);
>  13917					return err;
>  13918				}
>  13919			} else {
>  13920				tid_conf->mask = NULL;
>  13921			}
>  13922		}
>  13923	
>  13924		return 0;
>  13925	}
>  13926	
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox series

Patch

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index deeb1c1..69f4769 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -601,6 +601,7 @@  enum ieee80211_tid_conf_mask {
 	IEEE80211_TID_CONF_RETRY	= BIT(1),
 	IEEE80211_TID_CONF_AMPDU	= BIT(2),
 	IEEE80211_TID_CONF_RTSCTS	= BIT(3),
+	IEEE80211_TID_CONF_TX_BITRATE	= BIT(4),
 };
 
 /**
@@ -613,6 +614,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 {
 	u8 tid;
@@ -622,6 +625,8 @@  struct ieee80211_tid_cfg {
 	int retry_short;
 	u8 ampdu;
 	u8 rtscts;
+	enum nl80211_tx_rate_setting txrate_type;
+	struct cfg80211_bitrate_mask *mask;
 };
 
 /**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index f75f243..034d8ff 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -4696,6 +4696,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_DEFAULT: Default config for the TID. This is to
  *	notify driver to reset the previous config and use vif specific
@@ -4791,6 +4803,25 @@  enum nl80211_tid_config {
  *	NL80211_EXT_FEATURE_PER_TID_RTSCTS_CTRL and supporting per station
  *	RTS_CTS configuration should advertise
  *	NL80211_EXT_FEATURE_PER_STA_RTSCTS_CTRL.
+ * @NL80211_TID_CONFIG_ATTR_TX_RATES: 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_TID.
+ *	If the peer MAC address is passed in %NL80211_ATTR_MAC, then this
+ *	configuration is applied to the data frame for the tid to that connected
+ *	station. This attribute will be useful to notfiy the driver that what
+ *	type of txrate should be applied(%enum enum nl80211_tx_rate_setting)
+ *	for the connected station (%NL80211_ATTR_MAC),
+ *	Station specific retry configuration is valid only for STA's
+ *	current connection. i.e. the configuration will be reset to default when
+ *	the station connects back after disconnection/roaming.
+ *	when user-space does not include %NL80211_ATTR_MAC, this configuration
+ *	should be treated as per-netdev configuration. This configuration will
+ *	be cleared when the interface goes down and on the disconnection from a
+ *	BSS. Driver supporting this feature should advertise
+ *	NL80211_EXT_FEATURE_PER_TID_TX_BITRATE_MASK and supporting per station
+ *	TX bitrate configuration should advertise
+ *	NL80211_EXT_FEATURE_PER_STA_TX_BITRATE_MASK.
  */
 enum nl80211_tid_config_attr {
 	__NL80211_TID_CONFIG_ATTR_INVALID,
@@ -4801,6 +4832,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_RATES_TYPE,
+	NL80211_TID_CONFIG_ATTR_TX_RATES,
 
 	/* keep last */
 	__NL80211_TID_CONFIG_ATTR_AFTER_LAST,
@@ -5634,6 +5667,10 @@  enum nl80211_feature_flags {
  *	RTS_CTS control(enable/disable).
  * @NL80211_EXT_FEATURE_PER_STA_RTSCTS_CTRL: Driver supports STA specific
  *	RTS_CTS control(enable/disable).
+ * @NL80211_EXT_FEATURE_PER_TID_TX_BITRATE_MASK: Driver supports TID specific
+ *	TX bitrate configuration.
+ * @NL80211_EXT_FEATURE_PER_STA_TX_BITRATE_MASK: 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 +5725,8 @@  enum nl80211_ext_feature_index {
 	NL80211_EXT_FEATURE_PER_STA_AMPDU_CTRL,
 	NL80211_EXT_FEATURE_PER_TID_RTSCTS_CTRL,
 	NL80211_EXT_FEATURE_PER_STA_RTSCTS_CTRL,
+	NL80211_EXT_FEATURE_PER_TID_TX_BITRATE_MASK,
+	NL80211_EXT_FEATURE_PER_STA_TX_BITRATE_MASK,
 
 	/* add new features before the definition below */
 	NUM_NL80211_EXT_FEATURES,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index abce915..cb1f231 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -321,6 +321,18 @@  static int validate_ie_attr(const struct nlattr *attr,
 		NLA_POLICY_RANGE(NLA_U8, 1, 20),
 };
 
+static const struct nla_policy nl80211_txattr_policy[NL80211_TXRATE_MAX + 1] = {
+	[NL80211_TXRATE_LEGACY] = { .type = NLA_BINARY,
+				    .len = NL80211_MAX_SUPP_RATES },
+	[NL80211_TXRATE_HT] = { .type = NLA_BINARY,
+				.len = NL80211_MAX_SUPP_HT_RATES },
+	[NL80211_TXRATE_VHT] = {
+		.type = NLA_EXACT_LEN_WARN,
+		.len = sizeof(struct nl80211_txrate_vht),
+	},
+	[NL80211_TXRATE_GI] = { .type = NLA_U8 },
+};
+
 static const struct nla_policy
 nl80211_tid_config_attr_policy[NL80211_TID_CONFIG_ATTR_MAX + 1] = {
 	[NL80211_TID_CONFIG_ATTR_TID] = { .type = NLA_U8 },
@@ -333,6 +345,10 @@  static int validate_ie_attr(const struct nlattr *attr,
 			NLA_POLICY_MAX(NLA_U8, NL80211_TID_CONFIG_DISABLE),
 	[NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL] =
 			NLA_POLICY_MAX(NLA_U8, NL80211_TID_CONFIG_DISABLE),
+	[NL80211_TID_CONFIG_ATTR_TX_RATES_TYPE] =
+			NLA_POLICY_MAX(NLA_U8, NL80211_TX_RATE_FIXED),
+	[NL80211_TID_CONFIG_ATTR_TX_RATES] =
+			NLA_POLICY_NESTED(nl80211_txattr_policy),
 };
 
 const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
@@ -4240,19 +4256,9 @@  static bool vht_set_mcs_mask(struct ieee80211_supported_band *sband,
 	return true;
 }
 
-static const struct nla_policy nl80211_txattr_policy[NL80211_TXRATE_MAX + 1] = {
-	[NL80211_TXRATE_LEGACY] = { .type = NLA_BINARY,
-				    .len = NL80211_MAX_SUPP_RATES },
-	[NL80211_TXRATE_HT] = { .type = NLA_BINARY,
-				.len = NL80211_MAX_SUPP_HT_RATES },
-	[NL80211_TXRATE_VHT] = {
-		.type = NLA_EXACT_LEN_WARN,
-		.len = sizeof(struct nl80211_txrate_vht),
-	},
-	[NL80211_TXRATE_GI] = { .type = NLA_U8 },
-};
-
 static int nl80211_parse_tx_bitrate_mask(struct genl_info *info,
+					 struct nlattr *attrs[],
+					 enum nl80211_attrs attr,
 					 struct cfg80211_bitrate_mask *mask)
 {
 	struct nlattr *tb[NL80211_TXRATE_MAX + 1];
@@ -4283,14 +4289,14 @@  static int nl80211_parse_tx_bitrate_mask(struct genl_info *info,
 	}
 
 	/* if no rates are given set it back to the defaults */
-	if (!info->attrs[NL80211_ATTR_TX_RATES])
+	if (!attrs[attr])
 		goto out;
 
 	/* The nested attribute uses enum nl80211_band as the index. This maps
 	 * directly to the enum nl80211_band values used in cfg80211.
 	 */
 	BUILD_BUG_ON(NL80211_MAX_SUPP_HT_RATES > IEEE80211_HT_MCS_MASK_LEN * 8);
-	nla_for_each_nested(tx_rates, info->attrs[NL80211_ATTR_TX_RATES], rem) {
+	nla_for_each_nested(tx_rates, attrs[attr], rem) {
 		enum nl80211_band band = nla_type(tx_rates);
 		int err;
 
@@ -4766,7 +4772,9 @@  static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
 		return -EINVAL;
 
 	if (info->attrs[NL80211_ATTR_TX_RATES]) {
-		err = nl80211_parse_tx_bitrate_mask(info, &params.beacon_rate);
+		err = nl80211_parse_tx_bitrate_mask(info, info->attrs,
+						    NL80211_ATTR_TX_RATES,
+						    &params.beacon_rate);
 		if (err)
 			return err;
 
@@ -10510,7 +10518,8 @@  static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
 	if (!rdev->ops->set_bitrate_mask)
 		return -EOPNOTSUPP;
 
-	err = nl80211_parse_tx_bitrate_mask(info, &mask);
+	err = nl80211_parse_tx_bitrate_mask(info, info->attrs,
+					    NL80211_ATTR_TX_RATES, &mask);
 	if (err)
 		return err;
 
@@ -11105,7 +11114,9 @@  static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info)
 	}
 
 	if (info->attrs[NL80211_ATTR_TX_RATES]) {
-		err = nl80211_parse_tx_bitrate_mask(info, &setup.beacon_rate);
+		err = nl80211_parse_tx_bitrate_mask(info, info->attrs,
+						    NL80211_ATTR_TX_RATES,
+						    &setup.beacon_rate);
 		if (err)
 			return err;
 
@@ -13914,6 +13925,40 @@  static int parse_tid_conf(struct cfg80211_registered_device *rdev,
 			nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL]);
 	}
 
+	if (attrs[NL80211_TID_CONFIG_ATTR_TX_RATES_TYPE]) {
+		int idx;
+		enum nl80211_attrs attr;
+
+		err = nl80211_check_tid_config_support(rdev, extack, peer,
+				attrs[NL80211_TID_CONFIG_ATTR_TX_RATES_TYPE],
+				NL80211_EXT_FEATURE_PER_TID_TX_BITRATE_MASK,
+				NL80211_EXT_FEATURE_PER_STA_TX_BITRATE_MASK);
+		if (err)
+			return err;
+
+		idx = NL80211_TID_CONFIG_ATTR_TX_RATES_TYPE;
+		tid_conf->txrate_type = nla_get_u8(attrs[idx]);
+
+		tid_conf->tid_conf_mask |= IEEE80211_TID_CONF_TX_BITRATE;
+		if (tid_conf->txrate_type != NL80211_TX_RATE_AUTOMATIC) {
+			tid_conf->mask =
+				kzalloc(sizeof(struct cfg80211_bitrate_mask),
+					GFP_KERNEL);
+			if (!tid_conf->mask)
+				return -ENOMEM;
+
+			attr = NL80211_TID_CONFIG_ATTR_TX_RATES;
+			err = nl80211_parse_tx_bitrate_mask(info, attrs, attr,
+							    tid_conf->mask);
+			if (err) {
+				kfree(tid_conf->mask);
+				return err;
+			}
+		} else {
+			tid_conf->mask = NULL;
+		}
+	}
+
 	return 0;
 }