On Mon, Jan 7, 2013 at 12:30 AM, Patrik Flykt <patrik.fl...@linux.intel.com>wrote:
> > Hi, > > On Fri, 2013-01-04 at 09:25 -0800, Stan Hu wrote: > > Let's say you took your device somewhere and connected to SSID Alice. > > connman saves a settings file in /var/lib/connman for this successful > > connection. Let's say you then moved your device and connected to > > SSID Bob. connman also saves another settings file for this > > connection. > > > > Now, when connman starts up, it asks wpa_supplicant to scan SSIDs > > Alice and Bob and the frequencies on which the device last connected. > > The SSIDs are scanned only if the WiFi networks were hidden, in other > cases a normal broadcast scan is done. > connman v1.4 looks like it attempts to scan all the most recent networks that were connected in get_latest_connections() (i.e. profiles that are stored in /var/lib/connman/wifi_*) I think this is true in the latest version of connman as well. > > > Since Alice doesn't exist, the nl80211 driver reports: > > > > nl80211: Scan trigger failed: ret=-22 (Invalid argument) > > Which version of wpa_supplicant is in use? > I am using wpa_supplicant v0.73. I think I now fully understand where the -22 invalid argument error is coming from. It appears that the nl80211 scan fails because connman inserts more SSIDs than allowed by the the driver (max_scan_ssids). wpa_supplicant v1.0 added support for the MaxScanSSID parameter. Since v0.73 doesn't support this parameter, this parameter defaults to WPAS_MAX_SCAN_SSIDS (4): connmand[2478]: plugins/wifi.c:wifi_scan_fast() device 0x99048 0x91738 connmand[2478]: plugins/wifi.c:wifi_scan_fast() max ssids 4 The driver on my WiFi device supports only 1 SSID scan. Since connman attempts to feed 2 SSID devices, the failure causes connman to get stuck waiting for a scan to complete. This problem would be cured by upgrading to wpa_supplicant v1.0, but I do think this issue raises a number of questions: 1) Should the WPAS_MAX_SCAN_SSIDS in the supplicant be set to 0 or 1 by default instead of 4? 2) Why doesn't connman time out on the scan after failing to receive a response from wpa_supplicant? 3) wpa_supplicant should send an error message back to connman, which should abort the scan. > wpa_supplicant never returns a successful scan, so connman gets stuck > > waiting for the scan to complete. If you call 'iwlist wlan0 > > scanning', this causes the nl80211 driver to do a full scan WITHOUT > > the SSIDs. wpa_supplicant returns back the results,connman resumes, > > and everything works. > > Can you check ConnMan is stuck by running either 'test/test-connman scan > wifi' or 'connmanctl scan wifi'? Both commands wait until the scan is > done, which is a few seconds. What about a subsequent scan? If they > never return there is a bug somewhere. > I get a dbus error when I attempt to use 'test/test-connman scan wifi'. iwlist is the only thing that kicks it out of the state. > Cheers, > > Patrik > > > _______________________________________________ > connman mailing list > connman@connman.net > http://lists.connman.net/listinfo/connman > _______________________________________________ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman