]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - wl12xx/hostap.git/log
wl12xx/hostap.git
10 years agowpa_supplicant: fix scan with more than max_sched_scan_ssids android_jb_mr1_39 ol_r8.a8.06 ol_r8.a8.07 ol_r8.a8.08 ol_r8.a8.09 ol_r8.a8.10
Barak Bercovitz [Sun, 3 Nov 2013 13:22:44 +0000 (15:22 +0200)]
wpa_supplicant: fix scan with more than max_sched_scan_ssids

sched scan fills filter_ssids with non empty ssids
that may be non-hidden (not scan_ssid=1)
so we may get to a point where some hidden ssids aren't filtered
and we don't start a normal scan for them, since
total number of hidden ssid < max_sched_scan_ssids.
to solve this, we count all active ssids instead of just the
scan_ssid=1 ones

10 years agohostapd: Fix Max SP Length derivation from QoS Info ol_r8.a8.01 ol_r8.a8.02 ol_r8.a8.03 ol_r8.a8.04 ol_r8.a8.05
Srinivasan B [Sat, 16 Feb 2013 09:15:13 +0000 (11:15 +0200)]
hostapd: Fix Max SP Length derivation from QoS Info

Hostapd provides QoS info of the STA (Service Period & AC mask) to the
kernel during wpa_driver_nl80211_sta_add call. Bit 5 and Bit 6 of QoS
info represents the Max SP length. Fix an issue in the code to fetch the
Max SP by shifting right the QoS info by value WMM_QOSINFO_STA_SP_SHIFT.
(operator ">" is replaced with ">>" operator).

Signed-off-by: Srinivasan <srinivasanb@posedge.com>
10 years agodriver_nl80211: implement shared AP channel op
Arik Nemtsov [Sun, 25 Aug 2013 14:10:26 +0000 (17:10 +0300)]
driver_nl80211: implement shared AP channel op

Dump all AP interfaces using NL80211_CMD_GET_INTERFACE and make sure
the wiphy matches ours.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
10 years agohostapd: use new op to sync AP channels
Arik Nemtsov [Sun, 25 Aug 2013 14:08:27 +0000 (17:08 +0300)]
hostapd: use new op to sync AP channels

A new op will be used to get the operational frequency and secondary
channel of any existing APs, even if operating in different processes.

Use this op to select the channel for the current AP, if dictated by
the ap_channel_sync config parameter.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
10 years agohostapd: add hostapd.conf param to force AP channel sync
Arik Nemtsov [Sun, 25 Aug 2013 14:04:10 +0000 (17:04 +0300)]
hostapd: add hostapd.conf param to force AP channel sync

When ap_channel_sync=1 the 40Mhz operating channel of an AP will be
set to the channel of an existing AP operating on the same PHY (NIC).

Signed-off-by: Arik Nemtsov <arik@wizery.com>
10 years agohostapd: ACS: set correct ht_capab when no HT40 is not chosen ol_r8.a7.02
Arik Nemtsov [Sun, 11 Aug 2013 07:13:34 +0000 (10:13 +0300)]
hostapd: ACS: set correct ht_capab when no HT40 is not chosen

If HT40 is enabled for ACS, but we fail to select a secondary channel
for any reason (usually regulatory), the ht_capab must be stripped
of the HT40-support capability.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
10 years agohostapd: fix ACS behavior when 11n is disabled
Arik Nemtsov [Sun, 11 Aug 2013 07:11:58 +0000 (10:11 +0300)]
hostapd: fix ACS behavior when 11n is disabled

If 11n is disabled during compile time (CONFIG_IEEE80211N) or during
runtime (ieee80211n=0), ACS code would fail to complete interface init.

Handle these cases correctly by calling the setup completion function.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
10 years agodriver_nl80211: set_country fix ol_r8.a7.01
Igal Chernobelsky [Mon, 3 Jun 2013 11:48:03 +0000 (14:48 +0300)]
driver_nl80211: set_country fix

Regulatory domain setting may take some time.
Getting reg domain info immediately after reg domain setting returns
invalid reg domain data. Loop is added to read reg domain info back and
to compare set country. If read country does not match, fail to 1 sec sleep
and retry get/compare again.

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
10 years agobgscan_learn: start scanning from the first freq
Eliad Peller [Mon, 22 Jul 2013 22:16:28 +0000 (01:16 +0300)]
bgscan_learn: start scanning from the first freq

bgscan_learn_get_probe_freq() starts from returning
the second entry in the supp_freqs arrays.

Change its logic a bit to make it start from the first
entry.

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

10 years agobgscan_learn: avoid redundant frequencies
Eliad Peller [Mon, 22 Jul 2013 22:16:27 +0000 (01:16 +0300)]
bgscan_learn: avoid redundant frequencies

Some hw modes (e.g. 11b and 11g) contain the same frequencies,
causing the supp_freqs array to be populated with redundant entries.

Check for the existence of the freq before adding it.

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

10 years agobgscan: stop bgscan only on disassociaion
Eliad Peller [Mon, 22 Jul 2013 22:16:26 +0000 (01:16 +0300)]
bgscan: stop bgscan only on disassociaion

Stopping bgscan on any state other than COMPLETED results
in bgscan reset (stop + start) on every rekeying operation.

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

