aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c49
2 files changed, 34 insertions, 17 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index b528a20ade4f..f51b8cd80de5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2631,7 +2631,7 @@ static int iwl_mac_setup_register(struct iwl_priv *priv)
2631 */ 2631 */
2632 hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; 2632 hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;
2633 2633
2634 hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX; 2634 hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX + 1;
2635 /* we create the 802.11 header and a zero-length SSID element */ 2635 /* we create the 802.11 header and a zero-length SSID element */
2636 hw->wiphy->max_scan_ie_len = IWL_MAX_PROBE_REQUEST - 24 - 2; 2636 hw->wiphy->max_scan_ie_len = IWL_MAX_PROBE_REQUEST - 24 - 2;
2637 2637
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index 08faafae8497..f786a407638f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -651,9 +651,20 @@ u16 iwl_fill_probe_req(struct iwl_priv *priv, struct ieee80211_mgmt *frame,
651 if (left < 0) 651 if (left < 0)
652 return 0; 652 return 0;
653 *pos++ = WLAN_EID_SSID; 653 *pos++ = WLAN_EID_SSID;
654 *pos++ = 0; 654 if (!priv->is_internal_short_scan &&
655 655 priv->scan_request->n_ssids) {
656 len += 2; 656 struct cfg80211_ssid *ssid =
657 priv->scan_request->ssids;
658
659 /* Broadcast if ssid_len is 0 */
660 *pos++ = ssid->ssid_len;
661 memcpy(pos, ssid->ssid, ssid->ssid_len);
662 pos += ssid->ssid_len;
663 len += 2 + ssid->ssid_len;
664 } else {
665 *pos++ = 0;
666 len += 2;
667 }
657 668
658 if (WARN_ON(left < ie_len)) 669 if (WARN_ON(left < ie_len))
659 return len; 670 return len;
@@ -782,20 +793,26 @@ static void iwl_bg_request_scan(struct work_struct *data)
782 if (priv->is_internal_short_scan) { 793 if (priv->is_internal_short_scan) {
783 IWL_DEBUG_SCAN(priv, "Start internal passive scan.\n"); 794 IWL_DEBUG_SCAN(priv, "Start internal passive scan.\n");
784 } else if (priv->scan_request->n_ssids) { 795 } else if (priv->scan_request->n_ssids) {
785 int i, p = 0;
786 IWL_DEBUG_SCAN(priv, "Kicking off active scan\n"); 796 IWL_DEBUG_SCAN(priv, "Kicking off active scan\n");
787 for (i = 0; i < priv->scan_request->n_ssids; i++) { 797 /*
788 /* always does wildcard anyway */ 798 * The first SSID to scan is stuffed into the probe request
789 if (!priv->scan_request->ssids[i].ssid_len) 799 * template and the remaining ones are handled through the
790 continue; 800 * direct_scan array.
791 scan->direct_scan[p].id = WLAN_EID_SSID; 801 */
792 scan->direct_scan[p].len = 802 if (priv->scan_request->n_ssids > 1) {
793 priv->scan_request->ssids[i].ssid_len; 803 int i, p = 0;
794 memcpy(scan->direct_scan[p].ssid, 804 for (i = 1; i < priv->scan_request->n_ssids; i++) {
795 priv->scan_request->ssids[i].ssid, 805 if (!priv->scan_request->ssids[i].ssid_len)
796 priv->scan_request->ssids[i].ssid_len); 806 continue;
797 n_probes++; 807 scan->direct_scan[p].id = WLAN_EID_SSID;
798 p++; 808 scan->direct_scan[p].len =
809 priv->scan_request->ssids[i].ssid_len;
810 memcpy(scan->direct_scan[p].ssid,
811 priv->scan_request->ssids[i].ssid,
812 priv->scan_request->ssids[i].ssid_len);
813 n_probes++;
814 p++;
815 }
799 } 816 }
800 is_active = true; 817 is_active = true;
801 } else 818 } else