mech_eap.git
9 years agotests: Add option to build before running all tests
Ilan Peer [Mon, 27 Oct 2014 14:00:54 +0000 (10:00 -0400)]
tests: Add option to build before running all tests

Add an option --build to run-all.sh to build before starting to run all
the tests. In addition, add an option --codecov to extract the code
coverage data at the end of the run.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agotests: Make run-all.sh arguments non-positional
Ilan Peer [Mon, 27 Oct 2014 14:00:53 +0000 (10:00 -0400)]
tests: Make run-all.sh arguments non-positional

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agoRemove completed to-do items
Jouni Malinen [Sat, 1 Nov 2014 14:24:36 +0000 (16:24 +0200)]
Remove completed to-do items

While this file has not really been updated in years, some of the
completed items can easily be removed.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoRemove references to madwifi from various files
Jouni Malinen [Sat, 1 Nov 2014 14:15:53 +0000 (16:15 +0200)]
Remove references to madwifi from various files

Number of documentation and configuration files had references to the
madwifi driver interface that was removed in the previous commit. Remove
these references as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agomadwifi: Remove obsolete madwifi driver interface
Jouni Malinen [Sat, 1 Nov 2014 14:13:41 +0000 (16:13 +0200)]
madwifi: Remove obsolete madwifi driver interface

The MadWifi project is not active anymore and the last release happened
in early 2008. As such, there is no remaining justification for
maintaining the madwifi-specific driver interface for hostapd either.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agodbus: Fix memory leak in wpas_dbus_getter_bss_wps
Slava Monich [Tue, 28 Oct 2014 16:20:37 +0000 (18:20 +0200)]
dbus: Fix memory leak in wpas_dbus_getter_bss_wps

Signed-off-by: Slava Monich <slava.monich@jolla.com>
9 years agowpa_gui: Use dialog window type
Martin Kletzander [Wed, 29 Oct 2014 10:12:36 +0000 (11:12 +0100)]
wpa_gui: Use dialog window type

This helps window managers treat the window properly. Mostly tiling WMs
are affected by this. All other windows inherit this option from QDialog
already.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agotests: Concurrent station mode scan and p2p_find with P2P Device
Jouni Malinen [Thu, 30 Oct 2014 22:48:12 +0000 (00:48 +0200)]
tests: Concurrent station mode scan and p2p_find with P2P Device

This verifies that station mode interface SCAN command gets executed if
P2P Device instance is running p2p_find.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: P2P_STOP_FIND/P2P_FLUSH to ignore new results
Jouni Malinen [Thu, 30 Oct 2014 18:01:21 +0000 (20:01 +0200)]
tests: P2P_STOP_FIND/P2P_FLUSH to ignore new results

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2P: Do not consider the p2p_scan results after p2p_stop_find
Sunil Dutt [Thu, 30 Oct 2014 15:21:52 +0000 (20:51 +0530)]
P2P: Do not consider the p2p_scan results after p2p_stop_find

If p2p_stop_find is issued after the p2p_scan request is triggered to
the host driver, the obtained scan results are also considered to update
the P2P peer entries. This is not always desired behavior, i.e., it can
be clearer if no P2P-DEVICE-FOUND events are generated based of that
final pending scan.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2P: Document p2p_in_progress() return value 2
Jouni Malinen [Thu, 30 Oct 2014 18:13:16 +0000 (20:13 +0200)]
P2P: Document p2p_in_progress() return value 2

Function documentation was not in sync with the implementation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2P: Delay scan operation only when P2P is not in search state
Sunil Dutt [Thu, 30 Oct 2014 12:07:46 +0000 (17:37 +0530)]
P2P: Delay scan operation only when P2P is not in search state

