add Wide Band Scan support
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).
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 · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 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.
--- 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
@@ -1822,6 +1822,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
@@ -1848,6 +1849,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
@@ -5452,6 +5452,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. */
@@ -5497,6 +5500,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,
@@ -5608,6 +5612,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 ,
@@ -5623,6 +5629,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
@@ -662,11 +662,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
Re: [PATCH 1/2] nl80211: add Wide Band Scan support
Quoted 7 lines · Sathishkumar Muruganandam
New nl80211
ext_featureandscan_flagadded 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_defis included incfg80211_scan_request.
Quoted 7 lines
Signed-off-by Sathishkumar Muruganandam <[email protected]>--- 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(-)
I don't apply nl80211 patches. So you need to submit this to linux-wireless like all other nl80211 patches.
I'll also drop the ath11k patch, please resend once the nl80211 patch is applied.
Signature · 6 lines
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH 1/2] nl80211: add Wide Band Scan support
Quoted 18 lines · Kalle Valo
Quoted 7 lines · Sathishkumar Muruganandam
New nl80211
ext_featureandscan_flagadded 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_defis included incfg80211_scan_request.Quoted 8 lines
Signed-off-by Sathishkumar Muruganandam <[email protected]>--- 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(-)
Quoted 5 lines
I don't apply nl80211 patches. So you need to submit this to linux-wireless like all other nl80211 patches.
I'll also drop the ath11k patch, please resend once the nl80211 patch is applied.
Here both nl80211 and ath11k patches are inter-related to Wide band scan and hence I had sent them as single patch series like the other previous ath11k patches.
If I need to submit nl80211 patch to linux-wireless first, whether I can send ath11k patch also in series ?
Signature · 7 lines
Thanks, Sathishkumar _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH 1/2] nl80211: add Wide Band Scan support
Quoted 24 lines · Sathishkumar Muruganandam
Quoted 23 lines · Kalle Valo
Quoted 9 lines · Sathishkumar Muruganandam
New nl80211
ext_featureandscan_flagadded 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_defis
included incfg80211_scan_request.Quoted 8 lines
Signed-off-by Sathishkumar Muruganandam <[email protected]>--- 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(-)I don't apply nl80211 patches. So you need to submit this to linux-wireless like all other nl80211 patches.
Quoted 7 lines
Quoted 3 lines
I'll also drop the ath11k patch, please resend once the nl80211 patch is
applied.Here both nl80211 and ath11k patches are inter-related to Wide band scan and hence I had sent them as single patch series like the other previous ath11k patches.
Sure.
Quoted 2 lines
If I need to submit nl80211 patch to linux-wireless first, whether I can send ath11k patch also in series ?
Yeah, I think that's the best as then people can see how a driver would be using the feature. But make sure that nl80211/mac80211 patch applies to mac80211-next.
Signature · 6 lines
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 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 · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k