@@ -111,6 +111,8 @@ nl80211_scan_common(struct i802_bss *bss, u8 cmd,
struct nl_msg *msg;
size_t i;
u32 scan_flags = 0;
+ struct nlattr *nlrates;
+ unsigned char rates[12];
msg = nl80211_cmd_msg(bss, 0, cmd);
if (!msg)
@@ -133,6 +135,20 @@ nl80211_scan_common(struct i802_bss *bss, u8 cmd,
nla_nest_end(msg, ssids);
}
+ i = nl80211_build_legacy_rateset(bss->legacy_rates, 0, rates);
+ if (bss->legacy_rates & (1<<31)) {
+ /* User has specified a legacy rateset, use it. */
+ nlrates = nla_nest_start(msg, NL80211_ATTR_SCAN_SUPP_RATES);
+ if (!nlrates)
+ goto fail;
+
+ if (nla_put(msg, NL80211_BAND_2GHZ, i, rates))
+ goto fail;
+
+ /* TODO: Someday pay attention to HT/VHT rates as well? */
+ nla_nest_end(msg, nlrates);
+ }
+
if (params->extra_ies) {
wpa_hexdump(MSG_MSGDUMP, "nl80211: Scan extra IEs",
params->extra_ies, params->extra_ies_len);