3 years agowpa2_fix: merge fixes from latest supplicant master ol_R5.SP9.01
Guy Mishol [Wed, 13 Dec 2017 09:11:13 +0000 (11:11 +0200)]
wpa2_fix: merge fixes from latest supplicant

Fixes to the WPA2 KRACK

based of mainline hostap changes https://w1.fi/security/2017-1/

Signed-off-by: Guy Mishol <guym@ti.com>
8 years agoP2P: wait on GO negotiation confirm android_jb ol_R5.SP8.01 old_master R5.xx_Build-222 R5.xx_Build-223 R5.xx_Build-224 R5.xx_Build-225 R5.xx_Build-226 R5.xx_Build-227 R5.xx_Build-228 R5.xx_Build-229 R5.xx_Build-230 R5.xx_Build-231 R5.xx_Build-232 R5.xx_Build-234 R5.xx_Build-235 R5.xx_Build-236 R5.xx_Build-237 R5.xx_Build-241 R5.xx_Build-242 R5.xx_Build-243 R5.xx_Build-244 R5.xx_Build-245 R5.xx_Build-246 R5.xx_Build-247 R5.xx_Build-248 R5.xx_Build-250 R5.xx_Build-251 R5.xx_Build-252 R5.xx_Build-253 R5.xx_Build-254 R5.xx_Build-255 R5.xx_Build-256 R5.xx_Build-259 R5.xx_Build-260 R5.xx_Build-261 R5.xx_Build-263 R5.xx_Build-264 R5.xx_Build-265 R5.xx_Build-266 R5.xx_Build-267 R5.xx_Build-268 R5.xx_Build-269 R5.xx_Build-270 R5.xx_Build-271 R5.xx_Build-272 R5.xx_Build-273 R5.xx_Build-274 R5.xx_Build-275 R5.xx_Build-276 R5.xx_Build-277 R5.xx_Build-278 R5.xx_Build-279 R5.xx_Build-280 R5.xx_Build-281 R5.xx_Build-282 R5.xx_Build-283 R5.xx_Build-284 R5.xx_Build-285 R5.xx_Build-286 R5.xx_Build-287 R5.xx_Build-288 R8.xx_Build-236 R8.xx_Build-237 R8.xx_Build-238 R8.xx_Build-240 R8.xx_Build-241 R8.xx_Build-242 R8.xx_Build-243 R8.xx_Build-244 R8.xx_Build-245 R8.xx_Build-246 R8.xx_Build-247 R8.xx_Build-248 R8.xx_Build-249 R8.xx_Build-250 R8.xx_Build-251 R8.xx_Build-252 R8.xx_Build-253 R8.xx_Build-254 R8.xx_Build-258 R8.xx_Build-259 R8.xx_Build-260 R8.xx_Build-261 R8.xx_Build-262 R8.xx_Build-263 R8.xx_Build-264 R8.xx_Build-265 R8.xx_Build-266 R8.xx_Build-267 R8.xx_Build-268 R8.xx_Build-269 R8.xx_Build-270 R8.xx_Build-271 R8.xx_Build-272 R8.xx_Build-273 R8.xx_Build-274 R8.xx_Build-275 R8.xx_Build-279 R8.xx_Build-280 R8.xx_Build-281 R8.xx_Build-282 R8.xx_Build-283 R8.xx_Build-284 R8.xx_Build-285 R8.xx_Build-286 R8.xx_Build-287 R8.xx_Build-288 R8.xx_Build-289 R8.xx_Build-290 R8.xx_Build-291 R8.xx_Build-292 R8.xx_Build-293 R8.xx_Build-294 R8.xx_Build-295 R8.xx_Build-296 R8.xx_Build-297 R8.xx_Build-302 R8.xx_Build-304 R8.xx_Build-305 R8.xx_Build-306 R8.xx_Build-307 R8.xx_Build-308 R8.xx_Build-309 R8.xx_Build-310 R8.xx_Build-311 R8.xx_Build-312 R8.xx_Build-313 ol_R5.SP4.01 ol_R5.SP5.01 ol_R5.SP6.01 ol_R5.SP7.01 ol_R5.SP8.01 ol_r8.a5.14 ol_r8.a5.15 ol_r8.a6.01 ol_r8.a6.02
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>
8 years agoP2P: accept provision discovery with bcast group ID R5.xx_Build-209 R5.xx_Build-210 R5.xx_Build-211 R5.xx_Build-212 R5.xx_Build-213 R5.xx_Build-214 R5.xx_Build-215 R5.xx_Build-216 R5.xx_Build-217 R5.xx_Build-218 R5.xx_Build-219 R5.xx_Build-220 R5.xx_Build-221 R8.xx_Build-223 R8.xx_Build-224 R8.xx_Build-225 R8.xx_Build-226 R8.xx_Build-227 R8.xx_Build-228 R8.xx_Build-229 R8.xx_Build-230 R8.xx_Build-231 R8.xx_Build-232 R8.xx_Build-233 R8.xx_Build-234 R8.xx_Build-235
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, we currently
must accept these requests, as these devices are part of
the certification testbeds.

Signed-off-by: Eliad Peller <eliad@wizery.com>
8 years agowpa_s: new override_p2p_go_intent conf parameter (INTERNAL) R5.xx_Build-205 R5.xx_Build-206 R5.xx_Build-207 R8.xx_Build-219 R8.xx_Build-220 R8.xx_Build-221 R8.xx_Build-222
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

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
8 years agohostapd: add support for ACS whitelist and blacklist (INTERNAL) R5.xx_Build-195 R5.xx_Build-196 R5.xx_Build-197 R5.xx_Build-198 R5.xx_Build-199 R5.xx_Build-200 R5.xx_Build-201 R5.xx_Build-202 R5.xx_Build-203 R5.xx_Build-204 R8.xx_Build-205 R8.xx_Build-206 R8.xx_Build-207 R8.xx_Build-208 R8.xx_Build-209 R8.xx_Build-210 R8.xx_Build-211 R8.xx_Build-212 R8.xx_Build-213 R8.xx_Build-214 R8.xx_Build-215 R8.xx_Build-216 R8.xx_Build-217 R8.xx_Build-218 ol_r8.a5.10 ol_r8.a5.11
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>


8 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
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>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
8 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

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
8 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>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
8 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>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
8 years agowpa_s/hostapd: add description to version string R5.xx_Build-191 R5.xx_Build-192 R5.xx_Build-193 R5.xx_Build-194 R8.xx_Build-201 R8.xx_Build-202 R8.xx_Build-203 R8.xx_Build-204
Ido Reis [Thu, 3 Jan 2013 09:27:51 +0000 (11:27 +0200)]
wpa_s/hostapd: add description to version string

Signed-off-by: Ido Reis <idor@ti.com>
8 years agoWPS: Select only correct AP following provisioning (UPSTREAM) R5.xx_Build-170 R5.xx_Build-171 R5.xx_Build-172 R5.xx_Build-173 R5.xx_Build-174 R5.xx_Build-175 R5.xx_Build-182 R5.xx_Build-187 R5.xx_Build-188 R5.xx_Build-189 R5.xx_Build-190 R8.xx_Build-176 R8.xx_Build-177 R8.xx_Build-178 R8.xx_Build-179 R8.xx_Build-180 R8.xx_Build-181 R8.xx_Build-183 R8.xx_Build-185 R8.xx_Build-188 R8.xx_Build-190 R8.xx_Build-191 R8.xx_Build-196 R8.xx_Build-197 R8.xx_Build-198 R8.xx_Build-199 R8.xx_Build-200 ol_r8.a5.09
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>
8 years agoP2P: Fix broken rx action frame handling (INTERNAL-SQUASH) R5.xx_Build-143 R5.xx_Build-144 R5.xx_Build-145 R5.xx_Build-146 R5.xx_Build-147 R5.xx_Build-148 R5.xx_Build-149 R5.xx_Build-150 R5.xx_Build-151 R5.xx_Build-152 R5.xx_Build-153 R5.xx_Build-154 R5.xx_Build-155 R5.xx_Build-156 R5.xx_Build-157 R5.xx_Build-158 R5.xx_Build-159 R5.xx_Build-160 R5.xx_Build-161 R5.xx_Build-162 R5.xx_Build-163 R5.xx_Build-164 R5.xx_Build-165 R5.xx_Build-166 R5.xx_Build-167 R5.xx_Build-168 R5.xx_Build-169 R8.xx_Build-142 R8.xx_Build-143 R8.xx_Build-144 R8.xx_Build-145 R8.xx_Build-146 R8.xx_Build-147 R8.xx_Build-148 R8.xx_Build-149 R8.xx_Build-151 R8.xx_Build-152 R8.xx_Build-153 R8.xx_Build-154 R8.xx_Build-155 R8.xx_Build-156 R8.xx_Build-157 R8.xx_Build-158 R8.xx_Build-159 R8.xx_Build-160 R8.xx_Build-161 R8.xx_Build-162 R8.xx_Build-163 R8.xx_Build-164 R8.xx_Build-165 R8.xx_Build-166 R8.xx_Build-167 R8.xx_Build-168 R8.xx_Build-169 R8.xx_Build-170 R8.xx_Build-171 R8.xx_Build-172 R8.xx_Build-173 R8.xx_Build-174 R8.xx_Build-175 ol_r8.a5.05 ol_r8.a5.06 ol_r8.a5.07 ol_r8.a5.08
Eyal Shapira [Tue, 13 Nov 2012 01:00:21 +0000 (03:00 +0200)]
P2P: Fix broken rx action frame handling (INTERNAL-SQUASH)

Commit "P2P: Fix duplicate handling of rx action frames"
went too far and dropped any rx action frames arriving on the GO
interface. It assumed that any action frames were duplicated
and received on both GO interface and P2P device interface.
This is wrong as some actions frames like P2P presence request
are sent to the GO interface address and won't be duplicated.

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

(This should be squashed with
"P2P: Fix duplicate handling of rx action frames")

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 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>
8 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>
8 years agoAvoid sched scan flood in case of mismatched security (UPSTREAM) R5.xx_Build-142 R8.xx_Build-141
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>
8 years agonl80211: add support for DRIVER COUNTRY command R5.xx_Build-141 R8.xx_Build-140
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>
8 years agohostapd: enable dynamic modification of acl policy R5.xx_Build-134 R5.xx_Build-135 R5.xx_Build-136 R5.xx_Build-137 R5.xx_Build-138 R5.xx_Build-139 R8.xx_Build-132 R8.xx_Build-133 R8.xx_Build-134 R8.xx_Build-135 R8.xx_Build-137 R8.xx_Build-138 R8.xx_Build-139 ol_R5.SP3.05 ol_R5.SP3.06 ol_r8.a5.04
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>
8 years agoP2P: Fix duplicate handling of rx action frames (UPSTREAM) R5.xx_Build-133 R8.xx_Build-130 R8.xx_Build-131
Eyal Shapira [Mon, 5 Nov 2012 02:35:14 +0000 (04:35 +0200)]
P2P: Fix duplicate handling of rx action frames (UPSTREAM)

When using a separate group iface both p2p device iface
and the group iface are registered for action frames.
This causes duplicate handling of rx action frames.
One side effect of this is getting multiple responses for
requests sent over action frames while GO/CLI are up
like prov disc and dev disc.
Fix this by discarding the duplicate p2p action frames received
on the group iface. The code will handle all of these correctly
when coming on the p2p dev iface as it looks at the DA when
where relevant.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agoandroid: wpa_s template: set p2p_go_max_inactivity to 60s (ANDROID) R5.xx_Build-129 R5.xx_Build-130 R5.xx_Build-131 R5.xx_Build-132 R8.xx_Build-126 R8.xx_Build-127 R8.xx_Build-128 R8.xx_Build-129 ol_R5.SP3.04
Eyal Shapira [Fri, 2 Nov 2012 08:58:05 +0000 (10:58 +0200)]
android: wpa_s template: set p2p_go_max_inactivity to 60s (ANDROID)

The previous value of 30s was problematic in passing WiFi Direct
certification test 6.1.12. In this test the GO is checked for
buffering packets while the client is in PS and doesn't send a trigger
to get out of PS for 50s. Any value less than 50s would lead to a
failed inactivity check and the GO disconnecting the client in this test.

It's important to minimize p2p_go_max_inactivity as it helps the GO
detect clients which disconnected despite missing on the deauth frame.
This is not uncommon in JB as there are scans on the STA interface
which take us off the GO oper channel. Until the GO performs an
inactivity check the UI will keep showing the client as "Connected"
and the GO will remain operational which creates a bad user experience.

