10 months ago0048 - This patch not allow to load AP on JP-only channel 14, 38, 42, and 46. master upstream_29_rebase R8.8 R8.8_RC1
KN [Tue, 9 Jun 2020 21:50:48 +0000 (16:50 -0500)]
0048 - This patch not allow to load AP on JP-only channel 14, 38, 42, and 46.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0047 - Fix some Mesh sec bugs
KN [Tue, 9 Jun 2020 21:48:39 +0000 (16:48 -0500)]
0047 - Fix some Mesh sec bugs

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0046 - remove Mesh link in wpa_supplicant_event_assoc only if CONFIG_MESH.
KN [Tue, 9 Jun 2020 21:45:33 +0000 (16:45 -0500)]
0046 - remove Mesh link in wpa_supplicant_event_assoc only if CONFIG_MESH.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0045 - nl80211: define static function if CONFIG_MESH
KN [Tue, 9 Jun 2020 21:42:33 +0000 (16:42 -0500)]
0045 - nl80211: define static function if CONFIG_MESH

Do not define the static nl80211_get_low_signal_mesh function if CONFIG_MESH is not set.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0044 - Closes the link for mesh peer management only if mesh
KN [Tue, 9 Jun 2020 21:39:38 +0000 (16:39 -0500)]
0044 - Closes the link for mesh peer management only if mesh
 is activated.

This fixes the errror below:

     events.c: In wpa_supplicant_:
     events.c:4171:11: error: struct sta_info has no member 'plink_state'
         if (sta->plink_state == PLINK_ESTAB)

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0043 - Mesh: Support mesh connection to a "full" MP
KN [Tue, 9 Jun 2020 21:38:12 +0000 (16:38 -0500)]
0043 - Mesh: Support mesh connection to a "full" MP

Support for connection of an "empty" MP to a "full" MP
if no other MP are available.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0042 - Fix warrining compilation
KN [Tue, 9 Jun 2020 21:36:57 +0000 (16:36 -0500)]
0042 - Fix warrining compilation

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0041 - mesh on demand: Several fixes
KN [Tue, 9 Jun 2020 21:35:40 +0000 (16:35 -0500)]
0041 - mesh on demand: Several fixes

Contains some scan changes and bug fixes

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0040 - mesh on demand: Allow BG scan user configuration
KN [Tue, 9 Jun 2020 21:33:23 +0000 (16:33 -0500)]
0040 - mesh on demand: Allow BG scan user configuration

Enable BG scan params configuration from network profile.
Change default BG scan period from 30 sec to 0xFFFF.
Set sched scan to every 60 sec instead of 10 sec.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0039 - Fix deauth with reason 7 due to multiple assoc_req received
KN [Tue, 9 Jun 2020 21:31:29 +0000 (16:31 -0500)]
0039 - Fix deauth with reason 7 due to multiple assoc_req received

Additional assoc_reqs received after an initial assoc_req (due to a timeout
in the STA) was already being handled caused the handle_assoc flow to
run again and in the process delete the station added to the driver
(in add_pre_assoc_sta). A race would occur where assoc_resp
was already sent to the STA (as part of the handling of the initial
assoc_req) and it sent a null data packet which arrived
while the station was deleted. This caused the packet to be classified
as a class 3 frame coming from an unknown STA and a deauth
would occur. Fix this by discarding additional assoc_req between
receiving the 1st assoc_req and getting a tx callback for the assoc_resp.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0038 - ap: add missing WLAN_STA_ASSOC_REQ_OK flag cleanups
KN [Tue, 9 Jun 2020 21:29:58 +0000 (16:29 -0500)]
0038 - ap: add missing WLAN_STA_ASSOC_REQ_OK flag cleanups

cleanup of WLAN_STA_ASSOC_REQ_OK flag is missing in some
places (e.g. when deauth a sta).

