[PATCH v3 02/11] mbssid: retrieve driver capabilities
Aloka Dixit
quic_alokad at quicinc.com
Wed May 11 14:15:12 PDT 2022
Retrieve driver capabilities for maximum number of interfaces for
MBSSID and maximum allowed profile periodicity for enhanced MBSSID
advertisements.
Signed-off-by: Aloka Dixit <quic_alokad at quicinc.com>
---
hostapd/main.c | 3 +++
src/ap/hostapd.h | 5 +++++
src/drivers/driver.h | 5 +++++
src/drivers/driver_nl80211_capa.c | 27 +++++++++++++++++++++++++++
4 files changed, 40 insertions(+)
diff --git a/hostapd/main.c b/hostapd/main.c
index 21932d1bea06..e13e1665b6ce 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -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;
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index 297faaf1409c..36c6a8b21d08 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -625,6 +625,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 advertisements */
+ u8 mbssid_max_interfaces;
+ /* Maximum profile periodicity for enhanced MBSSID advertisements */
+ u8 ema_max_periodicity;
+
int (*enable_iface_cb)(struct hostapd_iface *iface);
int (*disable_iface_cb)(struct hostapd_iface *iface);
};
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 677b729d5d4a..39a2e6387d8a 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -2179,6 +2179,11 @@ struct wpa_driver_capa {
/* Maximum number of supported CSA counters */
u16 max_csa_counters;
+
+ /* Maximum number of interfaces supported for MBSSID advertisements */
+ u8 mbssid_max_interfaces;
+ /* Maximum profile periodicity for enhanced MBSSID advertisements */
+ u8 ema_max_periodicity;
};
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index a0803bad046a..00c6d5d82335 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -850,6 +850,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,
+ "multiple_bssid: max interfaces %u, max profile periodicity %u\n",
+ 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];
@@ -1081,6 +1105,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
if (tb[NL80211_ATTR_WIPHY_SELF_MANAGED_REG])
capa->flags |= WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY;
+ if (tb[NL80211_ATTR_MBSSID_CONFIG])
+ wiphy_info_mbssid(capa, tb[NL80211_ATTR_MBSSID_CONFIG]);
+
return NL_SKIP;
}
--
2.31.1
More information about the Hostap
mailing list