P2P: Make sure wait for the first client gets stopped

If a group was removed before the wait for the first client had timed
out and the client had not yet connected, p2p_go_wait_client could have
been left set and with that, scan operations could be unnecessarily
delayed. This fixes some undesired delays from commit
c1c0b35fea656345b672984910cc3b93938bc5e5.

CRs-Fixed: 554201
Git-commit: adeb4f59a22e73f0f0560ba6340a39b2e1d089e8
Git-repo: git://w1.fi/srv/git/hostap.git
Signed-hostap: Jouni Malinen <j@w1.fi>
Interworking: Do not reconnect if already connected

If we are already connected to the selected AP with a network block
that was created based on the selected credential, do not force a
reconnection or network block update.
Git-commit: d28f4e44f10a8549d969e5434f7d4d16f462dfcc
Git-repo : git://w1.fi/srv/git/hostap.git
CRs-fixed: 574574
Change-Id: Ia65be03a07f48697402aea22ef9dbc8a02206f91
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Interworking: Avoid duplicated network blocks

Do not add multiple network blocks for the same network from a single
credential. INTERWORKING_CONNECT used to generate a new network block
for each instance regardless of what network blocks have already been
configured. While this allows the connection to go through, it is not
efficient to leave behind potentially large number of network blocks
with the same contents (or worse, changed contents). Address this by
removing an older network block for the same credential before adding a
new one.
Git-commit: 6ede8a7e4d1d4f85d10287be9f399b17a50e1d9f
Git-repo : git://w1.fi/srv/git/hostap.git
CRs-fixed: 574574

Change-Id: I448768707406c1b747536ea46d7bb20999c5d526
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
P2P: Use group formation timeout on persistent group GO

Previously, GO considered the group to be fully re-invoked after
starting beaconing on successful invitation exchange. This would leave
the group running until idle timeout (which may not be enabled) or
explicit removal if the client fails to connect for any reason. Since
the client is expected to connect immediately after the invitation
exchange that ends with status=0 (i.e., either client initiated the
exchange or it responded with success), extend group formation timeout
to cover that period until the first successfully completed data
connection. This allows the GO to remove the group automatically if the
client devices does not connect within
P2P_MAX_INITIAL_CONN_WAIT_GO_REINVOKE (15) seconds.

Change-Id: I5a9622e46ff032a8297a55ba6e6d724a42834762
CRs-Fixed: 538026
Git-commit: bbc6c729a58897e9265d53d53677b3ddeda4ff94
Git-repo: git://w1.fi/srv/git/hostap.git
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Include Extended Capabilities element based on scan results

Add Extended Capabilities element to association request only if the AP
included this element in Beacon/Probe Response frames. This is a
workaround to address interoperability issues with some older APs that
do not seem to be able to handle Extended Capabilities element in
(Re)Association Request frames.

CRs-Fixed: 540084
Git-commit: 8b3b803ab9fe69650da7e3b2ee9e44f0f054ee0a
Git-repo : git://w1.fi/srv/git/hostap.git
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Change-Id: I4c314a628a3e114fdbe35b34eb3d3338a41810aa
Interworking: Reject BSS based on disallow_aps

If a BSS is disallowed temporarily with disallow_aps, the network
connection is going to fail. As such, there is not much point in
allowing Interworking network selection to try to connect with such BSS.
As such, do not consider disallowed networks for automatic network
selection and reject requests to connect to them through
INTERWORKING_CONNECT.
Git-commit: 50589751bf7b9e70ee6bf9b1ce8212b311cf971c
Git-repo : git://w1.fi/srv/git/hostap.git
CRs-fixed: 574574
Change-Id: I7a9f3e4c4251f01b4b41cf2cc201911715e92f7d
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Update regulatory change to all virtual interface for the phy

wpas_p2p_setup_channels function uses the per interface information
(wpa_s->hw.modes) for setting up the available channel list for P2P
operation, but if a separate P2P interface is used (e.g., p2p0 on
Android), the wpa_s instance for that interface may not get an updated
channel list. This can result in some operations, like "P2P_SET
disallow_freq", using old channel list information (e.g., world roaming
information with passive-scan/no-ibss flags) which was initialized
during the start-up. This could result in P2P functionality using
conflicting or obsolete channel information.

To resolve this issue, update channel list information on regulatory
change events to all of the virtual interfaces sharing the same phy for
which the event is received.

