systemd: Fix systemd interface alias

In the systemd interface templated the alias entry was specified
with wlan0 hard coded. Changing it to %i in this patch. [Bug 477]

Reported-by: zg <ml@mail.tsaitgaist.info>
Signed-hostap: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
wpa_supplicant: Allow vifs to scan only current channel

If a VIF is already associated, then only scan on the associated
frequency if user requests such. This is a big help when using
lots of virtual stations.

Signed-hostap: Ben Greear <greearb@candelatech.com>
Signed-off-by: Ben Greear <greearb@candelatech.com>
eloop: Allow to run event loop multiple times in a row

DFS implementation requires to run an eventloop while monitoring
the Channel Availability Check (CAC). After that, the "real" event
loop is started, and should not fail doing so.

Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
nl80211: Add driver events for radar detection

This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
nl80211: Add driver capability flag for radar detection

This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
nl80211: Add channel flags for DFS state information

This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
nl80211: Add driver_ops for starting radar detection

This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
nl80211: Add driver_ops for stopping AP beaconing

This can be used to stop AP mode beaconing temporarily, e.g., in
response to a radar detected event.

This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
DFS: Add ieee80211h hostapd configuration parameter

This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Rename hostapd_parse_rates() to a more generic int list parser

This can be used with other integer lists than just rates.

Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
tls_openssl: Store TLS context per-connection

Store context for each tls_init() caller, so events are generated for
the correct wpa_s instance. The tls_global variable is retained for
older OpenSSL implementations that may not have app-data for SSL_CTX.

Signed-hostap: Paul Stewart <pstew@chromium.org>
Defer scan if connection is in progress on any of the shared interfaces

Scanning can delay concurrent operations considerably, so it is better
to avoid that while trying to connect on any of the virtual interfaces
that share the same radio.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
tests: Use /var/run/hostapd-global to avoid socket file in work dir

This makes some cases more convenient with read-only file systems.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
wpadebug: Add forgotten installation step to documentation

Signed-hostap: Jouni Malinen <j@w1.fi>
tests: Allow hwsim_test and wlantest_cli to be used from PATH

This makes it easier to support some test environments where the
repository is shared between hosts.

Signed-hostap: Jouni Malinen <j@w1.fi>
wpadebug: Add a simple WebView activity

This provides a simple web browser that can be started and stopped from
other apps or native applications.

This activity can be started with the following command:
am start -a android.action.MAIN -c android.intent.category.LAUNCHER \
    -n w1.fi.wpadebug/.WpaWebViewActivity -e w1.fi.wpadebug.URL <URL>

If <URL> is set to FINISH the activity is finished.

Signed-hostap: Jouni Malinen <j@w1.fi>
Do not add BSS to blacklist on local disconnection request

There is no point in marking a BSS temporarily blacklisted based on a
connection failure or disconnection case if that happens as a result of
a local request to disconnect. The blacklist entry could result on
unexpected BSS getting selected on the next connection attempt. In
addition, the code to try to find another BSS within the ESS could
result in scanning a single channel on the next attempt. Fix these
issues by handling the connection failure events only if we are not in
disconnected state (i.e., would try to reconnect after this
automatically).

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Do not try auto connect mechanism in disconnected state

This cleans up debug log by not requesting the auto connect on
dissassociation event if we are already in disconnected state and would
not try to connect anyway.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Mark interface disconnected on removal request

This cleans up debug log by not trying to process the disconnection
event as a failure that could result in blacklist addition and auto
connect attempt. These are pointless operations since the interface is
going to removed immediately after this.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
wpadebug: Add broadcast intent receiver for Wi-Fi events

This makes it easier to debug Android framework actions with all the
related broadcast intents being logged.

Signed-hostap: Jouni Malinen <j@w1.fi>