2020-01-06 15:10:55

by Markus Theil

[permalink] [raw]
Subject: [PATCH 0/4] parse more events, updates for 5.5

Markus Theil (4):
iw: event: handle interface add/del
iw: event: parse stop ap and frame wait cancel events
update nl80211.h
iw: info: add missing extended flags for 5.5

event.c | 36 +++++++++++++++++++++++++++++++-----
info.c | 7 +++++--
nl80211.h | 39 +++++++++++++++++++++++++++++++++++++++
3 files changed, 75 insertions(+), 7 deletions(-)

--
2.24.1


2020-01-06 15:10:55

by Markus Theil

[permalink] [raw]
Subject: [PATCH 4/4] iw: info: add missing extended flags for 5.5

Add missing flags and reorder TXQ and airtime related flags
next to each other again. (Thanks Toke for the hint).
---
info.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/info.c b/info.c
index 0f24dae..04f4bd7 100644
--- a/info.c
+++ b/info.c
@@ -679,6 +679,10 @@ broken_combination:
ext_feat_print(tb, ACK_SIGNAL_SUPPORT,
"ack signal level support");
ext_feat_print(tb, TXQS, "FQ-CoDel-enabled intermediate TXQs");
+ ext_feat_print(tb, AIRTIME_FAIRNESS,
+ "airtime fairness scheduling");
+ ext_feat_print(tb, AQL,
+ "Airtime Queue Limits (AQL)");
ext_feat_print(tb, SCAN_RANDOM_SN,
"use random sequence numbers in scans");
ext_feat_print(tb, SCAN_MIN_PREQ_CONTENT,
@@ -687,8 +691,6 @@ broken_combination:
"can safely replace PTK 0 when rekeying");
ext_feat_print(tb, ENABLE_FTM_RESPONDER,
"enable FTM (Fine Time Measurement) responder");
- ext_feat_print(tb, AIRTIME_FAIRNESS,
- "airtime fairness scheduling");
ext_feat_print(tb, AP_PMKSA_CACHING,
"PMKSA caching supported in AP mode");
ext_feat_print(tb, SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD,
@@ -696,6 +698,7 @@ broken_combination:
ext_feat_print(tb, EXT_KEY_ID, "extended key ID support");
ext_feat_print(tb, STA_TX_PWR, "TX power control per station");
ext_feat_print(tb, SAE_OFFLOAD, "SAE offload support");
+ ext_feat_print(tb, VLAN_OFFLOAD, "VLAN offload support");
}

