[PATCH 14/21] AP: Retrieve CIP Capabilities and add helpers

Benjamin Berg benjamin at sipsolutions.net
Tue Oct 27 06:17:00 PDT 2026


From: Benjamin Berg <benjamin.berg at intel.com>

Fetch the CIP Capabilities from the driver and add helpers to write a
CIP Capabilities element.

Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
Reviewed-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 hostapd/main.c      |  2 ++
 src/ap/ap_config.h  |  1 +
 src/ap/ap_drv_ops.c | 16 ++++++++++++++++
 src/ap/ap_drv_ops.h |  1 +
 src/ap/hostapd.h    |  2 ++
 src/ap/ieee802_11.c | 25 +++++++++++++++++++++++++
 src/ap/ieee802_11.h |  3 +++
 7 files changed, 50 insertions(+)

diff --git a/hostapd/main.c b/hostapd/main.c
index de78a046ca..c508010e26 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -355,6 +355,8 @@ setup_mld:
 
 		hostapd_get_mld_capa(iface);
 
+		hostapd_get_cip_capa(iface);
+
 		triggs = wpa_get_wowlan_triggers(conf->wowlan_triggers, &capa);
 		if (triggs && hapd->driver->set_wowlan) {
 			if (hapd->driver->set_wowlan(hapd->drv_priv, triggs))
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index bde8165914..7ca7e0fe1f 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -1027,6 +1027,7 @@ struct hostapd_bss_config {
 	int mbssid_index;
 
 	bool spp_amsdu;
+	bool cip;
 #ifdef CONFIG_ENC_ASSOC
 	unsigned int assoc_frame_encryption:1;
 	unsigned int pmksa_caching_privacy:1;
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index 9dc8a07aef..d4ec42d688 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -1260,6 +1260,22 @@ void hostapd_get_mld_capa(struct hostapd_iface *iface)
 }
 
 
+void hostapd_get_cip_capa(struct hostapd_iface *iface)
+{
+	struct hostapd_data *hapd = iface->bss[0];
+	int res;
+
+	if (!hapd->driver || !hapd->driver->get_cip_capab)
+		return;
+
+	res = hapd->driver->get_cip_capab(hapd->drv_priv, WPA_IF_AP_BSS,
+					  &iface->cip_capa);
+
+	if (!res)
+		iface->cip_supported = true;
+}
+
+
 /**
  * hostapd_drv_do_acs - Start automatic channel selection
  * @hapd: BSS data for the device initiating ACS
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
index 5b7391e838..580b7d8286 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
@@ -166,6 +166,7 @@ int hostapd_drv_set_qos_map(struct hostapd_data *hapd, const u8 *qos_map_set,
 
 void hostapd_get_ext_capa(struct hostapd_iface *iface);
 void hostapd_get_mld_capa(struct hostapd_iface *iface);
+void hostapd_get_cip_capa(struct hostapd_iface *iface);
 
 void hostapd_get_hw_mode_any_channels(struct hostapd_data *hapd,
 				      struct hostapd_hw_modes *mode,
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index b4859979e5..68fc0a0152 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -640,6 +640,8 @@ struct hostapd_iface {
 	unsigned int extended_capa_len;
 
 	u16 mld_eml_capa, mld_mld_capa;
+	bool cip_supported;
+	u8 cip_capa;
 
 	unsigned int drv_max_acl_mac_addrs;
 
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 53dcd62034..b289407524 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -12410,3 +12410,28 @@ u8 * hostapd_eid_mbssid(struct hostapd_data *hapd_probed, u8 *eid, u8 *end,
 }
 
 #endif /* CONFIG_NATIVE_WINDOWS */
+
+size_t hostapd_eid_cip_capab_len(struct hostapd_data *hapd)
+{
+	if (!hapd->conf->cip)
+		return 0;
+
+	return 4;
+}
+
+
+u8 * hostapd_eid_cip_capab(struct hostapd_data *hapd, u8 *eid)
+{
+	u8 *pos = eid;
+
+	/* All callers should already check the station flag */
+	if (!hapd->conf->cip)
+		return pos;
+
+	*pos++ = WLAN_EID_EXTENSION;
+	*pos++ = 2;
+	*pos++ = WLAN_EID_EXT_CIP_CAPABILITIES;
+	*pos++ = hapd->iface->cip_capa;
+
+	return pos;
+}
diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h
index e0c2576a0f..fff2aa7469 100644
--- a/src/ap/ieee802_11.h
+++ b/src/ap/ieee802_11.h
@@ -354,4 +354,7 @@ void hostapd_get_uhr_capab(struct hostapd_data *hapd,
 			   struct ieee80211_uhr_capabilities *dest,
 			   size_t len);
 
+size_t hostapd_eid_cip_capab_len(struct hostapd_data *hapd);
+u8 * hostapd_eid_cip_capab(struct hostapd_data *hapd, u8 *eid);
+
 #endif /* IEEE802_11_H */
-- 
2.56.0




More information about the Hostap mailing list