]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/wireless/iwlwifi/iwl-scan.c
iwlwifi: multiple force reset mode
[mv-sheeva.git] / drivers / net / wireless / iwlwifi / iwl-scan.c
index 08faafae8497722f1f45cf39d36883152b83d35a..501477464e0787f504bb691209aa635bf48c411b 100644 (file)
@@ -250,8 +250,6 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
 
        if (!priv->is_internal_short_scan)
                priv->next_scan_jiffies = 0;
-       else
-               priv->last_internal_scan_jiffies = jiffies;
 
        IWL_DEBUG_INFO(priv, "Setting scan to off\n");
 
@@ -551,8 +549,6 @@ EXPORT_SYMBOL(iwl_mac_hw_scan);
  * internal short scan, this function should only been called while associated.
  * It will reset and tune the radio to prevent possible RF related problem
  */
-#define IWL_DELAY_NEXT_INTERNAL_SCAN (HZ*1)
-
 int iwl_internal_short_hw_scan(struct iwl_priv *priv)
 {
        int ret = 0;
@@ -572,12 +568,6 @@ int iwl_internal_short_hw_scan(struct iwl_priv *priv)
                ret = -EAGAIN;
                goto out;
        }
-       if (priv->last_internal_scan_jiffies &&
-           time_after(priv->last_internal_scan_jiffies +
-                      IWL_DELAY_NEXT_INTERNAL_SCAN, jiffies)) {
-               IWL_DEBUG_SCAN(priv, "internal scan rejected\n");
-               goto out;
-       }
 
        priv->scan_bands = 0;
        if (priv->band == IEEE80211_BAND_5GHZ)
@@ -651,9 +641,20 @@ u16 iwl_fill_probe_req(struct iwl_priv *priv, struct ieee80211_mgmt *frame,
        if (left < 0)
                return 0;
        *pos++ = WLAN_EID_SSID;
-       *pos++ = 0;
-
-       len += 2;
+       if (!priv->is_internal_short_scan &&
+           priv->scan_request->n_ssids) {
+               struct cfg80211_ssid *ssid =
+                       priv->scan_request->ssids;
+
+               /* Broadcast if ssid_len is 0 */
+               *pos++ = ssid->ssid_len;
+               memcpy(pos, ssid->ssid, ssid->ssid_len);
+               pos += ssid->ssid_len;
+               len += 2 + ssid->ssid_len;
+       } else {
+               *pos++ = 0;
+               len += 2;
+       }
 
        if (WARN_ON(left < ie_len))
                return len;
@@ -782,20 +783,26 @@ static void iwl_bg_request_scan(struct work_struct *data)
        if (priv->is_internal_short_scan) {
                IWL_DEBUG_SCAN(priv, "Start internal passive scan.\n");
        } else if (priv->scan_request->n_ssids) {
-               int i, p = 0;
                IWL_DEBUG_SCAN(priv, "Kicking off active scan\n");
-               for (i = 0; i < priv->scan_request->n_ssids; i++) {
-                       /* always does wildcard anyway */
-                       if (!priv->scan_request->ssids[i].ssid_len)
-                               continue;
-                       scan->direct_scan[p].id = WLAN_EID_SSID;
-                       scan->direct_scan[p].len =
-                               priv->scan_request->ssids[i].ssid_len;
-                       memcpy(scan->direct_scan[p].ssid,
-                              priv->scan_request->ssids[i].ssid,
-                              priv->scan_request->ssids[i].ssid_len);
-                       n_probes++;
-                       p++;
+               /*
+                * The first SSID to scan is stuffed into the probe request
+                * template and the remaining ones are handled through the
+                * direct_scan array.
+                */
+               if (priv->scan_request->n_ssids > 1) {
+                       int i, p = 0;
+                       for (i = 1; i < priv->scan_request->n_ssids; i++) {
+                               if (!priv->scan_request->ssids[i].ssid_len)
+                                       continue;
+                               scan->direct_scan[p].id = WLAN_EID_SSID;
+                               scan->direct_scan[p].len =
+                                       priv->scan_request->ssids[i].ssid_len;
+                               memcpy(scan->direct_scan[p].ssid,
+                                      priv->scan_request->ssids[i].ssid,
+                                      priv->scan_request->ssids[i].ssid_len);
+                               n_probes++;
+                               p++;
+                       }
                }
                is_active = true;
        } else