]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OCV: Don't start SA Query timer on CSA when SA Query is offloaded
authorNarasimha Rao PVS <quic_npvs@quicinc.com>
Thu, 3 Feb 2022 08:03:45 +0000 (08:03 +0000)
committerJouni Malinen <j@w1.fi>
Wed, 9 Feb 2022 18:32:17 +0000 (20:32 +0200)
Check driver support for SA Query offload in AP mode and skip starting
SA Query timer on CSA for OCV enabled STAs when the driver indicates
support for offloading SA Query procedures.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/ap/drv_callbacks.c
src/drivers/driver.h
src/drivers/driver_nl80211.c
src/drivers/driver_nl80211_capa.c

index a50e6f2afa773058d0b94d484c41c85813548b9b..d97b3535b003a60d6928bd212389fa91d01c7bde 100644 (file)
@@ -1011,7 +1011,9 @@ void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht,
                hostapd_neighbor_set_own_report(hapd->iface->bss[i]);
 
 #ifdef CONFIG_OCV
-       if (hapd->conf->ocv) {
+       if (hapd->conf->ocv &&
+           !(hapd->iface->drv_flags2 &
+             WPA_DRIVER_FLAGS2_SA_QUERY_OFFLOAD_AP)) {
                struct sta_info *sta;
                bool check_sa_query = false;
 
index 85be4c38449fa711373c264e21b552b9fb026d04..ebc550fbe630a62b2f9732bfc34f77499c23de92 100644 (file)
@@ -2027,6 +2027,8 @@ struct wpa_driver_capa {
 #define WPA_DRIVER_FLAGS2_OCV                  0x0000000000000080ULL
 /** Driver expects user space implementation of SME in AP mode */
 #define WPA_DRIVER_FLAGS2_AP_SME               0x0000000000000100ULL
+/** Driver handles SA Query procedures in AP mode */
+#define WPA_DRIVER_FLAGS2_SA_QUERY_OFFLOAD_AP  0x0000000000000200ULL
        u64 flags2;
 
 #define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
index 145f2f0d9c5c4bc79e0a1ebe5007c617c8451c4f..40b3e1b5c5ed7139d960a4c79d5b1206f5f06e62 100644 (file)
@@ -4656,10 +4656,24 @@ static int wpa_driver_nl80211_set_ap(void *priv,
             nla_put_flag(msg, NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT)))
                goto fail;
 
-       if (drv->device_ap_sme &&
-           (params->key_mgmt_suites & WPA_KEY_MGMT_SAE) &&
-           nla_put_flag(msg, NL80211_ATTR_EXTERNAL_AUTH_SUPPORT))
-               goto fail;
+       if (drv->device_ap_sme) {
+               u32 flags = 0;
+
+               if (params->key_mgmt_suites & WPA_KEY_MGMT_SAE) {
+                       /* Add the previously used flag attribute to support
+                        * older kernel versions and the newer flag bit for
+                        * newer kernels. */
+                       if (nla_put_flag(msg,
+                                        NL80211_ATTR_EXTERNAL_AUTH_SUPPORT))
+                               goto fail;
+                       flags |= NL80211_AP_SETTINGS_EXTERNAL_AUTH_SUPPORT;
+               }
+
+               flags |= NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT;
+
+               if (nla_put_u32(msg, NL80211_ATTR_AP_SETTINGS_FLAGS, flags))
+                       goto fail;
+       }
 
        wpa_printf(MSG_DEBUG, "nl80211: pairwise_ciphers=0x%x",
                   params->pairwise_ciphers);
index 83868b78e6f090e0aac52f9a49f259b8d4d6744e..200c545c2b700eea2ef7aa967f645c6e32cbeda9 100644 (file)
@@ -920,8 +920,15 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
        wiphy_info_tdls(capa, tb[NL80211_ATTR_TDLS_SUPPORT],
                        tb[NL80211_ATTR_TDLS_EXTERNAL_SETUP]);
 
-       if (tb[NL80211_ATTR_DEVICE_AP_SME])
+       if (tb[NL80211_ATTR_DEVICE_AP_SME]) {
+               u32 ap_sme_features_flags =
+                       nla_get_u32(tb[NL80211_ATTR_DEVICE_AP_SME]);
+
+               if (ap_sme_features_flags & NL80211_AP_SME_SA_QUERY_OFFLOAD)
+                       capa->flags2 |= WPA_DRIVER_FLAGS2_SA_QUERY_OFFLOAD_AP;
+
                info->device_ap_sme = 1;
+       }
 
        wiphy_info_feature_flags(info, tb[NL80211_ATTR_FEATURE_FLAGS]);
        wiphy_info_ext_feature_flags(info, tb[NL80211_ATTR_EXT_FEATURES]);