Skip to contentSkip to conversation

mac80211: include HT capabilities in probe request

PATCH Superseded Johannes Berg 1 participant 3 messages Mar 26, 2009 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211: include HT capabilities in probe request

Include the HT capabilities in the probe request frame.

---
 net/mac80211/ieee80211_i.h |    3 ++-
 net/mac80211/util.c        |   14 ++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
net/mac80211/ieee80211_i.h +2 -1
@@ -53,7 +53,8 @@ struct ieee80211_local;
 
 /* cfg80211 only supports 32 rates */
 #define MAC80211_PREQ_IE_LEN	( 2 + 32 /* SSID */\
-				+ 4 + 32 /* (ext) supp rates */)
+				+ 4 + 32 /* (ext) supp rates */\
+				+ sizeof(struct ieee80211_ht_cap))
 
 /*
  * Time after which we ignore scan results and no longer report/use
net/mac80211/util.c +14 -0
@@ -862,6 +862,20 @@ int ieee80211_build_preq_ies(struct ieee
 		*pos++ = rate->bitrate / 5;
 	}
 
+	if (sband->ht_cap.ht_supported) {
+		__le16 tmp = cpu_to_le16(sband->ht_cap.cap);
+
+		*pos++ = WLAN_EID_HT_CAPABILITY;
+		*pos++ = sizeof(struct ieee80211_ht_cap);
+		memset(pos, 0, sizeof(struct ieee80211_ht_cap));
+		memcpy(pos, &tmp, sizeof(u16));
+		pos += sizeof(u16);
+		/* TODO: needs a define here for << 2 */
+		*pos++ = sband->ht_cap.ampdu_factor |
+			 (sband->ht_cap.ampdu_density << 2);
+		memcpy(pos, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs));
+	}
+
 	/* if adding more here, adjust MAC80211_PREQ_IE_LEN */
 
 	if (ie) {
author maintainer
#1 lore raw
Quoted 1 line · Johannes Berg

Include the HT capabilities in the probe request frame.

this patch is broken.

johannes

author maintainer
#2 lore raw

PATCH v2 1/1 mac80211: include HT capabilities in probe request

In reply to Johannes Berg

Include the HT capabilities in the probe request frame.

---
v2: fix the HT IE

 net/mac80211/ieee80211_i.h |    3 ++-
 net/mac80211/util.c        |   16 ++++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
net/mac80211/ieee80211_i.h +2 -1
@@ -53,7 +53,8 @@ struct ieee80211_local;
 
 /* cfg80211 only supports 32 rates */
 #define MAC80211_PREQ_IE_LEN	( 2 + 32 /* SSID */\
-				+ 4 + 32 /* (ext) supp rates */)
+				+ 4 + 32 /* (ext) supp rates */\
+				+ sizeof(struct ieee80211_ht_cap))
 
 /*
  * Time after which we ignore scan results and no longer report/use
net/mac80211/util.c +16 -0
@@ -862,6 +862,22 @@ int ieee80211_build_preq_ies(struct ieee
 		*pos++ = rate->bitrate / 5;
 	}
 
+	if (sband->ht_cap.ht_supported) {
+		__le16 tmp = cpu_to_le16(sband->ht_cap.cap);
+
+		*pos++ = WLAN_EID_HT_CAPABILITY;
+		*pos++ = sizeof(struct ieee80211_ht_cap);
+		memset(pos, 0, sizeof(struct ieee80211_ht_cap));
+		memcpy(pos, &tmp, sizeof(u16));
+		pos += sizeof(u16);
+		/* TODO: needs a define here for << 2 */
+		*pos++ = sband->ht_cap.ampdu_factor |
+			 (sband->ht_cap.ampdu_density << 2);
+		memcpy(pos, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs));
+		pos += sizeof(sband->ht_cap.mcs);
+		pos += 2 + 4 + 1; /* ext info, BF cap, antsel */
+	}
+
 	/* if adding more here, adjust MAC80211_PREQ_IE_LEN */
 
 	if (ie) {