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>
hostapd: add support for android created sockets (/dev/socket/)

Add the same support that wpa_supplicant has with sockets created
by the Android system using the init.rc services options
Just as the supplicant, if the ctrl_iface is a name and not a path
(i.e. doesn't start with '/') the hostapd will assume that this is
an Android created socket named wpa_$(ctrl_iface) which is opened
in /dev/socket/
hostapd_cli sockets will be created in /data/misc/wifi/sockets
The hardcoded configuration is set in the Android.mk of hostapd
just like it is with the supplicant.

In addition, the hostapd_cli needs an Android property by the name
ap.interface to hold the ctrl_iface name to connect to the hostapd's
socket.
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>
nl80211: Add and align rx filters IDs

Add more patterns (SSDP, ARP, DHCP) and align IDs to a common
vendor Android framework implementation.
Note that ARP pattern shouldn't be used as our FW
responds to ARPs by default without waking up the host.
It is added only for ID alignments purposes.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Enable only unicast RXFILTER by default

In GB the framework always enabled RXFILTER for unicast
and bcast. This seems to be missing in ICS so enable
unicast by default as this is always required.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
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

Signed-off-by: Eyal Shapira <eyal@wizery.com>
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>
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
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