add Wide Band Scan support
v2 cover add Wide Band Scan support
Wide Band Scan allows to perform off-channel scan on requested channel/ frequency along with corresponding phy mode/bandwidth (40Mhz, 80Mhz).
Below are use cases of Wide Band Scan,
1. In case of phy running both AP and monitor vifs, wide band scan on a different channel along with phymode (40Mhz, 80Mhz) captures those off-channel data frames to monitor vif.
2. Doing wide band scan instead of normal 20Mhz scan before spectral dump, allows to fetch FFT reports for the complete requested bandwidth (40Mhz, 80Mhz).
Sathishkumar Muruganandam (2):
nl80211: add Wide Band Scan support
include/net/cfg80211.h | 2 ++ include/uapi/linux/nl80211.h | 7 +++++ net/mac80211/scan.c | 2 ++ net/wireless/nl80211.c | 68 ++++++++++++++++++++++++++++---------------- 4 files changed, 55 insertions(+), 24 deletions(-)
ath11k: add Wide Band Scan support
drivers/net/wireless/ath/ath11k/mac.c | 41 ++++++++++-- drivers/net/wireless/ath/ath11k/wmi.c | 115 +++++++++++++++++++++++++++++++--- drivers/net/wireless/ath/ath11k/wmi.h | 34 +++++++++- 3 files changed, 175 insertions(+), 15 deletions(-)
Signature · 1 line
2.7.4
PATCH v2 1/2 nl80211: add Wide Band Scan support
New nl80211 ext_feature and scan_flag added to support wide band scan which allows driver to scan on requested channel with corresponding phy mode/bandwidth (40Mhz, 80Mhz).
To handle center frequency of 80Mhz channel, struct cfg80211_chan_def is included in cfg80211_scan_request.
---
v2:
Updated message on cover letter
include/net/cfg80211.h | 2 ++ include/uapi/linux/nl80211.h | 7 +++++ net/mac80211/scan.c | 2 ++ net/wireless/nl80211.c | 68 ++++++++++++++++++++++++++++---------------- 4 files changed, 55 insertions(+), 24 deletions(-)
include/net/cfg80211.h +2 -0
@@ -1906,6 +1906,7 @@ struct cfg80211_scan_info {* @channels: channels to scan on. * @n_channels: total number of channels to scan * @scan_width: channel width for scanning +* @chandef: defines the channel to do wide band scan * @ie: optional information element(s) to add into Probe Request or %NULL * @ie_len: length of ie in octets * @duration: how long to listen on each channel, in TUs. If
@@ -1932,6 +1933,7 @@ struct cfg80211_scan_request {int n_ssids;u32 n_channels;enum nl80211_bss_scan_width scan_width; +struct cfg80211_chan_def *chandef;const u8 *ie;size_t ie_len;u16 duration;
include/uapi/linux/nl80211.h +7 -0
@@ -5492,6 +5492,9 @@ enum nl80211_feature_flags {* @NL80211_EXT_FEATURE_SAE_OFFLOAD: Device wants to do SAE authentication in * station mode (SAE password is passed as part of the connect command). * +* @NL80211_EXT_FEATURE_WIDE_BAND_SCAN: Driver/device supports wide band scan +* on a frequency along with its corresponding phymode (40Mhz, 80Mhz) +* * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index. */
@@ -5537,6 +5540,7 @@ enum nl80211_ext_feature_index {NL80211_EXT_FEATURE_EXT_KEY_ID ,NL80211_EXT_FEATURE_STA_TX_PWR ,NL80211_EXT_FEATURE_SAE_OFFLOAD , +NL80211_EXT_FEATURE_WIDE_BAND_SCAN ,/* add new features before the definition below */ NUM_NL80211_EXT_FEATURES,
@@ -5648,6 +5652,8 @@ enum nl80211_timeout_reason {* @NL80211_SCAN_FLAG_MIN_PREQ_CONTENT: minimize probe request content to * only have supported rates and no additional capabilities (unless * added by userspace explicitly.) +* @NL80211_SCAN_FLAG_WIDE_BAND_SCAN: This flag intends the driver to perform +* wide band scan only if the driver supports it. */ enum nl80211_scan_flags {NL80211_SCAN_FLAG_LOW_PRIORITY =1 <<0 ,
@@ -5663,6 +5669,7 @@ enum nl80211_scan_flags {NL80211_SCAN_FLAG_HIGH_ACCURACY =1 <<10 ,NL80211_SCAN_FLAG_RANDOM_SN =1 <<11 ,NL80211_SCAN_FLAG_MIN_PREQ_CONTENT =1 <<12 , + NL80211_SCAN_FLAG_WIDE_BAND_SCAN = 1<<13, };/**
net/mac80211/scan.c +2 -0
@@ -688,11 +688,13 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata, local->hw_scan_req =kmalloc (sizeof (*local->hw_scan_req) + +sizeof (*req->chandef) + req->n_channels *sizeof (req->channels[0 ]) + local->hw_scan_ies_bufsize,GFP_KERNEL );if (!local->hw_scan_req)return -ENOMEM ; + local->hw_scan_req->req.chandef = req->chandef; local->hw_scan_req->req.ssids = req->ssids; local->hw_scan_req->req.n_ssids = req->n_ssids; ies = (u8 *)local->hw_scan_req +
net/wireless/nl80211.c +44 -24
118 lines not on this page · raw message
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v2 2/2 ath11k: add Wide Band Scan support
In reply to Sathishkumar MuruganandamDoing wide band scan instead of normal 20Mhz scan before spectral dump, allows to fetch FFT reports for the complete requested bandwidth (40Mhz, 80Mhz).
Below are the FW expectations and configs from host to request Wide Band Scan,
1. SCAN_PHYMODE_SUPPORT WMI service bit advertised from FW.
2. SCAN_CHAN_LIST_CMD updated with the phymode and other channel params of the requested channel to do wide band scan.
3. START_SCAN_CMD updated with all the seven supported TLVs and PHYMODE TLV being the last. PHYMODE TLV holds the (wmi_phy_mode + 1) value corresponding to wide band scan channel. Scan flags scan_f_wide_band and scan_f_passive need to be set for wide band scan request from host.
In case of supporting NL80211_EXT_FEATURE_WIDE_BAND_SCAN, cfg80211_scan_request holds the cfg80211_chan_def of the requested channel from which we update the center frequencies and phymode params needed for SCAN_CHAN_LIST_CMD and START_SCAN_CMD to FW.
--- drivers/net/wireless/ath/ath11k/mac.c | 41 ++++++++++-- drivers/net/wireless/ath/ath11k/wmi.c | 115 +++++++++++++++++++++++++++++++--- drivers/net/wireless/ath/ath11k/wmi.h | 34 +++++++++- 3 files changed, 175 insertions(+), 15 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +37 -4
@@ -2088,6 +2088,28 @@ static int ath11k_start_scan(struct ath11k *ar,return 0 ; } +static void ath11k_mac_update_scan_params (struct cfg80211_scan_request *req, +struct scan_req_params *arg) +{ +int i; +struct wmi_chan_info *chan = &arg->chan_list.chan[0 ]; +enum nl80211_band band; +enum nl80211_chan_width width; + +if (req->chandef) { + band = req->chandef->chan->band; + width = req->chandef->width; + } + + arg->chan_list.num_chan = req->n_channels; +for (i =0 ; i < arg->chan_list.num_chan; i++) { +if (req->channels) + chan[i].freq = req->channels[i]->center_freq; +if (req->chandef) + chan[i].phymode = ath11k_phymodes[band][width]; + } +} +static int ath11k_mac_op_hw_scan (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_scan_request *hw_req)
@@ -2144,10 +2166,16 @@ static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw, arg.scan_flags |=WMI_SCAN_FLAG_PASSIVE ; } -if (req->n_channels) { - arg.num_chan = req->n_channels; -for (i =0 ; i < arg.num_chan; i++) - arg.chan_list[i] = req->channels[i]->center_freq; +if (req->n_channels) +ath11k_mac_update_scan_params (req, &arg); + +if (req->chandef) { + arg.scan_f_wide_band = true; + arg.scan_f_passive = true; + arg.chandef = req->chandef; + ret =ath11k_wmi_append_scan_chan_list (ar, &arg); +if (ret) + goto exit; } ret =ath11k_start_scan (ar, &arg);
@@ -5577,6 +5605,11 @@ static int ath11k_mac_register(struct ath11k *ar)wiphy_ext_feature_set (ar->hw->wiphy,NL80211_EXT_FEATURE_CQM_RSSI_LIST ); +if (test_bit (WMI_TLV_SERVICE_SCAN_PHYMODE_SUPPORT , + ar->ab->wmi_sc.svc_map)) +wiphy_ext_feature_set (ar->hw->wiphy, +NL80211_EXT_FEATURE_WIDE_BAND_SCAN ); + ar->hw->wiphy->cipher_suites = cipher_suites; ar->hw->wiphy->n_cipher_suites =ARRAY_SIZE (cipher_suites);
drivers/net/wireless/ath/ath11k/wmi.c +107 -8
174 lines not on this page · raw message
drivers/net/wireless/ath/ath11k/wmi.h +31 -3
@@ -2930,6 +2930,12 @@ struct wlan_ssid { };#define WMI_IE_BITMAP_SIZE 8 +#define PROBE_REQ_MAX_OUIS 16 + +struct wmi_vendor_oui { +u32 tlv_header; +u32 oui_type_subtype;/* vendor OUI type and subtype */ +};#define WMI_SCAN_MAX_NUM_SSID 0x0A/* prefix used by scan requestor ids on the host */
@@ -3051,6 +3057,22 @@ enum { ((flag) |= (((mode) <<WMI_SCAN_DWELL_MODE_SHIFT ) & \ WMI_SCAN_DWELL_MODE_MASK)) +struct wmi_chan_info { +u32 freq; +u32 phymode; +}; + +struct wmi_chan_list { +u32 num_chan; +struct wmi_chan_info chan[WLAN_SCAN_MAX_NUM_CHANNELS ]; +}; + +struct wmi_probe_req_whitelist { +u32 ie_bitmap[WMI_IE_BITMAP_SIZE ]; +u32 num_vendor_oui; +u32 voui[PROBE_REQ_MAX_OUIS ]; +}; +struct scan_req_params {u32 scan_id;u32 scan_req_id;
@@ -3111,23 +3133,24 @@ struct scan_req_params { scan_f_forced:1, scan_f_2ghz:1, scan_f_5ghz:1, - scan_f_80mhz:1; + scan_f_wide_band:1; };u32 scan_flags; };enum scan_dwelltime_adaptive_mode adaptive_dwell_time_mode;u32 burst_duration; -u32 num_chan;u32 num_bssid;u32 num_ssids;u32 n_probes; -u32 chan_list[WLAN_SCAN_MAX_NUM_CHANNELS ]; +struct wmi_chan_list chan_list; +struct cfg80211_chan_def *chandef;u32 notify_scan_events;struct wlan_ssid ssid[WLAN_SCAN_MAX_NUM_SSID ];struct wmi_mac_addr bssid_list[WLAN_SCAN_MAX_NUM_BSSID ];struct element_info extraie;struct element_info htcap;struct element_info vhtcap; +struct wmi_probe_req_whitelist ie_whitelist; };struct wmi_ssid_arg {
@@ -3470,9 +3493,12 @@ struct wmi_stop_scan_cmd {struct scan_chan_list_params {u32 pdev_id;u16 nallchans; +bool append_chan_list;struct channel_param ch_param[1 ]; }; +#define WMI_APPEND_TO_EXISTING_CHAN_LIST_FLAG BIT(0) +struct wmi_scan_chan_list_cmd {u32 tlv_header;u32 num_scan_chans;
@@ -4710,6 +4736,8 @@ int ath11k_wmi_vdev_delete(struct ath11k *ar, u8 vdev_id);void ath11k_wmi_start_scan_init (struct ath11k *ar,struct scan_req_params *arg);int ath11k_wmi_send_scan_start_cmd (struct ath11k *ar,struct scan_req_params *params); +int ath11k_wmi_append_scan_chan_list (struct ath11k *ar, +struct scan_req_params *params);int ath11k_wmi_send_scan_stop_cmd (struct ath11k *ar,struct scan_cancel_param *param); int ath11k_wmi_send_wmm_update_cmd_tlv(struct ath11k *ar, u32 vdev_id,
Signature · 1 line
2.7.4
Johannes Berg
maintainerQuoted 5 lines · Sathishkumar Muruganandam
Wide Band Scan allows to perform off-channel scan on requested channel/ frequency along with corresponding phy mode/bandwidth (40Mhz, 80Mhz).
Below are use cases of Wide Band Scan,
Quoted 7 lines
1. In case of phy running both AP and monitor vifs, wide band scan on a different channel along with phymode (40Mhz, 80Mhz) captures those off-channel data frames to monitor vif.
2. Doing wide band scan instead of normal 20Mhz scan before spectral dump, allows to fetch FFT reports for the complete requested bandwidth (40Mhz, 80Mhz).
Neither of these are scan use cases (at least not that are covered by nl80211 scan APIs), so that doesn't make sense.
johannes
Quoted 3 lines
Neither of these are scan use cases (at least not that are covered by nl80211 scan APIs), so that doesn't make sense.
Actually we had extended the existing 'iw scan' command to do Wide Band Scan using nl80211 scan APIs.
dev <devname> scan freq <freq> [HT40+|HT40-|80MHz] [ap-force]
dev <devname> scan trigger freq <freq> [HT40+|HT40-|80MHz] [ap-force]
Raised patch for above change, [PATCH] iw: Add phymode parameters to scan command for Wide Band Scan support.
--
Sathishkumar
Johannes Berg
maintainerQuoted 6 lines · Sathishkumar Muruganandam
Quoted 3 lines
Neither of these are scan use cases (at least not that are covered by nl80211 scan APIs), so that doesn't make sense.
Actually we had extended the existing 'iw scan' command to do Wide Band Scan using nl80211 scan APIs.
Yes ... but ... that doesn't address my question.
How is this related to scanning? It sounds to me like you're just (ab)using scan as a somewhat convenient "do some channel hopping" API
...
johannes
Quoted 5 lines · Johannes Berg
Quoted 4 lines · Sathishkumar Muruganandam
Quoted 3 lines
Neither of these are scan use cases (at least not that are covered by nl80211 scan APIs), so that doesn't make sense.
Quoted 9 lines
Quoted 2 lines
Actually we had extended the existing 'iw scan' command to do Wide Band Scan using nl80211 scan APIs.
Yes ... but ... that doesn't address my question.
How is this related to scanning? It sounds to me like you're just (ab)using scan as a somewhat convenient "do some channel hopping" API
...
Whether this can be used under "iw offchannel" with NL80211_CMD_REMAIN_ON_CHANNEL?
Please provide your comments.
Signature · 7 lines
Thanks, Sathishkumar _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Johannes Berg
maintainerQuoted 8 lines · Sathishkumar Muruganandam
Quoted 5 lines
How is this related to scanning? It sounds to me like you're just (ab)using scan as a somewhat convenient "do some channel hopping" API
...Whether this can be used under "iw offchannel" with
NL80211_CMD_REMAIN_ON_CHANNEL?
Not sure what you're asking. Are you asking if I would accept wide channel extensions to R-O-C? That seems more reasonable than for scanning anyway. Still I guess I'd like to see an actual reason for it.
johannes
Quoted 7 lines · Johannes Berg
Quoted 6 lines · Sathishkumar Muruganandam
Quoted 5 lines
How is this related to scanning? It sounds to me like you're just (ab)using scan as a somewhat convenient "do some channel hopping" API
...
Quoted 5 lines
Quoted 2 lines
Whether this can be used under "iw offchannel" with
NL80211_CMD_REMAIN_ON_CHANNEL?Are you asking if I would accept wide
channel extensions to R-O-C?
Yes, adding bandwidth config to existing command.
Something like this,
iw offchannel <freq> [HT40+|HT40-|80MHz] <duration>
Quoted 1 line
Still I guess I'd like to see an actual reason for it.
Wide band scan is actually moving to a off-channel for a specified duration to capture 40, 80Mhz data frames.
So, I hope offchannel would accommodate this extension.
Signature · 7 lines
Thanks, Sathishkumar _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Johannes Berg
maintainerQuoted 17 lines · Sathishkumar Muruganandam
Quoted 11 lines · Johannes Berg
Quoted 7 lines · Sathishkumar Muruganandam
Quoted 4 lines
How is this related to scanning? It sounds to me like you're just (ab)using scan as a somewhat convenient "do some channel hopping" API
...Whether this can be used under "iw offchannel" with
NL80211_CMD_REMAIN_ON_CHANNEL?Are you asking if I would accept wide
channel extensions to R-O-C?Yes, adding bandwidth config to existing command.
Something like this,
Quoted 8 lines
iw offchannel <freq> [HT40+|HT40-|80MHz] <duration>
Quoted 1 line
Still I guess I'd like to see an actual reason for it.
Wide band scan is actually moving to a off-channel for a specified duration to capture 40, 80Mhz data frames.
So, I hope offchannel would accommodate this extension.
That certainly makes more sense to me than scan, but it'd *still* be good to come up with use cases for supporting it and have that in the commit details.
johannes