Commit 5ef2d41a authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

mac80211: include HT capabilities in probe request

Include the HT capabilities in the probe request frame.
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent de95a54b
...@@ -822,6 +822,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) ...@@ -822,6 +822,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
struct net_device *mdev; struct net_device *mdev;
struct ieee80211_master_priv *mpriv; struct ieee80211_master_priv *mpriv;
int channels, i, j, max_bitrates; int channels, i, j, max_bitrates;
bool supp_ht;
/* /*
* generic code guarantees at least one band, * generic code guarantees at least one band,
...@@ -830,6 +831,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) ...@@ -830,6 +831,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
*/ */
channels = 0; channels = 0;
max_bitrates = 0; max_bitrates = 0;
supp_ht = false;
for (band = 0; band < IEEE80211_NUM_BANDS; band++) { for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
...@@ -846,6 +848,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) ...@@ -846,6 +848,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
if (max_bitrates < sband->n_bitrates) if (max_bitrates < sband->n_bitrates)
max_bitrates = sband->n_bitrates; max_bitrates = sband->n_bitrates;
supp_ht = supp_ht || sband->ht_cap.ht_supported;
} }
local->int_scan_req.n_channels = channels; local->int_scan_req.n_channels = channels;
...@@ -872,6 +875,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) ...@@ -872,6 +875,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
* information -- SSID is the driver's responsibility. * information -- SSID is the driver's responsibility.
*/ */
local->scan_ies_len = 4 + max_bitrates; /* (ext) supp rates */ local->scan_ies_len = 4 + max_bitrates; /* (ext) supp rates */
if (supp_ht)
local->scan_ies_len += 2 + sizeof(struct ieee80211_ht_cap);
if (!local->ops->hw_scan) { if (!local->ops->hw_scan) {
/* For hw_scan, driver needs to set these up. */ /* For hw_scan, driver needs to set these up. */
......
...@@ -861,6 +861,22 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer, ...@@ -861,6 +861,22 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
*pos++ = rate->bitrate / 5; *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 code in main.c * If adding more here, adjust code in main.c
* that calculates local->scan_ies_len. * that calculates local->scan_ies_len.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment