From cf684fdfa1d3ba4c7f003c601ed1c9ba38ba81dd Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Mon, 15 Jul 2019 16:12:55 +0200 Subject: [PATCH] scan: Add option to use the NO_CCK scan flag P2P probe requests are to be sent at min 6.0 Mb/s using OFDM, specifically the 802.11b rates are prohibited (section 2.4.1 in Wi-Fi P2p Technical Spec v1.7), some of which use CCK modulation. This is already the default for 5G but for 2.4G the drivers generally do this if we set the NL80211_ATTR_TX_NO_CCK_RATE flags with NL80211_CMD_TRIGGER_SCAN. --- src/scan.c | 4 ++++ src/scan.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/scan.c b/src/scan.c index a732ec86..efe96aa3 100644 --- a/src/scan.c +++ b/src/scan.c @@ -314,6 +314,10 @@ static struct l_genl_msg *scan_build_cmd(struct scan_context *sc, if (flags) l_genl_msg_append_attr(msg, NL80211_ATTR_SCAN_FLAGS, 4, &flags); + if (params->no_cck_rates) + l_genl_msg_append_attr(msg, NL80211_ATTR_TX_NO_CCK_RATE, 0, + NULL); + return msg; } diff --git a/src/scan.h b/src/scan.h index e8b599d0..a02f487d 100644 --- a/src/scan.h +++ b/src/scan.h @@ -80,6 +80,7 @@ struct scan_parameters { struct scan_freq_set *freqs; bool flush : 1; bool randomize_mac_addr_hint : 1; + bool no_cck_rates : 1; const char *ssid; /* Used for direct probe request */ };