(This in turn caused problems when working as GO, as our
internal commit (a3e0a16 "Fix deauth with reason 7 due to
multiple assoc_req received") caused reassociations
(after WPS) to get dropped.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0037 - mesh on demand: Perform BG Scan only on serving channel
KN [Tue, 9 Jun 2020 21:27:43 +0000 (16:27 -0500)]
0037 - mesh on demand: Perform BG Scan only on serving channel

The purpose of the BG scan in MoD, is to monitor the AP's RSSI.
Therefore, we can scan only the serving channel.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0036 - mesh: Cannot perform scan on mesh IF while mesh is connected with security
KN [Tue, 9 Jun 2020 21:26:09 +0000 (16:26 -0500)]
0036 - mesh: Cannot perform scan on mesh IF while mesh is connected with security

In mesh IF, the wpa_s state was either SCANNING in non-secured connection
or AUTHENTICATING in secured connection. The latter prevented the scan.
Updated the wpa_s state in mesh IF to be COMPLETED upon init (same as P2P GO).

Fixes #WILINK8_SW_DEV-547

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0035 - Mesh: Fixed max peer links
KN [Tue, 9 Jun 2020 21:24:57 +0000 (16:24 -0500)]
0035 - Mesh: Fixed max peer links

Added support for low ack, in that case we close the mesh link.
Cleaned the handling of the num_plinks - now being reduced only in one place.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0034 - Mesh: Don't allow SISO40 pri/sec channel switch
KN [Tue, 9 Jun 2020 21:22:15 +0000 (16:22 -0500)]
0034 - Mesh: Don't allow SISO40 pri/sec channel switch

Disable the option for switching primary and secondary channels in SISO40.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0033 - Mesh: Cannot create mesh network on channel 40
KN [Tue, 9 Jun 2020 21:21:05 +0000 (16:21 -0500)]
0033 - Mesh: Cannot create mesh network on channel 40

In case of siso40 off-channel (switching primary
and secondary channels), sending action frame done
on wrong freq causing ROC command to FW and
kernel warning.
Send the correct freq along with action frame.

Fixes: WILINK8_SW_DEV-449

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0032 - Mesh: Can't join other mesh network after joining mesh network
KN [Tue, 9 Jun 2020 21:19:11 +0000 (16:19 -0500)]
0032 - Mesh: Can't join other mesh network after joining mesh network

Due to the fix of how to deauthenticate a mesh interface
the problem was we sent a close action and never waited for a response
now we divided it into sending and waiting for the response and only then
deinitializing the interface.

in the select network scenario - this didn't work properly. we had to shorten
the timer time to 100ms from 300ms, change the code in such a way that it will
deinit only after the timer has finished.

fixes: WILINK8_SW_DEV-496 and WILINK8_SW_DEV-502

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0031 - Mesh: mesh on demand support
KN [Tue, 9 Jun 2020 21:13:38 +0000 (16:13 -0500)]
0031 - Mesh: mesh on demand support

Adding mesh on demand support logic.
The mesh on demand functionality is a multirole station/mesh configuration
that will always try to connect the station to a pre-defined AP. However
whenever this connection will not be available or be a low quality connection
will try to maintain/create connection via the Mesh interface.

There were several issues of connecting when security was configured as SAE.
In case on side has MeshBlocked and won't answer any beacons we enable this option
in case the other side has initiated a peering connection and we have a pending request.

Two issues are fixed in this patch. Mesh will begin as blocked and only after a scan by the station has been done
will be unblocked if it needs to be unblocked (bad RSSI or the pre-configured AP is not in the vicinity)

Scan results will be changed in Mesh On Demand only when going over results of the station scan and not the mesh scan

Fixes: WILINK8_SW_DEV-526

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0030 - Mesh: bug fix - make sure when we disconnect we wait for plink_close to be...
KN [Tue, 9 Jun 2020 21:11:29 +0000 (16:11 -0500)]
0030 - Mesh: bug fix - make sure when we disconnect we wait for plink_close to be received

When leaving mesh we are not waiting for the other side to respond to our
close command and tear down the interface.
This fix waits for 300ms and only then tears down the interface leaving
enough time for the other side to receive our close action and send us
a close action back.

note - there is still an issue with mesh_join - when calling mesh join
we first tear down the last mesh - in that case we won't wait - and this
bug still occurs - needs to be fixed later on.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0029 - mesh: fix error print upon join
KN [Tue, 9 Jun 2020 21:09:08 +0000 (16:09 -0500)]
0029 - mesh: fix error print upon join

Sending flush command to driver when iftype is STA
results in error code sent back to hostap and error print

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0028 - AP-Mesh channel sync
KN [Tue, 9 Jun 2020 21:07:52 +0000 (16:07 -0500)]
0028 - AP-Mesh channel sync

If mesh is joined before AP, AP will sync channel to the mesh channel.
If AP is already up and mesh required to join on a different channel, mesh will not join.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0027 - mesh : set OFDM basic rates as default
KN [Tue, 9 Jun 2020 21:06:03 +0000 (16:06 -0500)]
0027 - mesh : set OFDM basic rates as default

Set basic rates for mesh as OFDM only.
This is to improve the reliability of management frames.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0026 - Mesh: Connection fixes
KN [Tue, 9 Jun 2020 21:04:58 +0000 (16:04 -0500)]
0026 - Mesh: Connection fixes

1. For Mesh - updated ap's max_num_sta to the value of max_peer.
   This value is used to decide if new connection can be created and is not
   updated in the case of mesh.

2. Upon receiving a beacon from a new MP, it is added to the driver before
   deciding if connection can be initiated. If connection is not initiated,
   the MP is not remoced from the driver.
   fix is to add the new MP to driver only if decided to initiate connection.

fixes #WILINK8_SW_DEV-468

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0025 - Mesh: max peer parameter doesn't work
KN [Tue, 9 Jun 2020 21:03:47 +0000 (16:03 -0500)]
0025 - Mesh: max peer parameter doesn't work

1. Send the max_peer parameter to the driver even if user_mpm is set
mac80211 is using this param when building the beacon.
2. When receiving a peer's beacon - check the the capability bit that
indicates if peer is accepting new connections. Do not initiate
connection with this peer if bit is not set.

fixes #WILINK8_SW_DEV-439

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0024 - mesh: enable disassoc_low_ack event for mesh
KN [Tue, 9 Jun 2020 21:02:06 +0000 (16:02 -0500)]
0024 - mesh: enable disassoc_low_ack event for mesh

Enable to configure and use disassoc_low_ack event for mesh interface.
When receiving this event, there is no need to wait for any response
from the peer, just to simply remove it.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0023 - P2P: fix duplicate structure patch
KN [Tue, 9 Jun 2020 21:00:50 +0000 (16:00 -0500)]
0023 - P2P: fix duplicate structure patch

wpa_channel_info stucture is duplicate in this version.
This patch is remove the duplicate wpa_channel_info that added in hostapd: use new op to sync AP channels [AP AP] patch.
In addition, this patch modified the calling to this structe with the right field.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0022 - P2P: accept provision discovery with bcast group ID [IOP]
KN [Tue, 9 Jun 2020 20:54:35 +0000 (15:54 -0500)]
0022 - P2P: accept provision discovery with bcast group ID  [IOP]
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: KN <sudharshan@ti.com>
10 months ago0021 - P2P: accommodate peers that use the GO address in prov_disc_resp [IOP]
KN [Tue, 9 Jun 2020 20:52:45 +0000 (15:52 -0500)]
0021 - P2P: accommodate peers that use the GO address in prov_disc_resp [IOP]

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.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0020 - P2P: Ignore PBC overlap in P2P provisioning [IOP]
KN [Tue, 9 Jun 2020 20:49:14 +0000 (15:49 -0500)]
0020 - P2P: Ignore PBC overlap in P2P provisioning [IOP]

PBC overlap can be ignored as the P2P client knows
that it should connect to the P2P GO so no point of failing
the WPS session in case of overlap because some other
AP had WPS PBC on at the same time.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0019 - wpa_supplicant: declare 20/40 coex support [UPSTREAM]
KN [Tue, 9 Jun 2020 20:47:42 +0000 (15:47 -0500)]
0019 - wpa_supplicant: declare 20/40 coex support [UPSTREAM]
Set the appropriate bit in the extended capabilities IE

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0018 - P2P: increase p2p go initial connection timeout [WORKAROUND]
KN [Tue, 9 Jun 2020 20:46:04 +0000 (15:46 -0500)]
0018 - P2P: increase p2p go initial connection timeout  [WORKAROUND]
increase the P2P_MAX_INITIAL_CONN_WAIT_GO timeout
to avoid IOP issues with several P2P CL vendors.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0017 - reload iface on ifdown/up and suspend/resume (INTERNAL)
KN [Tue, 9 Jun 2020 20:44:32 +0000 (15:44 -0500)]
0017 - reload iface on ifdown/up and suspend/resume (INTERNAL)

When getting NL80211_CMD_STOP_AP (e.g. on suspend),
disable and re-enable the interface, so the ap
will be reconfigured (on resume, as this is when
we get the event).

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0016 - ACS: don't choose JP-only channel [ACS]
KN [Tue, 9 Jun 2020 20:40:35 +0000 (15:40 -0500)]
0016 - ACS: don't choose JP-only channel [ACS]
Avoid using channels 38 and 42 which are valid only in JP.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0015 - ap: wps: avoid sending wps commands for each interface [AP AP]
KN [Tue, 9 Jun 2020 20:38:30 +0000 (15:38 -0500)]
0015 - ap: wps: avoid sending wps commands for each interface [AP AP]
This is probably leftover from old times. it can actually
cause some issues (e.g. overlapping pbc).

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0014 - acs: retry ACS scan on EBUSY return code [ACS]
KN [Tue, 9 Jun 2020 20:35:54 +0000 (15:35 -0500)]
0014 - acs: retry ACS scan on EBUSY return code [ACS]
register a retry scan function if ACS failed due
to another ongoing scan.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0013 - hostap: don't check scan results in case of 20mhz [AP AP]
KN [Tue, 9 Jun 2020 20:32:49 +0000 (15:32 -0500)]
0013 - hostap: don't check scan results in case of 20mhz [AP AP]

When using ACS, we might get to ieee80211n_check_scan()
while having 20mhz configuration, which in turn might
cause unneeded channel swapping (e.g. 36 <-> 40).

Exit prematurely in this case.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0012 - driver_nl80211: implement shared AP channel op [AP AP]
KN [Tue, 9 Jun 2020 20:28:38 +0000 (15:28 -0500)]
0012 - driver_nl80211: implement shared AP channel op [AP AP]

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

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0011 - hostapd: use new op to sync AP channels [AP AP]
KN [Tue, 9 Jun 2020 20:26:07 +0000 (15:26 -0500)]
0011 - hostapd: use new op to sync AP channels [AP AP]
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: KN <sudharshan@ti.com>
10 months ago0010 - acs: skip HT_SCAN on channel sync [ACS]
KN [Tue, 9 Jun 2020 20:24:30 +0000 (15:24 -0500)]
0010 - acs: skip HT_SCAN on channel sync [ACS]
Since the channel was already chosen, we don't need
to do another HT_SCAN.
This reduces some problems that occur when radar
is detected during HT_SCAN, etc.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0009 - acs: add additional dfs operating classes [ACS]
KN [Tue, 9 Jun 2020 20:22:18 +0000 (15:22 -0500)]
0009 - acs: add additional dfs operating classes [ACS]
This will allow choosing dfs ht40 channels

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0008 - Porting the legacy ACS implementation.
KN [Tue, 9 Jun 2020 20:21:06 +0000 (15:21 -0500)]
0008 - Porting the legacy ACS implementation.

fix: remove redundant ieee80211n_check_40mhz call
The 40mhz check should be done only if no scan_results
are available (as being checked in the following lines).

The redundant scan finally results in a try to reconfigure
the already-configured channel.

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0007 - If another ap iface is enabled, sync to its channel (if ap_channel_sync is...
KN [Tue, 9 Jun 2020 20:18:44 +0000 (15:18 -0500)]
0007 - If another ap iface is enabled, sync to its channel (if ap_channel_sync is set).

Signed-off-by: KN <sudharshan@ti.com>
10 months ago0006 - When ap_channel_sync=1 the 40Mhz operating channel of an AP will be set to...
KN [Tue, 9 Jun 2020 20:17:20 +0000 (15:17 -0500)]
0006 - 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: KN <sudharshan@ti.com>
10 months agoIn our case we want to sync to existing frequency in case of running ap (e.g. AP...
KN [Tue, 9 Jun 2020 19:59:55 +0000 (14:59 -0500)]
In our case we want to sync to existing frequency in case of running ap (e.g. AP + GO), but don't sync in case of connected station (STA + GO).

Signed-off-by: KN <sudharshan@ti.com>
10 months agoLook for other used frequencies (by other hostapd processes) and use/prefer them...
KN [Tue, 9 Jun 2020 19:57:00 +0000 (14:57 -0500)]
Look for other used frequencies (by other hostapd processes) and use/prefer them for the new GO.


Signed-off-by: KN <sudharshan@ti.com>
10 months agoSome channels shuldn't be used in the US (even though they are in the allowed regulat...
KN [Tue, 9 Jun 2020 19:54:55 +0000 (14:54 -0500)]
Some channels shuldn't be used in the US (even though they are in the allowed regulatory range). skip them when choosing a new operating channel.

Signed-off-by: KN <sudharshan@ti.com>
10 months agoAccording to the requirement, channels 38/42/46 should not be advertised for non...
KN [Tue, 9 Jun 2020 19:52:01 +0000 (14:52 -0500)]
According to the requirement, channels 38/42/46 should not be advertised for non-JP countries. look for it explicitly.


Signed-off-by: KN <sudharshan@ti.com>
10 months agoFrom 0dc14149ba74a6b552a5bc7d23ed9a541dd4267c Mon Sep 17 00:00:00 2001
KN [Tue, 9 Jun 2020 18:40:19 +0000 (13:40 -0500)]
From 0dc14149ba74a6b552a5bc7d23ed9a541dd4267c Mon Sep 17 00:00:00 2001
From: Luciano Coelho <coelho@ti.com>
Date: Thu, 16 Feb 2012 00:55:05 +0200
Subject: [PATCH 01/47] changes to default build config

We use the Android config as default setup

- Enable roaming and bgscan and nl80211
- Remove WPS NFC support
- Add required Mesh flags

Signed-off-by: KN <sudharshan@ti.com>
10 months agoAdding the official hostapd_2_9 release from https://w1.fi/cgit/hostap/ to the intern... hostap_2_9_org
KN [Tue, 9 Jun 2020 18:23:06 +0000 (13:23 -0500)]
Adding the official hostapd_2_9 release from https://w1.fi/cgit/hostap/ to the internal repository

Signed-off-by: KN <sudharshan@ti.com>
7 years agoRevert "driver_nl80211: implement shared AP channel op" ol_r8.a9.01 w1fi
Eliad Peller [Thu, 19 Dec 2013 13:19:11 +0000 (15:19 +0200)]
Revert "driver_nl80211: implement shared AP channel op"

This reverts commit c7279ebf9e0f43d0e7913c011396d2f1651f1b11.

7 years agohostapd: sync channel on interface setup
Eliad Peller [Thu, 19 Dec 2013 11:22:10 +0000 (13:22 +0200)]
hostapd: sync channel on interface setup

If another ap iface is enabled, sync to its channel
(if ap_channel_sync is set).

Signed-off-by: Eliad Peller <eliad@wizery.com>
7 years agoRevert "hostapd: use new op to sync AP channels"
Eliad Peller [Thu, 19 Dec 2013 11:25:17 +0000 (13:25 +0200)]
Revert "hostapd: use new op to sync AP channels"

This reverts commit f49e37aab8cc2de89947821e80e0d072557f8c1c.

7 years agoap: allow passing "enable=1" param to ADD command
Eliad Peller [Wed, 18 Dec 2013 16:46:04 +0000 (18:46 +0200)]
ap: allow passing "enable=1" param to ADD command

this way we can start the ap right after adding it.
(we'll probably want to replace it with a more generic
IFNAME=<> commands, like in wpa_supplicant)

Signed-off-by: Eliad Peller <eliad@wizery.com>
7 years agoap: fix hostapd_add_iface error path
Eliad Peller [Wed, 18 Dec 2013 16:44:40 +0000 (18:44 +0200)]
ap: fix hostapd_add_iface error path

The current error path contains various issues
(use after free, leaks), so change the initialization
order a bit, and make the cleanup more simple.

Signed-off-by: Eliad Peller <eliad@wizery.com>
7 years agohostapd_cli: initial global ctrl iface support
Eliad Peller [Wed, 18 Dec 2013 13:47:05 +0000 (15:47 +0200)]
hostapd_cli: initial global ctrl iface support

Signed-off-by: Eliad Peller <eliad@wizery.com>
7 years agohostapd_cli: add raw command support
Eliad Peller [Thu, 19 Dec 2013 13:13:28 +0000 (15:13 +0200)]
hostapd_cli: add raw command support

Allow passing raw ctrl interface commands, similarly
to wpa_cli.

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

7 years agowpa_cli/hostapd_cli: unify some code
Eliad Peller [Thu, 19 Dec 2013 13:11:57 +0000 (15:11 +0200)]
wpa_cli/hostapd_cli: unify some code

Move some functions into wpa_ctrl instead of duplicating
the code.

TODO: we might want to convert the externs to something else?

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

7 years agoRevert "build: Use updated libnl3 header paths"
Eliad Peller [Wed, 18 Dec 2013 11:15:31 +0000 (13:15 +0200)]
Revert "build: Use updated libnl3 header paths"

This reverts commit e7ecddf33a446072effbc85a27a078a8e582c89e.

This patch breaks cross compilation

7 years agowpa_supplicant: fix scan with more than max_sched_scan_ssids
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

7 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>
7 years agowpa_s: make SETBAND take immediate effect
Vishal Mahaveer [Wed, 20 Jun 2012 22:06:58 +0000 (17:06 -0500)]
wpa_s: make SETBAND take immediate effect

Make SETBAND disconnect from the current AP if it's not
in the correct band. Also expire APs which aren't in the correct
band so scan results will immediately reflect the band change.

[Eyal - ammended commit description]

Signed-off-by: Panduranga Mallireddy <panduranga_mallireddy@ti.com>
Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
7 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>
7 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>
7 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>
7 years agoInitiate a periodic normal scan in addition to sched scan (ANDROID)
Eyal Shapira [Wed, 29 Feb 2012 18:16:47 +0000 (20:16 +0200)]
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>
7 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

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

7 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>

7 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>

7 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>
7 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

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

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

7 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>
7 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>
7 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>
7 years agowpa_s: fix hidden network connection (INTERNAL)
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>
7 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>
7 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>
7 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>
7 years agowpa_s: new override_p2p_go_intent conf parameter (INTERNAL)
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>
7 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>
7 years agoP2P: accept provision discovery with bcast group ID
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>
7 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>
7 years agoDo not delay p2p search in case of concurrent operations (INTERNAL)
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>
7 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>
7 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)

This will be useful for future operations.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
7 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>
7 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>
7 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>
7 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