wpa_supplicant ap_scan

I'm trying to figure out the 'ap_scan' parameter. Rarsa, tempestuous and JustGreg have been looking into this topic back in 2007 and 2008:

http://www.murga-linux.com/puppy/viewtopic.php?t=29205

Using my laptop's inbuilt wireless, which uses the ath5k driver, ap_scan=0 and ap_scan=1 both work. If I leave the ap_scan parameter out of wpa_supplicant.conf it also works -- so I wonder what wpa_supplicant defaults to? 0?

Using my Netgear WG311 wireless card with ndiswrapper, I have to use ap_scan=2.

There was a suggestion in the forum thread, why not try each in turn? Try in order 2, 1, 0.
...can anyone think why that would not be a good idea?

I have done considerable code cleanup and improvements for my SNS script. Now want to get this ap_scan thing sorted out... for now, I'm using ap_scan=1 as default, except if ndiswrapper driver then ap_scan=2.


Posted on 12 Mar 2010, 19:42


Comments:

Posted on 12 Mar 2010, 23:05 by jemimah
ap_scan
Here is the blurb about it from the developer's documentation (http://hostap.epitest.fi/wpa_supplicant/devel/driver_wrapper.html):

ap_scan=1:


* wpa_supplicant requests scan with SIOCSIWSCAN
* driver reports scan complete with wireless event SIOCGIWSCAN
* wpa_supplicant reads scan results with SIOCGIWSCAN (multiple call if a larget buffer is needed)
* wpa_supplicant decides which AP to use based on scan results
* wpa_supplicant configures driver to associate with the selected BSS (SIOCSIWMODE, SIOCSIWGENIE, SIOCSIWAUTH, SIOCSIWFREQ, SIOCSIWESSID, SIOCSIWAP)

ap_scan=2:

* wpa_supplicant configures driver to associate with an SSID (SIOCSIWMODE, SIOCSIWGENIE, SIOCSIWAUTH, SIOCSIWESSID)

After this, both modes use similar steps:

* optionally (or required for drivers that generate WPA/RSN IE for (Re)AssocReq), driver reports association parameters (AssocReq IEs) with wireless event IWEVASSOCREQIE (and optionally IWEVASSOCRESPIE)
* driver reports association with wireless event SIOCGIWAP
* wpa_supplicant takes care of EAPOL frame handling (validating information from associnfo and if needed, from scan results if WPA/RSN IE from the Beacon frame is not reported through associnfo)


Ap_scan=1 is the default.
Apparently ap_scan=0 is only used for wired networks.

Ap_scan=2: I think you generally only need it with proprietary or developmental drivers that have crappy wpa_supplicant support. There might be a list somewhere of which cards need it, but ap_scan=1 is correct for the vast majority of drivers.




Posted on 13 Mar 2010, 3:15 by bigpup
Look at this
I know this has nothing to do with this post, but I did a Google search for Distro watch and look what came up.

DistroWatch.com: Put the fun back into computing. Use Linux, BSD.
Mar 11, 2010 ... News and feature lists of Linux and BSD distributions.
distrowatch.com/ - Cached - SimilarMajor Distributions
Ubuntu
PCLinuxOS
Mint Puppy
openSUSE
Fedora
Use Linux, BSD
More results from distrowatch.com


Posted on 13 Mar 2010, 8:43 by JustGreg
My Notes on ap_scan
Here are my notes on ap_scan (access point scan). I kept them in the template for the config file to be used with wpa_supplicant.

#ap_scan=0 uses driver to scan for ap
#ap_scan=0
#ap_scan=1 is for broadcasted SSID normally
ap_scan=1
#ap_scan=2 is for hidden SSID normally
#I found for a hidden SSID, I need to use ap_scan=2 JustGreg 1 Sept 2008
# scan_ssid=1 for a hidden SSID does not work!

This has worked for me since Sept. 2008


Posted on 13 Mar 2010, 12:58 by 01micko
wg311v2
I have that card too Barry. Shame the linux sources aren't up to date. Downloading windows driver now.. 16MB!!! All for a few kilobytes of useful stuff, ugh.

Will test some stuff once I have driver.


Posted on 13 Mar 2010, 14:04 by ttuuxxx
Micko/Barry
Your wireless modem card looks like its covered by mad-wifi http://madwifi.org/Install-HOWTO/WL/wl.config.NetGear.WG311
why not compile and use that?
ttuuxxx


Posted on 13 Mar 2010, 14:39 by BarryK
Madwifi
ttuuxxx,
Could do, but the challenge right now is to get Ndiswrapper working properly in my SNS.



Posted on 13 Mar 2010, 14:55 by 01micko
ndiswrapper
Hmmm.. in my quirky 008 there is no ndiswrapper module present.. I made it with the delta, and it was successful so didn't bother with the checksum.

I booted pfix=ram, and unsuccessful with all methods (including sns-2), then tried modrobe ndiswrapper.. FATAL, not present error.

Card works though because I'm posting now from an old spup build with k2.6.29.4 with ndiswrapper.

Ndiswrapper is present in k2.6.31.5 but seems broken (tried on my tpup).. about to try quirky-006.


Posted on 13 Mar 2010, 15:32 by 01micko
ndiswrapper again
Ndiswrapper is ok in 431, (zigbert's stardust actually, but pretty close), guess it would have been reported by now. I have just never bothered with it except when I had my old laptop that I gave away.

I'll try sns-2 in it, pfix=ram.


Posted on 13 Mar 2010, 15:55 by 01micko
ndiswrapper take 3
sns performed almost as expected.. fell over at last hurdle. Zigbert has Pwireless2 in stardust (using his latest) by default. There is some minor conflict with dhcpcd, but I just can't put my finger on it.

Ndiswrapper worked in sns, the log was all good, just didn't connect, then Pwireless2 took over and straight online!

Hope some of this is useful.


Posted on 13 Mar 2010, 16:20 by BarryK
Ndiswrapper
Sorry, I forgot about the Ndiswrapper driver. Get it from here:

http://murga-linux.com/puppy/viewtopic.php?p=400397#400397

I'm running with Ndiswrapper right now, using WEP. SNS would not even connect using WEP, which was very frustrating as it worked before -- then I rebooted and tried again, it worked.