[PATCH v4 02/15] mbssid: retrieve driver capabilities

Aloka Dixit quic_alokad at quicinc.com
Wed Nov 30 19:18:34 PST 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 a6268ad37afb..ce2df81c4a86 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 2a2533ff647f..49036b0f56a6 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -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 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 1c5b2f896c43..e1e17b64ef0d 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -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 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 512bbb6de291..7dc90ba17513 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -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,
+		   "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];
@@ -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;
 }
 
-- 
2.25.1




More information about the Hostap mailing list