10 years agoRevert "Revert "Initialize P2P on p2p0 and not wlan0 (JB)""
Arik Nemtsov [Thu, 18 Jul 2013 09:24:20 +0000 (12:24 +0300)]
Revert "Revert "Initialize P2P on p2p0 and not wlan0 (JB)""

This reverts commit ff8600f0c5d08b245f1ec6e999b028ade86121bb.

This is required for normal operation of wlan0 + p2p0 interfaces

10 years agoRevert "Initialize P2P on p2p0 and not wlan0 (JB)"
Eliad Peller [Tue, 4 Jun 2013 16:17:12 +0000 (19:17 +0300)]
Revert "Initialize P2P on p2p0 and not wlan0 (JB)"

This reverts commit 1e513dec86ce7ca2b37d31ac2acd9901662e6611.

10 years agosync nl80211_copy.h
Eliad Peller [Sun, 5 May 2013 16:20:11 +0000 (19:20 +0300)]
sync nl80211_copy.h

after the latest rebase, some command indices
had to move, so make sure we are aligned again.

Signed-off-by: Eliad Peller <eliad@wizery.com>
10 years agodrivers.mak: don't use hardcoded libnl3 path (INTERNAL)
Eliad Peller [Wed, 8 May 2013 14:17:01 +0000 (17:17 +0300)]
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>
10 years agoctrl_iface: block commands while in smart_config mode
Eliad Peller [Mon, 13 May 2013 09:15:21 +0000 (12:15 +0300)]
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>
10 years agosmart_config: scan social channels first
Eliad Peller [Tue, 2 Apr 2013 16:57:01 +0000 (19:57 +0300)]
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>
10 years agoctrl_iface wpa_supplicant: handle SMART_CONFIG_SET_GROUP_KEY
Eliad Peller [Wed, 27 Mar 2013 14:55:36 +0000 (16:55 +0200)]
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>
10 years agodriver_nl80211: handle smart_config set group key command
Eliad Peller [Wed, 27 Mar 2013 14:54:29 +0000 (16:54 +0200)]
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>
10 years agowpa_cli: add smart_config set group key command
Eliad Peller [Wed, 27 Mar 2013 13:22:00 +0000 (15:22 +0200)]
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>
10 years agowpa_ctrl: add smart_config events
Eliad Peller [Mon, 18 Mar 2013 16:07:43 +0000 (18:07 +0200)]
wpa_ctrl: add smart_config events

Add events for SYNC completion and DECODE completion.

Signed-off-by: Eliad Peller <eliad@wizery.com>
10 years agoevents: add another network entry for smart_config WEP keys
Eliad Peller [Mon, 18 Mar 2013 15:53:39 +0000 (17:53 +0200)]
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>
10 years agoevents: add new network on decode
Eliad Peller [Mon, 18 Mar 2013 14:18:39 +0000 (16:18 +0200)]
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>
10 years agowpa_cli/ctrl_iface: handle SMART_CONFIG/STOP_SMART_CONFIG commands
Eliad Peller [Mon, 18 Mar 2013 14:13:34 +0000 (16:13 +0200)]
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>
10 years agowpa_supplicant: handle smart_config_start/stop
Eliad Peller [Mon, 18 Mar 2013 14:12:31 +0000 (16:12 +0200)]
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>
10 years agodriver_nl80211: register for testmode events
Eliad Peller [Mon, 18 Mar 2013 11:21:41 +0000 (13:21 +0200)]
driver_nl80211: register for testmode events

testmode events are used for smart_config

Signed-off-by: Eliad Peller <eliad@wizery.com>
10 years agodriver_nl80211: handle testmode events
Eliad Peller [Thu, 18 Apr 2013 11:11:30 +0000 (14:11 +0300)]
driver_nl80211: handle testmode events

Signed-off-by: Eliad Peller <eliad@wizery.com>
10 years agoallow sched_scan with no configured networks
Eliad Peller [Thu, 18 Apr 2013 11:18:06 +0000 (14:18 +0300)]
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>
10 years agoevents: add smart config events
Eliad Peller [Mon, 18 Mar 2013 13:55:13 +0000 (15:55 +0200)]
events: add smart config events

On EVENT_SMART_CONFIG_SYNC event, start ROCing forever, until
the info is decoded successfully.

10 years agodriver_nl80211: add smart_config_start/stop functions
Eliad Peller [Mon, 18 Mar 2013 13:00:36 +0000 (15:00 +0200)]
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>
10 years agodriver_nl80211: define driver_cmd callback for non-android builds as well
Eliad Peller [Mon, 18 Mar 2013 13:07:48 +0000 (15:07 +0200)]
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>
10 years agoadd copy of testmode.h
Eliad Peller [Mon, 18 Mar 2013 13:26:21 +0000 (15:26 +0200)]
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>
11 years agowpa_s: fix hidden network connection (INTERNAL) ol_r8.a6.02-mr1
Victor Goldenshtein [Tue, 19 Mar 2013 15:05:46 +0000 (17:05 +0200)]
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>
11 years agop2p: always scan using p2p probes on GO/CLI interfaces (INTERNAL)
Arik Nemtsov [Sun, 17 Mar 2013 09:44:21 +0000 (11:44 +0200)]
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>
11 years agoHACK: use android logic for p2p init by interface names ol_r8.a6.01-mr1
Arik Nemtsov [Wed, 13 Mar 2013 07:49:24 +0000 (09:49 +0200)]
HACK: use android logic for p2p init by interface names

