wl1271: fixed problem with WPS IEs in probe requests
authorGuy Eilam <guy@wizery.com>
Thu, 9 Dec 2010 14:54:59 +0000 (16:54 +0200)
committerLuciano Coelho <luciano.coelho@nokia.com>
Wed, 15 Dec 2010 13:41:04 +0000 (15:41 +0200)
Inclusion of a WPS IE in probe requests caused a problem
in the driver due to the maximum size of the probe request
template and the max_scan_ie_len values at initialization.

Increased the size of probe request template
to the maximum size allowed by the firmware.
Struct wl12xx_probe_req_template, which was only used
for calculating the max size of the probe request template,
is no longer used and needed.

max_scan_ie_len is used for validating the size of
additional IEs in scan requests.
Initialized the max_scan_ie_len field to the maximum size
of the probe request template minus the ieee80211 header size.

Signed-off-by: Guy Eilam <guy@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
drivers/net/wireless/wl12xx/init.c
drivers/net/wireless/wl12xx/main.c
drivers/net/wireless/wl12xx/wl12xx_80211.h

index 0392e37f0d6608664471cdd49a7435a84648a0b2..785a5304bfc4435c592791589b19b504978b32dc 100644 (file)
@@ -53,18 +53,16 @@ static int wl1271_init_hwenc_config(struct wl1271 *wl)
 int wl1271_init_templates_config(struct wl1271 *wl)
 {
        int ret, i;
-       size_t size;
 
        /* send empty templates for fw memory reservation */
        ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4, NULL,
-                                     sizeof(struct wl12xx_probe_req_template),
+                                     WL1271_CMD_TEMPL_MAX_SIZE,
                                      0, WL1271_RATE_AUTOMATIC);
        if (ret < 0)
                return ret;
 
-       size = sizeof(struct wl12xx_probe_req_template);
        ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5,
-                                     NULL, size, 0,
+                                     NULL, WL1271_CMD_TEMPL_MAX_SIZE, 0,
                                      WL1271_RATE_AUTOMATIC);
        if (ret < 0)
                return ret;
index f7d7cad730a25a887843b66c2fbfedb9c47c6bf2..0865585c8a757870b7ae59220f43274382095ef0 100644 (file)
@@ -2666,6 +2666,13 @@ int wl1271_init_ieee80211(struct wl1271 *wl)
        wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
                BIT(NL80211_IFTYPE_ADHOC);
        wl->hw->wiphy->max_scan_ssids = 1;
+       /*
+        * Maximum length of elements in scanning probe request templates
+        * should be the maximum length possible for a template, without
+        * the IEEE80211 header of the template
+        */
+       wl->hw->wiphy->max_scan_ie_len = WL1271_CMD_TEMPL_MAX_SIZE -
+                       sizeof(struct ieee80211_header);
        wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &wl1271_band_2ghz;
        wl->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &wl1271_band_5ghz;
 
index 8ee0d3a8fa6ef9cd9c2ab417dfd808747684ac71..be21032f4dc16047fa71dd8757d4d1bbb4db5825 100644 (file)
@@ -134,13 +134,6 @@ struct wl12xx_qos_null_data_template {
        __le16 qos_ctl;
 } __packed;
 
-struct wl12xx_probe_req_template {
-       struct ieee80211_header header;
-       struct wl12xx_ie_ssid ssid;
-       struct wl12xx_ie_rates rates;
-       struct wl12xx_ie_rates ext_rates;
-} __packed;
-
 struct wl12xx_arp_rsp_template {
        struct ieee80211_hdr_3addr hdr;