nl80211: Add support to configure TID specific AMPDU configuration
authorTamizh chelvam <tamizhr@codeaurora.org>
Mon, 20 Jan 2020 07:51:24 +0000 (13:21 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 24 Feb 2020 12:56:49 +0000 (13:56 +0100)
This patch adds support to configure per TID AMPDU control
configuration to enable/disable aggregation through the
NL80211_TID_CONFIG_ATTR_AMPDU_CTRL attribute.

Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
Link: https://lore.kernel.org/r/1579506687-18296-4-git-send-email-tamizhr@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/cfg80211.h
include/uapi/linux/nl80211.h
net/wireless/nl80211.c

index 98981d1a026b68a84e8c5af2f644dea437a4417e..78171ae01406635e49232a5bbeb9ea0239500a2d 100644 (file)
@@ -636,6 +636,7 @@ struct cfg80211_chan_def {
  * @noack: noack configuration value for the TID
  * @retry_long: retry count value
  * @retry_short: retry count value
+ * @ampdu: Enable/Disable aggregation
  */
 struct cfg80211_tid_cfg {
        bool config_override;
@@ -643,6 +644,7 @@ struct cfg80211_tid_cfg {
        u32 mask;
        enum nl80211_tid_config noack;
        u8 retry_long, retry_short;
+       enum nl80211_tid_config ampdu;
 };
 
 /**
index c3481e1feebeefe63b634fa1ed7f484c4b1b782e..71cae33e6679ba2b727f239f29a89d2a429d6af4 100644 (file)
@@ -4795,6 +4795,9 @@ enum nl80211_tid_config {
  *     &NL80211_CMD_SET_TID_CONFIG. Its type is u8, min value is 1 and
  *     the max value is advertised by the driver in this attribute on
  *     output in wiphy capabilities.
+ * @NL80211_TID_CONFIG_ATTR_AMPDU_CTRL: Enable/Disable aggregation for the TIDs
+ *     specified in %NL80211_TID_CONFIG_ATTR_TIDS. Its type is u8, using
+ *     the values from &nl80211_tid_config.
  */
 enum nl80211_tid_config_attr {
        __NL80211_TID_CONFIG_ATTR_INVALID,
@@ -4806,6 +4809,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,
index 4c79ba685992ecec7c19a737c20ff22cd04bd45a..078d30756b3e20a4fd15d06ed460207d16e2afb7 100644 (file)
@@ -338,6 +338,8 @@ nl80211_tid_config_attr_policy[NL80211_TID_CONFIG_ATTR_MAX + 1] = {
                        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] = {
@@ -14047,6 +14049,12 @@ static int parse_tid_conf(struct cfg80211_registered_device *rdev,
                        return -EINVAL;
        }
 
+       if (attrs[NL80211_TID_CONFIG_ATTR_AMPDU_CTRL]) {
+               tid_conf->mask |= BIT(NL80211_TID_CONFIG_ATTR_AMPDU_CTRL);
+               tid_conf->ampdu =
+                       nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_AMPDU_CTRL]);
+       }
+
        if (peer)
                mask = rdev->wiphy.tid_config_support.peer;
        else