if (tb_msg[NL80211_ATTR_COALESCE_RULE]) {
--
2.24.1

2020-01-06 15:11:03

by Markus Theil

[permalink] [raw]
Subject: [PATCH 3/4] update nl80211.h

Signed-off-by: Markus Theil <[email protected]>
---
nl80211.h | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

diff --git a/nl80211.h b/nl80211.h
index beee59c..5eab191 100644
--- a/nl80211.h
+++ b/nl80211.h
@@ -248,6 +248,22 @@
* %NL80211_ATTR_SAE_PASSWORD.
*/

+/**
+ * DOC: VLAN offload support for setting group keys and binding STAs to VLANs
+ *
+ * By setting @NL80211_EXT_FEATURE_VLAN_OFFLOAD flag drivers can indicate they
+ * support offloading VLAN functionality in a manner where the driver exposes a
+ * single netdev that uses VLAN tagged frames and separate VLAN-specific netdevs
+ * can then be added using RTM_NEWLINK/IFLA_VLAN_ID similarly to the Ethernet
+ * case. Frames received from stations that are not assigned to any VLAN are
+ * delivered on the main netdev and frames to such stations can be sent through
+ * that main netdev.
+ *
+ * %NL80211_CMD_NEW_KEY (for group keys), %NL80211_CMD_NEW_STATION, and
+ * %NL80211_CMD_SET_STATION will optionally specify vlan_id using
+ * %NL80211_ATTR_VLAN_ID.
+ */
+
/**
* enum nl80211_commands - supported nl80211 commands
*
@@ -571,6 +587,14 @@
* set of BSSID,frequency parameters is used (i.e., either the enforcing
* %NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict
* %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT).
+ * Driver shall not modify the IEs specified through %NL80211_ATTR_IE if
+ * %NL80211_ATTR_MAC is included. However, if %NL80211_ATTR_MAC_HINT is
+ * included, these IEs through %NL80211_ATTR_IE are specified by the user
+ * space based on the best possible BSS selected. Thus, if the driver ends
+ * up selecting a different BSS, it can modify these IEs accordingly (e.g.
+ * userspace asks the driver to perform PMKSA caching with BSS1 and the
+ * driver ends up selecting BSS2 with different PMKSA cache entry; RSNIE
+ * has to get updated with the apt PMKID).
* %NL80211_ATTR_PREV_BSSID can be used to request a reassociation within
* the ESS in case the device is already associated and an association with
* a different BSS is desired.
@@ -2373,6 +2397,9 @@ enum nl80211_commands {
* the allowed channel bandwidth configurations. (u8 attribute)
* Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13.
*
+ * @NL80211_ATTR_VLAN_ID: VLAN ID (1..4094) for the station and VLAN group key
+ * (u16).
+ *
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2835,6 +2862,8 @@ enum nl80211_attrs {
NL80211_ATTR_WIPHY_EDMG_CHANNELS,
NL80211_ATTR_WIPHY_EDMG_BW_CONFIG,

+ NL80211_ATTR_VLAN_ID,
+
/* add attributes here, update the policy in nl80211.c */

__NL80211_ATTR_AFTER_LAST,
@@ -5484,6 +5513,14 @@ enum nl80211_feature_flags {
* @NL80211_EXT_FEATURE_SAE_OFFLOAD: Device wants to do SAE authentication in
* station mode (SAE password is passed as part of the connect command).
*
+ * @NL80211_EXT_FEATURE_VLAN_OFFLOAD: The driver supports a single netdev
+ * with VLAN tagged frames and separate VLAN-specific netdevs added using
+ * vconfig similarly to the Ethernet case.
+ *
+ * @NL80211_EXT_FEATURE_AQL: The driver supports the Airtime Queue Limit (AQL)
+ * feature, which prevents bufferbloat by using the expected transmission
+ * time to limit the amount of data buffered in the hardware.
+ *
* @NUM_NL80211_EXT_FEATURES: number of extended features.
* @MAX_NL80211_EXT_FEATURES: highest extended feature index.
*/
@@ -5529,6 +5566,8 @@ enum nl80211_ext_feature_index {
NL80211_EXT_FEATURE_EXT_KEY_ID,
NL80211_EXT_FEATURE_STA_TX_PWR,
NL80211_EXT_FEATURE_SAE_OFFLOAD,
+ NL80211_EXT_FEATURE_VLAN_OFFLOAD,
+ NL80211_EXT_FEATURE_AQL,

/* add new features before the definition below */
NUM_NL80211_EXT_FEATURES,
--
2.24.1

2020-01-06 15:11:39

by Markus Theil

[permalink] [raw]
Subject: [PATCH 1/4] iw: event: handle interface add/del

Signed-off-by: Markus Theil <[email protected]>
---
event.c | 28 +++++++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/event.c b/event.c
index 2a12ca6..baeafae 100644
--- a/event.c
+++ b/event.c
@@ -668,9 +668,22 @@ static void parse_new_peer_candidate(struct nlattr **attrs)
printf("\n");
}

-static void parse_set_interface(struct nlattr **attrs)
+static void parse_recv_interface(struct nlattr **attrs, int command)
{
- printf("set interface");
+ switch (command) {
+ case NL80211_CMD_NEW_INTERFACE:
+ printf("new interface");
+ break;
+ case NL80211_CMD_DEL_INTERFACE:
+ printf("del interface");
+ break;
+ case NL80211_CMD_SET_INTERFACE:
+ printf("set interface");
+ break;
+ default:
+ printf("unknown interface command (%i) received\n", command);
+ return;
+ }

if (attrs[NL80211_ATTR_IFTYPE]) {
printf(" type ");
@@ -787,8 +800,11 @@ static int print_event(struct nl_msg *msg, void *arg)
genlmsg_attrlen(gnlh, 0), NULL);

if (tb[NL80211_ATTR_IFINDEX] && tb[NL80211_ATTR_WIPHY]) {
- if_indextoname(nla_get_u32(tb[NL80211_ATTR_IFINDEX]), ifname);
- printf("%s (phy #%d): ", ifname, nla_get_u32(tb[NL80211_ATTR_WIPHY]));
+ /* if_indextoname may fails on delete interface/wiphy event */
+ if(if_indextoname(nla_get_u32(tb[NL80211_ATTR_IFINDEX]), ifname))
+ printf("%s (phy #%d): ", ifname, nla_get_u32(tb[NL80211_ATTR_WIPHY]));
+ else
+ printf("phy #%d: ", nla_get_u32(tb[NL80211_ATTR_WIPHY]));
} else if (tb[NL80211_ATTR_WDEV] && tb[NL80211_ATTR_WIPHY]) {
printf("wdev 0x%llx (phy #%d): ",
(unsigned long long)nla_get_u64(tb[NL80211_ATTR_WDEV]),
@@ -1095,8 +1111,10 @@ static int print_event(struct nl_msg *msg, void *arg)
case NL80211_CMD_NEW_PEER_CANDIDATE:
parse_new_peer_candidate(tb);
break;
+ case NL80211_CMD_NEW_INTERFACE:
case NL80211_CMD_SET_INTERFACE:
- parse_set_interface(tb);
+ case NL80211_CMD_DEL_INTERFACE:
+ parse_recv_interface(tb, gnlh->cmd);
break;
case NL80211_CMD_STA_OPMODE_CHANGED:
parse_sta_opmode_changed(tb);
--
2.24.1