This prevents us from initializing p2p on the first interface.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agowpa_s: fix connection with WPSv2
Victor Goldenshtein [Sun, 10 Mar 2013 12:07:29 +0000 (14:07 +0200)]
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>
11 years agowpa_s: add DBUS support to defconfig
Ido Reis [Thu, 7 Mar 2013 14:00:51 +0000 (16:00 +0200)]
wpa_s: add DBUS support to defconfig

Signed-off-by: Ido Reis <idor@ti.com>
11 years agowpa_s: new override_p2p_go_intent conf parameter (INTERNAL) ol_r8.a5.14-mr1
Victor Goldenshtein [Sun, 20 Jan 2013 13:31:47 +0000 (15:31 +0200)]
wpa_s: new override_p2p_go_intent conf parameter (INTERNAL)

If override_p2p_go_intent is set in the p2p/wpa_supplicant.conf
use it instead of the p2p_go_intent value passed from the frame
work.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agoP2P: wait on GO negotiation confirm
Arik Nemtsov [Sun, 10 Feb 2013 12:37:57 +0000 (14:37 +0200)]
P2P: wait on GO negotiation confirm

This commit reverts:
792c887 P2P: Send GO Negotiation Confirm without wait

Some drivers rely on the wait period for sending packets on the
off-channel. If the wait value is small there's a race condition where
the driver ROC might complete before the packet was sent out.

This doesn't impede other drivers, as the wait is cancelled when a
Tx-completion arrives from the remote peer.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agoAndroid/wpa_supplicant: revert enable mr/mc by default
Igal Chernobelsky [Wed, 6 Feb 2013 14:42:34 +0000 (16:42 +0200)]
Android/wpa_supplicant: revert enable mr/mc by default

No need to pass use_multi_chan_concurrent & use_p2p_group_interface
driver parameters as in JB MR1 driver_nl80211 sets
WPA_DRIVER_FLAGS_P2P_CONCURRENT and WPA_DRIVER_FLAGS_MULTI_CHANNEL_CONCURRENT
flags according to wifi capabilities.

Reverts commits:
4a23708 Android/wpa_supplicant: enable mr/mc by default
83d2f35 android: wpa_s template: set p2p_go_max_inactivity and p2p concurrency

Change-Id: I3c66af1f0e4eaa70dd425be6f80b46c1734ffc48
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agoP2P: accept provision discovery with bcast group ID ol_r8.a5.13
Eliad Peller [Tue, 29 Jan 2013 15:13:04 +0000 (17:13 +0200)]
P2P: accept provision discovery with bcast group ID

Some bogus devices send provision discovery requests with
bcast group id, which is invalid. However, as we currently
must accept these requests, as they are needed for certification.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agoAndroid/wpa_supplicant: enable mr/mc by default ol_r8.a5.12
Igal Chernobelsky [Mon, 21 Jan 2013 11:58:57 +0000 (13:58 +0200)]
Android/wpa_supplicant: enable mr/mc by default

Change-Id: Ica21e3f16f27cb8815bb60243f4a83f55ee5b588
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agoP2P: Don't delete group on non P2P interfaces (UPSTREAM)
Eyal Shapira [Tue, 9 Oct 2012 21:26:09 +0000 (23:26 +0200)]
P2P: Don't delete group on non P2P interfaces (UPSTREAM)

p2p_group_remove * calls wpas_p2p_disconnect on all
interfaces including non P2P ones. This has undesired
effects such as disconnecting concurrent connected STA
interfaces as well as emitting P2P-GROUP-REMOVED events
on all interfaces including ones that didn't actually
have a P2P CLI or GO running.
Instead fail explicitly when attempting to p2p disconnect
an interface with no P2P activity.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agohostapd: add support for ACS whitelist and blacklist (INTERNAL)
Arik Nemtsov [Thu, 27 Dec 2012 20:16:55 +0000 (22:16 +0200)]
hostapd: add support for ACS whitelist and blacklist (INTERNAL)

Allow certain channels to be marked as forbidden for automatic channel
selection (ACS) via a blacklist. Also allow channels to be preferred
exclusively via a whitelist.

Both blacklist and whitelist can be configured via the hostapd.conf
file. Document these options in the sample hostapd.conf file given.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agohostapd: auto-select secondary channel (INTERNAL)
Arik Nemtsov [Sun, 23 Dec 2012 22:43:28 +0000 (00:43 +0200)]
hostapd: auto-select secondary channel (INTERNAL)

Select a secondary channel according to regulatory class and ambient
noise constraints, as measured by the number of APs on the primary
channel.
If the user wants HT40 operation, try to select a secondary channel
where the level of noise is still minimal. If such one cannot be found,
we prefer to operate as an HT20 AP. The secondary channel selected also
has the minimum number of APs between all allowed secondary channels.

