nl80211: Add FILS Discovery frame configuration

Add support for setting the parameters for FILS Discovery frame
transmission.

Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
This commit is contained in:
Aloka Dixit 2020-12-14 18:04:28 -08:00 committed by Jouni Malinen
parent 9c02a0f5a6
commit d76ba2b316
3 changed files with 40 additions and 0 deletions

View file

@ -4403,6 +4403,36 @@ static int nl80211_put_sae_pwe(struct nl_msg *msg, int pwe)
#endif /* CONFIG_SAE */ #endif /* CONFIG_SAE */
#ifdef CONFIG_FILS
static int nl80211_fils_discovery(struct i802_bss *bss, struct nl_msg *msg,
struct wpa_driver_ap_params *params)
{
struct nlattr *attr;
if (!bss->drv->fils_discovery) {
wpa_printf(MSG_ERROR,
"nl80211: Driver does not support FILS Discovery frame transmission for %s",
bss->ifname);
return -1;
}
attr = nla_nest_start(msg, NL80211_ATTR_FILS_DISCOVERY);
if (!attr ||
nla_put_u32(msg, NL80211_FILS_DISCOVERY_ATTR_INT_MIN,
params->fd_min_int) ||
nla_put_u32(msg, NL80211_FILS_DISCOVERY_ATTR_INT_MAX,
params->fd_max_int) ||
(params->fd_frame_tmpl &&
nla_put(msg, NL80211_FILS_DISCOVERY_ATTR_TMPL,
params->fd_frame_tmpl_len, params->fd_frame_tmpl)))
return -1;
nla_nest_end(msg, attr);
return 0;
}
#endif /* CONFIG_FILS */
static int wpa_driver_nl80211_set_ap(void *priv, static int wpa_driver_nl80211_set_ap(void *priv,
struct wpa_driver_ap_params *params) struct wpa_driver_ap_params *params)
{ {
@ -4688,6 +4718,11 @@ static int wpa_driver_nl80211_set_ap(void *priv,
goto fail; goto fail;
#endif /* CONFIG_SAE */ #endif /* CONFIG_SAE */
#ifdef CONFIG_FILS
if (params->fd_max_int && nl80211_fils_discovery(bss, msg, params) < 0)
goto fail;
#endif /* CONFIG_FILS */
ret = send_and_recv_msgs_owner(drv, msg, get_connect_handle(bss), 1, ret = send_and_recv_msgs_owner(drv, msg, get_connect_handle(bss), 1,
NULL, NULL, NULL, NULL); NULL, NULL, NULL, NULL);
if (ret) { if (ret) {

View file

@ -175,6 +175,7 @@ struct wpa_driver_nl80211_data {
unsigned int multicast_registrations:1; unsigned int multicast_registrations:1;
unsigned int no_rrm:1; unsigned int no_rrm:1;
unsigned int get_sta_info_vendor_cmd_avail:1; unsigned int get_sta_info_vendor_cmd_avail:1;
unsigned int fils_discovery:1;
u64 vendor_scan_cookie; u64 vendor_scan_cookie;
u64 remain_on_chan_cookie; u64 remain_on_chan_cookie;

View file

@ -648,6 +648,10 @@ static void wiphy_info_ext_feature_flags(struct wiphy_info_data *info,
if (ext_feature_isset(ext_features, len, if (ext_feature_isset(ext_features, len,
NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS)) NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS))
info->drv->multicast_registrations = 1; info->drv->multicast_registrations = 1;
if (ext_feature_isset(ext_features, len,
NL80211_EXT_FEATURE_FILS_DISCOVERY))
info->drv->fils_discovery = 1;
} }