mbssid: Retrieve driver capabilities

Retrieve driver capabilities for the maximum number of interfaces for
MBSSID and the maximum allowed profile periodicity for enhanced MBSSID
advertisement.

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
This commit is contained in:
Aloka Dixit 2022-11-30 19:18:34 -08:00 committed by Jouni Malinen
parent 7452e54477
commit 78d0b98995
5 changed files with 46 additions and 2 deletions

View file

@ -241,6 +241,9 @@ static int hostapd_driver_init(struct hostapd_iface *iface)
wpa_printf(MSG_ERROR, "set_wowlan failed");
}
os_free(triggs);
iface->mbssid_max_interfaces = capa.mbssid_max_interfaces;
iface->ema_max_periodicity = capa.ema_max_periodicity;
}
return 0;

View file

@ -643,6 +643,11 @@ struct hostapd_iface {
/* Previous WMM element information */
struct hostapd_wmm_ac_params prev_wmm[WMM_AC_NUM];
/* Maximum number of interfaces supported for MBSSID advertisement */
unsigned int mbssid_max_interfaces;
/* Maximum profile periodicity for enhanced MBSSID advertisement */
unsigned int ema_max_periodicity;
int (*enable_iface_cb)(struct hostapd_iface *iface);
int (*disable_iface_cb)(struct hostapd_iface *iface);
};

View file

@ -2216,6 +2216,11 @@ struct wpa_driver_capa {
/* Maximum number of supported AKM suites in commands */
unsigned int max_num_akms;
/* Maximum number of interfaces supported for MBSSID advertisement */
unsigned int mbssid_max_interfaces;
/* Maximum profile periodicity for enhanced MBSSID advertisement */
unsigned int ema_max_periodicity;
};

View file

@ -10110,7 +10110,9 @@ static int wpa_driver_nl80211_status(void *priv, char *buf, size_t buflen)
"capa.max_conc_chan_5_0=%u\n"
"capa.max_sched_scan_plans=%u\n"
"capa.max_sched_scan_plan_interval=%u\n"
"capa.max_sched_scan_plan_iterations=%u\n",
"capa.max_sched_scan_plan_iterations=%u\n"
"capa.mbssid_max_interfaces=%u\n"
"capa.ema_max_periodicity=%u\n",
drv->capa.key_mgmt,
drv->capa.enc,
drv->capa.auth,
@ -10132,7 +10134,9 @@ static int wpa_driver_nl80211_status(void *priv, char *buf, size_t buflen)
drv->capa.max_conc_chan_5_0,
drv->capa.max_sched_scan_plans,
drv->capa.max_sched_scan_plan_interval,
drv->capa.max_sched_scan_plan_iterations);
drv->capa.max_sched_scan_plan_iterations,
drv->capa.mbssid_max_interfaces,
drv->capa.ema_max_periodicity);
if (os_snprintf_error(end - pos, res))
return pos - buf;
pos += res;

View file

@ -875,6 +875,30 @@ err:
}
static void wiphy_info_mbssid(struct wpa_driver_capa *cap, struct nlattr *attr)
{
struct nlattr *config[NL80211_MBSSID_CONFIG_ATTR_MAX + 1];
if (nla_parse_nested(config, NL80211_MBSSID_CONFIG_ATTR_MAX, attr,
NULL))
return;
if (!config[NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES])
return;
cap->mbssid_max_interfaces =
nla_get_u8(config[NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES]);
if (config[NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY])
cap->ema_max_periodicity =
nla_get_u8(config[NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY]);
wpa_printf(MSG_DEBUG,
"mbssid: max interfaces %u, max profile periodicity %u",
cap->mbssid_max_interfaces, cap->ema_max_periodicity);
}
static int wiphy_info_handler(struct nl_msg *msg, void *arg)
{
struct nlattr *tb[NL80211_ATTR_MAX + 1];
@ -1113,6 +1137,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
capa->max_num_akms =
nla_get_u16(tb[NL80211_ATTR_MAX_NUM_AKM_SUITES]);
if (tb[NL80211_ATTR_MBSSID_CONFIG])
wiphy_info_mbssid(capa, tb[NL80211_ATTR_MBSSID_CONFIG]);
return NL_SKIP;
}