CRs-Fixed: 556398
Git-commit: 731ca6364e7e43997c2b7d715da0a7a0c5cb2ad9
Git-repo: git://w1.fi/srv/git/hostap.git
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Change-Id: I6c2f163bdf9e81d6d8d8295a1ec9bc0c57308edd
Interworking: Add support for multiple home FQDNs

Credentials can now be configured with more than one FQDN ('domain'
field in the cred block) to perform Domain Name List matching against
multiple home domains.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Git-commit: 463c8ffbd5bf15dc5158d68fc32347cfb5746a83
Git-repo : git://w1.fi/srv/git/hostap.git
CRs-fixed: 567930

Change-Id: I0ac87ac8c98d62722330321a3a3ce49ff81ab2c9
Interworking: Report STATUS:sp_type even if domain is not configured

This allows sp_type={home,roaming,unknown} to be used to determine
network type with SIM-based credentials even if the domain name
parameter is not configured explicitly.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Git-commit: 7617388ea3547ff59bdef70c5cb2591a951acd11
Git-repo : git://w1.fi/srv/git/hostap.git
CRs-fixed: 567930

Change-Id: I1d5cf0a61ab3a87c4fd9d632f8f0cd9f8f76e9fe
hostapd: Wait for channel list update after country code change

If hostapd is requested to set the country code and the previous country
code differs from the new one, the channel list information from the
driver may change. This change may not be instant, so wait for an
EVENT_CHANNEL_LIST_CHANGED event before continuing interface setup with
fetching of the channel list information. This fixes issues where the
selected channel is not available based on the previous regulatory data
and update through CRDA takes some time.

Change-Id: I0c0148a69307dd6893cc79974931b581c1af5dfd
CRs-Fixed: 570018
Git-commit:f0793bf191eb5c16db2d174b0127425bda79310f
Git-repo: git://w1.fi/srv/git/hostap.git
Signed-hostap: Jouni Malinen <j@w1.fi>

This includes changes from another upstream commit
e76da5052980f301fe61f2fc0e1e7a5789716061 ("hostapd: Add AP DFS support")
to address the drv_callbacks.c dependencies.
To avoid having to pull in all the DFS related changes
the conflicts are resolved manually for:
        src/ap/drv_callbacks.c
        src/ap/hostapd.c
hostapd: Filter channel list updated events after country code change

We were not filtering the EVENT_CHANNEL_LIST_CHANGED events based on the
regulatory hint initiator. So wait for EVENT_CHANNEL_LIST_CHANGED event
after our own change was triggered even when regulatory hint initiator
was the driver. This could result in the wait for the channel list to be
updated to be terminated before the real change has occurred and as
such, old channel list remaining in use when configuring
hostapd/wpa_supplicant country parameter. Fix this by filtering the
hints according to the initiator and only regulatory hints initiated by
user will be used to stop the wait.

CRs-Fixed: 570018
Git-commit:795baf773f6d53bae3cfae4df6edda63e5022344
Git-repo: git://w1.fi/srv/git/hostap.git
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Change-Id: I1498135bf949df27f6aeab75c41cebddbb9a89a7

conflicts are resolved manually for:
	src/ap/hostapd.h
	src/drivers/driver.h
Merge "P2P: Use group formation timeout on persistent group GO"
Merge "P2P: Make sure wait for the first client gets stopped"
Merge "Include Extended Capabilities element based on scan results"
P2P: Use negotiated channel from invitation for persistent GO

During persistent group re-invocation, GO may end up using a different
channel as the operation channel compared to what was indicated in the
invitation frames. This may break the connection if the peer device ends
up scanning the GO only on the channel from the invitation frame. Fix
this by using the negotiated channel (if available) on the GO as the
operating channel instead of the channel that was provided in the
p2p_invite command to start negotiation.

Change-Id: I85061ec54b669a88ff1469bf5efa49019874ab9b
Crs-Fixed: 543504
Git-commit: dcd25d4c3b63cf0726c6ef5feeccd8716a6c00f7
Git-repo: git://w1.fi/srv/git/hostap.git
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Merge "Interworking: Do not reconnect if already connected"
Merge "Interworking: Avoid duplicated network blocks"
Merge "Interworking: Reject BSS based on disallow_aps"
Merge "Update regulatory change to all virtual interface for the phy"
Merge "Interworking: Add support for multiple home FQDNs"