tests: Wait longer for hostapd REMOVE command to complete

Some kernel debugging options (especially
CONFIG_DEBUG_KOBJECT_RELEASE=y) can add significant blocking time to
interface removal with NL80211_CMD_DEL_INTERFACE and
SIOCGIFBR(BRCTL_DEL_BRIDGE) block for 1-8 seconds. This could result in
the VLAN test cases failing due to a wpaspy timeout on the REMOVE
command even though the issue was only in the kernel debugging code
making the operations significantly slower. Work around this by using a
longer timeout for that control interface command to allow this type of
debug kernel to be used.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Mark AP disabled if initialization steps fail

Previously, some of the last initialization steps could fail without
clearly marking the interface disabled. For example, configuring the
channel to the driver could fail, but hostapd would not clearly identify
as the interface not being in functional state apart from not moving it
to the ENABLED state. Send an AP-DISABLED event and mark interface state
DISABLED if such a setup operation fails.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: Check for AP-DISABLED when setting up AP

This allows a critical error to be noticed more quickly and reported
more clearly in the test log.

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

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
P2P: Report dev_found event (if not yet done) from GO Neg Req RX

p2p_find removes P2P_DEV_REPORTED flag from every existing P2P peer
entry. Thus, if a GO Negotiation Request frame is received before the
peer is re-discovered based on Probe Response frame, report
P2P-DEVICE-FOUND indication prior to the P2P-GO-NEG-REQUEST similarly to
how this is done the first time the peer is found.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Fix CONFIG_NO_SCAN_PROCESSING=y build

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
TDLS: Use QoS info from WMM IE obtained in TDLS frames

TDLS Setup Request/Response frames from the peers include the WMM IE,
hence parse the same and consider the QoS Info from the WMM IE. The
qos_info obtained in the WMM IE overwrites the one obtained through
WLAN_EID_QOS attribute.

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

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Allow reason code to be specified for DEAUTH/DISASSOC test frame

hostapd DEAUTHENTICATE and DISASSOCIATE control interface commands
accepted both a test=<0/1> and reason=<val> parameters, but these were
not supported in the same command as a combination. Move the code around
a bit to allow that as well since it can be helpful for automated test
scripts.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant AP: Allow PMF to be enabled with ieee80211w

The ieee80211w parameter was not previously copied to the hostapd BSS
structure from wpa_supplicant configuration, so PMF was practically
disabled. Allow it to be configured through the wpa_supplicant network
configuration block.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: Verify PMF association comeback and STA initiated SA Query

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
WPS: Extend per-station PSK to support ER case as well

When wpa_psk_file is used instead of wpa_psk/wpa_passphrase, each WPS
Enrollee was given a unique PSK. This did not work for the
station-as-Registrar case where ER would learn the current AP settings
instead of enrolling itself (i.e., when using the AP PIN instead of
station PIN). That case can be covered with a similar design, so
generate a per-device PSK when building M7 as an AP in wpa_psk_file
configuration.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: Per-station PSK with WPS

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: HS 2.0 subrem from control interface

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: Verify hostapd ENABLE/DISABLE/ENABLE

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: GAS with unknown advertisement protocol id

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
GAS server: Remove incomplete remote ANQP processing

Some of the remote ANQP server concepts were introduces into gas_serv.c,
but these were not completed. Remote the unused implementation for now.
It can be added back if support for remote ANQP server is added at some
point.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: WPS reconfiguration to open network

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: RADIUS Disconnect-Request using CUI

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests: Use disable_dgaf=1 for more coverage

This runs one of the HS 2.0 test cases with DGAF disabled.

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