]> git.karo-electronics.de Git - linux-beck.git/commitdiff
iwlwifi: invert the order of ssid list in scan cmd
authorDavid Spinadel <david.spinadel@intel.com>
Fri, 11 May 2012 08:53:17 +0000 (10:53 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 16 May 2012 17:08:19 +0000 (13:08 -0400)
The firmware inverts the order of ssid list of scan command, we
should invert the order before sending the command, in order to
get probe requests sent in wanted order.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-scan.c

index 0505e4edf2434de409a01d40ef0514049713ddd6..031d8e21f82f74e132dc48389818f93c2f393ee7 100644 (file)
@@ -767,7 +767,11 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
                        ssid_len = priv->scan_request->ssids[0].ssid_len;
                        ssid = priv->scan_request->ssids[0].ssid;
 
-                       for (i = 1; i < priv->scan_request->n_ssids; i++) {
+                       /*
+                        * Invert the order of ssids, the firmware will invert
+                        * it back.
+                        */
+                       for (i = priv->scan_request->n_ssids - 1; i >= 1; i--) {
                                scan->direct_scan[p].id = WLAN_EID_SSID;
                                scan->direct_scan[p].len =
                                        priv->scan_request->ssids[i].ssid_len;