Merge lp:~poliva/ubuntu/precise/wpasupplicant/fix-for-994739 into lp:ubuntu/precise/wpasupplicant

Proposed by Pau Oliva on 2012-05-21
Status: Rejected
Rejected by: Stéphane Graber on 2012-07-09
Proposed branch: lp:~poliva/ubuntu/precise/wpasupplicant/fix-for-994739
Merge into: lp:ubuntu/precise/wpasupplicant
Diff against target: 159 lines (+91/-0)
6 files modified
.pc/applied-patches (+1/-0)
debian/changelog (+12/-0)
debian/patches/fix_driver_wext_for_broadcom_wl.patch (+62/-0)
debian/patches/series (+1/-0)
src/drivers/driver_wext.c (+14/-0)
src/drivers/driver_wext.h (+1/-0)
To merge this branch: bzr merge lp:~poliva/ubuntu/precise/wpasupplicant/fix-for-994739
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Needs Fixing on 2012-06-28
Ubuntu branches 2012-05-21 Pending
Review via email: mp+106704@code.launchpad.net

Commit message

Add a workaround for Broadcom wl driver's first failing scan (LP: #994739)

Description of the change

Add a workaround for Broadcom wl driver's first failing scan (LP: #994739)

To post a comment you must log in.
Mathieu Trudel-Lapierre (cyphermox) wrote :

.pc/applied-patches and debian/patches/series list fix_driver_wext_for_broadcom_wl.patch; but it's not shown in the diff. I think you may have forgotten to bzr add that new file :)

Otherwise it looks right in principle, but we ought to have this patch applied in Quantal first. It should be trivial anyway and totally reproduceable there. I wish this patch was accepted upstream as well, but it probably just needs to be brought up on the ML again.

I'll gladly sponsor this to quantal and precise once the missing file is added and same behavior can be confirmed in Quantal; which should be the case anyway. Coordination for that test is being done on bug 994739.

review: Needs Fixing
20. By Pau Oliva on 2012-06-20

Add missing patch file fix_driver_wext_for_broadcom_wl.patch

Pau Oliva (poliva) wrote :

Sorry, never used bzr before, my fault!
The patch file has been added in the previous commit.

Mathieu Trudel-Lapierre (cyphermox) wrote :

You didn't really need a second entry to changelog though... :)

I'll fix this myself in the merge.

Mathieu Trudel-Lapierre (cyphermox) wrote :

Sorry for only getting around to looking at the merge now... :/

It turns out that there's actually a small issue: could you please re-do your merge against the ubuntu:wpa branch? That's now what wpasupplicant is called. The files should be in the same location, and you changelog can be something as simple as this:

 * debian/patches/fix_driver_wext_for_broadcom_wl.patch: Add a workaround for
   Broadcom wl driver's first failing scan (LP: #994739)

Or I'll be happy to make the changes for you, just giving you a chance to prepare everything from start to finish ;)

review: Needs Fixing
Stéphane Graber (stgraber) wrote :

Marking as Work in progress as either Pau or Mathieu need to rebase that change on ubuntu:wpa.

Pau Oliva (poliva) wrote :

Just done here:
https://code.launchpad.net/~poliva/ubuntu/quantal/wpa/quantal/

I hope it is correct this time, thanks for your patience! :)

Stéphane Graber (stgraber) wrote :

Marking this one rejected. Review will continue in the other one.

Unmerged revisions

20. By Pau Oliva on 2012-06-20

Add missing patch file fix_driver_wext_for_broadcom_wl.patch

19. By Pau Oliva on 2012-05-21