[This should supersede "P2P: set P2P_GO_MAX_INACTIVITY to 100s" in
the next rebase]

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 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>
8 years agoP2P: set P2P_GO_MAX_INACTIVITY to 100s R5.xx_Build-128 R8.xx_Build-125
Igal Chernobelsky [Thu, 1 Nov 2012 09:23:17 +0000 (11:23 +0200)]
P2P: set P2P_GO_MAX_INACTIVITY to 100s

WiFi Direct certification test 6.1.12 expects GO to be active
during 50 sec, so changing P2P_GO_MAX_INACTIVITY from 30 sec
to 100 sec to pass the test.

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
8 years agoDon't disable and select new network if SETBAND didn't change (ANDROID) R5.xx_Build-119 R5.xx_Build-120 R5.xx_Build-122 R5.xx_Build-123 R5.xx_Build-124 R5.xx_Build-125 R5.xx_Build-126 R5.xx_Build-127 R8.xx_Build-119 R8.xx_Build-120 R8.xx_Build-121 R8.xx_Build-122 R8.xx_Build-123 R8.xx_Build-124 ol_R5.SP3.03 ol_r8.a5.02 ol_r8.a5.03
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>
8 years agoTrigger sched scan on wpa_s init if enabled networks (INTERNAL)
Eyal Shapira [Wed, 24 Oct 2012 15:44:18 +0000 (17:44 +0200)]
Trigger sched scan on wpa_s init if enabled networks (INTERNAL)

The switch to triggering a normal scan initially was done
to prevent interference between sched scan and normal scan.
This is no longer an issue. Triggering a sched scan is better
as it works better in our case than the normal scan
wrt hidden networks.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 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>
8 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>
8 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>
8 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>
8 years agoP2P: Allow P2P functionality to be disabled per interface
Jouni Malinen [Wed, 10 Oct 2012 10:08:23 +0000 (13:08 +0300)]
P2P: Allow P2P functionality to be disabled per interface

By default, P2P is enabled globally for all virtual interfaces and this
makes wpa_supplicant include WSC and P2P IEs in Probe Request frames for
all scans even if this is for a non-P2P station connection to speed up
device discovery. If an interface is dedicated for non-P2P station mode
operations, it is now possible to disable addition of WSC and P2P IEs
into Probe Request frames with a per-interface p2p_disabled parameter.
This can be set either in the configuration file (p2p_disabled=1) or at
run time ("wpa_cli -i wlan0 set p2p_disabled 1"). Unlike the previous
mechanism ("wpa_cli p2p_set disabled 1"), the new parameter changes the
behavior only for the specified interface while other interfaces
continue to follow the global P2P enabled/disabled state.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agoRevert "Add P2P IEs to probe requests only when in P2P (UPSTREAM)"
Eyal Shapira [Sun, 28 Oct 2012 18:29:14 +0000 (20:29 +0200)]
Revert "Add P2P IEs to probe requests only when in P2P (UPSTREAM)"

This is replaced by a recent patch by Jouni in the upstream:
"P2P: Allow P2P functionality to be disabled per interface"

This reverts commit a56f6df6f8e5dcd650893e8beb4a16a633c179d1.



8 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>
8 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>
8 years agoP2P: cancel action frame offchan wait after recv go neg conf R5.xx_Build-110 R5.xx_Build-113 R5.xx_Build-114 R5.xx_Build-115 R5.xx_Build-116 R8.xx_Build-111 R8.xx_Build-112 R8.xx_Build-114 R8.xx_Build-115 R8.xx_Build-116 R8.xx_Build-117 R8.xx_Build-118 ol_r8.a5.01
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>
8 years agoP2P: Don't delete group on non P2P interfaces (UPSTREAM) R5.xx_Build-100 R5.xx_Build-101 R5.xx_Build-108 R5.xx_Build-109 R5.xx_Build-83 R5.xx_Build-84 R5.xx_Build-85 R5.xx_Build-86 R5.xx_Build-87 R5.xx_Build-88 R5.xx_Build-89 R5.xx_Build-90 R5.xx_Build-91 R5.xx_Build-92 R5.xx_Build-94 R5.xx_Build-96 R5.xx_Build-97 R5.xx_Build-98 R5.xx_Build-99 R8.xx_Build-100 R8.xx_Build-101 R8.xx_Build-109 R8.xx_Build-110 R8.xx_Build-80 R8.xx_Build-81 R8.xx_Build-82 R8.xx_Build-83 R8.xx_Build-84 R8.xx_Build-85 R8.xx_Build-86 R8.xx_Build-87 R8.xx_Build-89 R8.xx_Build-90 R8.xx_Build-91 R8.xx_Build-92 R8.xx_Build-93 R8.xx_Build-94 R8.xx_Build-95 R8.xx_Build-96 R8.xx_Build-97 R8.xx_Build-98 R8.xx_Build-99 ol_R5.SP3.02 ol_r8.a4.04 ol_r8.a4.05
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>
8 years agoandroid: wpa_s template: disassoc on low ack by default (ANDROID) R5.xx_Build-76 R5.xx_Build-77 R5.xx_Build-78 R5.xx_Build-79 R5.xx_Build-81 R5.xx_Build-82 R8.xx_Build-70 R8.xx_Build-71 R8.xx_Build-72 R8.xx_Build-73 R8.xx_Build-74 R8.xx_Build-76 R8.xx_Build-78 R8.xx_Build-79
Arik Nemtsov [Wed, 3 Oct 2012 09:39:34 +0000 (11:39 +0200)]
android: wpa_s template: disassoc on low ack by default (ANDROID)

When operating as a GO, disassoc the peer station on aging/Tx failure

Signed-off-by: Arik Nemtsov <arik@wizery.com>
8 years agoP2P: block find if P2P GO or CLI are active (INTERNAL) R5.xx_Build-70 R5.xx_Build-71 R5.xx_Build-72 R8.xx_Build-67 R8.xx_Build-68 R8.xx_Build-69
Eyal Shapira [Tue, 25 Sep 2012 08:54:09 +0000 (10:54 +0200)]
P2P: block find if P2P GO or CLI are active (INTERNAL)

The roc on a channel for 100+ ms which is part of the find
disturbs the P2P GO/CLI as these scenarios are unsupported
in non multi channel driver.
Therefore block the find in this case.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agoRevisit "nl80211: dummy DRIVER SETBAND handler" R5.xx_Build-67 R8.xx_Build-65
Vishal Mahaveer [Thu, 27 Sep 2012 19:11:18 +0000 (14:11 -0500)]
Revisit "nl80211: dummy DRIVER SETBAND handler"

Used the wrong string compare API before.
Fix it by using the correst API.

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
8 years agowpa_s: handle channel conflicts on GO+STA shared interface R5.xx_Build-65 R5.xx_Build-66 R8.xx_Build-64 ol_r8.a4.03
Victor Goldenshtein [Thu, 27 Sep 2012 09:54:11 +0000 (11:54 +0200)]
wpa_s: handle channel conflicts on GO+STA shared interface

Stop blocking GO role if its operational channel
differs from the STA channel, as now the driver
can handle channel conflicts by sending channel
switch request to the userspace.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
8 years agonl80211: dummy DRIVER SETBAND handler R5.xx_Build-62 R5.xx_Build-63 R5.xx_Build-64 R8.xx_Build-58 R8.xx_Build-59 R8.xx_Build-60 R8.xx_Build-61 R8.xx_Build-62 R8.xx_Build-63
Vishal Mahaveer [Mon, 24 Sep 2012 20:07:11 +0000 (15:07 -0500)]
nl80211: dummy DRIVER SETBAND handler

SETBAND command is handled in wpa_supplicant_driver_cmd API.
Add a dummy handler in driver_nl80211 for avoiding misleading log,
"Unsupported command: SETBAND ".

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
8 years agoP2P: correct p2p_mult_chan operation (SQUASH)
Arik Nemtsov [Tue, 25 Sep 2012 08:36:36 +0000 (10:36 +0200)]
P2P: correct p2p_mult_chan operation (SQUASH)

Should be squashed with:

commit 61d59eaa7ebf59c926d40b00228e227b3d27f8c9
Author: Arik Nemtsov <arik@wizery.com>
Date:   Mon Sep 24 17:39:23 2012 +0200

    P2P: add conf param to prefer p2p multi channel

Reported-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
8 years agoandroid: wpa_s template: allow p2p multi channel operation (ANDROID) R5.xx_Build-61 R8.xx_Build-55 R8.xx_Build-56 R8.xx_Build-57
Arik Nemtsov [Mon, 24 Sep 2012 15:56:18 +0000 (17:56 +0200)]
android: wpa_s template: allow p2p multi channel operation (ANDROID)

Set the p2p_multi_chan parameter to 1 by default. It will have no effect
if the current driver doesn't support multi-channel. Otherwise it will
allow the P2P channel to be set while disregarding other connected
interfaces on the phy.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
8 years agoP2P: add conf param to prefer p2p multi channel
Arik Nemtsov [Mon, 24 Sep 2012 15:39:23 +0000 (17:39 +0200)]
P2P: add conf param to prefer p2p multi channel

When p2p_multi_chan=1 is set in the wpa_supplicant.conf file, don't set
the P2P operating channel according to any existing shared frequency.

Normally we would force the operating channel to be the same as that of
other interfaces operating on the same phy. This param allow us to optimize
P2P user experience by allowing an arbitrary operating channel.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
8 years agoP2P: fix oper channel selection (SQUASH)
Arik Nemtsov [Mon, 24 Sep 2012 14:13:33 +0000 (16:13 +0200)]
P2P: fix oper channel selection (SQUASH)

Handles the forgotten p2p_process_go_neg_resp() case of patch:

commit 66b8140a08b9f6297cd49a3428ada713bf668300
Author: Arik Nemtsov <arik@wizery.com>
Date:   Thu Aug 30 21:06:45 2012 +0300

    P2P: always re-select oper channel if not hard coded

Signed-off-by: Arik Nemtsov <arik@wizery.com>
8 years agoP2P: don't handle concurrency conflicts in multi-chan mode (ANDROID)
Arik Nemtsov [Mon, 24 Sep 2012 10:51:20 +0000 (12:51 +0200)]
P2P: don't handle concurrency conflicts in multi-chan mode (ANDROID)

When the multi-channel flag is on, don't try to force specific
p2p connection modes or change go_intent.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
8 years agonl80211_copy: update from latest 12xx drv (INTERNAL) R5.xx_Build-39 R5.xx_Build-40 R5.xx_Build-41 R5.xx_Build-46 R5.xx_Build-47 R5.xx_Build-48 R5.xx_Build-49 R5.xx_Build-50 R5.xx_Build-51 R5.xx_Build-52 R5.xx_Build-53 R5.xx_Build-56 R5.xx_Build-59 R5.xx_Build-60 R8.xx_Build-38 R8.xx_Build-39 R8.xx_Build-40 R8.xx_Build-41 R8.xx_Build-42 R8.xx_Build-43 R8.xx_Build-44 R8.xx_Build-45 R8.xx_Build-46 R8.xx_Build-48 R8.xx_Build-49 R8.xx_Build-50 R8.xx_Build-51 R8.xx_Build-52 R8.xx_Build-53 ol_R5.SP3.01
Arik Nemtsov [Thu, 13 Sep 2012 11:18:25 +0000 (14:18 +0300)]
nl80211_copy: update from latest 12xx drv (INTERNAL)

add channel switch related commands and attributes

Signed-off-by: Arik Nemtsov <arik@wizery.com>
8 years agonl80211: add channel switch ability to AP & GO (INTERNAL)
Victor Goldenshtein [Mon, 21 Nov 2011 15:50:10 +0000 (17:50 +0200)]
nl80211: add channel switch ability to AP & GO (INTERNAL)

Implement AP channel switch command. Handle
channel switch request and channel switch
complete events.

Signed-hostap: Victor Goldenshtein <victorg@ti.com>

8 years agohostap: add channel switch ability to AP & GO (INTERNAL)
Victor Goldenshtein [Mon, 21 Nov 2011 13:19:52 +0000 (15:19 +0200)]
hostap: add channel switch ability to AP & GO (INTERNAL)

Add channel switch command and handle channel switch
request/complete events.

New hostapd_eid_csa() which builds the channel switch
announcement IE. Add this CSA to the beacon frame prior
performing a channel switch and remove it once it's

New EVENT_REQ_CH_SW which indicates that the driver
has requested to perform a channel switch.

Signed-hostap: Victor Goldenshtein <victorg@ti.com>

8 years agohostapd: implement channel switch request drv ops (INTERNAL)
Victor Goldenshtein [Mon, 21 Nov 2011 15:02:52 +0000 (17:02 +0200)]
hostapd: implement channel switch request drv ops (INTERNAL)