HT40 on 2.4Ghz is disallowed outright, since we can't fulfill all
regulatory constraints to operate in this mode.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agohostapd: auto-select AP channel (INTERNAL)
Arik Nemtsov [Sun, 23 Dec 2012 23:27:27 +0000 (01:27 +0200)]
hostapd: auto-select AP channel (INTERNAL)

Find all BSSes in scan results and find a channel in our HW mode where
the number of BSSes is minimal. Ignore channels disabled by our regulatory
domain.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agohostapd: re-use auto-select scan result for 40Mhz pre-scan (INTERNAL)
Arik Nemtsov [Sun, 23 Dec 2012 23:25:15 +0000 (01:25 +0200)]
hostapd: re-use auto-select scan result for 40Mhz pre-scan (INTERNAL)

We can use the scan done for selecting the channel for the mandatory
scan to be made for an 11a 40Mhz AP. Refactor some functions to be
able to use an existing scan_res structure.

Also make ieee80211n_check_scan() demand async completion, since the
interface is initialized by this function.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agohostapd: template function for auto-selection of channel (INTERNAL)
Arik Nemtsov [Sun, 23 Dec 2012 23:14:55 +0000 (01:14 +0200)]
hostapd: template function for auto-selection of channel (INTERNAL)

Don't fail when the configured AP channel is 0. Use it as a cue for
automatic channel selection. Move the code a bit up to avoid redundant
checks for channel validitly on the yet unselected channel.

Add an empty template function for auto-selecting a channel. At this point
a scan is initiated and its callback does nothing.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agop2p: accommodate peers that use the GO address in prov_disc_resp
Arik Nemtsov [Thu, 27 Dec 2012 07:49:43 +0000 (09:49 +0200)]
p2p: accommodate peers that use the GO address in prov_disc_resp

Don't try to perform another PD with the remote peer if we already have
one with its interface (GO) address. Usually the dev address is used in
this case.

This is compatibility fix for the Google CTS testing suite.

Change-Id: Ie8c53fc66cc845c3e0c35ece88b520590045e350
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agodriver_nl80211: ignore useless driver commands (ANDROID)
Arik Nemtsov [Tue, 18 Dec 2012 09:34:04 +0000 (11:34 +0200)]
driver_nl80211: ignore useless driver commands (ANDROID)

These are not used, so just return success to avoid creating spurious
errors in logcat.

Change-Id: I458a8969647f3cff391766b9f86a046600ed7d36
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agoandroid: remove redundant define from driver_nl80211
Arik Nemtsov [Mon, 17 Dec 2012 14:04:05 +0000 (16:04 +0200)]
android: remove redundant define from driver_nl80211

The AOSP libnl already contains this define. Defining it twice creates a
conflict during compilation.

Change-Id: I5a9183e1377f358b40ed3942cdde3da7dd229e3f
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agoAndroid.mk: update version string
Vishal Mahaveer [Fri, 10 Aug 2012 13:13:40 +0000 (08:13 -0500)]
Android.mk: update version string

Update version string to differentiate this tree from Google tree

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
11 years agoIncrease timeouts for p2p
Irfan Sheriff [Wed, 31 Oct 2012 05:22:52 +0000 (22:22 -0700)]
Increase timeouts for p2p

Dongles can be slow to respond and a quick turn around time on packets does not help.
Allow for upto 350ms on retry attempts for provision discovery, negotiation and invitation

This will catch slow responses within the first attempt and prevent any kind of issues
with sequence number handling

Bug: 7445415
Change-Id: I88a849d400b10f42ac298bad6d01f49803fcc8ba

11 years agoIncrease channel delay to 100ms
Irfan Sheriff [Wed, 17 Oct 2012 04:40:46 +0000 (21:40 -0700)]
Increase channel delay to 100ms

There is an inherent flaw in the p2p protocol design where an ACK loss right
before channel switch leads to peers being out of sync.

A work around of 50ms was added persistent case, but it turns out in heavy lossy
conditions that is not enough. Increase it to 100ms.

Experimental evaluation showed 100ms improves the reliability of p2p persistence
reinvocation.

Bug: 7359500
Change-Id: I73ab1b64e32b87101e95b0e487c90818c2c0aaf3

11 years agoclear wfd_dev_info_hex before use
Irfan Sheriff [Tue, 11 Sep 2012 15:58:24 +0000 (08:58 -0700)]
clear wfd_dev_info_hex before use

Change-Id: Ic5cdb4df220834faf9e7da5cc1cc0a4191e6abd1

11 years agoAdd WFD dev info in device found event
Irfan Sheriff [Mon, 10 Sep 2012 00:08:19 +0000 (17:08 -0700)]
Add WFD dev info in device found event

Change-Id: If25804d41e7ea1d028a30c180290d8de547f43e8

11 years agoFix join for p2p_connect
Irfan Sheriff [Fri, 7 Sep 2012 01:30:39 +0000 (18:30 -0700)]
Fix join for p2p_connect

wps_pbc with interface command stripped out ends up as a null character.
Supplicant tries to interpret that as a bssid. Fix it to ignore null
character as empty bssid

Change-Id: Ic91d6657efaf03fbe5c4a03e9e630b4b3ff5dec4

