From: David Spinadel Date: Fri, 11 May 2012 08:53:17 +0000 (+0200) Subject: iwlwifi: invert the order of ssid list in scan cmd X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=65781af6b5e0dd07bf33dfb12be876129e74efa5;p=openwrt%2Fstaging%2Fblogic.git iwlwifi: invert the order of ssid list in scan cmd 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 Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 0505e4edf243..031d8e21f82f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c @@ -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;