This patch adds new attributes to support unsolicited broadcast probe response transmission used for in-band discovery in 6GHz band (IEEE P802.11ax/D6.0 26.17.2.3.2, AP behavior for fast passive scanning). The new attribute, NL80211_ATTR_UNSOL_BCAST_PROBE_RESP, is nested which supports following parameters: (1) NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT - Packet interval (2) NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL - Template data
Unified · Split
| @@ -1099,6 +1099,22 @@ struct cfg80211_fils_discovery { · 1098 unmodified lines | ||
| 1099 | 1099 | const u8 *tmpl; |
| 1100 | 1100 | }; |
| 1101 | 1101 | |
| 1102 | +/** | |
| 1103 | + * struct cfg80211_unsol_bcast_probe_resp - Unsolicited broadcast probe | |
| 1104 | + * response parameters in 6GHz. | |
| 1105 | + * | |
| 1106 | + * @interval: Packet interval in TUs. Maximum allowed is 20 TU, as mentioned | |
| 1107 | + * in IEEE P802.11ax/D6.0 26.17.2.3.2 - AP behavior for fast passive | |
| 1108 | + * scanning | |
| 1109 | + * @tmpl_len: Template length | |
| 1110 | + * @tmpl: Template data for probe response | |
| 1111 | + */ | |
| 1112 | +struct cfg80211_unsol_bcast_probe_resp { | |
| 1113 | + u32 interval; | |
| 1114 | + size_t tmpl_len; | |
| 1115 | + const u8 *tmpl; | |
| 1116 | +}; | |
| 1117 | + | |
| 1102 | 1118 | /** |
| 1103 | 1119 | * enum cfg80211_ap_settings_flags - AP settings flags |
| 1104 | 1120 | * |
| @@ -1147,6 +1163,7 @@ enum cfg80211_ap_settings_flags { · 42 unmodified lines | ||
| 1147 | 1163 | * @he_bss_color: BSS Color settings |
| 1148 | 1164 | * @he_oper: HE operation IE (or %NULL if HE isn't enabled) |
| 1149 | 1165 | * @fils_discovery: FILS discovery transmission parameters |
| 1166 | + * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters | |
| 1150 | 1167 | */ |
| 1151 | 1168 | struct cfg80211_ap_settings { |
| 1152 | 1169 | struct cfg80211_chan_def chandef; |
| @@ -1178,6 +1195,7 @@ struct cfg80211_ap_settings { · 25 unmodified lines | ||
| 1178 | 1195 | struct ieee80211_he_obss_pd he_obss_pd; |
| 1179 | 1196 | struct cfg80211_he_bss_color he_bss_color; |
| 1180 | 1197 | struct cfg80211_fils_discovery fils_discovery; |
| 1198 | + struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp; | |
| 1181 | 1199 | }; |
| 1182 | 1200 | |
| 1183 | 1201 | /** |
| @@ -2517,6 +2517,10 @@ enum nl80211_commands { · 2516 unmodified lines | ||
| 2517 | 2517 | * discovery. It is a nested attribute, see |
| 2518 | 2518 | * &enum nl80211_fils_discovery_attributes. |
| 2519 | 2519 | * |
| 2520 | + * @NL80211_ATTR_UNSOL_BCAST_PROBE_RESP: Optional parameter to configure | |
| 2521 | + * unsolicited broadcast probe response. It is a nested attribute, see | |
| 2522 | + * &enum nl80211_unsol_bcast_probe_resp_attributes. | |
| 2523 | + * | |
| 2520 | 2524 | * @NUM_NL80211_ATTR: total number of nl80211_attrs available |
| 2521 | 2525 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
| 2522 | 2526 | * @__NL80211_ATTR_AFTER_LAST: internal use |
| @@ -3001,6 +3005,8 @@ enum nl80211_attrs { · 478 unmodified lines | ||
| 3001 | 3005 | |
| 3002 | 3006 | NL80211_ATTR_FILS_DISCOVERY, |
| 3003 | 3007 | |
| 3008 | + NL80211_ATTR_UNSOL_BCAST_PROBE_RESP, | |
| 3009 | + | |
| 3004 | 3010 | /* add attributes here, update the policy in nl80211.c */ |
| 3005 | 3011 | |
| 3006 | 3012 | __NL80211_ATTR_AFTER_LAST, |
| @@ -5876,6 +5882,9 @@ enum nl80211_feature_flags { · 2869 unmodified lines | ||
| 5876 | 5882 | * @NL80211_EXT_FEATURE_FILS_DISCOVERY: Driver/device supports FILS discovery |
| 5877 | 5883 | * frames transmission |
| 5878 | 5884 | * |
| 5885 | + * @NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP: Driver/device supports | |
| 5886 | + * unsolicited broadcast probe response transmission | |
| 5887 | + * | |
| 5879 | 5888 | * @NUM_NL80211_EXT_FEATURES: number of extended features. |
| 5880 | 5889 | * @MAX_NL80211_EXT_FEATURES: highest extended feature index. |
| 5881 | 5890 | */ |
| @@ -5935,6 +5944,7 @@ enum nl80211_ext_feature_index { · 53 unmodified lines | ||
| 5935 | 5944 | NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK, |
| 5936 | 5945 | NL80211_EXT_FEATURE_SAE_OFFLOAD_AP, |
| 5937 | 5946 | NL80211_EXT_FEATURE_FILS_DISCOVERY, |
| 5947 | + NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP, | |
| 5938 | 5948 | |
| 5939 | 5949 | /* add new features before the definition below */ |
| 5940 | 5950 | NUM_NL80211_EXT_FEATURES, |
| @@ -7063,4 +7073,30 @@ enum nl80211_fils_discovery_attributes { · 1122 unmodified lines | ||
| 7063 | 7073 | */ |
| 7064 | 7074 | #define NL80211_FILS_DISCOVERY_TMPL_MIN_LEN 42 |
| 7065 | 7075 | |
| 7076 | +/** | |
| 7077 | + * enum nl80211_unsol_bcast_probe_resp_attributes - Unsolicited broadcast probe | |
| 7078 | + * response configuration. Applicable only in 6GHz. | |
| 7079 | + * | |
| 7080 | + * @__NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INVALID: Invalid | |
| 7081 | + * | |
| 7082 | + * @NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT: Maximum packet interval (u32, TU). | |
| 7083 | + * Allowed range: 0..20 (TU = Time Unit). IEEE P802.11ax/D6.0 | |
| 7084 | + * 26.17.2.3.2 (AP behavior for fast passive scanning). | |
| 7085 | + * @NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL: Unsolicited broadcast probe response | |
| 7086 | + * frame template (binary). | |
| 7087 | + * | |
| 7088 | + * @__NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_LAST: Internal | |
| 7089 | + * @NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX: highest attribute | |
| 7090 | + */ | |
| 7091 | +enum nl80211_unsol_bcast_probe_resp_attributes { | |
| 7092 | + __NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INVALID, | |
| 7093 | + | |
| 7094 | + NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT, | |
| 7095 | + NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL, | |
| 7096 | + | |
| 7097 | + /* keep last */ | |
| 7098 | + __NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_LAST, | |
| 7099 | + NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX = | |
| 7100 | + __NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_LAST - 1 | |
| 7101 | +}; | |
| 7066 | 7102 | #endif /* __LINUX_NL80211_H */ |
| @@ -385,6 +385,13 @@ nl80211_fils_discovery_policy[NL80211_FILS_DISCOVERY_ATTR_MAX + 1] = { · 384 unmodified lines | ||
| 385 | 385 | IEEE80211_MAX_DATA_LEN), |
| 386 | 386 | }; |
| 387 | 387 | |
| 388 | +static const struct nla_policy | |
| 389 | +nl80211_unsol_bcast_probe_resp_policy[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX + 1] = { | |
| 390 | + [NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT] = NLA_POLICY_MAX(NLA_U32, 20), | |
| 391 | + [NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL] = { .type = NLA_BINARY, | |
| 392 | + .len = IEEE80211_MAX_DATA_LEN } | |
| 393 | +}; | |
| 394 | + | |
| 388 | 395 | static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { |
| 389 | 396 | [0] = { .strict_start_type = NL80211_ATTR_HE_OBSS_PD }, |
| 390 | 397 | [NL80211_ATTR_WIPHY] = { .type = NLA_U32 }, |
| @@ -695,6 +702,8 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { · 304 unmodified lines | ||
| 695 | 702 | NLA_POLICY_EXACT_LEN(sizeof(struct ieee80211_he_6ghz_capa)), |
| 696 | 703 | [NL80211_ATTR_FILS_DISCOVERY] = |
| 697 | 704 | NLA_POLICY_NESTED(nl80211_fils_discovery_policy), |
| 705 | + [NL80211_ATTR_UNSOL_BCAST_PROBE_RESP] = | |
| 706 | + NLA_POLICY_NESTED(nl80211_unsol_bcast_probe_resp_policy), | |
| 698 | 707 | }; |
| 699 | 708 | |
| 700 | 709 | /* policy for the key attributes */ |
| @@ -4915,6 +4924,35 @@ static int nl80211_parse_fils_discovery(struct cfg80211_registered_device *rdev, · 4214 unmodified lines | ||
| 4915 | 4924 | return 0; |
| 4916 | 4925 | } |
| 4917 | 4926 | |
| 4927 | +static int | |
| 4928 | +nl80211_parse_unsol_bcast_probe_resp(struct cfg80211_registered_device *rdev, | |
| 4929 | + struct nlattr *attrs, | |
| 4930 | + struct cfg80211_ap_settings *params) | |
| 4931 | +{ | |
| 4932 | + struct nlattr *tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX + 1]; | |
| 4933 | + int ret; | |
| 4934 | + struct cfg80211_unsol_bcast_probe_resp *presp = | |
| 4935 | + ¶ms->unsol_bcast_probe_resp; | |
| 4936 | + | |
| 4937 | + if (!wiphy_ext_feature_isset(&rdev->wiphy, | |
| 4938 | + NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP)) | |
| 4939 | + return -EINVAL; | |
| 4940 | + | |
| 4941 | + ret = nla_parse_nested(tb, NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX, | |
| 4942 | + attrs, NULL, NULL); | |
| 4943 | + if (ret) | |
| 4944 | + return ret; | |
| 4945 | + | |
| 4946 | + if (!tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT] || | |
| 4947 | + !tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL]) | |
| 4948 | + return -EINVAL; | |
| 4949 | + | |
| 4950 | + presp->tmpl = nla_data(tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL]); | |
| 4951 | + presp->tmpl_len = nla_len(tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL]); | |
| 4952 | + presp->interval = nla_get_u32(tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT]); | |
| 4953 | + return 0; | |
| 4954 | +} | |
| 4955 | + | |
| 4918 | 4956 | static void nl80211_check_ap_rate_selectors(struct cfg80211_ap_settings *params, |
| 4919 | 4957 | const u8 *rates) |
| 4920 | 4958 | { |
| @@ -5231,6 +5269,14 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) · 310 unmodified lines | ||
| 5231 | 5269 | goto out; |
| 5232 | 5270 | } |
| 5233 | 5271 | |
| 5272 | + if (info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP]) { | |
| 5273 | + err = nl80211_parse_unsol_bcast_probe_resp( | |
| 5274 | + rdev, info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP], | |
| 5275 | + ¶ms); | |
| 5276 | + if (err) | |
| 5277 | + return err; | |
| 5278 | + } | |
| 5279 | + | |
| 5234 | 5280 | nl80211_calculate_ap_params(¶ms); |
| 5235 | 5281 | |
| 5236 | 5282 | if (info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT]) |