With the radio work interface in place, station interface SCAN command
was not scheduled (i.e., it got continously delayed with "Delay station
mode scan while P2P operation is in progress") when a p2p_find was
operational. Fix this be delaying station mode scan only when a P2P
operation is in progress, but not in search state.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2P: Set p2p_scan_running based on driver scan request result
Sunil Dutt [Thu, 30 Oct 2014 10:50:22 +0000 (16:20 +0530)]
P2P: Set p2p_scan_running based on driver scan request result

With the radio work interface, the actual request to start p2p_scan
operation is scheduled from a radio work and hence the initial return
value cannot provide the real result of the driver operation to trigger
a scan. Introduce a new notification API to indicate the scan trigger
status based on which the p2p_scan_running instance can be set using the
real return value from the driver operation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoMACsec: Fix policy configuration
Jouni Malinen [Thu, 30 Oct 2014 09:43:47 +0000 (11:43 +0200)]
MACsec: Fix policy configuration

macsec_validate variable was set incorrectly to FALSE(0) or TRUE(1)
instead of the enum validate_frames values (Disabled(0), Checked(1),
Strict(2). This ended up policy == SHOULD_SECURE to be mapped to
macsec_validate == Checked instead of Strict. This could have resulted
in unintended SecY forwarding of invalid packets rather than dropping
them.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2P: Clean up p2p_go_neg_failed() calls
Jouni Malinen [Wed, 29 Oct 2014 11:04:09 +0000 (13:04 +0200)]
P2P: Clean up p2p_go_neg_failed() calls

This function is always called with the peer argument equal to
p2p->go_neg_peer, so there is no need for that argument to be there. In
addition, p2p->go_neg_peer is not NULL in cases where there is an
ongoing GO Negotiation, so the function can be simplified to just check
once whether the peer pointer is set and if not, skip all processing.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: GO Negotiation and timeout while waiting for peer
Jouni Malinen [Tue, 28 Oct 2014 14:39:33 +0000 (16:39 +0200)]
tests: GO Negotiation and timeout while waiting for peer

grpform_cred_ready_timeout2 is similar to the grpform_cred_ready_timeout
test case with the difference being in initiating a P2P_FIND operation
during the wait.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2P: Use timer to fail GO Negotation while waiting for peer
Rashmi Ramanna [Tue, 28 Oct 2014 11:26:43 +0000 (16:56 +0530)]
P2P: Use timer to fail GO Negotation while waiting for peer

The timeout check while waiting for the peer to accept the GO
Negotiation depended on the WAIT_PEER_IDLE or WAIT_PEER_CONNECT states
being in use. Any P2P command to alter such states would have resulted
in the failure to time out GO Negotiation and thus ended up in not
indicating GO Negotiation failure or left the selected peer available
for new GO negotiation after the expected two minute timeout.

Fix this by using a separate timer to time out GO Negotiation
irrespective of the P2P state.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Remove ap_ht40_csa and ap_ht40_csa3 workarounds
Jouni Malinen [Tue, 28 Oct 2014 12:01:16 +0000 (14:01 +0200)]
tests: Remove ap_ht40_csa and ap_ht40_csa3 workarounds

The issue in mac80211 was identified and proposed fix is now available,
so remove the workaround here and start reporting failures from
unexpected disconnection during CSA.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoP2P: Do not call wpas_p2p_disconnect_safely() if no match is found
Jouni Malinen [Mon, 27 Oct 2014 23:47:17 +0000 (01:47 +0200)]
P2P: Do not call wpas_p2p_disconnect_safely() if no match is found

In theory, wpas_p2p_disconnect_safely() could have dereferenced the
wpa_s == NULL argument, but in practice, it won't due to the
calling_wpa_s == wpa_s check and wpas_p2p_disconnect() accepting NULL.
Anyway, it is cleaner to add an explicit check for this. (CID 74492)

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agonl80211: Fix a copy-paste error in key offload management
Jouni Malinen [Mon, 27 Oct 2014 23:41:57 +0000 (01:41 +0200)]
nl80211: Fix a copy-paste error in key offload management

Commit b41f26845aaa7cf8aed6e4889e7041debc476ef9 ('Add support for
offloading key management operations to the driver') used incorrect
variable for determining the KCK length. This does not get triggered in
normal use cases since KCK and KEK are always included and of the same
length (in currently supported key management cases). Anyway, this needs
to be fixed to check the correct attribute. (CID 74491)

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoAP: Add support for Proxy ARP, DHCP snooping mechanism
Kyeyoon Park [Fri, 26 Sep 2014 05:32:55 +0000 (22:32 -0700)]
AP: Add support for Proxy ARP, DHCP snooping mechanism

Proxy ARP allows the AP devices to keep track of the hardware address to
IP address mapping of the STA devices within the BSS. When a request for
such information is made (i.e., ARP request, Neighbor Solicitation), the
AP will respond on behalf of the STA device within the BSS. Such
requests could originate from a device within the BSS or also from the
bridge. In the process of the AP replying to the request (i.e., ARP
reply, Neighbor Advertisement), the AP will drop the original request
frame. The relevant STA will not even know that such information was
ever requested.

This feature is a requirement for Hotspot 2.0, and is defined in IEEE
Std 802.11-2012, 10.23.13. While the Proxy ARP support code mainly
resides in the kernel bridge code, in order to optimize the performance
and simplify kernel implementation, the DHCP snooping code was added to
the hostapd.

Signed-off-by: Kyeyoon Park <kyeyoonp@qca.qualcomm.com>
9 years agocommon: Add definition for ETH_HLEN
Kyeyoon Park [Thu, 25 Sep 2014 06:17:29 +0000 (23:17 -0700)]
common: Add definition for ETH_HLEN

Signed-off-by: Kyeyoon Park <kyeyoonp@qca.qualcomm.com>
9 years agoAP: Add support for setting bridge network parameter
Kyeyoon Park [Sat, 27 Sep 2014 04:09:54 +0000 (21:09 -0700)]
AP: Add support for setting bridge network parameter

This allows setting a network parameter on the bridge that the BSS
belongs to.

This commit adds the needed functionality in driver_nl80211.c for the
Linux bridge implementation. In theory, this could be shared with
multiple Linux driver interfaces, but for now, only the main nl80211
interface is supported.

Signed-off-by: Kyeyoon Park <kyeyoonp@qca.qualcomm.com>
9 years agoAP: Add support for setting bridge port attributes
Kyeyoon Park [Fri, 26 Sep 2014 04:04:43 +0000 (21:04 -0700)]
AP: Add support for setting bridge port attributes

This allows setting a bridge port attribute. Specifically, the bridge
port in this context is the port to which the BSS belongs.

This commit adds the needed functionality in driver_nl80211.c for the
Linux bridge implementation. In theory, this could be shared with
multiple Linux driver interfaces, but for now, only the main nl80211
interface is supported.

Signed-off-by: Kyeyoon Park <kyeyoonp@qca.qualcomm.com>
9 years agoAP: Add support for IPv4 neighbor entry management to the BSS bridge
Kyeyoon Park [Wed, 24 Sep 2014 06:02:04 +0000 (23:02 -0700)]
AP: Add support for IPv4 neighbor entry management to the BSS bridge

This allows adding/deleting an IPv4 neighbor entry to/from the bridge,
to which the BSS belongs. This commit adds the needed functionality in
driver_nl80211.c for the Linux bridge implementation. In theory, this
could be shared with multiple Linux driver interfaces, but for now, only
the main nl80211 interface is supported.

Signed-off-by: Kyeyoon Park <kyeyoonp@qca.qualcomm.com>
9 years agonl80211: Make br_ifindex available in i802_bss
Kyeyoon Park [Wed, 10 Sep 2014 05:25:16 +0000 (22:25 -0700)]
nl80211: Make br_ifindex available in i802_bss

Signed-off-by: Kyeyoon Park <kyeyoonp@qca.qualcomm.com>
9 years agol2_packet: Add support for DHCP packet filter in l2_packet_linux
Kyeyoon Park [Mon, 8 Sep 2014 21:27:11 +0000 (14:27 -0700)]
l2_packet: Add support for DHCP packet filter in l2_packet_linux

Signed-off-by: Kyeyoon Park <kyeyoonp@qca.qualcomm.com>
9 years agotests: Scan result update changing last_scan_res and connect_work
Jouni Malinen [Mon, 27 Oct 2014 22:24:11 +0000 (00:24 +0200)]
tests: Scan result update changing last_scan_res and connect_work

This verifies that last_scan_res and connect work pointers to BSS
entries get updated when scan result update ends up removing or
reallocating a BSS entry.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoUpdate pending connect radio work BSS pointer on scan update
Jouni Malinen [Mon, 27 Oct 2014 22:19:24 +0000 (00:19 +0200)]
Update pending connect radio work BSS pointer on scan update

It is possible for scan result processing or BSS entry removal to occur
while there is a pending connect or sme-connect radio work with a
previously selected BSS entry. The BSS pointer was previously verified
to be valid, i.e., still point to a BSS entry, at the time the actual
connection operation is started. However, that BSS entry could have
changed to point to another BSS if the old BSS entry was either removed
or reallocated and a new BSS entry was added at the same location in
memory. This could result in the connection attempt failing to configure
parameters properly due to different BSS information (e.g., different
BSSID).

Fix this by updated the pending connect radio work data on BSS entry
updates similarly to how the last_scan_res array was updated. If the
selected BSS entry is removed, this will still result in a failed
connection, but reallocated BSS entry is now followed properly and used
when the connection work starts.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: WPS with ap_scan=2
Jouni Malinen [Mon, 27 Oct 2014 18:19:45 +0000 (20:19 +0200)]
tests: WPS with ap_scan=2

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoInvoke connect work done for all the connection failure cases
Sunil Dutt [Mon, 20 Oct 2014 04:48:47 +0000 (10:18 +0530)]
Invoke connect work done for all the connection failure cases

This commit fixes couple of connection failure paths where
wpas_connect_work_done() was not called, thus enabling the radio work
interface to proceed with the other queued actions.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoWPS: Fix ap_scan=2 special association case
Jouni Malinen [Mon, 27 Oct 2014 18:13:39 +0000 (20:13 +0200)]
WPS: Fix ap_scan=2 special association case

Commit 22628eca3440976bf51846da0554099f7429b206 ('Support driver-based
BSS selection in ap_scan=1 mode') ended up disabling the special
ap_scan=2 WPS case where ap_scan=1 like scan followed by association is
used to find the WPS AP using wildcard SSID. Fix this by allowing
association request even with wpas_driver_bss_selection() when searching
for a WPS AP.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agodbus: Redirect P2P request to the managment device if present
Tomasz Bursztyka [Thu, 23 Oct 2014 08:31:21 +0000 (11:31 +0300)]
dbus: Redirect P2P request to the managment device if present

In case of a P2P management device being present, it will be up to that
interface to handle P2P requests.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
9 years agonotify: Do not raise any signal from a P2P management interface
Tomasz Bursztyka [Thu, 23 Oct 2014 08:31:20 +0000 (11:31 +0300)]
notify: Do not raise any signal from a P2P management interface

Such interface is not registered on DBus, thus there is no need to raise
any signal from it.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
9 years agowpa_supplicant: Do not register a P2P management interface on DBus
Tomasz Bursztyka [Thu, 23 Oct 2014 08:31:19 +0000 (11:31 +0300)]
wpa_supplicant: Do not register a P2P management interface on DBus

DBus client should always request the proper netdev interface. This will
be necessary to get a consistent behavior whatever driver is in use:
iwlwifi (which requires a P2P mgmt dev), ath9/10k (which does not),
etc...

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
9 years agowpa_supplicant: Parent interface should know about its dedicated P2P dev
Tomasz Bursztyka [Thu, 23 Oct 2014 08:31:18 +0000 (11:31 +0300)]
wpa_supplicant: Parent interface should know about its dedicated P2P dev

This will be useful to hand-off P2P commands from the parent interface
to its dedicated P2P device if that one is present, in DBus interface.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
9 years agoP2P: Support GCMP as part of 60 GHz support
Ahmad Masri [Sun, 26 Oct 2014 12:04:29 +0000 (12:04 +0000)]
P2P: Support GCMP as part of 60 GHz support

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Allow GCMP to be added into ap_wps_mixed_cred network profile
Jouni Malinen [Mon, 27 Oct 2014 14:51:04 +0000 (16:51 +0200)]
tests: Allow GCMP to be added into ap_wps_mixed_cred network profile

This is needed in preparation for WPS AES being mapped to enabling both
CCMP and GCMP if the driver supports both ciphers.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agotests: Add support for reading modules list from a file
Ilan Peer [Sun, 26 Oct 2014 07:06:33 +0000 (03:06 -0400)]
tests: Add support for reading modules list from a file

The new run-tests.py argument "-l <file>" can now be used to specify the
test modules using a text file.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agotests: Add usage() to build.sh
Ilan Peer [Sun, 26 Oct 2014 07:06:30 +0000 (03:06 -0400)]
tests: Add usage() to build.sh

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agotests: Add an option to force copy config files
Ilan Peer [Sun, 26 Oct 2014 07:06:29 +0000 (03:06 -0400)]
tests: Add an option to force copy config files

"./build.sh --force-config" can be used to force copying configuration
files before building. This will overwrite any changes in .config files.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agotests: Add an option to build with code coverage
Ilan Peer [Sun, 26 Oct 2014 07:06:28 +0000 (03:06 -0400)]
tests: Add an option to build with code coverage

"./build.sh --codecov" can now be used to request CONFIG_CODE_COVERAGE=y
to be added to hostapd and wpa_supplicant .config files.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agonl80211: Move more event processing into driver_nl80211_event.c
Jouni Malinen [Sun, 26 Oct 2014 14:23:46 +0000 (16:23 +0200)]
nl80211: Move more event processing into driver_nl80211_event.c

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agonl80211: Move event handling into a separate file
Jouni Malinen [Sun, 26 Oct 2014 14:13:27 +0000 (16:13 +0200)]
nl80211: Move event handling into a separate file

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agonl80211: Move capability determination into a separate file
Jouni Malinen [Sun, 26 Oct 2014 11:28:39 +0000 (13:28 +0200)]
nl80211: Move capability determination into a separate file

This moves significant amount of code away from large driver_nl80211.c.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agonl80211: Move QCA DFS offload capability determination to init time
Jouni Malinen [Sun, 26 Oct 2014 11:23:30 +0000 (13:23 +0200)]
nl80211: Move QCA DFS offload capability determination to init time

There is no need to fetch this capability for each get_capa() call.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agonl80211: Move AP monitor interface handling to a separate file
Jouni Malinen [Sun, 26 Oct 2014 10:40:10 +0000 (12:40 +0200)]
nl80211: Move AP monitor interface handling to a separate file

This moves the old monitor interface design to driver_nl80211_monitor.c.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agonl80211: Make some helper functions non-static
Jouni Malinen [Sun, 26 Oct 2014 15:20:37 +0000 (17:20 +0200)]
nl80211: Make some helper functions non-static

This allows more functionality to be moved to separate files.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agonl80211: Move most of the Android code into a separate file
Jouni Malinen [Sun, 26 Oct 2014 10:27:35 +0000 (12:27 +0200)]
nl80211: Move most of the Android code into a separate file

This moves most of the Android specific implementation from
driver_nl80211.c to driver_nl80211_android.c.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agonl80211: Move definitions into separate header files
Jouni Malinen [Sun, 26 Oct 2014 10:02:36 +0000 (12:02 +0200)]
nl80211: Move definitions into separate header files

This is an initial step in starting to split the large driver_nl80211.c
implementation into somewhat smaller parts.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: cfg80211 connect command for WEP connection
Jouni Malinen [Sun, 26 Oct 2014 13:48:57 +0000 (15:48 +0200)]
tests: cfg80211 connect command for WEP connection

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoAvoid unsigned vs. signed comparison warning
Jouni Malinen [Sun, 26 Oct 2014 10:16:53 +0000 (12:16 +0200)]
Avoid unsigned vs. signed comparison warning

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoWrite human readable version of channel width to CSA event debug log
Jouni Malinen [Sun, 26 Oct 2014 09:36:14 +0000 (11:36 +0200)]
Write human readable version of channel width to CSA event debug log

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: External bridge control for hostapd interface
Jouni Malinen [Sun, 26 Oct 2014 09:29:16 +0000 (11:29 +0200)]
tests: External bridge control for hostapd interface

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agonl80211: Store externally managed bridge name in driver status
Jouni Malinen [Sun, 26 Oct 2014 09:20:01 +0000 (11:20 +0200)]
nl80211: Store externally managed bridge name in driver status

This makes it easier to figure out from hostapd control interface
whether an interface had been added to a bridge externally at the time
hostapd interface was enabled or if the interface gets added during
hostapd operations.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: hostapd rfkill
Jouni Malinen [Sun, 26 Oct 2014 08:53:37 +0000 (10:53 +0200)]
tests: hostapd rfkill

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agohostapd: Add INTERFACE-ENABLED and INTERFACE-DISABLED events
Jouni Malinen [Sun, 26 Oct 2014 08:52:54 +0000 (10:52 +0200)]
hostapd: Add INTERFACE-ENABLED and INTERFACE-DISABLED events

These can be convenient for upper layer programs to determine if the
hostapd interface gets disabled/re-enabled, e.g., due to rfkill
block/unblock.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Print failure exeception if logger output goes to file
Jouni Malinen [Sun, 26 Oct 2014 08:39:32 +0000 (10:39 +0200)]
tests: Print failure exeception if logger output goes to file

This makes it more convenient to determine failure reasons during test
case development and VM testing.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: IP address in STATUS
Jouni Malinen [Sun, 26 Oct 2014 08:21:48 +0000 (10:21 +0200)]
tests: IP address in STATUS

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoP2P: Save group common frequencies in invitation result
Ilan Peer [Mon, 7 Jul 2014 11:21:01 +0000 (14:21 +0300)]
P2P: Save group common frequencies in invitation result

Save the group common frequencies when starting a GO due to
an invitation signaling requesting to re-invoke a persistent GO.

To do so, move the code that handles the translation of p2p_channels to
frequency list into a public function so it can be re-used both when GO
Negotiation is done and invitation signaling is done.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agoP2P: Save group common frequencies
Ilan Peer [Mon, 7 Jul 2014 11:20:59 +0000 (14:20 +0300)]
P2P: Save group common frequencies

Once a P2P GO interface is configured, save the group common
frequencies, as this can be useful later for channel selection
considerations during channel switch, etc.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agoWPS: Add missing device types
Ilan Peer [Mon, 7 Jul 2014 11:21:06 +0000 (14:21 +0300)]
WPS: Add missing device types

Add missing device category and device sub category definitions.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agonl80211: Clear beacon_set when deleting a beacon from deinit_ap()
Ilan Peer [Mon, 7 Jul 2014 11:20:58 +0000 (14:20 +0300)]
nl80211: Clear beacon_set when deleting a beacon from deinit_ap()

When a beacon was deleted from the kernel in
wpa_driver_nl80211_deinit_ap(), bss->beacon_set was not cleared so
restarting the AP again was not possible.

Fix this by clearing the variable once the beacon was deleted.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agonl80211: Add indoor only and GO concurrent flags
Ilan Peer [Mon, 7 Jul 2014 11:20:55 +0000 (14:20 +0300)]
nl80211: Add indoor only and GO concurrent flags

Add the following channel flags:

* INDOOR_ONLY: The channel can be used if and only if there is a clear
  assessment that the device is operating in an indoor environment, i.e.,
  it is AC power.

* CONCURRENT_GO: The channel can be used for instantiating a GO if and
  only if there is an additional station interface that is currently
  connected to an AP on the same channel or on the same U-NII band
  (assuming that the AP is an authorized master).

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agowpa_supplicant: Use the 'no_ir' notation
Ilan Peer [Mon, 7 Jul 2014 11:20:54 +0000 (14:20 +0300)]
wpa_supplicant: Use the 'no_ir' notation

Use the 'no_ir' notation instead of the 'passive scan' and
'no_ibss' notations to match the earlier change in nl80211.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
9 years agotests: Make ap_ht40_csa and ap_ht40_csa3 less likely to fail
Jouni Malinen [Sat, 25 Oct 2014 19:27:24 +0000 (22:27 +0300)]
tests: Make ap_ht40_csa and ap_ht40_csa3 less likely to fail

It looks like cfg80211 can trigger disconnection even without disabling
HT, so the same issue may be hit with both of the channel switches in
these test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Group formation wait for peer with driver increasing ROC duration
Jouni Malinen [Sat, 25 Oct 2014 18:26:23 +0000 (21:26 +0300)]
tests: Group formation wait for peer with driver increasing ROC duration

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoAdd test functionality to simulate driver increased ROC duration
Jouni Malinen [Sat, 25 Oct 2014 18:25:00 +0000 (21:25 +0300)]
Add test functionality to simulate driver increased ROC duration

The extra_roc_dur parameter can now be used in CONFIG_TESTING_OPTIONS=y
builds to simulate driver behavior where the ROC duration gets increased
without user space request.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoP2P: Stop driver listen in p2p_state_timeout()
Constantin Musca [Fri, 12 Sep 2014 07:22:19 +0000 (10:22 +0300)]
P2P: Stop driver listen in p2p_state_timeout()

When a P2P timeout occurs and p2p_state_timeout is executed, the
stop_listen function can be called besides setting in_listen to zero in
cases where the driver is still in ROC. That should not really happen in
normal cases, but it is possible for some drivers to extend the ROC
duration. If that happens, the next start_listen request may get
rejected with "P2P: Reject start_listen since p2p_listen_work already
exists".

Signed-off-by: Constantin Musca <constantin.musca@intel.com>
9 years agoP2P: Use neg_freq when re-establish persistent group as GC
Mikael Kanstrup [Tue, 21 Oct 2014 10:08:30 +0000 (12:08 +0200)]
P2P: Use neg_freq when re-establish persistent group as GC

When GC receives invitation response and tries to re-establish
connection to a persistent group channels from passive list should
be allowed. A missing check for operation mode triggered reselection
of operating channel from active channels only to happen and thus fail
the connect attempt.

Add a check for operation mode and if GC instead use negotiated
frequency (i.e. GO operating channel from invitation response).

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
9 years agohostapd: Skip some configuration steps for mesh cases
Javier Lopez [Mon, 1 Sep 2014 04:23:37 +0000 (00:23 -0400)]
hostapd: Skip some configuration steps for mesh cases

Modify hostapd.c logic to add checks for valid mconf data structure:

- For hostapd_setup_bss we don't need to flush old stations in case
  we're rejoining a mesh network.

- In hostapd_setup_interface_complete, we don't need to setup the
  interface until we join the mesh (same reasoning for
  hostapd_tx_queue_params).

Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Jason Mobarak <x@jason.mobarak.name>
9 years agomesh: Implement mesh scanning
Jason Abele [Mon, 1 Sep 2014 04:23:32 +0000 (00:23 -0400)]
mesh: Implement mesh scanning

When mesh is configured in, include the wildcard mesh id so that mesh
networks are returned.

Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Jason Abele <jason.abele@gmail.com>
9 years agomesh: Use mesh id instead of SSID in BSS table
Jason Abele [Mon, 1 Sep 2014 04:23:32 +0000 (00:23 -0400)]
mesh: Use mesh id instead of SSID in BSS table

Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Jason Abele <jason.abele@gmail.com>
9 years agomesh: Accept Action frames without BSSID match
Bob Copeland [Mon, 1 Sep 2014 04:23:30 +0000 (00:23 -0400)]
mesh: Accept Action frames without BSSID match

[original patch by: Thomas Pedersen <thomas@noack.us>]
Signed-off-by: Bob Copeland <me@bobcopeland.com>
9 years agomesh: Add no_auto_peer config option
Thomas Pedersen [Mon, 1 Sep 2014 04:23:26 +0000 (00:23 -0400)]
mesh: Add no_auto_peer config option

Add no_auto_peer parameter, which controls wheter a station will
automatically initiate peering to another mesh peer that comes into
range.

Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Jason Mobarak <x@jason.mobarak.name>
Signed-off-by: Thomas Pedersen <thomas@noack.us>
9 years agomesh: Add mesh mode config option
Thomas Pedersen [Mon, 1 Sep 2014 04:23:26 +0000 (00:23 -0400)]
mesh: Add mesh mode config option

Modify network mode to support mode number 5 when CONFIG_MESH is
enabled.

Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Jason Mobarak <x@jason.mobarak.name>
Signed-off-by: Thomas Pedersen <thomas@noack.us>
9 years agomesh: Avoid join if already joined a mesh group
Thomas Pedersen [Mon, 1 Sep 2014 04:23:24 +0000 (00:23 -0400)]
mesh: Avoid join if already joined a mesh group

Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Thomas Pedersen <thomas@noack.us>
9 years agomesh: Add mesh peering manager
Bob Copeland [Tue, 11 Mar 2014 04:07:01 +0000 (21:07 -0700)]
mesh: Add mesh peering manager

The mesh peering manager establishes and maintains links among
mesh peers, tracking each peer link via a finite state machine.

This implementation supports open mesh peerings.

[assorted fixes from Yu Niiro <yu.niiro@gmail.com>]
[more fixes from Masashi Honma <masashi.honma@gmail.com>]
Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: Ashok Nagarajan <ashok.dragon@gmail.com>
Signed-off-by: Jason Mobarak <x@jason.mobarak.name>
Signed-hostap: Bob Copeland <me@bobcopeland.com>

9 years agomesh: Add user_mpm config option
Thomas Pedersen [Mon, 1 Sep 2014 04:23:26 +0000 (00:23 -0400)]
mesh: Add user_mpm config option

Add user_mpm config parameter, when this is set to 1 (the default) the
peer link management is done on userspace, otherwise the peer management
will be done by the kernel.

Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Jason Mobarak <x@jason.mobarak.name>
Signed-off-by: Thomas Pedersen <thomas@noack.us>
9 years agomesh: Add mesh mode routines
Thomas Pedersen [Mon, 1 Sep 2014 04:23:21 +0000 (00:23 -0400)]
mesh: Add mesh mode routines

Add routines to (de)initialize mesh interface data structures and
join and leave mesh networks.

Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: Jason Mobarak <x@jason.mobarak.name>
Signed-off-by: Thomas Pedersen <thomas@noack.us>
9 years agonl80211: Do not try to change supported rates
Bob Copeland [Mon, 1 Sep 2014 04:23:23 +0000 (00:23 -0400)]
nl80211: Do not try to change supported rates

For mesh mode to work properly, set supported rates only once.

Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: Jason Mobarak <x@jason.mobarak.name>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
9 years agonl80211: Add STA flag WPA_STA_AUTHENTICATED
Bob Copeland [Mon, 1 Sep 2014 04:23:23 +0000 (00:23 -0400)]
nl80211: Add STA flag WPA_STA_AUTHENTICATED

This is needed for managing STA entries for mesh use cases.

Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: Jason Mobarak <x@jason.mobarak.name>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
9 years agonl80211: Add plink_action_field to hostapd_sta_add_params
Bob Copeland [Mon, 1 Sep 2014 04:23:23 +0000 (00:23 -0400)]
nl80211: Add plink_action_field to hostapd_sta_add_params

Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: Jason Mobarak <x@jason.mobarak.name>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
9 years agonl80211: Reject deauth/disassoc for mesh interface
Bob Copeland [Mon, 1 Sep 2014 04:23:23 +0000 (00:23 -0400)]
nl80211: Reject deauth/disassoc for mesh interface

sta_info call these to send out the disassoc and deauth frame
which are both not relevent to mesh. So don't send them.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: Jason Mobarak <x@jason.mobarak.name>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
9 years agonl80211: Register to receive mesh frames
Bob Copeland [Mon, 1 Sep 2014 04:23:23 +0000 (00:23 -0400)]
nl80211: Register to receive mesh frames

Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: Jason Mobarak <x@jason.mobarak.name>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
9 years agomesh: Show [MESH] flag in scan results
Jason Abele [Mon, 1 Sep 2014 04:23:32 +0000 (00:23 -0400)]
mesh: Show [MESH] flag in scan results

Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Jason Abele <jason.abele@gmail.com>
9 years agoAdd SAE and FT/SAE into scan results info
Jason Abele [Mon, 1 Sep 2014 04:23:32 +0000 (00:23 -0400)]
Add SAE and FT/SAE into scan results info

These key management options were missing from the previous set of
parsed information in scan results.

Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Jason Abele <jason.abele@gmail.com>
9 years agotests: Channel switch with HT40
Jouni Malinen [Sat, 25 Oct 2014 09:09:02 +0000 (12:09 +0300)]
tests: Channel switch with HT40

ap_ht40_csa and ap_ht40_csa3 seem to show a cfg80211/mac80211 issue
where a CSA from HT40+ to HT40- channel results in HT getting disabled
due to cfg80211_chandef_compatible() check on c1->width == c2->width
claiming that the new channel is not compatible. For now, comment out
the FAIL case for these known issues to avoid constant failure for cases
that are not wpa_supplicant/hostapd issues. Once the kernel side design
has been reviewed, these error cases can be enabled here.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Channel switch with VHT80
Jouni Malinen [Sat, 25 Oct 2014 08:29:28 +0000 (11:29 +0300)]
tests: Channel switch with VHT80

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agonl80211: Write channel type in debug log on channel switch event
Jouni Malinen [Sat, 25 Oct 2014 08:28:56 +0000 (11:28 +0300)]
nl80211: Write channel type in debug log on channel switch event

This makes it easier to understand what kind of channel switch was
indicated by the driver.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agoFix channel switch to disable VHT with HT
Jouni Malinen [Sat, 25 Oct 2014 08:27:48 +0000 (11:27 +0300)]
Fix channel switch to disable VHT with HT

If both HT and VHT was enabled on AP and channel switch event from the
driver indicated that HT was disabled, VHT was left enabled. This
resulted in the following channel configuration failing. Fix this by
disabling VHT if HT gets disabled.

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agotests: Radar detection on HT40 channel
Jouni Malinen [Sat, 25 Oct 2014 07:52:06 +0000 (10:52 +0300)]
tests: Radar detection on HT40 channel

Signed-off-by: Jouni Malinen <j@w1.fi>
9 years agonl80211: Advertise and configure SMPS modes
Eliad Peller [Mon, 20 Oct 2014 03:21:41 +0000 (23:21 -0400)]
nl80211: Advertise and configure SMPS modes

Advertise static/dynamic SMPS mode support (according to the wiphy
feature bits) and pass the configured smps_mode when starting the AP.

Signed-off-by: Eliad Peller <eliad@wizery.com>
9 years agoHT: Pass the smps_mode in AP parameters
Eliad Peller [Mon, 20 Oct 2014 03:21:40 +0000 (23:21 -0400)]
HT: Pass the smps_mode in AP parameters

The driver needs to know what SMPS mode it should use.

Signed-off-by: Eliad Peller <eliad@wizery.com>
9 years agoHT: Let the driver advertise its supported SMPS modes for AP mode
Eliad Peller [Mon, 20 Oct 2014 03:21:39 +0000 (23:21 -0400)]
HT: Let the driver advertise its supported SMPS modes for AP mode

Add smps_modes field, and let the driver fill it with its supported SMPS
modes (static/dynamic). This will let us start an AP with specific SMPS
mode (e.g., dynamic) that will allow it to reduce its power usage.

Signed-off-by: Eliad Peller <eliad@wizery.com>
9 years agodbus: Do a full P2P find as it is in ctrl_iface.c
Tomasz Bursztyka [Wed, 22 Oct 2014 06:33:22 +0000 (09:33 +0300)]
dbus: Do a full P2P find as it is in ctrl_iface.c

So the behavior is consistent whatever interface is in use.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
9 years agoP2P: Stop TX wait on SD query TX status failure
Jouni Malinen [Thu, 23 Oct 2014 18:52:05 +0000 (21:52 +0300)]
P2P: Stop TX wait on SD query TX status failure

The previous TX operation could be on another channel if there are
multiple peers with pending SD queries. To avoid failing to send the
following query, stop the last one to allow any Listen channel to be
used for the following query during p2p_find iteration.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2P: Limit number of SD retries during find
Jouni Malinen [Thu, 23 Oct 2014 18:49:42 +0000 (21:49 +0300)]
P2P: Limit number of SD retries during find

Commit 7139cf4a4f1fecfd03d0daff9bb33adb80cc3530 ('P2P: Decrement
sd_pending_bcast_queries when sd returns success') added support for
retrying P2P SD queries. However, it did this without limiting how many
retries are allowed. This can result in excessive number of retries if a
peer device does not show up on its Listen channel and there is a
pending SD query to it. Limit the maximum number of SD retries to 100
per p2p_find operation for each peer to avoid unlimited retries.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoP2P: Iterate through all peers in pending pre-find operation
Jouni Malinen [Thu, 23 Oct 2014 18:30:32 +0000 (21:30 +0300)]
P2P: Iterate through all peers in pending pre-find operation

Commit 7139cf4a4f1fecfd03d0daff9bb33adb80cc3530 ('P2P: Decrement
sd_pending_bcast_queries when sd returns success') changed P2P SD
behavior in a way that the P2P search loop ended up in continuing with
the first peer entry until it acknowledged receipt of a pending
broadcast SD request while the previous design went through all peers
once. While it is reasonable to retry SD, getting stuck with the first
peer is not really desirable. Change the p2p_continue_find() loop to
continue from the next peer in each iteration to allow progress through
all peers that have pending operations if any other peer is not
acknowledging frames (e.g., due to not being on Listen channel).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
9 years agoAdd support for offloading key management operations to the driver
Chet Lanctot [Thu, 23 Oct 2014 15:21:49 +0000 (18:21 +0300)]
Add support for offloading key management operations to the driver

This commit introduces a QCA vendor command and event to provide an
option to use extended versions of the nl80211 connect/roam operations
in a way that allows drivers to offload key management operations to the
driver/firmware.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>