11 years agohostapd: Allow hostapd_cli to work on Android
Jeff Johnson [Tue, 4 Sep 2012 05:12:17 +0000 (22:12 -0700)]
hostapd: Allow hostapd_cli to work on Android

Add definitions of the Android specific directories used for control
interface sockets so that hostapd_cli can connect to the Android
hostapd.

Change-Id: Iabcd8d70ef61fae6656066991240d55e65a032e4

11 years agoRestore p2p_group_formation pointer
Dmitry Shmidt [Tue, 4 Sep 2012 18:06:50 +0000 (11:06 -0700)]
Restore p2p_group_formation pointer

Restore the pointer till the 4-way handshake completes for the p2p client

Change-Id: I976659ae5dac4cf01ecdd7995ff9abb6bf914bc1
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
11 years agop2p: various fixes
Arik Nemtsov [Tue, 11 Dec 2012 15:02:40 +0000 (17:02 +0200)]
p2p: various fixes

- Allow group idle timeout to run during WPS disconnect
- Perform single channel scan if we know the channel of the GO joined

Change-Id: I7e9e15b9c44804196bc98c01d51a71e24412b91d
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
11 years agoAdd delimiter for bss command
Irfan Sheriff [Mon, 13 Aug 2012 17:56:16 +0000 (10:56 -0700)]
Add delimiter for bss command

With the availability of MASK option, the number of lines per BSS is not obvious,
add a delimiter to make parsing less flaky

Bug: 2961159
Change-Id: I9e5523f8da183e0735dbc06f0c09c9f841060504

11 years agoAdd action parameter to service discovery functionality
Arik Nemtsov [Tue, 11 Dec 2012 10:42:20 +0000 (12:42 +0200)]
Add action parameter to service discovery functionality

Change-Id: Ibc74c4053996e91f2f577b57695c68c86b5603c2
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
11 years agoUse bssid instead of pending_bssid
Irfan Sheriff [Wed, 1 Aug 2012 18:10:15 +0000 (11:10 -0700)]
Use bssid instead of pending_bssid

pending_bssid is not valid during roaming, use bssid

Bug: 6915644
Change-Id: Ib2181a41845f90812bd7428dbef6433adfe9f749

11 years agoGet rid of LOCAL_MODULE_TAGS := user
Joe Onorato [Tue, 22 May 2012 21:16:30 +0000 (14:16 -0700)]
Get rid of LOCAL_MODULE_TAGS := user

Change-Id: I6d9ed4e6e1d94cfedcb703eec4adfe227d35b473

11 years agoUse SSL_OP_NO_TLSv1_1 SSL_OP_NO_TLSv1_2 SSL_OP_NO_TICKET for better wpa_supplicant_8...
Brian Carlstrom [Thu, 26 Jul 2012 06:11:44 +0000 (23:11 -0700)]
Use SSL_OP_NO_TLSv1_1 SSL_OP_NO_TLSv1_2 SSL_OP_NO_TICKET for better wpa_supplicant_8 interoperability

Bug: https://bugs.launchpad.net/ubuntu/+source/wpasupplicant/+bug/969343/comments/72
Bug: http://w1.fi/bugz/show_bug.cgi?id=447#c7
Bug: http://code.google.com/p/android/issues/detail?id=34212
Bug: 6883259
Change-Id: Ib53326cc8cd40e800454b7b92586c052bc910ba8

11 years agowpa_supplicant: Remove snprintf call from interface= extension
Dmitry Shmidt [Mon, 16 Jul 2012 23:15:05 +0000 (16:15 -0700)]
wpa_supplicant: Remove snprintf call from interface= extension

BUG: b/6826116

Change-Id: I35023ce94152a402da94c34083de8ea1387cc758
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
11 years agoDo not delay p2p search in case of concurrent operations (INTERNAL) android_jb_rebased
Eyal Shapira [Wed, 19 Dec 2012 16:24:24 +0000 (18:24 +0200)]
Do not delay p2p search in case of concurrent operations (INTERNAL)

In our case there's no real need for the 500ms delay.
Canceling it improves the peer detection speed and user experience.
If a STA is connected then the p2p find won't affect it except
for a possible throughput hit but we prefer a better that in order
to get a beter user experience during the find.
If a STA is attempting to connect or scanning the p2p find will
be restarted as it's resilient to failures in scan and listen phases.

Change-Id: I455ce99be9fa54521cf2cea96bd023e9f14b64eb
Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agoDon't stop scan results processing due to pending P2P (INTERNAL)
Eyal Shapira [Tue, 18 Dec 2012 22:59:20 +0000 (00:59 +0200)]
Don't stop scan results processing due to pending P2P (INTERNAL)

The removed code unnecessarily discarded scan results
as well as fueled a ping pong between P2P search scans
and STA scans.

In Android whenever STA is connected further frameworks scans
are performed with changing ap_scan to 2 prior to the actual scan.
The combo of the current code and ap_scan == 2 would sometimes
lead to P2P search getting stuck as it wasn't being restarted
following STA scan.

[A similar patch by Neeraj is discussed on hostap but hasn't been
taken yet due to Jouni's rejection  so currently mark this as INTERNAL
and consider replacing it with the upstream version once approved]

