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.
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.
wpa_s: make SETBAND take immediate effect

Make SETBAND disconnect from the current AP if it's not
in the correct band. Also expire APs which aren't in the correct
band so scan results will immediately reflect the band change.

[Eyal - ammended commit description]

Signed-off-by: Panduranga Mallireddy <panduranga_mallireddy@ti.com>
Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
driver_nl80211: 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>
driver_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>
driver_nl80211: 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>
nl80211: add support for drop rx filters

Enable configuring rx filters which will be
dropped even if matching another rx filter. This
can be used for generating exception filters.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
config: enable NL80211

Just enable it in both hostapd and wpa_s.

Signed-off-by: Luciano Coelho <coelho@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>
Use exact interface as socket parameter for init

For p2p, there are virtual interfaces (like p2p-wlan0-X) created and
that results in binding to the common init socket right now.

Instead, have the init bind fail for p2p interfaces and create seperate
sockets specified by the ctrl_interface path in config file

Bug: 5002384
Change-Id: Ia155df079a0bcca1871b6bcab2ef7111f0cba6c1
wpa_supplicant: VERSION_STR_POSTFIX is now defined to 'git describe'
android: wpa_s.conf template: add WPS parameters (INTERNAL)
Add state message sent after 'status' command

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Add network connection event for status

We need both supplicant state and network connection state
for proper sync up with framework
Restore OpenSSL ENGINE support

We now use an OpenSSL ENGINE to support keystore functionality.
Use keystore ENGINE for private key operations

The new keystore ENGINE is usable to perform private key operations when
we can't get the actual private key data. This is the case when hardware
crypto is enabled: the private key never leaves the hardware.

Subsequently, we need to be able to talk to OpenSSL ENGINEs that aren't
PKCS#11 or OpenSC. This just changes a few #define variables to allow us
to talk to our keystore engine without having one of those enabled and
without using a PIN.
wpa_supplicant: Fix compilation without BOARD_WPA_SUPPLICANT_DRIVER

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Android.mk: Define ANDROID_P2P

Changes within #ifdef ANDROID_P2P are BRCM additions
which are non BRCM specific and there should be included.
That's in contrast of ANDROID_BRCM_P2P_PATCH which mark
parts that are BRCM implementation specific (like device_ap_sme)
and therefore would be compiled in only when compiling with BRCM
driver.

Change-Id: I031f0908055756b6e85b64c5151c18b8a73b9841
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Allow immediate scan request even if another scan was scheduled later

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>