Roam back to the origin AP when assoc/auth times out

When roaming, avoid going to DISCONNECTED in case assoc or auth
times out with the new AP. Instead attempt to reconnect
back to old AP.
Ignore a deauth from a different BSS than the current one

This fixes an issue with roaming where the previous
BSS would send a DEAUTH during the roaming and this
would caused the supplicant to disconnect.
Prevent roaming to a different ESS while connected

While connected to a certain ESS prevent roaming to a different
ESS AP even if its signal is better. This prevents an undesired
switch between networks in this example scenario:
2 network profiles configured Net1 and Net2. We're already associated
to an AP on the ESS Net1 and while walking with the device we get close
to an AP from ESS Net2. Before this change a decision to switch to
Net2 was made.
nl80211_driver: add private commands to use dropbcast

Add DRIVER DROPBCAST {GET,ENABLE,DISABLE} commands to show the current
setting, enable and disable the feature of dropping all broadcast
packets while in suspend mode.

Signed-off-by: Luciano Coelho <coelho@ti.com>
P2P: ignore neg_req with previously used dialog_token

The p2p spec is a bit broken. if for some reason we
get duplicate negotiation request, the supplicant
will generate 2 different responses (different SSIDs)
with the same dialog token. The remote peer will
confirm one of them, but it will probably be the
wrong one (the first he received)...

Workaround it but ignoring negotiation requests with
the last used dialog_token.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Execute p2p_find instead of p2p_listen

In order for the Android UI to update its
peers list, p2p_find should be used but the Android
WiFi Direct UI uses p2p_listen for some reason.
So workaround it by starting a p2p_find instead.
increase the eapol pending timer to 500ms
P2P: update scan results

(not sure this should go upstream)

update p2p scan results (and notify) if the
listen_freq or go_state were changed.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Initiate a periodic normal scan in addition to sched scan

Some applications (e.g. detecting open network around
in Android) require periodic broadcast scan results.
The periodic broadcast scan was replaced by sched scan
completely. Re-enable these scan alongside sched scans.
Increase the scan_interval to 15 secs

The current periodic scan by wpa_s is
set to 5 secs. This is too short so increase
it to 15 secs.
P2P: Ignore PBC overlap in P2P provisioning

PBC overlap can be ignored as the P2P client knows
that it should connect to the P2P GO so no point of failing
the WPS session in case of overlap because some other
AP had WPS PBC on at the same time.
Use exact interface as socket parameter for init

For p2p, there are virtual interfaces (like p2p-wlan0-X) created and
that results in binding to the common init socket right now.

Instead, have the init bind fail for p2p interfaces and create seperate
sockets specified by the ctrl_interface path in config file

Bug: 5002384
Change-Id: Ia155df079a0bcca1871b6bcab2ef7111f0cba6c1
print ctrl_iface commands

the android wpa_supplicant currently doesn't implement
wpa_hexdump_ascii, so add a simple print for the control
interface commands

Signed-off-by: Eliad Peller <eliad@wizery.com>
wpa_supplicant: VERSION_STR_POSTFIX is now defined to 'git describe'
p2p: consider age for the p2p scan results

Cfg80211 caches the scan results according the
channel number. Due to the 15 sec aging this
might cause the user mode to see more than one
scan result with the same BSSID, e.g. - one
scan result for the p2p-device and one for the
p2p-GO (once it's enabled).

Fix this by updating the device entry only if
the new peer entry is newer than the one
previously stored.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
nl80211_copy: update according to 3.4rc5 kernel

Keep all unsupported defines but move them to the end so they don't
interfere with a virgin kernel-mode driver.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
wpa_supplicant: don't scan ssids that were scheduled scanned

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>
ctrl_iface: check for ongoing sched_scan on SCAN command

The first "if" in the SCAN command handling didn't
check properly for sched_scan, causing the sched_scan
and scan to run concurrently, instead of cancelling
the ongoing sched scan (which is handled by the
"else if" later).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Disconnect if we can't roam following beacon loss

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>