Change-Id: I86abb93587e76f90b2c63280f596133e02f163bd
Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agoAvoid sched scan flood in case of mismatched security (UPSTREAM)
Eyal Shapira [Mon, 12 Nov 2012 11:51:35 +0000 (13:51 +0200)]
Avoid sched scan flood in case of mismatched security (UPSTREAM)

Current sched scan in the kernel is limited to SSID matching.
A rare corner case is when an AP with a matching SSID but unmatching
security to a saved profile is in the vicinity. In such a case
sched scan results will immediately be returned after initiating sched
scan however no match will be found due to the security mismatch.
This goes on in a tight loop which is bad as it will effectively
prevent the host from suspending and scan results will eventually
contain the single AP matched by the sched scan due to expiration
of other APs scanned in normal scans which are less frequent.

Avoid this by stopping sched scan after detecting sched scan results
were received but no matched network. Don't start another sched
scan immediately but wait for the next normal scan without any results
to restart it. This prevents the tight loop.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agoAndroid: Initiate a periodic normal scan in addition to sched scan (ANDROID)
Eyal Shapira [Wed, 29 Feb 2012 18:16:47 +0000 (20:16 +0200)]
Android: Initiate a periodic normal scan in addition to sched scan (ANDROID)

Android assumes wpa_s performs periodic broadcast scans whenever there are
saved networks. It relies on these scans for the "open networks detection"
feature. Whenever there aren't any saved networks the framework will initiate
these periodic scans on its own. Switching to using sched scan in wpa_s
effectively disabled these periodic broadcast scans as no results are returned
from the sched scan until a saved network is seen.
Fix this by initiating a normal scan every scan interval following no match
when handling scan results.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agoDistinguish between sched scan results and normal scan results (UPSTREAM)
Eyal Shapira [Sun, 16 Dec 2012 09:08:58 +0000 (11:08 +0200)]
Distinguish between sched scan results and normal scan results (UPSTREAM)

In case concurrent normal scan and sched scan is supported we'd like
to avoid restarting sched scan upon receiving normal scan results.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agoWPS: Select only correct AP following provisioning (UPSTREAM)
Eyal Shapira [Thu, 13 Dec 2012 13:01:32 +0000 (15:01 +0200)]
WPS: Select only correct AP following provisioning (UPSTREAM)

If there are other saved enabled networks a scan following
a successful WPS provisioing may connect to one of those
instead of the AP with which the provisioning was just done.
Avoid that by allowing only selection of a scan result with
a matching bssid to the WPS AP. This will be limited to a number
of scans following WPS provisioing using the same counter
wpa_s->after_wps used to optimize scan frequency post provisioning.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowpa_s: restart sched scan on channel list change
Victor Goldenshtein [Mon, 12 Nov 2012 15:32:11 +0000 (17:32 +0200)]
wpa_s: restart sched scan on channel list change

The channel list can be changed as a result of arriving
beacon hints during normal scan or as a result of local
Reg-Domain change, some passive channels can become
active and shall be reconfigured accordingly for the
scheduled scan.

This fixes the connection to hidden SSIDs on 5Ghz band
during default Reg-Domain 00 (world roaming).

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agoAdd API and CLI command to control sched scan intervals (UPSTREAM)
Eyal Shapira [Sun, 12 Feb 2012 23:59:31 +0000 (01:59 +0200)]
Add API and CLI command to control sched scan intervals (UPSTREAM)

Enable control over the sched scan intervals parameters
through a new wpa_s API (SCHED_SCAN_INTERVALS) and a
matching wpa_cli command.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agosched scan: Add config parameters for short and long intervals (UPSTREAM)
Eyal Shapira [Mon, 16 Jan 2012 23:13:35 +0000 (01:13 +0200)]
sched scan: Add config parameters for short and long intervals (UPSTREAM)

Part of support for short and long intervals

11 years agosched scan: add support for short and long intervals (UPSTREAM)
Eyal Shapira [Wed, 18 Jan 2012 14:19:24 +0000 (16:19 +0200)]
sched scan: add support for short and long intervals (UPSTREAM)

Configure sched scan to use short and long intervals
if the driver supports it

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agosched scan: read driver support for sched scan intervals (UPSTREAM)
Eyal Shapira [Tue, 17 Jan 2012 00:16:06 +0000 (02:16 +0200)]
sched scan: read driver support for sched scan intervals (UPSTREAM)

Use the feature flag reported by NL80211 to know
if the driver supports short and long intervals in
the sched scan API. This is a prep patch for the
actual handling of this flag.

11 years agoDon't scan ssids that were sched scanned (UPSTREAM)
Eliad Peller [Sun, 13 May 2012 12:37:03 +0000 (15:37 +0300)]
Don't scan ssids that were sched scanned (UPSTREAM)

When having more than max_sched_scan_ssids ssids, scanning
of the remaining ssids (not included in the sched scan)
might take a while.

Reduce this time by avoiding scanning of ssids that
were already included in the scheduled scan.

Signed-off-by: Eliad Peller <eliad@wizery.com>
11 years agoChange sched_scan logic for large number of configured networks (UPSTREAM)
Eyal Shapira [Mon, 26 Dec 2011 13:21:12 +0000 (15:21 +0200)]
Change sched_scan logic for large number of configured networks (UPSTREAM)

