]> 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 fd6bafbddfcae78607ba3dec988d03908c9add7e..501477464e0787f504bb691209aa635bf48c411b 100644 (file)
@@ -192,19 +192,17 @@ static void iwl_rx_scan_results_notif(struct iwl_priv *priv,
        IWL_DEBUG_SCAN(priv, "Scan ch.res: "
                       "%d [802.11%s] "
                       "(TSF: 0x%08X:%08X) - %d "
-                      "elapsed=%lu usec (%dms since last)\n",
+                      "elapsed=%lu usec\n",
                       notif->channel,
                       notif->band ? "bg" : "a",
                       le32_to_cpu(notif->tsf_high),
                       le32_to_cpu(notif->tsf_low),
                       le32_to_cpu(notif->statistics[0]),
-                      le32_to_cpu(notif->tsf_low) - priv->scan_start_tsf,
-                      jiffies_to_msecs(elapsed_jiffies
-                                       (priv->last_scan_jiffies, jiffies)));
+                      le32_to_cpu(notif->tsf_low) - priv->scan_start_tsf);
 #endif
 
-       priv->last_scan_jiffies = jiffies;
-       priv->next_scan_jiffies = 0;
+       if (!priv->is_internal_short_scan)
+               priv->next_scan_jiffies = 0;
 }
 
 /* Service SCAN_COMPLETE_NOTIFICATION (0x84) */
@@ -250,8 +248,9 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
                        goto reschedule;
        }
 
-       priv->last_scan_jiffies = jiffies;
-       priv->next_scan_jiffies = 0;
+       if (!priv->is_internal_short_scan)
+               priv->next_scan_jiffies = 0;
+
        IWL_DEBUG_INFO(priv, "Setting scan to off\n");
 
        clear_bit(STATUS_SCANNING, &priv->status);
@@ -528,15 +527,6 @@ int iwl_mac_hw_scan(struct ieee80211_hw *hw,
                goto out_unlock;
        }
 
-       /* if we just finished scan ask for delay */
-       if (iwl_is_associated(priv) && priv->last_scan_jiffies &&
-           time_after(priv->last_scan_jiffies + IWL_DELAY_NEXT_SCAN, jiffies)) {
-               IWL_DEBUG_SCAN(priv, "scan rejected: within previous scan period\n");
-               queue_work(priv->workqueue, &priv->scan_completed);
-               ret = 0;
-               goto out_unlock;
-       }
-
        priv->scan_bands = 0;
        for (i = 0; i < req->n_channels; i++)
                priv->scan_bands |= BIT(req->channels[i]->band);
@@ -578,6 +568,7 @@ int iwl_internal_short_hw_scan(struct iwl_priv *priv)
                ret = -EAGAIN;
                goto out;
        }
+
        priv->scan_bands = 0;
        if (priv->band == IEEE80211_BAND_5GHZ)
                priv->scan_bands |= BIT(IEEE80211_BAND_5GHZ);
@@ -650,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;
@@ -781,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