nl80211: add parameter to force multi channel concurrency (BRCM)

Add a parameter which can be set from wpa_s commandline
or conf file to force real multi channel.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
P2P: Decrease peer expiry time (BRCM)

Changed from 5 min to 30 secs probably in order
to avoid stale peers appearing in the Android UI.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
P2P: Improve scan results handling (BRCM)

Avoid reporting scan results to the application in case a P2P search
is in progress as there will be many events but the scan is only
done on channels 1,6,11. This may cause APs on other channels to "disappear"
from the scan results.
Also avoid updating P2P interfaces with STA interfaces scan results
in order to avoid having results which are not on the social channels.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
P2P: Avoid peer expiration while connection in progress (BRCM)

(This seems to be a bug fix squashed in one of the BRCM patches.
Could be that the probability of this occuring once the expiration
time was reduced to 30s is higher)

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Fix a crash in WPS PBC overlap (BRCM)

Supposedly fixed a crash which occurs during actual PBC overlap
according to BRCM commit log.

(Not quite sure what's the exact cause of the crash here. However
this looks like a non BRCM specific change so take it).
p2p_dev_addr can be NULL in some of the calls. Might cause a problem ?)

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Handle new interface parameter in ctrl commands (BRCM)

Some commands sent to wpa_s by the framework in JB include
a new interface parameter. Handle it and dispatch the the
command on the correct interface.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Increase P2P_MAX_CLIENT_IDLE to 20 secs (BRCM)

This is from Jithu Jance submission to hostap ML:

Consider the disconnect event generated due to EAP-FAILURE(after WPS handshake)
during the P2P connection.

In this disconnect context, the group idle timer will be set to 10 and assoc retry starts.
If the connection doesn't go through in the first attempt the group will be removed.
This is because the authentication timeout happens at 10secs and the assoc will be retried only after that.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Initialize P2P on p2p0 and not wlan0 (JB)

P2P is being initialized using a global struct
which points to the first initialized interface wpa_s
struct. That's causing P2P commands sent on the control
socket matching p2p0 to generate scan and ROC on the
wrong interface (wlan0) as well as events like PEER_DEVICE_FOUND
are sent on the wrong control socket to the Android framework.
This caused the framework to ignore these and prevent
displaying the P2P peer in the UI.

Solve it by an ugly hack for now to enable P2P only when the
interface p2p0 is being initialized.

This probably should be fixed upstream as well by marking
somehow on which interface you can do p2p or enable p2p per
interface.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
android: wpa_s template: set p2p_go_max_inactivity and p2p concurrency

Set p2p_go_max_inactivity to 60 secs (instead of the default
of 300 secs) to avoid creating a user of experience of a
WiFi Direct connection which doesn't disconnect. This may
happen if the P2P GO interface misses a deauth/disassoc frame
and keeps on thinking the client is connected. Limit this
time to 30 secs which creates a better user experience.

[Arik - also set the default mode of operation to p2p concurrency. This
means we will work with 2 interfaces for p2p]

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
android: wpa_s template: allow HT40 GO by default (ANDROID)

Signed-off-by: Arik Nemtsov <arik@wizery.com>