Fix ENABLE_NETWORK not to reconnect in disconnected state

DISCONNECT followed by ENABLE_NETWORK ended up starting a scan for a new
connection due to wpa_supplicant_enable_one_network() setting
wpa_s->reassociate = 1. This was done regardless of wpa_s->disconnected
being 1 which should imply that wpa_supplicant should not try to connect
before asked explicitly with REASSOCIATE or RECONNECT.

Fix this by making ENABLE_NETWORK setting of reassociate = 1 and
starting of scans for connection conditional on wpa_s->disconnected ==
0. This will make ENABLE_NETWORK trigger a connection only if
wpa_supplicant is already in a state where it would try to connect if
there are any enabled networks.

Change-Id: I3f15688d7016551219182e6f8e751941b6340aa6
CRs-Fixed: 564226
Git-commit:d2592497624d7dff53e71cc01fc2d5db1e59733e
Git-repo: git://w1.fi/srv/git/hostap.git
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
P2P: Increase Invitation Request timeouts

In noisy environment peer may take more time to send Invitation
Response so increase Invitation Response timeout to 500 ms in success
case and also increase Invitation Request action wait time to 500 ms.
This makes the Invitation Request case use the same timeout with GO
Negotiation.

CRs-Fixed: 538699
Git-commit: 63ce59dea8c6b458d9a0c24e91f971f461f17b79
Git-repo: git://w1.fi/srv/git/hostap.git
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Change-Id: Idd3dea0e7ed16cd7564b34dfe279a49f16f021d4
P2P: Cancel group formation timeout on client connection

It was possiblle for the group formation timeout to be left running even
after the P2P Client connected to the group if the WPS provisioning step
was not completed cleanly (e.g., due to WSC_Done not getting received
from the client). There is no need to remove the group in such case due
to the initial group formation timeout, so work around this by removing
that timeout on data connection.

CRs-Fixed: 538026
Git-commit: eab2b50dc83e1d14dcb573dfc9b10fc6a9cb1cdd
Git-repo: git://w1.fi/srv/git/hostap.git
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Change-Id: I15e65a8e2436db5c408d5960bff6ba7af16f62c1
P2P: Extend group formation timeout on GO to first data connection

Previously, GO considered the group to be fully formed at the completed
of WPS provisioning step. 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 WPS provisioning step, 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 (10)
seconds

Change-Id: Ia33cbf738490d89263c80a39d9044500a847b470
CRs-Fixed: 538026
Git-commit: 41f853235fe1d1fad1acecc0ee5dfe81c872c6b2
Git-repo: git://w1.fi/srv/git/hostap.git
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Merge "P2P: Increase Invitation Request timeouts"
Merge "Fix ENABLE_NETWORK not to reconnect in disconnected state"
P2P Extend postponing of concurrent scans for persistent GO

Update the p2p_go_wait_client timestamp in p2p_go_configured() to
address the case where the group is set up without the provisioning
step.

Change-Id: Idff6b55f2d572fc27ee8abcf05778a7ed5451632
CRs-Fixed: 554201
Git-commit: 6903ee6f62e4585451c1e4f90db8ca8d7cc82070
Git-repo: git://w1.fi/srv/git/hostap.git
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
P2P: Clear p2p_group_formation and p2p_in_provisioning on group removal

Commit 41f853235fe1d1fad1acecc0ee5dfe81c872c6b2 extends group formation
timeout for the first data connection to complete and resets
p2p_go_group_formation_completed flag due to which p2p_in_provisioning
and p2p_group_formation flags are not cleared when
wpas_group_formation_completed() is called. This can result in both
station scan and p2p_find failures in the case where separate P2P group
interface is not used and the client does not complete 4-way handshake.
Fix this by clearing p2p_group_formation and p2p_in_provisioning when
such a P2P group is deleted.

Change-Id: Ia1842eca41e01d6ecc07d09f4a3d9deb413acbd5
CRs-Fixed: 554197
Git-commit: acdd0fc84f01d8b5e8aa39d6e4573cee0b5ac707
Git-repo: git://w1.fi/srv/git/hostap.git
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Merge "P2P: Cancel group formation timeout on client connection"
Merge "P2P: Extend group formation timeout on GO to first data connection"
Merge "P2P Extend postponing of concurrent scans for persistent GO"
eap_proxy: Confirm eap_proxy initialization before reading SIM info

Trying to access the SIM card details without checking if the eap_proxy
layer has been initialized can result in a crash. Address this by
sending the request for the IMSI through eapol_supp_sm.c which can
verify that eap_proxy has been initialized.

Change-Id: Ib8215047e37100c009eadd247a0d3a871ef04142
CRs-Fixed: 564458
Git-commit: 07041c6f991d933d2361c8204433c09212f9fb0b
Git-repo: git://w1.fi/srv/git/hostap.git
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
eap_proxy: Re-read IMSI from proxy in Interworking functionality

Try to read the IMSI values through the eap_proxy layer for Interworking
functionality again if the value was not available at startup.

Change-Id: I6b11aedd129d776cae35e62a5a97ec2222bcea8f
CRs-Fixed: 566759
Git-commit: efc58df29c6d812d17b793128e3085a2e7e883c3
Git-repo: git://w1.fi/srv/git/hostap.git
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Merge "P2P: Clear p2p_group_formation and p2p_in_provisioning on group removal"
Merge "eap_proxy: Confirm eap_proxy initialization before reading SIM info"
Merge "eap_proxy: Re-read IMSI from proxy in Interworking functionality"
eap_proxy: Add context data pointer to the get_imsi call

This was already included in all the other calls to eap_proxy, but
somehow the get_imsi call had been forgotten.

Change-Id: Icfad4572d6946d62d269a49cd18b73e883e0e4ee
CRs-Fixed: 564458
Git-commit: fa56315cfc9ebaff2b210ed99d43dda9b16bdf56
Git-repo: git://w1.fi/srv/git/hostap.git
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Merge "eap_proxy: Add context data pointer to the get_imsi call"
merge in klp-release history after reset to klp-dev

Change-Id: Id2154fb90ad80a656faab2763cb0ee1c46a56e9e
Merge branch 'kk_2.7_rb1.10' of git://codeaurora.org/platform/external/wpa_supplicant_8 into kk_2.7_rb1.10