]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Show OCV and beacon protection capabilities in control interface
authorVeerendranath Jakkam <vjakkam@codeaurora.org>
Fri, 22 Jan 2021 16:27:38 +0000 (21:57 +0530)
committerJouni Malinen <j@w1.fi>
Mon, 15 Feb 2021 22:47:43 +0000 (00:47 +0200)
Indicate local support for Operating Channel Validation (OCV) and beacon
protection.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
wpa_supplicant/ctrl_iface.c

index d6684451e604c7076b6d6fce5b70beb45c259309..fe338b1852b97cea9f0014b09914979d048dc658 100644 (file)
@@ -4833,6 +4833,31 @@ static int wpa_supplicant_ctrl_iface_get_capability(
        }
 #endif /* CONFIG_SAE */
 
+#ifdef CONFIG_OCV
+       if (os_strcmp(field, "ocv") == 0) {
+               if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) ||
+                   (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_OCV))
+                       res = os_snprintf(buf, buflen, "supported");
+               else
+                       res = os_snprintf(buf, buflen, "not supported");
+               if (os_snprintf_error(buflen, res))
+                       return -1;
+               return res;
+       }
+#endif /* CONFIG_OCV */
+
+       if (os_strcmp(field, "beacon_prot") == 0) {
+               if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_BEACON_PROTECTION) ||
+                   (wpa_s->drv_flags2 &
+                    WPA_DRIVER_FLAGS2_BEACON_PROTECTION_CLIENT))
+                       res = os_snprintf(buf, buflen, "supported");
+               else
+                       res = os_snprintf(buf, buflen, "not supported");
+               if (os_snprintf_error(buflen, res))
+                       return -1;
+               return res;
+       }
+
        wpa_printf(MSG_DEBUG, "CTRL_IFACE: Unknown GET_CAPABILITY field '%s'",
                   field);