]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mbssid: Retrieve driver capabilities
authorAloka Dixit <quic_alokad@quicinc.com>
Thu, 1 Dec 2022 03:18:34 +0000 (19:18 -0800)
committerJouni Malinen <j@w1.fi>
Fri, 2 Dec 2022 14:43:59 +0000 (16:43 +0200)
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>
hostapd/main.c
src/ap/hostapd.h
src/drivers/driver.h
src/drivers/driver_nl80211.c
src/drivers/driver_nl80211_capa.c

index a6268ad37afb3551fb912871a0d7da8b0f5f14ff..ce2df81c4a8690bd18f55762f59f11e76ba1f798 100644 (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;
index 2a2533ff647f1f9d58c2111ad7e5f6791bd2aaac..e945a211e2e7c1d62a719f9542875fda9a9d4ef5 100644 (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);
 };
index 0b019e3afd295475d2c579fb29c2fcb0e11e9bc2..b7e9774ff34a736c11ac9e6828cb6673f0faad13 100644 (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;
 };
 
 
index c3e6594f30f95510b0d7c3f2a1412a80663e47a0..cf06179a3d99270fe567741eb1257c9eebf59133 100644 (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;
index 512bbb6de2915e889bc9606ca217cd13bade35b4..bb2fd4cd05963d2d50fa349556c552a60f3228f0 100644 (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;
 }