From: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
To: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
Johannes Berg <johannes@sipsolutions.net>
Cc: Jouni Malinen <j@w1.fi>,
Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>,
Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Subject: [RFC 2/3] iw: add phy subcommands to configure aggregation
Date: Mon, 5 Nov 2018 14:30:39 +0000 [thread overview]
Message-ID: <20181105143027.17570-3-sergey.matyukevich.os@quantenna.com> (raw)
In-Reply-To: <20181105143027.17570-1-sergey.matyukevich.os@quantenna.com>
Add phy subcommands to enable/disable AMPDU/AMSDU aggregation.
Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
---
nl80211.h | 6 ++++++
phy.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 66 insertions(+)
diff --git a/nl80211.h b/nl80211.h
index 1766a12..41eec4a 100644
--- a/nl80211.h
+++ b/nl80211.h
@@ -2241,6 +2241,9 @@ enum nl80211_commands {
* association request when used with NL80211_CMD_NEW_STATION). Can be set
* only if %NL80211_STA_FLAG_WME is set.
*
+ * @NL80211_ATTR_WIPHY_AMPDU_ENABLED: enable/disable AMPDU aggregation.
+ * @NL80211_ATTR_WIPHY_AMSDU_ENABLED: enable/disable AMSDU aggregation.
+ *
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2682,6 +2685,9 @@ enum nl80211_attrs {
NL80211_ATTR_HE_CAPABILITY,
+ NL80211_ATTR_WIPHY_AMPDU_ENABLED,
+ NL80211_ATTR_WIPHY_AMSDU_ENABLED,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
diff --git a/phy.c b/phy.c
index 77df7a7..be949e7 100644
--- a/phy.c
+++ b/phy.c
@@ -843,3 +843,63 @@ static int handle_get_txq(struct nl80211_state *state,
COMMAND(get, txq, "",
NL80211_CMD_GET_WIPHY, 0, CIB_PHY, handle_get_txq,
"Get TXQ parameters.");
+
+static int handle_ampdu(struct nl80211_state *state,
+ struct nl_msg *msg,
+ int argc, char **argv,
+ enum id_input id)
+{
+ unsigned int ampdu;
+
+ if (argc != 1)
+ return 1;
+
+ if (strcmp(argv[0], "on") == 0)
+ ampdu = 1;
+ else if (strcmp(argv[0], "off") == 0)
+ ampdu = 0;
+ else {
+ printf("Invalid parameter: %s\n", argv[0]);
+ return 2;
+ }
+
+ NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_AMPDU_ENABLED, ampdu);
+
+ return 0;
+
+ nla_put_failure:
+ return -ENOBUFS;
+}
+COMMAND(set, ampdu, "<on|off>",
+ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_ampdu,
+ "Enable/disable AMPDU aggregation.");
+
+static int handle_amsdu(struct nl80211_state *state,
+ struct nl_msg *msg,
+ int argc, char **argv,
+ enum id_input id)
+{
+ unsigned int amsdu;
+
+ if (argc != 1)
+ return 1;
+
+ if (strcmp(argv[0], "on") == 0)
+ amsdu = 1;
+ else if (strcmp(argv[0], "off") == 0)
+ amsdu = 0;
+ else {
+ printf("Invalid parameter: %s\n", argv[0]);
+ return 2;
+ }
+
+ NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_AMSDU_ENABLED, amsdu);
+
+ return 0;
+
+ nla_put_failure:
+ return -ENOBUFS;
+}
+COMMAND(set, amsdu, "<on|off>",
+ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_amsdu,
+ "Enable/disable AMSDU aggregation.");
--
2.11.0
next prev parent reply other threads:[~2018-11-05 14:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-05 14:30 [RFC 0/3] cfg80211/nl80211/iw: add basic AMPDU/AMSDU controls Sergey Matyukevich
2018-11-05 14:30 ` [RFC 1/3] cfg80211/nl80211: add wiphy flags to control aggregation Sergey Matyukevich
2018-11-05 14:30 ` Sergey Matyukevich [this message]
2018-11-05 14:30 ` [RFC 3/3] qtnfmac: add support for basic aggregation control Sergey Matyukevich
2018-11-05 20:32 ` [RFC 0/3] cfg80211/nl80211/iw: add basic AMPDU/AMSDU controls Johannes Berg
2018-11-05 20:45 ` Ben Greear
2018-11-05 22:49 ` Igor Mitsyanko
2018-11-05 22:55 ` Ben Greear
2018-11-06 10:56 ` Sergey Matyukevich
2018-11-05 22:49 ` Igor Mitsyanko
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=20181105143027.17570-3-sergey.matyukevich.os@quantenna.com \
--to=sergey.matyukevich.os@quantenna.com \
--cc=igor.mitsyanko.os@quantenna.com \
--cc=j@w1.fi \
--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).