Don't give up scanning so easily

Bug #638303 reported by Michael Terry
50
This bug affects 7 people
Affects Status Importance Assigned to Milestone
wpa_supplicant
Confirmed
Medium
wpasupplicant (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Binary package hint: wpasupplicant

I was working on a machine with a broadcom wifi card. It used the proprietary wl.o driver. I noticed that when I resumed from suspend or pressed the F2 button (which on this machine is an rfkill button) to enable wifi, reconnection times with NetworkManager were around 30s. This seemed too long to me.

Investigation revealed that wpasupplicant was scanning after the card was brought up in these scenarios, but failed because (I assume) the wl.o driver was not ready yet. Then it gave up scanning. NM never saw new access points, so didn't bother trying to connect. Then it waited 20s, like it does, before asking wpasupplicant to try scanning again. This scan succeeded and NM proceeded to connect.

I came up with the following patch to get wpasupplicant to try a little harder to scan and forwarded it upstream (see linked bug):

Index: wpasupplicant-0.6.9/wpa_supplicant/events.c
===================================================================
--- wpasupplicant-0.6.9.orig/wpa_supplicant/events.c 2010-09-13 15:28:08.000000000 -0400
+++ wpasupplicant-0.6.9/wpa_supplicant/events.c 2010-09-13 15:28:14.000000000 -0400
@@ -619,6 +619,7 @@
   wpa_printf(MSG_DEBUG, "Failed to get scan results - try "
       "scanning again");
   timeout = 1;
+ wpa_s->scan_req = 1; /* Force scan again */
   goto req_scan;
  }

This is a tracking bug for the issue.

Related branches

Michael Terry (mterry)
tags: added: oem-services patch-forwarded-upstream
Revision history for this message
Kalle Valo (kvalo) wrote :

I sent a patch for 0.7 branch to the list:

http://lists.shmoo.com/pipermail/hostap/2010-October/021809.html

Changed in wpasupplicant:
status: Unknown → Confirmed
Changed in wpasupplicant:
importance: Unknown → Medium
Revision history for this message
Kalle Valo (kvalo) wrote :

I sent a v3 of the patch upstream:

http://lists.shmoo.com/pipermail/hostap/2011-February/022564.html

I'll try to create a distro patch for natty soon. Quite a few people seem to suffer from this.

Changed in wpasupplicant (Ubuntu):
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Kalle Valo (kvalo)
Revision history for this message
Kalle Valo (kvalo) wrote :

Created branch lp:~kvalo/wpasupplicant/bug-638303 which contains my v3 patch backported 0.7 series and uploaded test packages to my ppa.

amd64:
https://launchpad.net/~kvalo/+archive/ppa/+buildjob/2268538

i386:
https://launchpad.net/~kvalo/+archive/ppa/+buildjob/2268539

Kalle Valo (kvalo)
Changed in wpasupplicant (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Kalle Valo (kvalo) wrote :
Revision history for this message
Gema Gomez (gema) wrote :

We would like to get this change integrated.

Changed in wpasupplicant (Ubuntu):
assignee: Kalle Valo (kvalo) → Canonical Foundations Team (canonical-foundations)
Changed in wpasupplicant (Ubuntu):
status: In Progress → Triaged
assignee: Canonical Foundations Team (canonical-foundations) → nobody
Revision history for this message
Brian Murray (brian-murray) wrote :

Looking closely at v4 of the patch which is linked to in comment #4 it doesn't look like it would apply to the current version of wpasupplicant in Oneiric.

Revision history for this message
Pau Oliva (poliva) wrote :

I have adapted the v4 patch above to the current version of wpasupplicant (0.7.3):

https://bugs.launchpad.net/ubuntu/+source/wpasupplicant/+bug/994739/comments/13

Please consider integrating this, as the wl driver is being used in a wide variety of hardware.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.