]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P2: Add support to fetch the P2P2 and PCC capability
authorVinay Gannevaram <quic_vganneva@quicinc.com>
Thu, 20 Feb 2025 06:20:22 +0000 (11:50 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 6 Mar 2025 21:36:57 +0000 (23:36 +0200)
Add support to fetch the P2P2 and PCC capability from wpa_supplicant.
This defines the driver capability bits for this and the control
interface extension. The actual driver capability fetching will be
handled in future commit(s).

Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
src/drivers/driver.h
wpa_supplicant/ctrl_iface.c

index 566475214b561499afd9e06b7eaabd74d5cd0904..1830019eed7e84ced19ee3fc6e3cd4fa4582a9cc 100644 (file)
@@ -2380,6 +2380,10 @@ struct wpa_driver_capa {
 #define WPA_DRIVER_FLAGS2_NAN_OFFLOAD          0x0000000000800000ULL
 /** Driver/device supports SPP A-MSDUs */
 #define WPA_DRIVER_FLAGS2_SPP_AMSDU            0x0000000001000000ULL
+/** Driver supports P2P V2 */
+#define WPA_DRIVER_FLAGS2_P2P_FEATURE_V2       0x0000000002000000ULL
+/** Driver supports P2P PCC mode */
+#define WPA_DRIVER_FLAGS2_P2P_FEATURE_PCC_MODE 0x0000000004000000ULL
        u64 flags2;
 
 #define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
index 91591e9db6e302a1ed658604ba9879208ec161c2..a89cb5211966679972220a27170a3590f6085446 100644 (file)
@@ -4942,6 +4942,28 @@ static int wpa_supplicant_ctrl_iface_get_capability(
                return res;
        }
 
+#ifdef CONFIG_P2P
+       if (os_strcmp(field, "p2p2") == 0) {
+               if (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_P2P_FEATURE_V2)
+                       res = os_snprintf(buf, buflen, "supported");
+               else
+                       res = os_snprintf(buf, buflen, "not supported");
+               if (os_snprintf_error(buflen, res))
+                       return -1;
+               return res;
+       }
+
+       if (os_strcmp(field, "pcc_mode") == 0) {
+               if (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_P2P_FEATURE_PCC_MODE)
+                       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_P2P */
+
        wpa_printf(MSG_DEBUG, "CTRL_IFACE: Unknown GET_CAPABILITY field '%s'",
                   field);