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>
smart_config: scan social channels first

scan on channels 1/6/11 first (that is the current requirement.
it doesn't seem very useful, though...)

we can also simplify the code by letting the driver check
whether the channel is disabled. however, the rest of the
scan code checks it in userspace as well, so do it also
here.

Signed-off-by: Eliad Peller <eliad@wizery.com>
ctrl_iface: block commands while in smart_config mode

block most of the ctrl_iface commands while the supplicant
is in smart_config mode.

Allow only a limited set of commands, as the driver/supplicant
is not fully functional in this stage.

Signed-off-by: Eliad Peller <eliad@wizery.com>
drivers.mak: don't use hardcoded libnl3 path (INTERNAL)

Using hardcoded libnl-3 path breaks cross-compilation.
Don't use it if LIBNL_PATH is defined.

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