diff mbox series

[07/21] wpa_supplicant: Add helper to check for CIP support

Message ID 20261027141645.6d1ba1b2bb0b.I3333988e6cbb7c5ec002669707d4bf9988d2e49b@changeid
State New
Headers show
Series Control Integrity Protocol (CIP) support | expand

Commit Message

Benjamin Berg Oct. 27, 2026, 1:16 p.m. UTC
From: Benjamin Berg <benjamin.berg@intel.com>

The driver flags support for CIP per interface. As such, add a function
to check for support as there is no driver flag for this.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
---
 wpa_supplicant/driver_i.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
diff mbox series

Patch

diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h
index 9122b9353b..559be7aad6 100644
--- a/wpa_supplicant/driver_i.h
+++ b/wpa_supplicant/driver_i.h
@@ -1386,4 +1386,21 @@  static inline int wpa_drv_get_inact_sec(struct wpa_supplicant *wpa_s,
 
 #endif /* CONFIG_NAN */
 
+static inline int wpa_drv_get_cip_supported(struct wpa_supplicant *wpa_s)
+{
+	enum wpa_driver_if_type iftype = WPA_IF_STATION;
+	u8 cip_capab;
+
+	if (!wpa_s->driver->get_cip_capab)
+		return 0;
+
+#ifdef CONFIG_P2P
+	if (wpa_s->go_params)
+		iftype = WPA_IF_P2P_CLIENT;
+#endif
+
+	return !wpa_s->driver->get_cip_capab(wpa_s->drv_priv, iftype,
+					     &cip_capab);
+}
+
 #endif /* DRIVER_I_H */