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.
scan.c: force passive scan when in smart_config mode

Otherwise, an acrive scan with wildcard ssid is used,
even though there are no enabled networks.

Signed-off-by: Eliad Peller <eliad@wizery.com>
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.

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

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

Signed-off-by: Eliad Peller <eliad@wizery.com>
events: use max_remain_on_chan time for decode stage

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>