One of the major motivations behind sched scan is offloading
periodic scanning to the device firmware so that the host can
suspend and only be woken up when a known network is close by.
When there are more than max_match_sets or max_sched_scan_ssids
networks in the configuration the current logic will attempt to sched
scan a maximal group up to a certain timeout and then switch to
the next group. The timeout also changes with a backoff.

There are a couple of problems with this approach:
1. The host can suspend while we are sched scanning an arbitrary
sub group of networks from all the configured networks. The
device will keep searching only for these networks while suspended
and other configured networks won't be scanned for.

2. The current backoff mechanism won't handle well large
number of networks

Instead of this we switch to a simpler logic whose principles are:
1. We sched scan only a single group of networks which are determined
according to those networks with the highest priority. This way
when the host suspends we'll be scanning the highest priority networks.

2. If there are more networks than sched scan can handle it will
fallback to normal scan so we can still scan for the lower priority
networks.

3. As there's no need to switch groups there's no need for
timeout and backoff.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agoCancel sched scan upon assoc event (UPSTREAM)
Eyal Shapira [Wed, 12 Dec 2012 01:45:55 +0000 (03:45 +0200)]
Cancel sched scan upon assoc event (UPSTREAM)

Looks like since scan is canceled so should any sched scan.
This should probably not occur as both are canceled upon
attempting to connect.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agoRestart sched scan following remove network (UPSTREAM)
Eyal Shapira [Wed, 12 Dec 2012 01:31:36 +0000 (03:31 +0200)]
Restart sched scan following remove network (UPSTREAM)

As the enabled networks list changes sched scan should
be restarted with the new networks list to avoid keep scanning
for removed networks.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowpa_supplicant: use a different function to enable a network
David Spinadel [Mon, 29 Oct 2012 09:13:41 +0000 (11:13 +0200)]
wpa_supplicant: use a different function to enable a network

Use a function to enable a network, and then start scan if needed.
Stop scheduled scan, if exists, before starting a regular scan.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
11 years agowpa_supplicant: add function that enables one network
David Spinadel [Mon, 29 Oct 2012 09:13:40 +0000 (11:13 +0200)]
wpa_supplicant: add function that enables one network

This function enables one network, clears temp_disabled, notifies
About changing status and toggles reassociate if we are disconnected.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
11 years agoFix use-after-free when removing all networks (UPSTREAM)
Eyal Shapira [Thu, 2 Aug 2012 08:30:24 +0000 (11:30 +0300)]
Fix use-after-free when removing all networks (UPSTREAM)

commit 59ff6653
"Fix REMOVE_NETWORK to not run operations with invalid current_ssid"
fixed the removal of a single network but the same use-after-free
issue exists when removing all networks.

As part of the fix refactor ctrl_iface_remove_network to use
wpa_supplicant_remove_network which actually does the work.
This should help with fixing the use-after-free issue also when
remove network is done via dbus.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agoAllow a new sched scan to replace an existing one (UPSTREAM)
Eyal Shapira [Mon, 26 Dec 2011 12:42:49 +0000 (14:42 +0200)]
Allow a new sched scan to replace an existing one (UPSTREAM)

Sched scan needs to be restarted in cases where the enabled
networks list changes. Make wpa_supplicant_req_sched_scan
cancel the previous scan in case there's an ongoing one and
start a new one with the updated networks list.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agoAvoid changing state to WPA_SCANNING for sched scan (UPSTREAM)
Eyal Shapira [Mon, 26 Dec 2011 13:34:29 +0000 (15:34 +0200)]
Avoid changing state to WPA_SCANNING for sched scan (UPSTREAM)

This prevents manual scan requests from the control iface
in case of sched scan and normal scan can run concurrently.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agoDo not sched scan if no enabled networks (UPSTREAM)
Eyal Shapira [Mon, 26 Dec 2011 13:01:32 +0000 (15:01 +0200)]
Do not sched scan if no enabled networks (UPSTREAM)

There is no point to sched scan when there are no enabled networks.
With some drivers initiating such an empty sched scan causes
returning of scan results with zero results. If this is repeated
it leads to clearing of wpa_s scan results.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowpa_s: don't accumulate delayed sched scan requests (UPSTREAM)
Victor Goldenshtein [Tue, 13 Nov 2012 08:06:24 +0000 (10:06 +0200)]
wpa_s: don't accumulate delayed sched scan requests (UPSTREAM)

Clear any previous pending timeouts before scheduling
a new delayed sched scan.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agonl80211: add support for DRIVER COUNTRY command
Vishal Mahaveer [Fri, 9 Nov 2012 15:41:40 +0000 (09:41 -0600)]
nl80211: add support for DRIVER COUNTRY command

Add this for supporting country command coming as DRIVER command in Android.

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
11 years agohostapd: enable dynamic modification of acl policy
Nadim Zubidat [Mon, 5 Nov 2012 03:18:26 +0000 (11:18 +0800)]
hostapd: enable dynamic modification of acl policy

add APIs for dynamically changing the macaddr_acl
policy and mac addresses lists.
once changed, hostapd will deauth stations which
do not pass the new policy.

