From: Tamizh Chelvam <tamizhr@codeaurora.org>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, Tamizh chelvam <tamizhr@codeaurora.org>
Subject: [PATCHv9 2/6] nl80211: Add support to configure TID specific retry configuration
Date: Mon, 13 Jan 2020 18:41:26 +0530 [thread overview]
Message-ID: <1578921090-9758-3-git-send-email-tamizhr@codeaurora.org> (raw)
In-Reply-To: <1578921090-9758-1-git-send-email-tamizhr@codeaurora.org>
From: Tamizh chelvam <tamizhr@codeaurora.org>
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.
Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
---
include/net/cfg80211.h | 12 ++++++++++++
include/uapi/linux/nl80211.h | 28 +++++++++++++++++++++++++++-
net/wireless/nl80211.c | 36 ++++++++++++++++++++++++++++++++++++
3 files changed, 75 insertions(+), 1 deletion(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index c5d1eb1..c2dec5e 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -600,6 +600,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),
};
/**
@@ -610,12 +614,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;
};
/**
@@ -4583,6 +4591,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 */
@@ -4727,6 +4737,8 @@ struct wiphy {
const struct cfg80211_pmsr_capabilities *pmsr_capa;
+ u8 max_data_retry_count;
+
char priv[0] __aligned(NETDEV_ALIGN);
};
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index df1ebdc..cdd259b 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2427,6 +2427,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
@@ -2893,6 +2895,7 @@ enum nl80211_attrs {
NL80211_ATTR_VLAN_ID,
NL80211_ATTR_TID_CONFIG,
+ NL80211_ATTR_MAX_RETRY_COUNT,
/* add attributes here, update the policy in nl80211.c */
@@ -4754,12 +4757,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,
@@ -5584,7 +5599,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.
@@ -5634,6 +5656,10 @@ enum nl80211_ext_feature_index {
NL80211_EXT_FEATURE_VLAN_OFFLOAD,
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,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index d20c832..bb26e3d 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -327,6 +327,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] = {
@@ -2453,6 +2455,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;
@@ -13874,6 +13882,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;
}
--
1.7.9.5
next prev parent reply other threads:[~2020-01-13 13:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-13 13:11 [PATCHv9 0/6] cfg80211/mac80211: Add support for TID specific configuration Tamizh Chelvam
2020-01-13 13:11 ` [PATCHv9 1/6] nl80211: Add NL command to support TID speicific configurations Tamizh Chelvam
2020-01-14 12:09 ` Sergey Matyukevich
2020-01-13 13:11 ` Tamizh Chelvam [this message]
2020-01-13 13:11 ` [PATCHv9 3/6] nl80211: Add support to configure TID specific AMPDU configuration Tamizh Chelvam
2020-01-13 13:11 ` [PATCHv9 4/6] nl80211: Add support to configure TID specific RTSCTS configuration Tamizh Chelvam
2020-01-13 13:11 ` [PATCHv9 5/6] nl80211: Add support to configure TID specific txrate configuration Tamizh Chelvam
2020-01-14 12:31 ` Sergey Matyukevich
2020-01-20 7:49 ` tamizhr
2020-01-13 13:11 ` [PATCHv9 6/6] mac80211: Add api to support configuring TID specific configuration Tamizh Chelvam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1578921090-9758-3-git-send-email-tamizhr@codeaurora.org \
--to=tamizhr@codeaurora.org \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).