update nl80211_copy from latest kernel (INTERNAL)

Includes internal TI commands (channel switch etc).
P2P: ignore neg_req with previously used dialog_token

If for some reason we get a 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 it received).

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

Signed-off-by: Eliad Peller <eliad@wizery.com>
blacklist: Add expiration mechanism

With the current implementation, once a BSS was added
to the blacklist, it can't go out. Add a simple timeout
(2 minutes) to allow blacklist expiration.

TODO: the timeout should probably be set more dynamically,
or at least make it configurable...

Signed-off-by: Eliad Peller <eliad@wizery.com>
bgscan_learn: fix initial interval

In case the initial signal level of the associated BSS
was above the given threshold , bgscan_learn module would
begin using the short_interval but never switch to the
long_interval as there would be no signal change event.
Make the init code poll for the current signal level and
set scan_interval accordingly.
This logic exists in bgscan_simple but was missing in
bgscan_learn.
bgscan_learn: Scan all channels in certain scenarios

The current scanning of learned frequencies and only a single
new frequency every interval may result in a very long time until
a specific channel where a BSS candidate operates would be scanned
(especially if working on both 2.4 and 5Ghz). To better handle
this scan all frequencies when signal is low and we haven't learned
more than 1 channel.
bgscan_learn: scan all freq only if there are no candidates (INTERNAL)

change to patch 19958a54733009e7ef07dc10d98c8b04fa94b882

The original fix to bgscan_learn performs a scan on
all frequencies if bss candidates were not seen on other
channels.
This patch changes it so that if a candidate bss was
seen on the channel of the current AP do not scan
all frequencies.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
SME: Handle Netgear APs WEP shared quirks

Some Netgear APs like WNAP210 have a quirk behavior when
configured for WEP Shared. They send an auth response with algo
SHARED and status code NOT_SUPPORTED_AUTH_ALG (13) when being
sent a request made with auth algo OPEN.
Handle such APs by re-trying SHARED auth in this case.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
add station before getting assoc resp tx completion

Add the station before sending the association
response (rather than after tx completion), in
order to handle EAPOL-Start before tx completion
race.

[Seems this is missing some cleanups - can't go upstream yet]

Signed-off-by: Eliad Peller <eliad@wizery.com>

Conflicts:

	src/ap/ieee802_11.c
save eapol for later use (EAPOL Start race)

[ Includes null check missing from the original patch - Arik ]

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Fix deauth with reason 7 due to multiple assoc_req received

Additional assoc_reqs received after an initial assoc_req (due to a timeout
in the STA) was already being handled caused the handle_assoc flow to
run again and in the process delete the station added to the driver
(in add_pre_assoc_sta). A race would occur where assoc_resp
was already sent to the STA (as part of the handling of the initial
assoc_req) and it sent a null data packet which arrived
while the station was deleted. This caused the packet to be classified
as a class 3 frame coming from an unknown STA and a deauth
would occur. Fix this by discarding additional assoc_req between
receiving the 1st assoc_req and getting a tx callback for the assoc_resp.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
ap: add missing WLAN_STA_ASSOC_REQ_OK flag cleanups

cleanup of WLAN_STA_ASSOC_REQ_OK flag is missing in some
places (e.g. when deauth a sta).

(This in turn caused problems when working as GO, as our
internal commit (a3e0a16 "Fix deauth with reason 7 due to
multiple assoc_req received") caused reassociations
(after WPS) to get dropped.

Signed-off-by: Eliad Peller <eliad@wizery.com>
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>
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.
initiate roaming on beacon_loss

Add wpa_s->roaming to indicate (forced) roaming request.
set it on beacon_loss event.
(no need to disconnect if there is no available ap, as
the driver will send disassoc after some time)

Signed-off-by: Eliad Peller <eliad@wizery.com>
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.

[Arik - reorder deauth event notification and make it is a deauth event
before touching its data]

Signed-off-by: Eyal Shapira <Eyal@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
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.
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>
Revert "P2P: Assume GO Negotiation failed if GO Neg Conf wait times out"

Galaxy Nexus takes time to send the GO Neg Confirm (~200ms) and this
commit caused the GO Neg to fail because of this.

This reverts commit 579a80982ad07619373876c09cdd60e2afcba5b5.
Android: Add top level makefiles

These are from Android wpa_supplicant_8.git initial 0.8.X commit
8d520ff1dc2da35cdca849e982051b86468016d8.

Change-Id: I26aec5afbbd4f4a1f5fd900912545b6f5050de64
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>