wpa_supplicant: change config - enable ROAMING, 11n and remove rand-pool

CONFIG_ROAMING flag was added in Android for roaming and it is
turned off by default.

Also turn on 11N in wpa_supplicant and disable the random-pool (to speed
up connection operations)

Change-Id: I3eb21cc5da656e7686e2f1f8d20df2e86696e788
Signed-off-by: Vishal Mahaveer <a0271468@ti.com>
driver_nl8011: Add support for DRIVER RXFILTER command

Add support for this Android specific feature using WoWLAN packet
pattern triggers.

Signed-off-by: Pontus Fuchs <pontus.fuchs@tactel.se>
driver_nl80211: rx filters - add support for longer patterns

- Add support for long patterns (longer than 8 bytes)
- Separate Rx filters static configuration from code
- Add DHCP and ARP Rx filters

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Assaf Azulay <assaf@ti.com>
Remove ARP wowlan wakeup pattern

As FW now includes Auto ARP response there's no
need to wakeup on ARPs

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Always set RXFILTER 0 and 1

In ginger these filters where always set but they where removed
completely in ICS. They need to be active for unicast and bcast
to work. Make sure they are always set.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
sched scan: Fallback to normal scan during WPS

This is a fix for the WPS problem where WPS
session wasn't initiated until an manual scan was triggered.
During WPS session we need a periodic broadcast scan
to occur so that APs will see that we're in WPS session.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
sched scan: Turn passive scan into active

In case there are no scan_ssid networks in the conf
passive scan was done. Better do an active scan using
broadcast probe request as it's shorter
sched scan: Update scan according to changes in network list

sched scan wasn't updated according to changes in the network list
(enable/disable/remove). This caused the FW to continue scanning
with the wrong list configured which triggered problems.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
sched scan: Continue to scan even if previous scan cancel fails

cancel_sched_scan might fail if there wasn't any scan going
on before. This shouldn't stop a new sched scan attempt.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
sched scan: Avoid scan if no enabled networks

There's no point to sched scan when there's no enabled networks.
This also fixes a bug where the supplicant would reset
its scan results in case such a sched scan was initiated
and therefore would cause a "flickering" network list effect on Android.
(For a moment you see the network list and the next it's empty)

Signed-off-by: Eyal Shapira <eyal@wizery.com>
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>
sched scan: Continue to scan even if previous scan cancel fails

cancel_sched_scan might fail if there wasn't any scan going
on before. This shouldn't stop a new sched scan attempt.

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>
Fix wpa_supplicant and hostapd native linux compilation

Android related stuff weren't ifdef'd properly
which broke down native linux compilation