Add a workaround for Broadcom wl driver's first failing scan (LP: #994739)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.pc/applied-patches'
2--- .pc/applied-patches 2012-02-16 16:21:29 +0000
3+++ .pc/applied-patches 2012-06-21 06:49:18 +0000
4@@ -8,3 +8,4 @@
5 hostap_allow-linking-with-libnl-3.2.patch
6 for-MS-CHAP-convert-the-password-from-UTF-8-to-UCS-2.patch
7 dbus-activation-cmdline.patch
8+fix_driver_wext_for_broadcom_wl.patch
9
10=== modified file 'debian/changelog'
11--- debian/changelog 2012-03-16 09:55:12 +0000
12+++ debian/changelog 2012-06-21 06:49:18 +0000
13@@ -1,3 +1,15 @@
14+wpasupplicant (0.7.3-6ubuntu4) quantal; urgency=low
15+
16+ * Add missing patch file fix_driver_wext_for_broadcom_wl.patch
17+
18+ -- Pau Oliva Fora (pof) <pau@eslack.org> Wed, 20 Jun 2012 19:24:29 +0200
19+
20+wpasupplicant (0.7.3-6ubuntu3) quantal; urgency=low
21+
22+ * Add a workaround for Broadcom wl driver's first failing scan (LP: #994739)
23+
24+ -- Pau Oliva Fora (pof) <pau@eslack.org> Mon, 21 May 2012 22:36:22 +0200
25+
26 wpasupplicant (0.7.3-6ubuntu2) precise; urgency=low
27
28 * debian/wpasupplicant.postinst: don't fail package configuration if the
29
30=== added file 'debian/patches/fix_driver_wext_for_broadcom_wl.patch'
31--- debian/patches/fix_driver_wext_for_broadcom_wl.patch 1970-01-01 00:00:00 +0000
32+++ debian/patches/fix_driver_wext_for_broadcom_wl.patch 2012-06-21 06:49:18 +0000
33@@ -0,0 +1,62 @@
34+From: Pau Oliva <pau@eslack.org>
35+Bug-Ubuntu: https://bugs.launchpad.net/bugs/994739
36+Origin: other, http://lists.shmoo.com/pipermail/hostap/2011-March/022891.html
37+Subject: fix driver_wext for broadcom wl driver
38+
39+With broadcom's "wl" driver the first scan after ifup always fails with
40+EINVAL. This produces a 30 seconds timeout when establishing a connection
41+either on boot, or after resuming from suspend.
42+This is a workaround to wext driver which will rerun the scan if first
43+scan fails EINVAL.
44+
45+--- wpasupplicant-0.7.3.orig/src/drivers/driver_wext.c
46++++ wpasupplicant-0.7.3/src/drivers/driver_wext.c
47+@@ -733,6 +733,8 @@ void * wpa_driver_wext_init(void *ctx, c
48+
49+ drv->mlme_sock = -1;
50+
51++ drv->scans = 0;
52++
53+ if (wpa_driver_wext_finish_drv_init(drv) < 0)
54+ goto err3;
55+
56+@@ -916,10 +918,13 @@ int wpa_driver_wext_scan(void *priv, str
57+ static u8 * wpa_driver_wext_giwscan(struct wpa_driver_wext_data *drv,
58+ size_t *len)
59+ {
60++ struct wpa_driver_scan_params params;
61+ struct iwreq iwr;
62+ u8 *res_buf;
63+ size_t res_buf_len;
64+
65++ drv->scans++;
66++
67+ res_buf_len = IW_SCAN_MAX_DATA;
68+ for (;;) {
69+ res_buf = os_malloc(res_buf_len);
70+@@ -942,6 +947,15 @@ static u8 * wpa_driver_wext_giwscan(stru
71+ wpa_printf(MSG_DEBUG, "Scan results did not fit - "
72+ "trying larger buffer (%lu bytes)",
73+ (unsigned long) res_buf_len);
74++ } if (errno == EINVAL && drv->scans == 1) {
75++ /*
76++ * Broadcom's wl driver is buggy and the first scan
77++ * after ifup always fail with EINVAL. Rerun the
78++ * scan to get scan results.
79++ */
80++ os_memset(&params, 0, sizeof(params));
81++ wpa_driver_wext_scan(drv, &params);
82++ return NULL;
83+ } else {
84+ perror("ioctl[SIOCGIWSCAN]");
85+ os_free(res_buf);
86+--- wpasupplicant-0.7.3.orig/src/drivers/driver_wext.h
87++++ wpasupplicant-0.7.3/src/drivers/driver_wext.h
88+@@ -42,6 +42,7 @@ struct wpa_driver_wext_data {
89+
90+ char mlmedev[IFNAMSIZ + 1];
91+
92++ int scans;
93+ int scan_complete_events;
94+
95+ int cfg80211; /* whether driver is using cfg80211 */
96
97=== modified file 'debian/patches/series'
98--- debian/patches/series 2012-02-16 16:21:29 +0000
99+++ debian/patches/series 2012-06-21 06:49:18 +0000
100@@ -8,3 +8,4 @@
101 hostap_allow-linking-with-libnl-3.2.patch
102 for-MS-CHAP-convert-the-password-from-UTF-8-to-UCS-2.patch
103 dbus-activation-cmdline.patch
104+fix_driver_wext_for_broadcom_wl.patch
105
106=== modified file 'src/drivers/driver_wext.c'
107--- src/drivers/driver_wext.c 2011-04-17 21:07:58 +0000
108+++ src/drivers/driver_wext.c 2012-06-21 06:49:18 +0000
109@@ -733,6 +733,8 @@
110
111 drv->mlme_sock = -1;
112
113+ drv->scans = 0;
114+
115 if (wpa_driver_wext_finish_drv_init(drv) < 0)
116 goto err3;
117
118@@ -916,10 +918,13 @@
119 static u8 * wpa_driver_wext_giwscan(struct wpa_driver_wext_data *drv,
120 size_t *len)
121 {
122+ struct wpa_driver_scan_params params;
123 struct iwreq iwr;
124 u8 *res_buf;
125 size_t res_buf_len;
126
127+ drv->scans++;
128+
129 res_buf_len = IW_SCAN_MAX_DATA;
130 for (;;) {
131 res_buf = os_malloc(res_buf_len);
132@@ -942,6 +947,15 @@
133 wpa_printf(MSG_DEBUG, "Scan results did not fit - "
134 "trying larger buffer (%lu bytes)",
135 (unsigned long) res_buf_len);
136+ } if (errno == EINVAL && drv->scans == 1) {
137+ /*
138+ * Broadcom's wl driver is buggy and the first scan
139+ * after ifup always fail with EINVAL. Rerun the
140+ * scan to get scan results.
141+ */
142+ os_memset(&params, 0, sizeof(params));
143+ wpa_driver_wext_scan(drv, &params);
144+ return NULL;
145 } else {
146 perror("ioctl[SIOCGIWSCAN]");
147 os_free(res_buf);
148
149=== modified file 'src/drivers/driver_wext.h'
150--- src/drivers/driver_wext.h 2011-04-17 21:07:58 +0000
151+++ src/drivers/driver_wext.h 2012-06-21 06:49:18 +0000
152@@ -42,6 +42,7 @@
153
154 char mlmedev[IFNAMSIZ + 1];
155
156+ int scans;
157 int scan_complete_events;
158
159 int cfg80211; /* whether driver is using cfg80211 */

Subscribers

People subscribed via source and target branches

to all changes: