From 732d7813d67fc0def9410fe629039da3d1dee974 Mon Sep 17 00:00:00 2001
From: Maxime Bizon <mbizon@freebox.fr>
Date: Mon, 18 Nov 2013 17:00:34 +0100
Subject: [PATCH 04/18] hostapd: export STA HT/VHT caps

---
 src/ap/ieee802_11.c |   21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 14fb567..cec8ed6 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -2129,8 +2129,25 @@ int ieee802_11_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
 int ieee802_11_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta,
 			   char *buf, size_t buflen)
 {
-	/* TODO */
-	return 0;
+	int len = 0, ret;
+	u16 ht_caps = 0, vht_caps = 0;
+
+	if (sta->ht_capabilities)
+		ht_caps = sta->ht_capabilities->ht_capabilities_info;
+	if (sta->vht_capabilities)
+		vht_caps = sta->vht_capabilities->vht_capabilities_info;
+
+	/* Private MIB */
+	ret = os_snprintf(buf + len, buflen - len,
+			  "hostapdSTAHTCAP=0x%x\n"
+			  "hostapdSTAVHTCAP=0x%x\n",
+			  ht_caps, vht_caps);
+
+	if (ret < 0 || (size_t) ret >= buflen - len)
+		return len;
+	len += ret;
+
+	return len;
 }
 
 
-- 
1.7.9.5

