diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-mac80211.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-scan.c | 31 |
2 files changed, 24 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c index d33cc9cc7d3f..9abe07abcd3f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c +++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c | |||
@@ -223,8 +223,8 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv, | |||
223 | hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; | 223 | hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; |
224 | 224 | ||
225 | hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX; | 225 | hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX; |
226 | /* we create the 802.11 header and a zero-length SSID element */ | 226 | /* we create the 802.11 header and a max-length SSID element */ |
227 | hw->wiphy->max_scan_ie_len = capa->max_probe_length - 24 - 2; | 227 | hw->wiphy->max_scan_ie_len = capa->max_probe_length - 24 - 34; |
228 | 228 | ||
229 | /* | 229 | /* |
230 | * We don't use all queues: 4 and 9 are unused and any | 230 | * We don't use all queues: 4 and 9 are unused and any |
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 6f221de5a76a..0505e4edf243 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -617,7 +617,8 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv, | |||
617 | */ | 617 | */ |
618 | 618 | ||
619 | static u16 iwl_fill_probe_req(struct ieee80211_mgmt *frame, const u8 *ta, | 619 | static u16 iwl_fill_probe_req(struct ieee80211_mgmt *frame, const u8 *ta, |
620 | const u8 *ies, int ie_len, int left) | 620 | const u8 *ies, int ie_len, const u8 *ssid, |
621 | u8 ssid_len, int left) | ||
621 | { | 622 | { |
622 | int len = 0; | 623 | int len = 0; |
623 | u8 *pos = NULL; | 624 | u8 *pos = NULL; |
@@ -639,14 +640,18 @@ static u16 iwl_fill_probe_req(struct ieee80211_mgmt *frame, const u8 *ta, | |||
639 | /* ...next IE... */ | 640 | /* ...next IE... */ |
640 | pos = &frame->u.probe_req.variable[0]; | 641 | pos = &frame->u.probe_req.variable[0]; |
641 | 642 | ||
642 | /* fill in our indirect SSID IE */ | 643 | /* fill in our SSID IE */ |
643 | left -= 2; | 644 | left -= ssid_len + 2; |
644 | if (left < 0) | 645 | if (left < 0) |
645 | return 0; | 646 | return 0; |
646 | *pos++ = WLAN_EID_SSID; | 647 | *pos++ = WLAN_EID_SSID; |
647 | *pos++ = 0; | 648 | *pos++ = ssid_len; |
649 | if (ssid && ssid_len) { | ||
650 | memcpy(pos, ssid, ssid_len); | ||
651 | pos += ssid_len; | ||
652 | } | ||
648 | 653 | ||
649 | len += 2; | 654 | len += ssid_len + 2; |
650 | 655 | ||
651 | if (WARN_ON(left < ie_len)) | 656 | if (WARN_ON(left < ie_len)) |
652 | return len; | 657 | return len; |
@@ -683,6 +688,8 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
683 | int scan_cmd_size = sizeof(struct iwl_scan_cmd) + | 688 | int scan_cmd_size = sizeof(struct iwl_scan_cmd) + |
684 | MAX_SCAN_CHANNEL * sizeof(struct iwl_scan_channel) + | 689 | MAX_SCAN_CHANNEL * sizeof(struct iwl_scan_channel) + |
685 | priv->fw->ucode_capa.max_probe_length; | 690 | priv->fw->ucode_capa.max_probe_length; |
691 | const u8 *ssid = NULL; | ||
692 | u8 ssid_len = 0; | ||
686 | 693 | ||
687 | if (WARN_ON_ONCE(priv->scan_request && | 694 | if (WARN_ON_ONCE(priv->scan_request && |
688 | priv->scan_request->n_channels > MAX_SCAN_CHANNEL)) | 695 | priv->scan_request->n_channels > MAX_SCAN_CHANNEL)) |
@@ -753,10 +760,14 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
753 | if (priv->scan_request->n_ssids) { | 760 | if (priv->scan_request->n_ssids) { |
754 | int i, p = 0; | 761 | int i, p = 0; |
755 | IWL_DEBUG_SCAN(priv, "Kicking off active scan\n"); | 762 | IWL_DEBUG_SCAN(priv, "Kicking off active scan\n"); |
756 | for (i = 0; i < priv->scan_request->n_ssids; i++) { | 763 | /* |
757 | /* always does wildcard anyway */ | 764 | * The highest priority SSID is inserted to the |
758 | if (!priv->scan_request->ssids[i].ssid_len) | 765 | * probe request template. |
759 | continue; | 766 | */ |
767 | ssid_len = priv->scan_request->ssids[0].ssid_len; | ||
768 | ssid = priv->scan_request->ssids[0].ssid; | ||
769 | |||
770 | for (i = 1; i < priv->scan_request->n_ssids; i++) { | ||
760 | scan->direct_scan[p].id = WLAN_EID_SSID; | 771 | scan->direct_scan[p].id = WLAN_EID_SSID; |
761 | scan->direct_scan[p].len = | 772 | scan->direct_scan[p].len = |
762 | priv->scan_request->ssids[i].ssid_len; | 773 | priv->scan_request->ssids[i].ssid_len; |
@@ -890,6 +901,7 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
890 | vif->addr, | 901 | vif->addr, |
891 | priv->scan_request->ie, | 902 | priv->scan_request->ie, |
892 | priv->scan_request->ie_len, | 903 | priv->scan_request->ie_len, |
904 | ssid, ssid_len, | ||
893 | scan_cmd_size - sizeof(*scan)); | 905 | scan_cmd_size - sizeof(*scan)); |
894 | break; | 906 | break; |
895 | case IWL_SCAN_RADIO_RESET: | 907 | case IWL_SCAN_RADIO_RESET: |
@@ -898,6 +910,7 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
898 | cmd_len = iwl_fill_probe_req( | 910 | cmd_len = iwl_fill_probe_req( |
899 | (struct ieee80211_mgmt *)scan->data, | 911 | (struct ieee80211_mgmt *)scan->data, |
900 | iwl_bcast_addr, NULL, 0, | 912 | iwl_bcast_addr, NULL, 0, |
913 | NULL, 0, | ||
901 | scan_cmd_size - sizeof(*scan)); | 914 | scan_cmd_size - sizeof(*scan)); |
902 | break; | 915 | break; |
903 | default: | 916 | default: |