aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/scan.c
Commit message (Collapse)AuthorAgeFilesLines
* wpa_s: don't accumulate delayed sched scan requests (UPSTREAM)Victor Goldenshtein2012-11-131-0/+3
| | | | | | | Clear any previous pending timeouts before scheduling a new delayed sched scan. Signed-off-by: Victor Goldenshtein <victorg@ti.com>
* Avoid normal scans before sched scan if max_scan_ssids=1 (UPSTREAM)Eyal Shapira2012-10-291-0/+5
| | | | | | | | | | In the case of max_scan_ssids=1 we may fallback to normal scan if there's a single scan_ssid network. However the normal scan can't add a wildcard SSID to the ssid list as it's limited to a single entry. This delays getting broadcast scan results. Always prefer to do a sched scan in such a case. Signed-off-by: Eyal Shapira <eyal@wizery.com>
* P2P: Allow P2P functionality to be disabled per interfaceJouni Malinen2012-10-291-1/+2
| | | | | | | | | | | | | | | | | By default, P2P is enabled globally for all virtual interfaces and this makes wpa_supplicant include WSC and P2P IEs in Probe Request frames for all scans even if this is for a non-P2P station connection to speed up device discovery. If an interface is dedicated for non-P2P station mode operations, it is now possible to disable addition of WSC and P2P IEs into Probe Request frames with a per-interface p2p_disabled parameter. This can be set either in the configuration file (p2p_disabled=1) or at run time ("wpa_cli -i wlan0 set p2p_disabled 1"). Unlike the previous mechanism ("wpa_cli p2p_set disabled 1"), the new parameter changes the behavior only for the specified interface while other interfaces continue to follow the global P2P enabled/disabled state. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Eyal Shapira <eyal@wizery.com>
* Revert "Add P2P IEs to probe requests only when in P2P (UPSTREAM)"Eyal Shapira2012-10-291-1/+1
| | | | | | | | | | | This is replaced by a recent patch by Jouni in the upstream: "P2P: Allow P2P functionality to be disabled per interface" This reverts commit a56f6df6f8e5dcd650893e8beb4a16a633c179d1. Conflicts: src/p2p/p2p.c
* Add P2P IEs to probe requests only when in P2P (UPSTREAM)Eyal Shapira2012-08-131-1/+1
| | | | | | | | | | | | The current code caused P2P and consquently WPS IEs to be added to any probe as the check was for non null global->p2p. global->p2p gets set whenever P2P is initialized globally and that occurs on the first interface init. Fix this by indicating wps is in use only when in active P2P discovery or connection establishement. (i.e. not P2P_IDLE - either doing search, neg or provisioning) Signed-off-by: Eyal Shapira <eyal@wizery.com>
* Fix adding extra ies in sched scan (UPSTREAM)Eyal Shapira2012-08-121-7/+9
| | | | | | | | | Refactoring done in commit 46ee04 IEEE 802.11u: Allow Interworking and HESSID to be configured broke adding extra ies in sched scan. Fix it and remove unused params arg in wpa_supplicant_extra_ies. Signed-off-by: Eyal Shapira <eyal@wizery.com>
* Allow immediate scan request even if another scan was scheduled laterDmitry Shmidt2012-08-021-1/+2
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* Android: Implement SETBAND for scan requestsJouni Malinen2012-08-021-0/+60
| | | | | | This provides partial SETBAND driver command implementation by converting the request into a filter for which channels are scanned by wpa_supplicant.
* Fix reporting hidden APs during scanDmitry Shmidt2012-08-021-0/+2
| | | | | Change-Id: I2f3274c6f89ac0100331f4987c40e23f36577817 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* Fix scan notification in case of canceling scanDmitry Shmidt2012-08-021-0/+1
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* Disconnect if we can't roam following beacon lossEyal Shapira2012-08-021-2/+10
| | | | | | | | | | | | | | | | | The driver reports the 1st beacon loss event but doesn't disconnect until further consecutive beacon loss events are received. That's being done in order to give the supplicant time to roam seamlessly (i.e. without reporting DISCONNECTED to upper layers). However, in case we can't find any roaming candidates it's better to disconnect as soon as possible so any supplicant client will be able to switch quickly to another communication channel (e.g. mobile 3G). This change initiates up to two immediate specific SSID scans on all channels following a beacon loss in order to locate a roaming candidate. Two scans are performed in case a roaming candidate was preivously blacklisted. That way, it'll be explored if there's no other option. Signed-off-by: Eyal Shapira <eyal@wizery.com>
* wpa_supplicant: don't scan ssids that were scheduled scannedEliad Peller2012-08-021-1/+13
| | | | | | | | | | | When having more than max_sched_scan_ssids ssids, scanning of the remaining ssids (not included in the sched scan) might take a while. Reduce this time by avoiding scanning of ssids that were already included in the scheduled scan. Signed-off-by: Eliad Peller <eliad@wizery.com>
* sched scan: add support for short and long intervalsEyal Shapira2012-08-021-6/+28
| | | | | Configure sched scan to use short and long intervals if the driver supports it
* sched scan: Avoid changing state to SCANNINGEyal Shapira2012-08-021-10/+2
| | | | | | | | sched scan was indicating to the supplicant that scanning was in progress which prevented broadcast scan attempts from cli (or in Android from the framework). Signed-off-by: Eyal Shapira <eyal@wizery.com>
* sched scan: Logic changesEyal Shapira2012-08-021-118/+55
| | | | | | | | Scan up to 16 network of the top priority in the configuration using sched scan. If there are more than 16 use normal scan as well. Stop using the timeout mechanism and interval/timeout backoffs. Signed-off-by: Eyal Shapira <eyal@wizery.com>
* sched scan: Avoid scan if no enabled networksEyal Shapira2012-08-021-1/+3
| | | | | | | | | | There's no point to sched scan when there's no enabled networks. This also fixes a bug where the supplicant would reset its scan results in case such a sched scan was initiated and therefore would cause a "flickering" network list effect on Android. (For a moment you see the network list and the next it's empty) Signed-off-by: Eyal Shapira <eyal@wizery.com>
* sched scan: Continue to scan even if previous scan cancel failsEyal Shapira2012-08-021-8/+15
| | | | | | | cancel_sched_scan might fail if there wasn't any scan going on before. This shouldn't stop a new sched scan attempt. Signed-off-by: Eyal Shapira <eyal@wizery.com>
* sched scan: Update scan according to changes in network listEyal Shapira2012-08-021-2/+2
| | | | | | | | sched scan wasn't updated according to changes in the network list (enable/disable/remove). This caused the FW to continue scanning with the wrong list configured which triggered problems. Signed-off-by: Eyal Shapira <eyal@wizery.com>
* sched scan: Turn passive scan into activeEyal Shapira2012-08-021-0/+5
| | | | | | | | In case there are no scan_ssid networks in the conf passive scan was done. Better do an active scan using broadcast probe request as it's shorter Signed-off-by: Eyal Shapira <eyal@wizery.com>
* autoscan: Fix potential freeing of uninitialized pointerJouni Malinen2012-07-031-1/+1
| | | | | | | | | Commit 7c865c68536825d91e64e1545a1f6ed51526ebff introduced a code path that can skip extra_ie initialization in wpa_supplicant_scan(). This could result in semi-random crashes when using the autoscan mechanism. Fix this by initializing extra_ie to NULL. Signed-hostap: Jouni Malinen <j@w1.fi>
* Add automatic scanning supportTomasz Bursztyka2012-06-261-4/+26
| | | | | | | | | | | | | | | | | | | Like bgscan, autoscan is an optional module based feature to automate scanning but while disconnected or inactive. Instead of requesting directly a scan, it only sets the scan_interval and the sched_scan_interval. So, if the driver supports sched_scan, autoscan will be able to tweak its interval. Otherwise, the tweaked scan_interval will be used. If scan parameters needs to be tweaked, an autoscan_params pointer in wpa_s will provide those. So req_scan / req_sched_scan will not set the scan parameters as they usually do, but instead will use this pointer. Modules will not have to request a scan directly, like bgscan does. Instead, it will need to return the interval it wants after each notification. Signed-hostap: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
* Add debug prints of scan result IEsJouni Malinen2012-05-111-0/+8
| | | | | | | | | | Excessive debug level can now be used to dump the IEs received in scan results from both Beacon and Probe Response frames. This makes it easier to debug issues where the driver (or well, more likely cfg80211) does not update the IEs based on Beacon frames if even a single Probe Response frame has been received. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Validate WEP key lengths based on driver capabilitiesJouni Malinen2012-05-101-13/+16
| | | | | | | | | | The nl80211 driver interface does not allow 128-bit WEP to be used without a vendor specific cipher suite and no such suite is defined for this purpose. Do not accept WEP key length 16 for nl80211 driver interface forn ow. wext-interface can still try to use these for backwards compatibility. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* HS 2.0: Add Hotspot 2.0 indication into Probe RequestJay Katabathuni2012-05-081-0/+6
| | | | Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Ignore network blocks that have invalid WEP key lengthJouni Malinen2012-05-071-10/+12
| | | | | | | | | | | | | Do not try to associate with a network that has an invalid or incomplete configuration because the association or at least data connection would fail anyway. This commits adds a common function for checking whether a network block is disabled to make it easier to check network blocks without having to reject them during configuration file parsing (which would prevent wpa_supplicant from starting). The only additional check added in this commit is to verify the WEP key length. Similar checks for other parameters can be added in future commits. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Fix sched_scan for max-num-of-scan_ssid=1 networksJouni Malinen2012-04-171-0/+4
| | | | | | | | | | When the network configuration includes exactly the number of scan_ssid=1 networks as the driver supports for scan_sched and no networks need wildcard SSID scan, there is no need to use sched_scan timeout. Check this condition and optimize this case to avoid the extra sched_scan start/stop operations. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Fix sched_scan debug print regarding timeoutJouni Malinen2012-04-171-4/+4
| | | | | | | The debug messages were showing the opposite of what the actual implementation was doing for sched_scan timeout. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Add disable_scan_offload parameter to disable automatic scan offloadingJouni Malinen2012-04-171-1/+1
| | | | | | | | This new configuration parameter can be used to disable automatic offloading of scan requests to the driver which was previously used by default if the driver supported sched_scan. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Use scan optimization for post-provisioning connectionJouni Malinen2012-02-291-3/+5
| | | | | | | | Since P2P GO cannot change the SSID after WPS provisioning step, we can use the specific SSID for the scan for data connection. In addition, mark this as p2p_probe to avoid unnecessary use of 802.11b rates. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Use specific SSID in scan for provisioning stepJouni Malinen2012-02-291-0/+14
| | | | | | | | | Since the P2P client learns the SSID of the group during GO Negotiation, use the specific SSID in the Probe Request frames during the provisioning step. This helps in avoiding unnecessary Probe Response frames from other P2P GOs or APs. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Advertise immediate availability of WPS credentialJouni Malinen2012-02-271-1/+3
| | | | | | | | | | | | | | Use Device Password ID in WSC IE of Probe Request and Probe Response frames to advertise immediate availability of WPS credentials per P2P specification sections 3.1.2.1.1 (Listen State), 3.1.2.1.2 (Scan Phase), and 3.1.2.1.3 (Find Phase). For now, the Device Password ID is set only for the case where we are active GO Negotiation with a specific peer. In practice, this means that the Probe Response frames during pending GO Negotiation (whenever in Listen state) indicate availability of the credential. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Add BSSID filter for testing purposesJouni Malinen2012-02-161-0/+45
| | | | | | | | | | | wpa_supplicant can now be configured to filter out scan results based on a BSSID filter. Space-separated set of allowed BSSIDs can be set with wpa_cli set bssid_filter command. Filtering mechanism can be disabled by setting this variable to an empty list. When set, only the BSSes that have a matching entry in this list will be accepted from scan results. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* WPS: Do not use sched_scan for provisioning stepJouni Malinen2012-02-151-0/+14
| | | | | | | | | | Normal scan is more reliable and faster for WPS operations and since these are for short periods of time, the benefit of trying to use sched_scan would be limited. This can fix WPS connectivity issues with some drivers. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com> intended-for: hostap-1
* Remove the GPL notification from files contributed by Jouni MalinenJouni Malinen2012-02-111-8/+2
| | | | | | | Remove the GPL notification text from the files that were initially contributed by myself. Signed-hostap: Jouni Malinen <j@w1.fi>
* Interleave wildcard and specific SSID scans when max_ssids=1Eyal Shapira2012-01-291-8/+26
| | | | | | | | For drivers limited to scan a single SSID at a time, this prevents waiting too long for a wildcard scan in case there are several scan_ssid networks in the configuration. Signed-hostap: Eyal Shapira <eyal@wizery.com>
* P2P: Fix WSC IE inclusion for P2P disabled caseJouni Malinen2012-01-271-4/+6
| | | | | | | | | | | wpas_wps_in_use() was forcing WPS to be enabled unconditionally if P2P support was included in the build. This is not really the correct behavior for the case when P2P has been disabled at runtime. Change the code here to verify runtime configuration of P2P before forcing WPS to be enabled. This allows WSC IE to be left out from Probe Request frames when scanning for APs without P2P or WPS being in use. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* WPS: Use single channel scan if AP channel already knownJouni Malinen2011-12-311-0/+10
| | | | | | | | | If the BSSID of the AP is specified in the WPS command, the target AP is likely already in the BSS table and its operating channel is known. Use this information to speed up connection by only scanning the known channel. Signed-hostap: Jouni Malinen <j@w1.fi>
* Fix compiler warning with CONFIG_NO_STDOUT_DEBUG=yJouni Malinen2011-12-111-0/+2
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* Increase min sched_scan interval from 2 to 10 secondsJouni Malinen2011-11-291-1/+1
| | | | | | | | | Trying to run sched_scan round every two seconds by defaults sounds way too frequent since dualband cards are unlikely to be able to complete the full scan cycle in two seconds. For now, set the hardcoded value to 10 seconds to make this somewhat more reasonable. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Use normal scan before sched_scan if that can speed up connectionJouni Malinen2011-11-281-9/+31
| | | | | | | | | | When normal scan can speed up operations, use that for the first three scan runs before starting the sched_scan to allow user space sleep more. We do this only if the normal scan has functionality that is suitable for this or if the sched_scan does not have better support for multiple SSIDs. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Add broadcast SSID for sched_scan for scan_ssid=0 networksJouni Malinen2011-11-281-0/+18
| | | | | | | | Previously, only networks with scan_ssid=1 were included in sched_scan. This needs to behave similarly to the normal scan where broadcast SSID is used to find networks that are not scanned for with a specific SSID. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Use common code for disabled network case in sched_scanJouni Malinen2011-11-281-5/+3
| | | | | | There is no need to implement two copies of the iteration code here. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Drop sched_scan filter if not enough match sets supportedJouni Malinen2011-11-281-2/+7
| | | | | | | | Instead of including only a single SSID in the sched_scan request if the driver does not support match sets, just drop the SSID filter and configure more SSIDs up to the sched_scan limit. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Make sched_scan debug clearer on timeout useJouni Malinen2011-11-281-3/+9
| | | | Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Fix sched_scan filter_ssids setting for no filters caseJouni Malinen2011-11-281-0/+5
| | | | | | | The filter_ssids pointer needs to be set to NULL if no SSID filters are set to avoid filtering out all scan results. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Fix sched_scan filter setting for max_match_sets == 0Jouni Malinen2011-11-251-1/+2
| | | | | | | | The previous implementation was trying to add the first SSID to a zero-length array. Avoid this with an explicit validation of the array length. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Do not try to add wildcard SSID into active sched_scanJouni Malinen2011-11-191-2/+3
| | | | | | | | Even though scan_ssid should not really be set for wildcard SSID, better verify that here explicitly insead of assuming that the SSID is set. Signed-hostap: Jouni Malinen <j@w1.fi>
* sched scan: Fix passive scanningEyal Shapira2011-11-181-6/+7
| | | | | | | | | | | Scan wasn't initiated in case the config contained only networks without scan_ssid. In such a case we want scan to be initiated without any SSIDs to actively scan but include all the SSIDs in the filter list. Also added some debug logs to easily see which SSIDs were included in which list. Cc: Luciano Coelho <coelho@ti.com> Signed-off-by: Eyal Shapira <eyal@wizery.com>
* Clean up debug dump for scan results sortingJouni Malinen2011-10-301-9/+30
| | | | | | | There is not much need for showing the interim qsort steps, so just show the ordered results. Signed-hostap: Jouni Malinen <j@w1.fi>
* Prefer 5 GHz networks over 2.4 GHz networksGary Morain2011-10-301-5/+41
| | | | | | | In scan.c, merge a channel's noise value into the scan results. When comparing scan results, compute the signal-to-noise ratio and use it when available. Prefer a 5 GHz network if its SNR is really big (> 30) or if its SNR is relatively close to the other network's.