aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/scan.c
diff options
context:
space:
mode:
authorLuciano Coelho <coelho@ti.com>2011-09-02 07:28:23 -0400
committerLuciano Coelho <coelho@ti.com>2011-09-14 05:18:38 -0400
commit20a33e52edfd75510ee8cc56a013dd55cb0de0aa (patch)
tree6ada17df8550e5838256d75b744f1ba23b26e55c /drivers/net/wireless/wl12xx/scan.c
parent221737d24f884f3f829e7f94d24fc4cc6d0f7b41 (diff)
wl12xx: ignore sched scan match sets without SSID
For now, cfg80211 only support match sets with SSIDs, but in the future more parameters will be added. This patch ignores eventual matches that do not contain SSIDs in preparation for the future. This change also affects the case where broadcast SSIDs are used. Matching a broadcast SSID will match everything, so they can be ignored. Signed-off-by: Luciano Coelho <coelho@ti.com>
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,