New hostapd_channel_switch – to handle channel switch request.

Signed-hostap: Victor Goldenshtein <victorg@ti.com>

8 years agonl80211: make unicast RX filter always match STA iface mac (ANDROID) R8.xx_Build-37
Eyal Shapira [Tue, 11 Sep 2012 23:04:17 +0000 (02:04 +0300)]
nl80211: make unicast RX filter always match STA iface mac (ANDROID)

This is part of changing the RX filters configuration to being
global and not dependent on the interface context.
RX filter #0 should point to a filter matching any unicast frame
sent to the STA (wlan0) mac. The configuration is done by
querying the mac address of the interface. As we now have
reconfiguration of filters done from the context of the p2p interface
filter #0 would get reconfigured with the P2P dev mac.
Avoid this by hard coded querying for the mac of wlan0 when
creating the pattern for RX filter #0.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agonl80211: reconfigure RX filters whenever a new interface is added (ANDROID)
Eyal Shapira [Tue, 11 Sep 2012 23:30:00 +0000 (02:30 +0300)]
nl80211: reconfigure RX filters whenever a new interface is added (ANDROID)

This is used to reconfigure RX filters to include a new filter whenever
the P2P group interface is added. The new filter matches any unicast
frame sent to a dest mac which matches the P2P group interface mac.
This is important as otherwise we wouldn't allow any data frames through
to this interface.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agonl80211: support configuring RX filters dynamically (ANDROID)
Eyal Shapira [Tue, 11 Sep 2012 23:20:26 +0000 (02:20 +0300)]
nl80211: support configuring RX filters dynamically (ANDROID)

The current RX filters are statically defined and can only
be enabled or disabled by the DRIVER RX-FILTER commands.
Add support to add or remove RX filters "on the fly" from
within wpa_s code so we can use this to add an RX filter matching
unicast packets going to the new P2P interface mac.
Whenever the filters change the whole list of filters needs
to be configured to the kernel.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agonl80211: make rx filters config global (ANDROID)
Eyal Shapira [Tue, 11 Sep 2012 22:43:39 +0000 (01:43 +0300)]
nl80211: make rx filters config global (ANDROID)

The RX filters (wowlan) configuration is per interface
but this doesn't reflect the state in the kernel where it's
per hw device (effectively in Android global).
In JB this is more important as wpa_s uses up to 3 different
interfaces when running P2P+STA. Also, fix a minor bug
in nl80211_toggle_wowlan_trigger where the wpa_s wowlan state
changed even if configuring the kernel failed.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agonl80211: Remove driver specific commands not used in JB (JB) R5.xx_Build-36 R5.xx_Build-37 R8.xx_Build-36
Eyal Shapira [Wed, 12 Sep 2012 15:25:16 +0000 (18:25 +0300)]
nl80211: Remove driver specific commands not used in JB (JB)

The following driver specific commands aren't used in JB
and were replaced by other APIs:

Remove code handling these commands.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agonl80211: Remove driver command DROPBCAST (ANDROID) R5.xx_Build-35 R8.xx_Build-35
Eyal Shapira [Wed, 12 Sep 2012 02:46:57 +0000 (05:46 +0300)]
nl80211: Remove driver command DROPBCAST (ANDROID)

There's no support for this in the driver for now
as the relevant patches were dropped. Therefore
remove relevant code in wpa_s as well.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agoMake copies basic_rates list more useful R5.xx_Build-25 R5.xx_Build-26 R5.xx_Build-27 R5.xx_Build-28 R5.xx_Build-32 R5.xx_Build-34 R8.xx_Build-23 R8.xx_Build-24 R8.xx_Build-25 R8.xx_Build-27 R8.xx_Build-28 R8.xx_Build-32 R8.xx_Build-34 ol_r8.a4.02
Jouni Malinen [Thu, 6 Sep 2012 21:15:53 +0000 (00:15 +0300)]
Make copies basic_rates list more useful

Commit e5693c4775bae65faa960f80889f98b0a6cb2e1c added a copy of the
determined basic rate set into struct hostapd_iface, but did not
actually copy the terminating -1 value. This could be problematic if
something were to actually try to use this list since would be no way to
know what is the last entry in the list. Fix this by copying the
terminating value.

Signed-hostap: Jouni Malinen <j@w1.fi>

8 years agoP2P: prefer operating channels where HT40 is possible R5.xx_Build-20 R5.xx_Build-22 R5.xx_Build-23 R5.xx_Build-24 R8.xx_Build-15 R8.xx_Build-16 R8.xx_Build-17 R8.xx_Build-18 R8.xx_Build-20 R8.xx_Build-21 R8.xx_Build-22
Arik Nemtsov [Thu, 30 Aug 2012 19:07:57 +0000 (22:07 +0300)]
P2P: prefer operating channels where HT40 is possible

When no other user preference is specified, opt to use an operating
channel that allows HT40 operation. This way, if driver capabilities
and regulatory constraints allow, we might enjoy increased bandwidth.

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

8 years agoP2P: always re-select oper channel if not hard coded
Arik Nemtsov [Thu, 30 Aug 2012 18:06:45 +0000 (21:06 +0300)]
P2P: always re-select oper channel if not hard coded

Since the operating channel is randomly set to 1/6/11 on init, which is
always in the channel intersection, we were effectively ignoring the set
of p2p preferred channels.
Fix this by trying to get the best channel we can, unless the user hard
coded the operating channel in the configuration file. Fall back to the
initial randomly selected channel if a better one cannot be chosen.

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

8 years agoandroid: wpa_s template: allow HT40 GO by default (ANDROID)
Arik Nemtsov [Thu, 30 Aug 2012 19:08:43 +0000 (22:08 +0300)]
android: wpa_s template: allow HT40 GO by default (ANDROID)

Signed-off-by: Arik Nemtsov <arik@wizery.com>
8 years agoP2P: add a conf parameter to start a GO as HT40 if allowed
Arik Nemtsov [Thu, 30 Aug 2012 18:14:26 +0000 (21:14 +0300)]
P2P: add a conf parameter to start a GO as HT40 if allowed

When specified in the conf file this parameter will make all
invocations of p2p_group_add and p2p_connect behave as if "ht40"
has been specified on the command line.
This shouldn't do harm since regulatory constraints and driver
capabilities are consulted anyway before starting HT40 mode.

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

8 years agoP2P: Use larger GO config timeout if HT40 is used R8.xx_Build-12 R8.xx_Build-13
Jouni Malinen [Wed, 15 Aug 2012 20:19:11 +0000 (23:19 +0300)]
P2P: Use larger GO config timeout if HT40 is used

Increase GO config timeout if HT40 is used since it takes some time
to scan channels for coex purposes before the BSS can be started.

Signed-hostap: Jouni Malinen <j@w1.fi>

8 years agoP2P: Add optional "ht40" argument for p2p_connect
Rajkumar Manoharan [Wed, 15 Aug 2012 20:07:44 +0000 (23:07 +0300)]
P2P: Add optional "ht40" argument for p2p_connect

This can be used to start negotiated GO in 40 MHz channel width
in 5GHz band.

Signed-hostap: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

8 years agoP2P: Enable 40 MHz support for autonomous P2P group addition
Rajkumar Manoharan [Wed, 15 Aug 2012 19:53:01 +0000 (22:53 +0300)]
P2P: Enable 40 MHz support for autonomous P2P group addition

Add optional "ht40" argument for p2p_group_add command to enable 40 MHz
in 5GHz band. This configures the secondary channel, when HT support is
enabled and if the HW supports 40 MHz channel width.

Signed-hostap: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

8 years agoP2P: Move channel validation into a separate function
Rajkumar Manoharan [Wed, 15 Aug 2012 19:44:34 +0000 (22:44 +0300)]
P2P: Move channel validation into a separate function

Signed-hostap: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

8 years agoSupply the connection scan results to bgscan after init
Yoni Divinsky [Fri, 17 Aug 2012 17:53:44 +0000 (20:53 +0300)]
Supply the connection scan results to bgscan after init

If bgscan is enabled, then bgscan is initiated after the connection,
with no bss scan result information. Since a scan was performed prior to
the connection, the information exists and can be used to initialize the
bgscan's cache.

Signed-hostap: Yoni Divinsky <yoni.divinsky@ti.com>

8 years agoRevert "Supply the connection scan results to bgscan after init"
Arik Nemtsov [Thu, 30 Aug 2012 13:10:22 +0000 (16:10 +0300)]
Revert "Supply the connection scan results to bgscan after init"

This reverts commit 1cd9da6b88d7dd9b3c887b62a584aba4bb08299f.

This old commit has a memory leak. Use a newer commit from upstream that
amends this.

8 years agoRemove default ACM=1 from AC_VO and AC_VI
Jouni Malinen [Sun, 12 Aug 2012 08:36:45 +0000 (11:36 +0300)]
Remove default ACM=1 from AC_VO and AC_VI

There is no need to mandate admission control (ACM=1) by default, so
clear that flag in the case the configuration file does not specify
wmm_ac_{vo,vi}_acm value. This gets closer to the values mentioned
in the sample hostapd.conf file and reduces the need to specify WMM
parameters in the configuration file for most common use cases.

Signed-hostap: Jouni Malinen <j@w1.fi>

8 years agoAP: configure basic rates from iface and not conf
Arik Nemtsov [Mon, 3 Sep 2012 07:50:17 +0000 (10:50 +0300)]
AP: configure basic rates from iface and not conf

The conf doesn't contain any basic rates in some cases. Most notably,
when starting a p2p GO in 5Ghz. Use the iface rates which are
initialized in hostapd_prepare_rates() to the conf rates or set to
default values if no conf values exist.

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

8 years agoctrl_iface: allow forcing go_intent during p2p_connect (ANDROID) R5.xx_Build-10 R5.xx_Build-11 R5.xx_Build-12 R5.xx_Build-13 R5.xx_Build-14 R5.xx_Build-15 R5.xx_Build-16 R5.xx_Build-17 R5.xx_Build-19 R5.xx_Build-57 R5.xx_Build-58 R5.xx_Build-6 R5.xx_Build-7 R5.xx_Build-8 R5.xx_Build-9 R8.xx_Build-10 R8.xx_Build-2 R8.xx_Build-3 R8.xx_Build-4 R8.xx_Build-5 R8.xx_Build-6 R8.xx_Build-7 R8.xx_Build-8 R8.xx_Build-9 ol_r8.a3.14 ol_r8.a4.01
Arik Nemtsov [Wed, 15 Aug 2012 06:10:19 +0000 (09:10 +0300)]
ctrl_iface: allow forcing go_intent during p2p_connect (ANDROID)

Allow the p2p_connect command to ignore android p2p concurrency
Use the command line argument "no_p2p_conc" to p2p_connect in order to
be able to set the go_intent.

For instance:
wpa_cli p2p_connect 00:11:22:33:44:55 pbc no_p2p_conc go_intent=3

Signed-off-by: Arik Nemtsov <arik@wizery.com>
8 years agoAdd P2P IEs to probe requests only when in P2P (UPSTREAM)
Eyal Shapira [Mon, 13 Aug 2012 11:49:56 +0000 (14:49 +0300)]
Add P2P IEs to probe requests only when in P2P (UPSTREAM)

The current code caused P2P and consquently WPS IEs to be added
to any probe as the check was for non null global->p2p.
global->p2p gets set whenever P2P is initialized globally
and that occurs on the first interface init.
Fix this by indicating wps is in use only when in active P2P
discovery or connection establishement.
(i.e. not P2P_IDLE - either doing search, neg or provisioning)

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agoWPS: fix nonce comparisons (UPSTREAM)
Eyal Shapira [Mon, 13 Aug 2012 01:24:40 +0000 (04:24 +0300)]
WPS: fix nonce comparisons (UPSTREAM)

Multiple memcmps of nonces were actually comparing
only the first byte instead of all 16 bytes.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agoFix adding extra ies in sched scan (UPSTREAM)
Eyal Shapira [Sun, 12 Aug 2012 15:41:18 +0000 (18:41 +0300)]
Fix adding extra ies in sched scan (UPSTREAM)

Refactoring done in
commit 46ee04 IEEE 802.11u: Allow Interworking and HESSID to be configured
broke adding extra ies in sched scan.
Fix it and remove unused params arg in wpa_supplicant_extra_ies.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agoP2P: Increase GO Negotiation timeouts
Jouni Malinen [Sat, 11 Aug 2012 18:14:57 +0000 (21:14 +0300)]
P2P: Increase GO Negotiation timeouts

p2p_set_timeout() calls in GO Neg Req/Resp TX callbacks used timeout of
100 ms which is the value given in the P2P specification for GO
Negotiation, but this was actually shorter than the
wait-for-offchannel-TX value (200 ms) used for the driver call. In
addition, it looks like some devices (e.g., Galaxy Nexus with JB image)
can take longer time to reply to GO Negotiation Response (somewhere
between 200 and 250 ms has been observed).

Increase the wait-for-GO-Neg-Resp timeout from 100 ms to 200 ms if GO
Negotiation Request frame was acknowledged (this matches with the
offchannel wait timeout that used previously). The no-ack case is left
at 100 ms since we use GO Negotiation Request frame also to discover
whether the peer is on its Listen channel.

Increase the wait-for-GO-Neg-Conf timeout from 100 ms to 250 ms (and
increase the offchannel wait timeout to matching 250 ms) as a workaround
for devices that take over 200 ms to reply to GO Negotiation Response.

Signed-hostap: Jouni Malinen <j@w1.fi>

8 years agoFix wpa_s crash and kickstart sched scan (INTERNAL-SQ) ol_r8.a3.13-jb
Eyal Shapira [Tue, 7 Aug 2012 00:42:30 +0000 (03:42 +0300)]
Fix wpa_s crash and kickstart sched scan (INTERNAL-SQ)

data may be NULL and should be checked before dereferencing it.
This can happen when scan times out for example.
Another bug fixed is that sched scan wouldn't be kick started
from anywhere. Previously it was started following a normal scan
which didn't find any results. Fix it by start it if it's not running.

(These issues were introduced by commit
a523a28 wpa_s: don't reschedule the sched scan on each scan complete event
and the fix should be squashed into it)

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
8 years agoSME: Fix handle Netgear APs WEP shared quirks (UPSTREAM-SQ) ol_r8.a3.12-jb
William List [Mon, 6 Aug 2012 15:15:46 +0000 (10:15 -0500)]
SME: Fix handle Netgear APs WEP shared quirks (UPSTREAM-SQ)

If the network entry is created with both WPA_AUTH_ALG_OPEN and
WPA_AUTH_ALG_SHARED set in wpa_s->current_ssid->auth_alg, the
existing logic will end up picking WPA_AUTH_ALG_LEAP instead of
shared when open authentication fails.

Fix this by using a bitwise-and to check for WPA_AUTH_ALG_OPEN instead.

(Should be squashed into commit
2e35a02 SME: Handle Netgear APs WEP shared quirks)

Signed-Off-By: William List <wlist@ti.com>
Signed-Off-By: Eyal Shapira <eyal@wizery.com>
8 years agoWPS: Update dev.config_methods in wps_update_config
jim1_lin [Sat, 4 Aug 2012 17:14:59 +0000 (20:14 +0300)]
WPS: Update dev.config_methods in wps_update_config

dev.config_methods was not updated when wps_update_config was called.
This could lead to mismatching config methods between Probe Request and
M1 packets. Add missing part for it.

8 years agoFix a couple memory leaks
Paul Stewart [Sat, 4 Aug 2012 17:10:08 +0000 (20:10 +0300)]
Fix a couple memory leaks

Found using valgrind.

Signed-hostap: Paul Stewart <pstew@chromium.org>

8 years agoandroid: wpa_s template: set p2p_go_max_inactivity (ANDROID)
Eyal Shapira [Wed, 8 Aug 2012 17:38:35 +0000 (20:38 +0300)]
android: wpa_s template: set p2p_go_max_inactivity (ANDROID)

Set p2p_go_max_inactivity to 30 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.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agoAdd p2p_go_max_inactivity config option (UPSTREAM)
Eyal Shapira [Wed, 8 Aug 2012 17:38:34 +0000 (20:38 +0300)]
Add p2p_go_max_inactivity config option (UPSTREAM)

This enables setting a different max inactivity timeout for P2P GO.
This timeout is used to detect inactive clients. In some scenarios
it may be useful to have control over this and set a shorter timeout
than the default 300s. For example when running STA and P2P GO interfaces
concurrently, the STA interface may perform scans which may cause the
GO to miss a disassoc / deauth frames from a client and keep assuming
that the client is connected until the inactivity detection kicks in.
300 secs is a bit too long for such scenarios and creates a bad user

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agoandroid: wpa_s template: use group interface and set conc mode ol_R5.SP2.04 ol_r8.a3.11_jb
Arik Nemtsov [Thu, 2 Aug 2012 08:35:04 +0000 (11:35 +0300)]
android: wpa_s template: use group interface and set conc mode

Make sure we operate the same way as BRCM, with a separate group
interface, by incorporating a driver param.

Also set a default p2p_conc_mode (set to 2), to fit WL6/7 cards. Note
this will have to be changed to p2p_conc_mode=1 for WL8 cards.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
8 years agowpa_s: support p2p concurrency modes when connecting P2P
Arik Nemtsov [Wed, 1 Aug 2012 08:23:15 +0000 (11:23 +0300)]
wpa_s: support p2p concurrency modes when connecting P2P

Prevent P2P connection when STA concurrency requirements do not allow
it. The behavior is determined according to the p2p_conc_mode
config file parameter.
We force go_intent=15 if only GO is allowed and abort the connection
if join is attempted with go_intent=15.
Also manipulate go_intent in our favor (go_intent=14) to minimize the
chances of a concurrency conflict in p2p_conc_mode=2. This supersedes a
similar previous patch by Eyal S.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
8 years agowpa_s: support different p2p concurrency modes when connecting STA
Arik Nemtsov [Wed, 1 Aug 2012 06:59:19 +0000 (09:59 +0300)]
wpa_s: support different p2p concurrency modes when connecting STA

support p2p concurrency modes using the p2p_conc_mode=0/1/2 config
file parameter. Meaning is as follows:
0 - support STA + P2P CL/GO on the same channel (BRCM default)
1 - support only one connection at a time (WL8)
2 - support STA + P2P GO on same channel, but not P2P CL (WL6/7)

When connecting STA, disallow the connection or disconnect existing
p2p connection, according to existing concurrency preference.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
8 years agonl80211: avoid using another interface for P2P GO (INTERNAL)
Eyal Shapira [Fri, 15 Jun 2012 10:32:11 +0000 (13:32 +0300)]
nl80211: avoid using another interface for P2P GO (INTERNAL)

Relevant for wl6/7 only, we need to figure out the wl8 MR case.
We now declare iface combinations in wlcore due to cfg80211
enforcement of that. Since we declare support for concurrent
STA and P2P_GO, wpa_s would like to use another interface for
GO. However, since we don't really support P2P_GO so well in MR
but we do want to enable it in MR, prevent wpa_s from using P2P
concurrent mode.

This should be removed once we support P2P_GO properly in MR.

[Arik - should be changed to a configuration parameter to wpa_s, and the
current default should be preserved]

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agoInitialize P2P on p2p0 and not wlan0 (JB)
Eyal Shapira [Tue, 17 Jul 2012 12:33:31 +0000 (15:33 +0300)]
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

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agoIncrease P2P_MAX_CLIENT_IDLE to 20 secs (BRCM)
Eyal Shapira [Sun, 22 Jul 2012 00:10:40 +0000 (03:10 +0300)]
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>
8 years agoHandle new interface parameter in ctrl commands (BRCM)
Eyal Shapira [Sat, 21 Jul 2012 23:57:08 +0000 (02:57 +0300)]
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>
8 years agoFix a crash in WPS PBC overlap (BRCM)
Eyal Shapira [Sat, 21 Jul 2012 23:49:48 +0000 (02:49 +0300)]
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>
8 years agoP2P: Avoid peer expiration while connection in progress (BRCM)
Eyal Shapira [Fri, 20 Jul 2012 22:04:50 +0000 (01:04 +0300)]
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>
8 years agoP2P: Improve scan results handling (BRCM)
Eyal Shapira [Fri, 20 Jul 2012 23:27:50 +0000 (02:27 +0300)]
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>
8 years agoP2P: Start blocked p2p find even if scan was on another interface (BRCM)
Eyal Shapira [Fri, 20 Jul 2012 22:38:35 +0000 (01:38 +0300)]
P2P: Start blocked p2p find even if scan was on another interface (BRCM)

p2p find can now defer starting the p2p scan due to an ongoing
scan on a different interface. Relying on p2p_cb_on_scan_complete
which is a per interface flag is wrong here and we won't resume
the p2p find in case the scan wasn't on the same interface (which is
the case in Android JB).
Fix this by relying on the global p2p state instead.

(This description is based on analysis of the code as the original
BRCM commit doesn't contain any useful information)

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agoP2P: Defer p2p scan if scanning on other interfaces (BRCM)
Eyal Shapira [Fri, 20 Jul 2012 07:00:35 +0000 (10:00 +0300)]
P2P: Defer p2p scan if scanning on other interfaces (BRCM)

The current defer p2p scan until scan complete works
only when the scanning is done on the same interface.
However in Android case there are scans in progress on the STA
interface so these would fail the p2p_scan and consequently
the p2p find.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agoP2P: Decrease peer expiry time (BRCM)
Eyal Shapira [Fri, 20 Jul 2012 21:55:20 +0000 (00:55 +0300)]
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>
8 years agonl80211: add parameter to force multi channel concurrency (BRCM)
Eyal Shapira [Sat, 21 Jul 2012 23:29:22 +0000 (02:29 +0300)]
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>
8 years agonl80211: fix extending shared_freq detection to AP/GO (BRCM)
Eyal Shapira [Sat, 21 Jul 2012 07:55:48 +0000 (10:55 +0300)]
nl80211: fix extending shared_freq detection to AP/GO (BRCM)

Commit d3bd0f "nl80211: Extend shared_freq to handle AP/GO mode interfaces"
still discards AP/GO interfaces so effectively shared_freq
won't work on AP/GO interaces like intended.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agoP2P: fix freq conflict resolution in case of P2P and STA
Eyal Shapira [Sat, 21 Jul 2012 18:13:23 +0000 (21:13 +0300)]
P2P: fix freq conflict resolution in case of P2P and STA

The conflict resolution code doesn't run in case wpa_s SME is used
so moved it up wpa_supplicant_associate.
wpas_p2p_handle_frequency_conflicts assumes use of a different interface
created for p2p group (p2p_group_interface != 0) but that's not
necessarily the case with all drivers. Switch to detect if an iface
is used for P2P_GO by looking at current_ssid->mode.

[Arik - fix the separate interface case, was broken by the original

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
8 years agoP2P: Resolve frequency conflicts between STA and P2P (BRCM)
Eyal Shapira [Fri, 20 Jul 2012 21:02:19 +0000 (00:02 +0300)]
P2P: Resolve frequency conflicts between STA and P2P (BRCM)

Upon association check whether there's a a frequency
conflict given that no support for multi channel. In case
there's a freq conflict with an existing P2P_GO or P2P_CLI
decide how to resolve it (which one to disable or disconnect)
according to the priority configuration.

Effectively on Android JB, STA is always prioritized over P2P
so in case of a conflict P2P will be disconnected so that STA
can associate on a different channel.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agoPrep work to configure a prioritized interface (BRCM)
Eyal Shapira [Fri, 20 Jul 2012 21:48:19 +0000 (00:48 +0300)]
Prep work to configure a prioritized interface (BRCM)

Add a new configurable property which points to the interface
name that should prioritized in case of resolving connection

(This appears to be prep work which doesn't get used however
we include it to better align with JB)

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agonl80211: Use native cfg80211 sta events (BRCM)
Dmitry Shmidt [Tue, 20 Mar 2012 19:51:25 +0000 (12:51 -0700)]
nl80211: Use native cfg80211 sta events (BRCM)

[Eyal - Keep specific BRCM specific stuff under
TI solution compiles with]

Change-Id: I0f6222839ac87241f1bfbbb1fdc6469bf6359652
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agoFix p2p service discovery
Irfan Sheriff [Wed, 13 Jun 2012 18:09:23 +0000 (11:09 -0700)]
Fix p2p service discovery

- Fix listen timing to improve SD reliability
- Fix SD packet scheduling

Signed-off-by: Eyal Shapira <eyal@wizery.com>
8 years agoFix null pointer access for SSID printing.
andy2_kuo [Tue, 22 May 2012 18:53:07 +0000 (11:53 -0700)]
Fix null pointer access for SSID printing.

8 years agoFix SSID printing in events
Irfan Sheriff [Fri, 11 May 2012 18:23:35 +0000 (11:23 -0700)]
Fix SSID printing in events

8 years agoAdd SSID in supplicant change event
Irfan Sheriff [Mon, 16 Apr 2012 23:48:34 +0000 (16:48 -0700)]
Add SSID in supplicant change event