aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-04-20 17:36:56 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:57:18 -0400
commit1ecf9fc1317f8df91eb1d74360f408558d657478 (patch)
tree3709c5b51fa28847a891b9a19bba693fe38f95a9 /drivers/net/wireless/iwlwifi/iwl3945-base.c
parent9b3bf06abad70db820c74c90118ea49358549d22 (diff)
iwlwifi: improve scan support
This modifies iwlwifi to * no longer build its own probe request, but use mac80211's * therefore, support arbitrary scan IEs (up to the max len) * support multiple scan SSIDs * support passive scanning Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c48
1 files changed, 29 insertions, 19 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index ed497551a860..4df9b4b5072a 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2942,9 +2942,9 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
2942 int rc = 0; 2942 int rc = 0;
2943 struct iwl3945_scan_cmd *scan; 2943 struct iwl3945_scan_cmd *scan;
2944 struct ieee80211_conf *conf = NULL; 2944 struct ieee80211_conf *conf = NULL;
2945 u8 n_probes = 2; 2945 u8 n_probes = 0;
2946 enum ieee80211_band band; 2946 enum ieee80211_band band;
2947 DECLARE_SSID_BUF(ssid); 2947 bool is_active = false;
2948 2948
2949 conf = ieee80211_get_hw_conf(priv->hw); 2949 conf = ieee80211_get_hw_conf(priv->hw);
2950 2950
@@ -3043,18 +3043,25 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
3043 scan_suspend_time, interval); 3043 scan_suspend_time, interval);
3044 } 3044 }
3045 3045
3046 /* We should add the ability for user to lock to PASSIVE ONLY */ 3046 if (priv->scan_request->n_ssids) {
3047 if (priv->one_direct_scan) { 3047 int i, p = 0;
3048 IWL_DEBUG_SCAN(priv, "Kicking off one direct scan for '%s'\n", 3048 IWL_DEBUG_SCAN(priv, "Kicking off active scan\n");
3049 print_ssid(ssid, priv->direct_ssid, 3049 for (i = 0; i < priv->scan_request->n_ssids; i++) {
3050 priv->direct_ssid_len)); 3050 /* always does wildcard anyway */
3051 scan->direct_scan[0].id = WLAN_EID_SSID; 3051 if (!priv->scan_request->ssids[i].ssid_len)
3052 scan->direct_scan[0].len = priv->direct_ssid_len; 3052 continue;
3053 memcpy(scan->direct_scan[0].ssid, 3053 scan->direct_scan[p].id = WLAN_EID_SSID;
3054 priv->direct_ssid, priv->direct_ssid_len); 3054 scan->direct_scan[p].len =
3055 n_probes++; 3055 priv->scan_request->ssids[i].ssid_len;
3056 memcpy(scan->direct_scan[p].ssid,
3057 priv->scan_request->ssids[i].ssid,
3058 priv->scan_request->ssids[i].ssid_len);
3059 n_probes++;
3060 p++;
3061 }
3062 is_active = true;
3056 } else 3063 } else
3057 IWL_DEBUG_SCAN(priv, "Kicking off one indirect scan.\n"); 3064 IWL_DEBUG_SCAN(priv, "Kicking off passive scan.\n");
3058 3065
3059 /* We don't build a direct scan probe request; the uCode will do 3066 /* We don't build a direct scan probe request; the uCode will do
3060 * that based on the direct_mask added to each channel entry */ 3067 * that based on the direct_mask added to each channel entry */
@@ -3079,9 +3086,11 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
3079 } 3086 }
3080 3087
3081 scan->tx_cmd.len = cpu_to_le16( 3088 scan->tx_cmd.len = cpu_to_le16(
3082 iwl_fill_probe_req(priv, band, 3089 iwl_fill_probe_req(priv,
3083 (struct ieee80211_mgmt *)scan->data, 3090 (struct ieee80211_mgmt *)scan->data,
3084 IWL_MAX_SCAN_SIZE - sizeof(*scan))); 3091 priv->scan_request->ie,
3092 priv->scan_request->ie_len,
3093 IWL_MAX_SCAN_SIZE - sizeof(*scan)));
3085 3094
3086 /* select Rx antennas */ 3095 /* select Rx antennas */
3087 scan->flags |= iwl3945_get_antenna_flags(priv); 3096 scan->flags |= iwl3945_get_antenna_flags(priv);
@@ -3090,8 +3099,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
3090 scan->filter_flags = RXON_FILTER_PROMISC_MSK; 3099 scan->filter_flags = RXON_FILTER_PROMISC_MSK;
3091 3100
3092 scan->channel_count = 3101 scan->channel_count =
3093 iwl3945_get_channels_for_scan(priv, band, 1, /* active */ 3102 iwl3945_get_channels_for_scan(priv, band, is_active, n_probes,
3094 n_probes,
3095 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); 3103 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]);
3096 3104
3097 if (scan->channel_count == 0) { 3105 if (scan->channel_count == 0) {
@@ -4119,7 +4127,9 @@ static int iwl3945_setup_mac(struct iwl_priv *priv)
4119 4127
4120 hw->wiphy->custom_regulatory = true; 4128 hw->wiphy->custom_regulatory = true;
4121 4129
4122 hw->wiphy->max_scan_ssids = 1; /* WILL FIX */ 4130 hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX_3945;
4131 /* we create the 802.11 header and a zero-length SSID element */
4132 hw->wiphy->max_scan_ie_len = IWL_MAX_PROBE_REQUEST - 24 - 2;
4123 4133
4124 /* Default value; 4 EDCA QOS priorities */ 4134 /* Default value; 4 EDCA QOS priorities */
4125 hw->queues = 4; 4135 hw->queues = 4;