Signed-off-by: Nadim Zubidat <nadimz@ti.com>
11 years agoP2P: Fix broken rx action frame handling (INTERNAL-SQUASH)
Eyal Shapira [Mon, 5 Nov 2012 02:35:14 +0000 (04:35 +0200)]
P2P: Fix broken rx action frame handling (INTERNAL-SQUASH)

The root cause of the duplication lies within the Rx path in mac80211
in Johannes` patch "mac80211: accept public action frames with mismatched BSSID".
When wpa_s works with a separate group interface this creates a duplicated Rx
on both the P2P dev interface and the GO interface.

Fix the issue by canceling the duplication in wpa_s and discarding
public action frames with unmatching bssid arriving on a dedicated GO interface

[Arik - for upstream we can't do this since it can break non-mac80211
drivers. Maybe set a flag in wiphy capabilities for when the kernel driver
does this?]

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agoP2P: cancel action frame offchan wait after recv go neg resp (UPSTREAM)
Eyal Shapira [Thu, 1 Nov 2012 22:14:23 +0000 (00:14 +0200)]
P2P: cancel action frame offchan wait after recv go neg resp (UPSTREAM)

A wait of 200ms is configured after sending the go neg request.
The go neg process can end quickly within less than 200ms. If this wait
isn't canceled it can cause the beaconing of the GO to start while
mac80211 is still off channel on the listen channel and this may cause
beaconing on the wrong channel if oper channel is different from
the listen channel.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agoDon't disable and select new network if SETBAND didn't change (ANDROID)
Eyal Shapira [Wed, 24 Oct 2012 15:47:30 +0000 (17:47 +0200)]
Don't disable and select new network if SETBAND didn't change (ANDROID)

Current SETBAND would trigger network selection and as part of this
a scan attempt. This is not required in case SETBAND didn't change the
existing setting.

In Android which sends SETBAND immediately after WiFi startup this
would trigger needless scan attempts which would usually fail with -EBUSY
as another framework triggers scan was already going on.
The retry mechanism would then attempt further scans every 1 sec.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agoandroid: wpa_s template: enable concurrent_sched_scan (ANDROID)
Eyal Shapira [Sun, 28 Oct 2012 18:37:39 +0000 (20:37 +0200)]
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>
11 years agoAllow concurrent normal scan and sched scan (UPSTREAM)
Eyal Shapira [Sun, 28 Oct 2012 17:45:12 +0000 (19:45 +0200)]
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>
11 years agoAvoid normal scans before sched scan if max_scan_ssids=1 (UPSTREAM)
Eyal Shapira [Sun, 28 Oct 2012 16:18:06 +0000 (18:18 +0200)]
Avoid normal scans before sched scan if max_scan_ssids=1 (UPSTREAM)

In the case of max_scan_ssids=1 we may fallback to normal scan
if there's a single scan_ssid network. However the normal scan
can't add a wildcard SSID to the ssid list as it's limited to a single
entry. This delays getting broadcast scan results.
Always prefer to do a sched scan in such a case.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agoDisable p2p on wlan0 (JB)
Eyal Shapira [Mon, 29 Oct 2012 05:08:23 +0000 (07:08 +0200)]
Disable p2p on wlan0 (JB)

This prevents P2P IEs from being added to probes of scans on the
STA interface. These are not needed and prolong required channel
dwell time and Tx of probes.

This is somewhat of a hack but was a preferred approach on adding
framework changes to add p2p_disabled=1 to p2p_supplicant.conf and
not to wpa_supplicant.conf when both are created from the same template.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agoP2P: speed up scans when connecting to persistent GO (UPSTREAM)
Eyal Shapira [Thu, 25 Oct 2012 13:24:10 +0000 (15:24 +0200)]
P2P: speed up scans when connecting to persistent GO (UPSTREAM)

In the case of a persistent GO invoking a P2P group by invite
the P2P client starts scanning for the GO but it might still
not be up. If not found the next scan is scheduled for scan_interval
secs but this too long.
Speed up scans to find GO like it's being done in P2P provisioing.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowpa_s: fix bss selection on identical SSIDs with WEP+AES/TKIP
Victor Goldenshtein [Mon, 29 Oct 2012 08:38:05 +0000 (10:38 +0200)]
wpa_s: fix bss selection on identical SSIDs with WEP+AES/TKIP

Configuring two identical SSIDs - one with WEP-SHARED
security and one with AES/TKIP breaks any authentication
attempt with WEP-SHARED SSID.

Reason for this behavior is that during BSS selection
from the priority group wrong BSS (with AES/TKIP) was
selected. Fix this by disallowing "non-WPA/WPA2" BSS
selection with defined rsn_ie/wpa_ie.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agoP2P: cancel action frame offchan wait after recv go neg conf
Eyal Shapira [Wed, 24 Oct 2012 02:58:02 +0000 (04:58 +0200)]
P2P: cancel action frame offchan wait after recv go neg conf

The missing call to scan_action_done keeps us offchan
on the listen channel for 250ms following sending go neg resp.
In case the oper channel is different from the listen channel
and we're GO a race could lead to start beaconing while offchan.
This causes the beacons to go out on the listen channel instead
of the oper channel.

Signed-off-by: Eyal Shapira <eyal@wizery.com>