public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: Jouni Malinen <j@w1.fi>, linux-wireless <linux-wireless@vger.kernel.org>
Subject: [PATCH v2] mac80211: include HT capabilities in probe request
Date: Thu, 26 Mar 2009 18:51:27 +0100	[thread overview]
Message-ID: <1238089887.4331.78.camel@johannes.local> (raw)
In-Reply-To: <1238088685.4331.72.camel@johannes.local> (sfid-20090326_183202_056572_CFB0861F)

Include the HT capabilities in the probe request frame.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
v2: fix the HT IE

 net/mac80211/ieee80211_i.h |    3 ++-
 net/mac80211/util.c        |   16 ++++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

--- wireless-testing.orig/net/mac80211/ieee80211_i.h	2009-03-26 18:21:59.000000000 +0100
+++ wireless-testing/net/mac80211/ieee80211_i.h	2009-03-26 18:28:44.000000000 +0100
@@ -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
--- wireless-testing.orig/net/mac80211/util.c	2009-03-26 18:21:59.000000000 +0100
+++ wireless-testing/net/mac80211/util.c	2009-03-26 18:46:22.000000000 +0100
@@ -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) {



      parent reply	other threads:[~2009-03-26 17:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-26 17:31 [PATCH] mac80211: include HT capabilities in probe request Johannes Berg
2009-03-26 17:39 ` Johannes Berg
2009-03-26 17:51 ` Johannes Berg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1238089887.4331.78.camel@johannes.local \
    --to=johannes@sipsolutions.net \
    --cc=j@w1.fi \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox