sched scan: Logic changes

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 changing state to SCANNING

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>
nl80211: Do not send HANGED event on private command failure

Upstream implementation sends the HANGED state event on
private command failure. Unimplemented commands were
sent to the driver as-is, causing the HANGED event to be sent
and cause a recovery. Private command handling was modified so
that only implemented commands are sent to the driver and
the sending of the HANGED event was removed
P2P: use GO channel for Operating Channel IE

[ To be upstreamed - Arik ]

Change-Id: I5285126515b47cd3b4cdce717310835f23a78f0a
Signed-off-by: Eliad Peller <eliad@wizery.com>
AP: use uapsd if go_apsd was set

don't set params.uapsd to -1, as it's a valid value.

set conf->bss->wmm_enabled and conf->bss->wmm_uapsd
to enable (and advertise) wmm.

This is currently only a workaround, until we'll have
a more generic way to set GO params.

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

Signed-off-by: Arik Nemtsov <arik@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>
sched scan: read driver support for sched scan intervals

Use the feature flag reported by NL80211 to know
if the driver supports short and long intervals in
the sched scan API. This is a prep patch for the
actual handling of this flag.
sched scan: Add config parameters for short and long intervals

Part of support for short and long intervals
sched scan: add support for short and long intervals

Configure sched scan to use short and long intervals
if the driver supports it
nl80211: Handle ROAMING_SUPPORT event

Some drivers may notify us that roaming support changed.
This is passed on to wpa_s in order to take that into
account regarding bgscan and roaming.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
wpa_s: Disable bgscan and roaming when driver support is limited

Some drivers are limited in certain conditions (e.g. wl12xx
on multi role with a single channel) and would like wpa_s
to disable bgscan and roaming attempts in these situations.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Android: hostapd: enable N rates in build config

Signed-off-by: Ido Reis <idor@ti.com>
Android: wpa_s: changes to default build config

Enable roaming and bgscan

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Ido Reis <idor@ti.com>
wpa_s: add API to disable or enable roaming

If bgscan is configured then it will be disabled and enabled
as well as roaming. This allows wpa_s users to disable roaming
and bgscan when they wish (e.g. device screen is turned off/on)
To disable send "SET roaming_disabled 1" and to enable replace with 0.
config: enable NL80211

Just enable it in both hostapd and wpa_s.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Add API and CLI command to control sched scan intervals

Enable control over the sched scan intervals parameters
through a new wpa_s API (SCHED_SCAN_INTERVALS) and a
matching wpa_cli command.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Fix initial interval of bgscan_learn

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.
Add blacklist expiration

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>