Android: driver_nl80211: implement NoA/p2p_ps/set_wps_ie stubs

Most return -1, as if the functions were not implemented. This allows
us to compile with ANDROID_P2P. set_wps_ie returns 0 to allow AP
initialization to work.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Change-Id: I9a454782524270e3db5af45b0aadd051c6fa41a0
Android: wpa_s template: set p2p_go_max_inactivity and p2p concurrency

Set p2p_go_max_inactivity to 60 secs (instead of the default
of 300 secs) to avoid creating a user of experience of a
WiFi Direct connection which doesn't disconnect. This may
happen if the P2P GO interface misses a deauth/disassoc frame
and keeps on thinking the client is connected. Limit this
time to 30 secs which creates a better user experience.

[Arik - also set the default mode of operation to p2p concurrency. This
means we will work with 2 interfaces for p2p]

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Android: wpa_s template: allow HT40 GO by default

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Android: nl80211: dummy DRIVER SETBAND handler

SETBAND command is handled in wpa_supplicant_driver_cmd API.
Add a dummy handler in driver_nl80211 for avoiding misleading log,
"Unsupported command: SETBAND ".

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
Android: Implement SETBAND for scan requests

This provides partial SETBAND driver command implementation by
converting the request into a filter for which channels are scanned
by wpa_supplicant.
P2P: Prefer 20 MHz operating channels on 5 GHz band over 2.4 GHz

When no other user preference is specified, opt to use an operating
channel that allows 5 GHz band to be used rather than 2.4 GHz.
Previously, this was already done in practice for HT40 channels since no
such channel is enabled for P2P on 2.4 GHz. This commit extends this to
apply 5 GHz preference for 20 MHz channels as well.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Android: P2P: fix band A limitation

This fixes up patch f407457 from Jouni for an older version of the
supplicant (aligned to the upstream KK).

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