History

wifi: nl80211: fixes to FILS discovery updates

Add a new flag 'update' which is set to true during start_ap() if (and only if) one of the following two conditions are met: - Userspace passed an empty nested attribute which indicates that the feature should be disabled and templates deleted. - Userspace passed all the parameters for the nested attribute. Existing configuration will not be changed while the flag remains false. Add similar changes for unsolicited broadcast probe response transmission.

Aloka Dixit committed 3 years ago

Commit 0cfaec21 parent e04b1973 files · +26 −5Browse files

Unified · Split

3 files
  1. include/net/cfg80211.h +4 −0
  2. include/uapi/linux/nl80211.h +7 −4
  3. net/wireless/nl80211.c +15 −1
include/net/cfg80211.h+4−0
@@ -1338,6 +1338,7 @@ struct cfg80211_acl_data { · 1337 unmodified lines
13381338 * struct cfg80211_fils_discovery - FILS discovery parameters from
13391339 * IEEE Std 802.11ai-2016, Annex C.3 MIB detail.
13401340 *
1341+ * @update: Set to true if the feature configuration should be updated.
13411342 * @min_interval: Minimum packet interval in TUs (0 - 10000)
13421343 * @max_interval: Maximum packet interval in TUs (0 - 10000)
13431344 * @tmpl_len: Template length
@@ -1345,6 +1346,7 @@ struct cfg80211_acl_data { · 1 unmodified line
13451346 * frame headers.
13461347 */
13471348 struct cfg80211_fils_discovery {
1349+ bool update;
13481350 u32 min_interval;
13491351 u32 max_interval;
13501352 size_t tmpl_len;
@@ -1355,6 +1357,7 @@ struct cfg80211_fils_discovery { · 4 unmodified lines
13551357 * struct cfg80211_unsol_bcast_probe_resp - Unsolicited broadcast probe
13561358 * response parameters in 6GHz.
13571359 *
1360+ * @update: Set to true if the feature configuration should be updated.
13581361 * @interval: Packet interval in TUs. Maximum allowed is 20 TU, as mentioned
13591362 * in IEEE P802.11ax/D6.0 26.17.2.3.2 - AP behavior for fast passive
13601363 * scanning
@@ -1362,6 +1365,7 @@ struct cfg80211_fils_discovery { · 1 unmodified line
13621365 * @tmpl: Template data for probe response
13631366 */
13641367 struct cfg80211_unsol_bcast_probe_resp {
1368+ bool update;
13651369 u32 interval;
13661370 size_t tmpl_len;
13671371 const u8 *tmpl;
include/uapi/linux/nl80211.h+7−4
@@ -2690,11 +2690,13 @@ enum nl80211_commands { · 2689 unmodified lines
26902690 *
26912691 * @NL80211_ATTR_FILS_DISCOVERY: Optional parameter to configure FILS
26922692 * discovery. It is a nested attribute, see
2693− * &enum nl80211_fils_discovery_attributes.
2693+ * &enum nl80211_fils_discovery_attributes. Userspace should pass an empty
2694+ * nested attribute to disable this feature and delete the templates.
26942695 *
26952696 * @NL80211_ATTR_UNSOL_BCAST_PROBE_RESP: Optional parameter to configure
26962697 * unsolicited broadcast probe response. It is a nested attribute, see
2697− * &enum nl80211_unsol_bcast_probe_resp_attributes.
2698+ * &enum nl80211_unsol_bcast_probe_resp_attributes. Userspace should pass an empty
2699+ * nested attribute to disable this feature and delete the templates.
26982700 *
26992701 * @NL80211_ATTR_S1G_CAPABILITY: S1G Capability information element (from
27002702 * association request when used with NL80211_CMD_NEW_STATION)
@@ -7606,7 +7608,7 @@ enum nl80211_iftype_akm_attributes { · 4905 unmodified lines
76067608 * @NL80211_FILS_DISCOVERY_ATTR_INT_MIN: Minimum packet interval (u32, TU).
76077609 * Allowed range: 0..10000 (TU = Time Unit)
76087610 * @NL80211_FILS_DISCOVERY_ATTR_INT_MAX: Maximum packet interval (u32, TU).
7609− * Allowed range: 0..10000 (TU = Time Unit)
7611+ * Allowed range: 0..10000 (TU = Time Unit). If set to 0, the feature is disabled.
76107612 * @NL80211_FILS_DISCOVERY_ATTR_TMPL: Template data for FILS discovery action
76117613 * frame including the headers.
76127614 *
@@ -7639,7 +7641,8 @@ enum nl80211_fils_discovery_attributes { · 26 unmodified lines
76397641 *
76407642 * @NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT: Maximum packet interval (u32, TU).
76417643 * Allowed range: 0..20 (TU = Time Unit). IEEE P802.11ax/D6.0
7642− * 26.17.2.3.2 (AP behavior for fast passive scanning).
7644+ * 26.17.2.3.2 (AP behavior for fast passive scanning). If set to 0, the feature is
7645+ * disabled.
76437646 * @NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL: Unsolicited broadcast probe response
76447647 * frame template (binary).
76457648 *
net/wireless/nl80211.c+15−1
@@ -5647,6 +5647,13 @@ static int nl80211_parse_fils_discovery(struct cfg80211_registered_device *rdev, · 5646 unmodified lines
56475647 if (ret)
56485648 return ret;
56495649
5650+ if (!tb[NL80211_FILS_DISCOVERY_ATTR_INT_MIN] &&
5651+ !tb[NL80211_FILS_DISCOVERY_ATTR_INT_MAX] &&
5652+ !tb[NL80211_FILS_DISCOVERY_ATTR_TMPL]) {
5653+ fd->update = true;
5654+ return 0;
5655+ }
5656+
56505657 if (!tb[NL80211_FILS_DISCOVERY_ATTR_INT_MIN] ||
56515658 !tb[NL80211_FILS_DISCOVERY_ATTR_INT_MAX] ||
56525659 !tb[NL80211_FILS_DISCOVERY_ATTR_TMPL])
@@ -5656,7 +5663,7 @@ static int nl80211_parse_fils_discovery(struct cfg80211_registered_device *rdev, · 3 unmodified lines
56565663 fd->tmpl = nla_data(tb[NL80211_FILS_DISCOVERY_ATTR_TMPL]);
56575664 fd->min_interval = nla_get_u32(tb[NL80211_FILS_DISCOVERY_ATTR_INT_MIN]);
56585665 fd->max_interval = nla_get_u32(tb[NL80211_FILS_DISCOVERY_ATTR_INT_MAX]);
5659−
5666+ fd->update = true;
56605667 return 0;
56615668 }
56625669
@@ -5679,6 +5686,12 @@ nl80211_parse_unsol_bcast_probe_resp(struct cfg80211_registered_device *rdev, · 16 unmodified lines
56795686 if (ret)
56805687 return ret;
56815688
5689+ if (!tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT] &&
5690+ !tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL]) {
5691+ presp->update = true;
5692+ return 0;
5693+ }
5694+
56825695 if (!tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT] ||
56835696 !tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL])
56845697 return -EINVAL;
@@ -5686,6 +5699,7 @@ nl80211_parse_unsol_bcast_probe_resp(struct cfg80211_registered_device *rdev, · 1 unmodified line
56865699 presp->tmpl = nla_data(tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL]);
56875700 presp->tmpl_len = nla_len(tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL]);
56885701 presp->interval = nla_get_u32(tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT]);
5702+ presp->update = true;
56895703 return 0;
56905704 }
56915705

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t