Android: make wpa_driver_nl80211_driver_cmd static

Pave the way for an internal implementation of the command. No static
library.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Android: p2p: various fixes

- Allow group idle timeout to run during WPS disconnect
- Perform single channel scan if we know the channel of the GO joined

Change-Id: I7e9e15b9c44804196bc98c01d51a71e24412b91d
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Android: Fix join for p2p_connect

wps_pbc with interface command stripped out ends up as a null character.
Supplicant tries to interpret that as a bssid. Fix it to ignore null
character as empty bssid

Change-Id: Ic91d6657efaf03fbe5c4a03e9e630b4b3ff5dec4
Android: nl80211: add support for DRIVER COUNTRY command

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
Android: fix driver command retval

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Android: driver_nl80211: ignore useless driver commands

These are not used, so just return success to avoid creating spurious
errors in logcat.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Android: Android.mk: build only for TI builds

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Android: wpa_s template: disassoc on low ack by default

When operating as a GO, disassoc the peer station on aging/Tx failure

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Android: wpa_s template: enable concurrent_sched_scan

Our solution supports this and it speeds up initial connection
to hidden networks.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
nl80211: sync to kernel version for TI R8.2 release (INTERNAL)

Also add NL80211_ATTR_PEER_AID to make this supplicant compile

Signed-off-by: Arik Nemtsov <arik@wizery.com>
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>
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>