wpa_s: fix connection with WPSv2

Once a new scan results are available and no suitable
network found, enable a normal scan as it's preferable
for the WPS operations. This fixes some connections
problems with WPSv2.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
p2p: always scan using p2p probes on GO/CLI interfaces (INTERNAL)

If we get BSS loss as a CLI, the interface is no longer in formation,
and we mistakenly use CCK rates in the scan.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Allow concurrent normal scan and sched scan (UPSTREAM)

Some drivers support sched scan and normal scan. Enable this
by configuration of concurrent_sched_scan=1
This can speed up connection to scan_ssid=1 networks as
the sched scan doesn't get interrupted by a normal scan
for wildcard SSID.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Android: wpa_s template: enable concurrent_sched_scan (ANDROID)

Our solution supports this and it speeds up initial connection
to hidden networks.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
wpa_s: fix hidden network connection (INTERNAL)

Scheduled scan can handle up to WPAS_MAX_SCAN_SSIDS per scan.
If the number of configured networks exceeds this limitation,
iterate over rest SSIDs (> WPAS_MAX_SCAN_SSIDS) with cyclic
normal scan.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
add copy of testmode.h

Use a copy in order to sync testmode commands with the kernel

Signed-off-by: Eliad Peller <eliad@wizery.com>
driver_nl80211: define driver_cmd callback for non-android builds as well

call the original android implementation if ANDROID is defined,
otherwise, return -1.

we'll later extend this function to support testmode commands as well.

Signed-off-by: Eliad Peller <eliad@wizery.com>
driver_nl80211: add smart_config_start/stop functions

Add generic testmode command function, and use it in
order to send smart_config_start/stop commands.

Signed-off-by: Eliad Peller <eliad@wizery.com>
events: add smart config events

On EVENT_SMART_CONFIG_SYNC event, start ROCing forever, until
the info is decoded successfully.
allow sched_scan with no configured networks

In case of smart_config (during the sync stage), we want
to issue a sched_scan, while there are no configured networks.

Signed-off-by: Eliad Peller <eliad@wizery.com>
driver_nl80211: handle testmode events

Signed-off-by: Eliad Peller <eliad@wizery.com>
driver_nl80211: register for testmode events

testmode events are used for smart_config

Signed-off-by: Eliad Peller <eliad@wizery.com>
wpa_supplicant: handle smart_config_start/stop

handle smart_config start/stop commands.
Call the newly added stop function on SMART_CONFIG_DECODE event
as well, in order to avoid duplicated code.

On SMART_CONFIG_START we stop temporarily disable
all networks and disable the ongoing scans. Then,
we send testmode command to enter smart_config mode,
and initiate an empty scan (so the fw will try syncing
on a channel with smart_config data being transmitted)

Signed-off-by: Eliad Peller <eliad@wizery.com>
wpa_cli/ctrl_iface: handle SMART_CONFIG/STOP_SMART_CONFIG commands

simply call the respective wpa_supplicant_smart_config_start/stop
command.

Signed-off-by: Eliad Peller <eliad@wizery.com>
events: add new network on decode

On successfull smart config decode, add a new enabled network,
and save it (if update_config=1).

Signed-off-by: Eliad Peller <eliad@wizery.com>
events: add another network entry for smart_config WEP keys

in case of hex keys with len=10/26, add another network
block with wep encryption.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wpa_ctrl: add smart_config events

Add events for SYNC completion and DECODE completion.

Signed-off-by: Eliad Peller <eliad@wizery.com>
wpa_cli: add smart_config set group key command

Add new smart_config_set_group_key wpa_cli command
to set a group key for the smart_config decode stage.

The relevnat key is later used in the smart_config
decode phase in order to decrypt the received
data (ssid, pwd).

Signed-off-by: Eliad Peller <eliad@wizery.com>
driver_nl80211: handle smart_config set group key command

Handle SMART_CONFIG_SET_GROUP_KEY command, by sending
the respective testmode command to the driver.

Signed-off-by: Eliad Peller <eliad@wizery.com>
ctrl_iface wpa_supplicant: handle SMART_CONFIG_SET_GROUP_KEY

Issue an internal SMART_CONFIG_SET_GROUP_KEY driver command.

Signed-off-by: Eliad Peller <eliad@wizery.com>