site  contact  subhomenews

wpa_supplicant ap_scan

March 12, 2010 — BarryK
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:

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.


Username: jemimah
Here is the blurb about it from the developer's documentation ( [code]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) [/code] 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.

Look at this
Username: bigpup
"I know this has nothing to do with this post, but I did a Google search for Distro watch and look what came up. Put the fun back into computing. Use Linux, BSD. Mar 11, 2010 ... News and feature lists of Linux and BSD distributions. - Cached - SimilarMajor Distributions Ubuntu PCLinuxOS Mint Puppy openSUSE Fedora Use Linux, BSD More results from

My Notes on ap_scan
Username: JustGreg
"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

Username: 01micko
"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.

Username: ttuuxxx
"Your wireless modem card looks like its covered by mad-wifi why not compile and use that? ttuuxxx

Username: BarryK
"ttuuxxx, Could do, but the challenge right now is to get Ndiswrapper working properly in my SNS.

Username: 01micko
"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.

ndiswrapper again
Username: 01micko
"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.

ndiswrapper take 3
Username: 01micko
"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.

Username: BarryK
"Sorry, I forgot about the Ndiswrapper driver. Get it from here: 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.

Tags: puppy