~vicamo/ubuntu/vivid/wpa/add-wowlan-support

« back to all changes in this revision

Viewing changes to debian/patches/fix_driver_wext_for_broadcom_wl.patch

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2012-08-01 12:02:44 UTC
  • Revision ID: package-import@ubuntu.com-20120801120244-jgad5vwfy8ygxtf5
Tags: 1.0-2ubuntu3
debian/patches/fix_driver_wext_for_broadcom_wl.patch: Drop the patch, it
appears to break at least some scans with some Broadcom devices.
(LP: #994739)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
5
 
 
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
10
 
scan fails EINVAL.
11
 
 
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
16
 
@@ -855,6 +855,8 @@
17
 
 
18
 
        drv->mlme_sock = -1;
19
 
 
20
 
+       drv->scans = 0;
21
 
+
22
 
        if (wpa_driver_wext_finish_drv_init(drv) < 0)
23
 
                goto err3;
24
 
 
25
 
@@ -1064,10 +1066,13 @@
26
 
 static u8 * wpa_driver_wext_giwscan(struct wpa_driver_wext_data *drv,
27
 
                                    size_t *len)
28
 
 {
29
 
+       struct wpa_driver_scan_params params;
30
 
        struct iwreq iwr;
31
 
        u8 *res_buf;
32
 
        size_t res_buf_len;
33
 
 
34
 
+       drv->scans++;
35
 
+
36
 
        res_buf_len = IW_SCAN_MAX_DATA;
37
 
        for (;;) {
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) {
44
 
+                       /*
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.
48
 
+                        */
49
 
+                       os_memset(&params, 0, sizeof(params));
50
 
+                       wpa_driver_wext_scan(drv, &params);
51
 
+                       return NULL;
52
 
                } else {
53
 
                        perror("ioctl[SIOCGIWSCAN]");
54
 
                        os_free(res_buf);
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
59
 
@@ -45,6 +45,7 @@
60
 
 
61
 
        char mlmedev[IFNAMSIZ + 1];
62
 
 
63
 
+       int scans;
64
 
        int scan_complete_events;
65
 
 
66
 
        int cfg80211; /* whether driver is using cfg80211 */