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>
nl80211_driver: rename is_p2p_interface

Rename is_p2p_interaface() to is_p2p_net_interface() since it used to identify
network P2P interfaces to disable 11b rates on them.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
nl80211_driver: Identify if nl80211 is capable of p2p device abstraction

Check the supported interfaces attribute to identify support for
a dedicated p2p device interface type. If set update the driver
capabilities flag to notify the supplicant.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
nl80211 driver: hold wdev identification for P2P device

Add wdev_id to i802_bss.
Init wdev_id to -1 by default.
Use wdev_id if assigned, instead of ifindex.
Use wdev_id for events that come from the kernel to identify the
relevant interface.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
nl80211_driver: add a handler to create_interface

Add an option to pass handler to nl80211_create_iface and
nl80211_create_interface_once that will be called after recieving
the message from the kernel.
this handler will add the option to process the message in different ways
for different interfaces.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
nl80211_driver: add support for P2P device in add interface

Don't try to assign ifindex for P2P device interface.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
p2p_supp: create P2P Device interface if supported

If the capability flag of the driver indicates a dedicated
P2P Device is supported, a P2P Device interface is created
in wpas_p2p_init().

Signed-hostap: Arend van Spriel <arend@broadcom.com>
nl80211: allow Android P2P functionality

To support Android the kernel may have a "p2p0" netdev for a
P2P-Device even though this isn't very useful, but Android
requires a netdev. To support this in the supplicant, if the
interface mode is P2P_DEVICE, re-set it to the same instead
of STATION mode.

Note that this is only possible with a kernel that creates a
netdev for the P2P-Device wdev.

Change-Id: Ia558cf847e0753b9c77056deee3acc618a63755f
Signed-hostap: Johannes Berg <johannes.berg@intel.com>
driver: nl80211: handle creation of P2P device interface

Add specific handler for creating the P2P device to store the
wdev_id as this type of interface does not have an interface
index.

Signed-hostap: Arend van Spriel <arend@broadcom.com>
wpa_s: fix wpa_supplicant_init_iface() for P2P Device interface

Couple of issues upon initializing a P2P Device interface needed
to be solved.

Signed-off-by: Arend van Spriel <arend@broadcom.com>