aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorGuy Eilam <guy@wizery.com>2010-12-09 09:54:59 -0500
committerLuciano Coelho <luciano.coelho@nokia.com>2010-12-15 08:41:04 -0500
commitea559b460509b241cc1a3f36eebe0b2b634b3cf2 (patch)
tree345f4cc80cd3a25a6ae261629e4fcc0c4e19925d /drivers/net
parentc5312772156bb5f9b2e95e4c91526d578426a069 (diff)
wl1271: fixed problem with WPS IEs in probe requests
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>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/wl12xx/init.c6
-rw-r--r--drivers/net/wireless/wl12xx/main.c7
-rw-r--r--drivers/net/wireless/wl12xx/wl12xx_80211.h7
3 files changed, 9 insertions, 11 deletions
diff --git a/drivers/net/wireless/wl12xx/init.c b/drivers/net/wireless/wl12xx/init.c
index 0392e37f0d66..785a5304bfc4 100644
--- a/drivers/net/wireless/wl12xx/init.c
+++ b/drivers/net/wireless/wl12xx/init.c
@@ -53,18 +53,16 @@ static int wl1271_init_hwenc_config(struct wl1271 *wl)
53int wl1271_init_templates_config(struct wl1271 *wl) 53int wl1271_init_templates_config(struct wl1271 *wl)
54{ 54{
55 int ret, i; 55 int ret, i;
56 size_t size;
57 56
58 /* send empty templates for fw memory reservation */ 57 /* send empty templates for fw memory reservation */
59 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4, NULL, 58 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4, NULL,
60 sizeof(struct wl12xx_probe_req_template), 59 WL1271_CMD_TEMPL_MAX_SIZE,
61 0, WL1271_RATE_AUTOMATIC); 60 0, WL1271_RATE_AUTOMATIC);
62 if (ret < 0) 61 if (ret < 0)
63 return ret; 62 return ret;
64 63
65 size = sizeof(struct wl12xx_probe_req_template);
66 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5, 64 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5,
67 NULL, size, 0, 65 NULL, WL1271_CMD_TEMPL_MAX_SIZE, 0,
68 WL1271_RATE_AUTOMATIC); 66 WL1271_RATE_AUTOMATIC);
69 if (ret < 0) 67 if (ret < 0)
70 return ret; 68 return ret;
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index f7d7cad730a2..0865585c8a75 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -2666,6 +2666,13 @@ int wl1271_init_ieee80211(struct wl1271 *wl)
2666 wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | 2666 wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
2667 BIT(NL80211_IFTYPE_ADHOC); 2667 BIT(NL80211_IFTYPE_ADHOC);
2668 wl->hw->wiphy->max_scan_ssids = 1; 2668 wl->hw->wiphy->max_scan_ssids = 1;
2669 /*
2670 * Maximum length of elements in scanning probe request templates
2671 * should be the maximum length possible for a template, without
2672 * the IEEE80211 header of the template
2673 */
2674 wl->hw->wiphy->max_scan_ie_len = WL1271_CMD_TEMPL_MAX_SIZE -
2675 sizeof(struct ieee80211_header);
2669 wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &wl1271_band_2ghz; 2676 wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &wl1271_band_2ghz;
2670 wl->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &wl1271_band_5ghz; 2677 wl->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &wl1271_band_5ghz;
2671 2678
diff --git a/drivers/net/wireless/wl12xx/wl12xx_80211.h b/drivers/net/wireless/wl12xx/wl12xx_80211.h
index 8ee0d3a8fa6e..be21032f4dc1 100644
--- a/drivers/net/wireless/wl12xx/wl12xx_80211.h
+++ b/drivers/net/wireless/wl12xx/wl12xx_80211.h
@@ -134,13 +134,6 @@ struct wl12xx_qos_null_data_template {
134 __le16 qos_ctl; 134 __le16 qos_ctl;
135} __packed; 135} __packed;
136 136
137struct wl12xx_probe_req_template {
138 struct ieee80211_header header;
139 struct wl12xx_ie_ssid ssid;
140 struct wl12xx_ie_rates rates;
141 struct wl12xx_ie_rates ext_rates;
142} __packed;
143
144struct wl12xx_arp_rsp_template { 137struct wl12xx_arp_rsp_template {
145 struct ieee80211_hdr_3addr hdr; 138 struct ieee80211_hdr_3addr hdr;
146 139