1
From: Pau Oliva <pau@eslack.org>
2
Bug-Ubuntu: https://bugs.launchpad.net/bugs/994739
3
Origin: other, http://lists.shmoo.com/pipermail/hostap/2011-March/022891.html
4
Subject: fix driver_wext for broadcom wl driver
6
With broadcom's "wl" driver the first scan after ifup always fails with
7
EINVAL. This produces a 30 seconds timeout when establishing a connection
8
either on boot, or after resuming from suspend.
9
This is a workaround to wext driver which will rerun the scan if first
12
Index: wpa/src/drivers/driver_wext.c
13
===================================================================
14
--- wpa.orig/src/drivers/driver_wext.c 2012-07-09 16:41:16.328347000 +0200
15
+++ wpa/src/drivers/driver_wext.c 2012-07-09 16:42:18.149589666 +0200
22
if (wpa_driver_wext_finish_drv_init(drv) < 0)
25
@@ -1064,10 +1066,13 @@
26
static u8 * wpa_driver_wext_giwscan(struct wpa_driver_wext_data *drv,
29
+ struct wpa_driver_scan_params params;
36
res_buf_len = IW_SCAN_MAX_DATA;
38
res_buf = os_malloc(res_buf_len);
39
@@ -1090,6 +1095,15 @@
40
wpa_printf(MSG_DEBUG, "Scan results did not fit - "
41
"trying larger buffer (%lu bytes)",
42
(unsigned long) res_buf_len);
43
+ } if (errno == EINVAL && drv->scans == 1) {
45
+ * Broadcom's wl driver is buggy and the first scan
46
+ * after ifup always fail with EINVAL. Rerun the
47
+ * scan to get scan results.
49
+ os_memset(¶ms, 0, sizeof(params));
50
+ wpa_driver_wext_scan(drv, ¶ms);
53
perror("ioctl[SIOCGIWSCAN]");
55
Index: wpa/src/drivers/driver_wext.h
56
===================================================================
57
--- wpa.orig/src/drivers/driver_wext.h 2012-07-09 16:41:16.328347000 +0200
58
+++ wpa/src/drivers/driver_wext.h 2012-07-09 16:42:18.149589666 +0200
61
char mlmedev[IFNAMSIZ + 1];
64
int scan_complete_events;
66
int cfg80211; /* whether driver is using cfg80211 */