提交 1c1b5b26 编写于 作者: L Luciano Coelho 提交者: Emmanuel Grumbach

iwlwifi: mvm: revert order of SSIDs for sched scans

The firmware inverts the order of the SSIDs sent out in probe requests
(for some reason).  For regular scans, we've been passing the SSIDs in
the opposite order so they go out in the order we want.  With
scheduled scans, we were not doing that, so they were sent out in
reverse order of priority.  Fix that by using the reverse order when
populating the SSIDs array for scheduled scans as well.
Signed-off-by: NLuciano Coelho <luciano.coelho@intel.com>
Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
上级 5ef766fe
......@@ -446,7 +446,7 @@ static int iwl_ssid_exist(u8 *ssid, u8 ssid_len, struct iwl_ssid_ie *ssid_list)
}
static void iwl_scan_offload_build_ssid(struct iwl_mvm_scan_params *params,
struct iwl_ssid_ie *direct_scan,
struct iwl_ssid_ie *ssid,
u32 *ssid_bitmap)
{
int i, j;
......@@ -457,31 +457,34 @@ static void iwl_scan_offload_build_ssid(struct iwl_mvm_scan_params *params,
* iwl_config_sched_scan_profiles() uses the order of these ssids to
* config match list.
*/
for (i = 0; i < params->n_match_sets && i < PROBE_OPTION_MAX; i++) {
for (i = 0, j = params->n_match_sets - 1;
j >= 0 && i < PROBE_OPTION_MAX;
i++, j--) {
/* skip empty SSID matchsets */
if (!params->match_sets[i].ssid.ssid_len)
if (!params->match_sets[j].ssid.ssid_len)
continue;
direct_scan[i].id = WLAN_EID_SSID;
direct_scan[i].len = params->match_sets[i].ssid.ssid_len;
memcpy(direct_scan[i].ssid, params->match_sets[i].ssid.ssid,
direct_scan[i].len);
ssid[i].id = WLAN_EID_SSID;
ssid[i].len = params->match_sets[j].ssid.ssid_len;
memcpy(ssid[i].ssid, params->match_sets[j].ssid.ssid,
ssid[i].len);
}
/* add SSIDs from scan SSID list */
*ssid_bitmap = 0;
for (j = 0; j < params->n_ssids && i < PROBE_OPTION_MAX; j++) {
for (j = params->n_ssids - 1;
j >= 0 && i < PROBE_OPTION_MAX;
i++, j--) {
index = iwl_ssid_exist(params->ssids[j].ssid,
params->ssids[j].ssid_len,
direct_scan);
ssid);
if (index < 0) {
if (!params->ssids[j].ssid_len)
continue;
direct_scan[i].id = WLAN_EID_SSID;
direct_scan[i].len = params->ssids[j].ssid_len;
memcpy(direct_scan[i].ssid, params->ssids[j].ssid,
direct_scan[i].len);
ssid[i].id = WLAN_EID_SSID;
ssid[i].len = params->ssids[j].ssid_len;
memcpy(ssid[i].ssid, params->ssids[j].ssid,
ssid[i].len);
*ssid_bitmap |= BIT(i + 1);
i++;
} else {
*ssid_bitmap |= BIT(index + 1);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册