aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/scan.c')
-rw-r--r--drivers/net/wireless/wl12xx/scan.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/net/wireless/wl12xx/scan.c b/drivers/net/wireless/wl12xx/scan.c
index 488033b2a39b..eeccc9f095bb 100644
--- a/drivers/net/wireless/wl12xx/scan.c
+++ b/drivers/net/wireless/wl12xx/scan.c
@@ -479,12 +479,17 @@ wl12xx_scan_sched_scan_ssid_list(struct wl1271 *wl,
479 struct wl1271_cmd_sched_scan_ssid_list *cmd = NULL; 479 struct wl1271_cmd_sched_scan_ssid_list *cmd = NULL;
480 struct cfg80211_match_set *sets = req->match_sets; 480 struct cfg80211_match_set *sets = req->match_sets;
481 struct cfg80211_ssid *ssids = req->ssids; 481 struct cfg80211_ssid *ssids = req->ssids;
482 int ret = 0, type, i, j; 482 int ret = 0, type, i, j, n_match_ssids = 0;
483 483
484 wl1271_debug(DEBUG_CMD, "cmd sched scan ssid list"); 484 wl1271_debug(DEBUG_CMD, "cmd sched scan ssid list");
485 485
486 /* count the match sets that contain SSIDs */
487 for (i = 0; i < req->n_match_sets; i++)
488 if (sets[i].ssid.ssid_len > 0)
489 n_match_ssids++;
490
486 /* No filter, no ssids or only bcast ssid */ 491 /* No filter, no ssids or only bcast ssid */
487 if (!req->n_match_sets && 492 if (!n_match_ssids &&
488 (!req->n_ssids || 493 (!req->n_ssids ||
489 (req->n_ssids == 1 && req->ssids[0].ssid_len == 0))) { 494 (req->n_ssids == 1 && req->ssids[0].ssid_len == 0))) {
490 type = SCAN_SSID_FILTER_ANY; 495 type = SCAN_SSID_FILTER_ANY;
@@ -497,7 +502,7 @@ wl12xx_scan_sched_scan_ssid_list(struct wl1271 *wl,
497 goto out; 502 goto out;
498 } 503 }
499 504
500 if (!req->n_match_sets) { 505 if (!n_match_ssids) {
501 /* No filter, with ssids */ 506 /* No filter, with ssids */
502 type = SCAN_SSID_FILTER_DISABLED; 507 type = SCAN_SSID_FILTER_DISABLED;
503 508
@@ -514,6 +519,10 @@ wl12xx_scan_sched_scan_ssid_list(struct wl1271 *wl,
514 519
515 /* Add all SSIDs from the filters */ 520 /* Add all SSIDs from the filters */
516 for (i = 0; i < req->n_match_sets; i++) { 521 for (i = 0; i < req->n_match_sets; i++) {
522 /* ignore sets without SSIDs */
523 if (!sets[i].ssid.ssid_len)
524 continue;
525
517 cmd->ssids[cmd->n_ssids].type = SCAN_SSID_TYPE_PUBLIC; 526 cmd->ssids[cmd->n_ssids].type = SCAN_SSID_TYPE_PUBLIC;
518 cmd->ssids[cmd->n_ssids].len = sets[i].ssid.ssid_len; 527 cmd->ssids[cmd->n_ssids].len = sets[i].ssid.ssid_len;
519 memcpy(cmd->ssids[cmd->n_ssids].ssid, 528 memcpy(cmd->ssids[cmd->n_ssids].ssid,