diff mbox series

hostapd: dump VHT/HE/EHT full capabilities

Message ID 20240227171747.3033772-1-janusz.dziedzic@gmail.com
State Accepted
Headers show
Series hostapd: dump VHT/HE/EHT full capabilities | expand

Commit Message

Janusz Dziedzic Feb. 27, 2024, 5:17 p.m. UTC
Show full VHT/HE/EHT capablities for
connected stations.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
---
 src/ap/ctrl_iface_ap.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

Comments

Jouni Malinen March 3, 2024, 7:56 p.m. UTC | #1
On Tue, Feb 27, 2024 at 06:17:47PM +0100, Janusz Dziedzic wrote:
> Show full VHT/HE/EHT capablities for
> connected stations.

Thanks, applied.
diff mbox series

Patch

diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
index 537867180..e6b2a5955 100644
--- a/src/ap/ctrl_iface_ap.c
+++ b/src/ap/ctrl_iface_ap.c
@@ -364,6 +364,26 @@  static int hostapd_ctrl_iface_sta_mib(struct hostapd_data *hapd,
 			len += ret;
 	}
 
+#ifdef CONFIG_IEEE80211AX
+	if ((sta->flags & WLAN_STA_HE) && sta->he_capab) {
+		len += os_snprintf(buf + len, buflen - len, "he_capab=");
+		len += wpa_snprintf_hex(buf + len, buflen - len,
+					(const u8 *) sta->he_capab,
+					sta->he_capab_len);
+		len += os_snprintf(buf + len, buflen - len, "\n");
+	}
+#endif /* CONFIG_IEEE80211AX */
+
+#ifdef CONFIG_IEEE80211BE
+	if ((sta->flags & WLAN_STA_EHT) && sta->eht_capab) {
+		len += os_snprintf(buf + len, buflen - len, "eht_capab=");
+		len += wpa_snprintf_hex(buf + len, buflen - len,
+					(const u8 *) sta->eht_capab,
+					sta->eht_capab_len);
+		len += os_snprintf(buf + len, buflen - len, "\n");
+	}
+#endif /* CONFIG_IEEE80211BE */
+
 #ifdef CONFIG_IEEE80211AC
 	if ((sta->flags & WLAN_STA_VHT) && sta->vht_capabilities) {
 		res = os_snprintf(buf + len, buflen - len,
@@ -372,6 +392,12 @@  static int hostapd_ctrl_iface_sta_mib(struct hostapd_data *hapd,
 					       vht_capabilities_info));
 		if (!os_snprintf_error(buflen - len, res))
 			len += res;
+
+		len += os_snprintf(buf + len, buflen - len, "vht_capab=");
+		len += wpa_snprintf_hex(buf + len, buflen - len,
+					(const u8 *) sta->vht_capabilities,
+					sizeof(*sta->vht_capabilities));
+		len += os_snprintf(buf + len, buflen - len, "\n");
 	}
 #endif /* CONFIG_IEEE80211AC */