Commit Graph

314 Commits

Author SHA1 Message Date
Abhishek Singh
deeaf6e9b2 qcacmn: Add logic to negotiate the auth and enc type depending on AP
In testbed sta mode the RSNE enc type and auth type may not match the
AP's enc type and auth type and thus the scan filter is unable to match
and find the AP.

Introduce auth and enc type as "ANY" in scan filter. With the auth
and enc type set as ANY, all the AP's matching the BSSID and SSID
will be filtered and the negotiated auth and enc type will be
dependent on AP's auth and enc type.

Change-Id: I82f07f68d9ec6c6f2104122a05d06a698c61a50a
CRs-Fixed: 2197222
2018-03-06 01:51:30 -08:00
gaurank kathpalia
1e6e00f350 qcacmn: Remove 11ax IE length checks
With IE length sanity check, that involved by Change-Id I9a091486,
11ax AP cant be found due to the addition of +1 byte in HE-operation
IE in latest spec of 11ax (D2.2).

Remove all 11ax extended capability IE length checks for now due to
11ax being under development.

Change-Id: I45d676325c72c8e0020ca52d094fb1652f8fcaf2
CRs-Fixed: 2197252
2018-03-05 23:33:35 -08:00
Abhishek Singh
a6157cfeb1 qcacmn: Avoid scan entry use after free in scm_handle_bcn_probe
In scm_handle_bcn_probe, scm_add_update_entry is called before
inform_beacon(wlan_cfg80211_inform_bss_frame).

Once scan entry is added to db, there is race condition that other
threads may remove it from db before wlan_cfg80211_inform_bss_frame
is called. Thus freed memory will be accessed in
wlan_cfg80211_inform_bss_frame.

To fix call inform_beacon(wlan_cfg80211_inform_bss_frame) before
adding the entry to scan DB and after updating required fields
from duplicate older entry.

Change-Id: Ib6dd967da9625ce944bffda5037b689ffd70903a
CRs-Fixed: 2197238
2018-03-05 04:28:16 -08:00
Om Prakash Tripathi
52402555cd qcacmn: Free raw frame pointer in failure path
Free raw frame pointer if scan node allocation fails.

Change-Id: If080f33cd85eb043c60c90c4170ae2ca4a161e0c
CRs-Fixed: 2194056
2018-02-27 15:08:00 -08:00
gaurank kathpalia
26f9833fb8 qcacmn: Send per chain rssi to upper layer
Add support to send the per chain rssi to upper layer
for each beacon and probe responses.

Change-Id: Ife6cb9e8e65591baf485c54a985f84d842400321
CRs-Fixed: 2177638
2018-02-27 01:57:52 -08:00
Abhishek Singh
46a383c663 qcacmn: Add scan filter to ignore PMF check for STA test mode
In testbed STA mode the RSNE may not match with APUT and thus
driver fails to filter AP from scan cache as PMF capability
mismatch.

With this change driver will ignore PMF capability check and
proceed with connection to send auth and assoc to APUT.

Change-Id: I195cda133c8d2b9d38b1d2966261c320185ffeca
CRs-Fixed: 2195352
2018-02-26 21:44:57 -08:00
Om Prakash Tripathi
5e47d43331 qcacmn: Add support to drop beacon if channel mismatch
Add support to drop beacon, probe response frames if frame
receipt channel and channel mentioned in IEs dont match.

Change-Id: Ib545f125dc53ccfb21abf6bdcb94a327ecde5a0a
CRs-Fixed: 2149224
2018-02-26 13:42:14 -08:00
Sandeep Puligilla
2850421a77 qcacmn: copy raw data length to new scan entry
scan entry raw data length is not populated
during the duplicate scan entry generation.

Copy raw data length to new scan entry
while duplicating the scan entry. This api
is triggered as part of the get scan results
handler.

Change-Id: Ie59782fd437415552b7ae29c1b190e86d4b72d48
CRs-Fixed: 2186845
2018-02-23 13:57:14 -08:00
Om Prakash Tripathi
fdaf38b849 qcacmn: Invoke beacon update callback before adding new entry
Invoke beacon update callback function before adding new entry
to scan list. It's required as get_scan_result API will end up
returning partially initialized scan entry.

Change-Id: Ia34f9c69b4eef2435b135912e06c39018a8987b8
CRs-Fixed: 2189783
2018-02-22 06:01:31 -08:00
akosigi
6e19edc1e4 qcacmn: Update function name and remove redundant code
Rename scan_tx_ops_register for consistency
Remove redundant lines of code in tx_ops registration

Change-Id: I3ade89f7eeb1f506f75b5c859dd4bc4242414628
CRs-Fixed: 2127952
2018-02-21 18:20:52 -08:00
gaurank kathpalia
7d65c1b32d qcacmn: Add individual length checks to Beacon Information element
Currently there is no individual length check to each IE, which
could probably result in buffer overead. Minimum length should
be checked for each varibale IE for avoid the same. Also some fixed
IEs should have a length check of not greater than the size of
their respective structures to avoid corrupting other IE data.

Fix is to add a length check to each individual IE to avoid
corrupting other IEs and also to prevent reception of any IE
of invalid length IE.

Change-Id: I9a0914861d7ff2871ac72ad7357ebbb7ef10eeb3
CRs-Fixed: 2183014
2018-02-13 05:47:44 -08:00
Om Prakash Tripathi
339dc26b21 qcacmn: Enable scan command time out if not disabled explicitly
1. Enable scan command time out for all commands if not disabled
   explicitly.
2. Remove QDF_BUG() for no serialization command buffers

Change-Id: I5357211ef6bc44f8ebd4b8acaa56a12f691fa46d
CRs-Fixed: 2175843
2018-02-13 03:55:25 -08:00
gaurank kathpalia
98d3395e7a qcacmn: Fix KWork issues in Scan component
Fix KWork issues (NULL pointer checks, pointer dereference)
in scan path

Change-Id: I1c66a99bbfc69202d24f288ccfbebd2811345ded
CRs-Fixed: 2160771
2018-02-12 23:51:06 -08:00
Padma, Santhosh Kumar
01548b7f5c qcacmn: Fix hidden ssid match in OWE
OWE SSID is hidden in OWE transition mode. When supplicant detects
connection to OWE transition mode, it issues connect with required
SSID to driver. But that ssid does not present in driver scan cache
as it is hidden. Instead of this ssid, driver scan cache has NULL
entry. This can result in connection failure due to mismatch in ssid.

In normal hidden ssid cases, supplicant issues scan with specific
ssid which helps to update driver scan cache with required ssid. SSID
is also hidden in OWE transition mode, but supplicant does not issue
scan with specific ssid which results in NULL entry in driver scan
cache for that SSID.

Fix this issue by explicit check for OWE if it is hidden.

Change-Id: I95e6b9af37e62c56b4b890090c33d53f89fed731
CRs-Fixed: 2185576
2018-02-09 07:45:42 -08:00
Yeshwanth Sriram Guntuka
f70a37bb90 qcacmn: Move wma_get_buf_start_scan_cmd to ucfg_scan_update_params
Move wma_get_buf_start_scan_cmd logic to common code in
ucfg_scan_update_params.

Change-Id: I4c9dcb48b4862ad10f64e260d87938251e270185
CRs-Fixed: 2180960
2018-02-08 23:34:41 -08:00
Paul Zhang
ca6152167b qcacmn: Support 11d for non-offload platform
Support 11d for non-offload platform by maintaining
count of beacons encountered for each country code
and choosing country code with max votes as device's
country code.

Change-Id: I83b66e980854eded17e254386561fa32b1f8c4ac
CRs-Fixed: 2154048
2018-02-08 21:37:37 -08:00
Om Prakash Tripathi
7dd49fec17 qcacmn: scan all channels in A/G if 0 channels provided
When wide band scan is enabled, host configures all possible
channels with all possible phy modes. In his case if a scan
is invoked with 0 channels, target will end up scanning each
channel with all possible phy modes which increases scan time
exponentially.
If wide band scan is enabled and scan is issues with 0 channels,
configure target to scan all available channels only in 11A/11G mode.

Change-Id: I7c678ccf43c3238aacbfc59cc7e7bd19763453cc
CRs-Fixed: 2165025
2018-02-07 03:07:47 -08:00
Om Prakash Tripathi
f534bf9363 qcacmn: notify scan complete after comamd complete
Do command complete before invoking scan event handlers.
Its required as few scan event handlers check if scan is
active on underlying pdev which returns true as command
complete is not done yet.

Change-Id: Ia415b55e9c9a1cea71faa160c6b52c88dc8329a9
CRs-Fixed: 2180033
2018-02-02 07:46:03 -08:00
Abhishek Singh
c05285da8a qcacmn: Fix RSSI for the beacon received in adjacent channnel
Due to Rx sensitivity issue, sometime beacons are seen on adjacent
channel so workaround in software is needed. If DS params or HT
info are present driver can get proper channel info from these IEs
and set channel_mismatch so that the older RSSI values are used in
new entry.

For the cases where DS params and HT info is not present, driver
needs to check below conditions to get proper channel and set
channel_mismatch so that the older RSSI values are used in
new entry:
   -- The old entry channel and new entry channel are not same
   -- RSSI is less than -80, this indicate that the signal has
       leaked in adjacent channel

Change-Id: Ie9dc26f938b58b0c5d071ce4f2ba02b8e7fd4f60
CRs-Fixed: 2180012
2018-01-31 02:05:55 -08:00
Naveen Rawat
6f7ddcadb4 qcacmn: Avoid null pointer dereference and un-initialized data access
Fix possible null pointer dereference and un-initialized vairable access
in scan component.

Change-Id: Ide1adf2f53712fa987fdda8170eee4e95bff0036
CRs-Fixed: 2169517
2018-01-30 13:40:35 -08:00
Zhu Jianmin
cb80e2f5d2 qcacmn: Fix scan node use after free issue
For each scan node in db, real delete should be called only once.
If 2 threads are trying to delete a note, only one thread should
mark it delete and decrement the ref count and the other thread
should return. or use after free happens as some other thread is
still using it.

Change-Id: I8cfaea73f28f31406816c9fb38f6b65f6b50428d
CRs-Fixed: 2169890
2018-01-29 15:43:06 -08:00
Om Prakash Tripathi
3653ab5bee qcacmn: Pass back scan start request in scan events
Pass back scan start request in scan events so that
handlers can know parameters used to start underlying scan.

Change-Id: I8ca3d55edb266677cc636228919656baa12b43d9
CRs-Fixed: 2159700
2018-01-24 12:29:42 -08:00
wadesong
49ae4cbad4 qcacmn: Fix coding errors detected by gcc 5+
With gcc 5+ utilized for driver building, more coding errors are
detected, some of which are valid issues.

Fix all those errors in one shot.

Change-Id: I263c70d4bff9ec0c3076103001cd7f2ccc8e0d1a
CRs-Fixed: 2176076
2018-01-24 04:26:08 -08:00
gaurank kathpalia
29e7f156dc qcacmn: Modify scan pno dwell-time depending upon current conc mode
Change scan pno active , passive dwell time based upon the current
concurrency mode which can any of p2p_go , p2p_client or Sap

Change-Id: I8223879a981c412e4f57451346d4c2f375780f8e
CRs-Fixed: 2163209
2018-01-23 13:40:16 -08:00
Padma, Santhosh Kumar
6f3e4a828d qcacmn: Add SAE AKM in umac component
Add support for SAE AKM in UMAC component.

Change-Id: I7b84c408b819e3fac614289bf8a161d2fc2c259a
CRs-Fixed: 2115701
2018-01-17 11:36:24 -08:00
Abhishek Singh
ca6ca82087 qcacmn: Use default RSN IE fields if optional fields are not present
Adds logic to use default RSN IE fields if optional fields are not
present in IE. So if RSN IE doesn't contain AKM, group and unicast
cipher, use the default AKM(AKM_IEEE8021X) and cipher (CCMP).

Change-Id: Icabfb8b88b294e935908b249462a61124aa76268
CRs-Fixed: 2164531
2018-01-16 00:24:41 -08:00
Padma, Santhosh Kumar
f379e37f94 qcacmn: Add support for SuiteB AKM suites
Add support for Suite B AKM suites 000FAC 11/12

Change-Id: I4893241ad138d7598d15228cedb29b656afbe32e
CRs-Fixed: 2164932
2018-01-11 15:39:46 -08:00
gaurank kathpalia
7c6b803c4f qcacmn: Add variable to enable scoring result filter on scan results
Add bss_scoring_required in scan filter to enable/disable
scan results filtering based on scoring

Change-Id: I6c2c08a1cd959f1586e3e5bb7b63665f04c3a856
CRs-Fixed: 2165465
2018-01-08 18:28:42 -08:00
Om Prakash Tripathi
1d2f3d2a25 qcacmn: Ensure vdev is valid before accessing it
Ensure vdev is valid before accessing it.

Change-Id: I27fc2d2964829d9609c1b489a95a712e07b2e0be
CRs-Fixed: 2164427
2017-12-28 07:25:10 -08:00
Sandeep Puligilla
c6764593d5 qcacmn: Extend beacon parse util functionality
Beacon parse util API currently returns only one
scan cache entry to the caller.

Extended the beacon parse api to return list of
scan cache entries in scenarios like mbssid

Change-Id: Ia362cda4fdbc9955966696484869fee6ac2d0a22
CRs-Fixed: 2154753
2017-12-22 09:26:16 -08:00
Yeshwanth Sriram Guntuka
b9e2f66377 qcacmn: Set passive dwell time
Set passive dwell time to 28msecs for active
scan when bt a2dp is enabled and hw is not dbs
capable and when sta is connected on 2G band.

Change-Id: I44f2e3d98f2d7ddc52e4902ba989131c256da4ef
CRs-Fixed: 2160963
2017-12-21 05:26:49 -08:00
Paul Zhang
8b7ea68fc0 qcacmn: Do sanity check of requester ID
If the requester id is 0 or other invalid values,
the function scm_scan_get_requester_event_handler
will get unexpected handler.

Change-Id: I505e2e1a1bdc9cec57aaa0c28abadf28d228ba5b
CRs-Fixed: 2147555
2017-12-16 14:08:10 -08:00
Om Prakash Tripathi
8509483038 qcacmn: Add option to wait for target scan cancel
Current scan cancel API frees scan request and notifies internal
scan complete event to registered scan event handlers.
Add option to wait for target scan cancel event before freeing
scan request.

Change-Id: I9ccd753595b3467f6b4e668e9cac876a1105bba0
CRs-Fixed: 2145484
2017-12-15 21:25:19 -08:00
Abhishek Singh
3f11bd6b0a qcacmn: Add logic to logically delete the scan cache node
When a beacon/probe resp is received the scan cache delete the
old node (N1) and adds a new node(N2) at the end of the list, If any
other process is using old node (N1), for some amount of time driver
will have 2 entry for the same AP. Now if driver again receive a
beacon/probe resp during this time, it end up deleting the older node
(N1) Again and thus making its ref count 0 and freeing it, even when
the process using old node (N1) hasnt freed it.

To fix this add a active state to the scan node, and mark it inactive
or logically delete the node as soon its deleted from ageout, entry update
or flush logic. Also do not use the inactive or logically deleted node
for any new operation. For this add a logic to return only active nodes in
scm_get_next_node.

CRs-Fixed: 2155538
Change-Id: I186d3a0b0540f0b572735e1d95239ddcd8c9bdc9
2017-12-13 05:40:22 -08:00
Abhishek Singh
bcec8a775d qcacmn: Split the filter and bss score logics in different files
Split the filter and bss score logics in different files

Change-Id: Ic346ac7758ec6bbc1b62cda067f9e0bd4d0fcadc
CRs-Fixed: 2148889
2017-12-06 21:27:14 -08:00
Dustin Brown
c2fa95196d qcacmn: Abort scan cancel upon failure to get vdev ref
ucfg_scan_cancel currently grabs a vdev reference unconditionally. This
opens the possibility of operating on a destroyed vdev. Instead, try to
get a vdev reference, and abort the scan cancel operation if a reference
cannot be obtained.

Change-Id: I6380775c6cd09920ad70feed0ec67e4c85ba890d
CRs-Fixed: 2149645
2017-11-30 19:38:14 -08:00
Abhishek Singh
7b59903d41 qcacmn: Update new scoring logic with configurable user value
Adds new scoring logic with configurable user value

Change-Id: Ie8c051a3f380930d8a7951617b27aa8f8187619b
CRs-Fixed: 2144588
2017-11-24 03:21:56 -08:00
Padma, Santhosh Kumar
bc6003b78f qcacmn: Fix PMF check
Currently driver assigns WLAN_PMF_REQUIRED to AP pmf capability
even if rsn capability do not matches with RSN_CAP_MFP_REQUIRED.
Add check for rsn capability against RSN_CAP_MFP_REQUIRED to fix
this issue.

Change-Id: Iff51090c9a65fd7c0d45048b73c5383d56bb13a5
CRs-Fixed: 2146881
2017-11-23 17:19:42 -08:00
Padma, Santhosh Kumar
b5088bf0b8 qcacmn: Add OWE AKM in umac component
Add support for OWE AKM in UMAC component.

Change-Id: I37ffc36207ca128373a5e0c451e9311aa50387d2
CRs-Fixed: 2148452
2017-11-23 15:31:15 -08:00
Om Prakash Tripathi
3e166ff7e4 qcacmn: Add support for wide band scan
Add support for 40 MHz or wider channel bandwidth scan

Change-Id: I72f3cf42e6dc957ef56842d0c333c62169cb6d68
CRs-Fixed: 2139415
2017-11-10 17:41:00 -08:00
Abhishek Singh
a0f242168c qcacmn: Changes to support DPP AKM
Adds cmn changes to support and parse AKM required for DPP.

Change-Id: I8efd4075f2c62500dbe11c2a6847f2dab2f31b34
CRs-Fixed: 2138461
2017-11-08 21:57:29 -08:00
Kiran Kumar Lokere
584e6617ca qcacmn: Enable scan mac randomization if user cfg is set
Enable scan randomization only if gEnableMacAddrSpoof
configuration is enabled

Change-Id: I1b9accb7fe1049ee6c5dda2a4f5920c0908196ff
CRs-Fixed: 2104796
2017-11-01 14:39:19 -07:00
Ganesh Kondabattini
948539c1d3 qcacmn: Go for DBS scan if atleast one session is connected
In coex mode, BT throughput test cases are getting effected as
driver is selecting non-DBS scan policy for directed scan requests.
FW is going to use only one MAC for scan when performing non-DBS
scan which inturn increases the total scan duration.
This increase in total scan duration has effect on BT throughput
test cases.

Select DBS scan policy if atleast one session is in connected
state.

CRs-Fixed: 2084608
Change-Id: I6fba26accbaed4d57c6c56a782e570b534af43c4
2017-10-29 07:25:15 -07:00
Ganesh Kondabattini
ef8506f32a qcacmn: check for directed SSID and BSSID
Update dbs scan policy as HDD_SCAN_DBS_POLICY_FORCE_NONDBS if
the scan request is for directed SSID or directed BSSID.

CRs-Fixed: 2084612
Change-Id: I9d720770e2e364ca5cb01bb5fe137f7248593398
2017-10-29 07:25:13 -07:00
Kiran Kumar Lokere
c55ea47249 qcacmn: Add knobs to configure the scan paramters
Add user configuration parameters to configure the number of
probes in scan request and probe repeate time during scan

Change-Id: I65a3734d8080d8adfe3e9ffa26905e6adc196197
CRs-Fixed: 2071697
2017-10-27 13:33:00 -07:00
Frank Liu
e72a02d4e7 qcacmn: fix FT_PSK connection failure
For FT_PSK connection, we use WLAN_AKM_FT_IEEE8021X to make the
security match which causes can't find the candidate AP, the fix
is to use WLAN_AKM_FT_PSK instead.

Change-Id: Ic11fa8e47ccee04621e3bb9491f138c425c91cee
CRs-Fixed: 2131598
2017-10-26 23:48:07 -07:00
Abhishek Singh
358312c3da qcacmn: Update Scan_ctrl_flags_ext flag on passive scan
For passive scan host expects dpp public action frames which
are broadcast. So set 3rd bit of scan_ctrl_flags_ext to 1, so
that firmware sends these frames to host upon passive scan.

Change-Id: I7ab70ef92d9226fc265e99f3d1196c5ebae6acb4
CRs-Fixed: 2124683
2017-10-23 08:06:26 -07:00
Abhishek Singh
65c4be7ef3 qcacmn: Add support to enable/disable scans
Adds support to enable/disable scans for the psoc.
Also adds API to set and get the scan enable/disable status.

Change-Id: I2ebb6f9c7fffabef90e9f8c461bdf735e95f0db3
CRs-Fixed: 2124783
2017-10-23 03:42:51 -07:00
Sathyanarayanan
0a00062f58 qcacmn: Fix MIPS regression
Change-Id: I34d30e097cfedef9b805d3e97cd256da232b1e28
CRs-Fixed: 2123844
2017-10-12 14:22:39 -07:00
Himanshu Agarwal
99881a9668 qcacmn: WMI changes to send BSS scoring params from INI to firmware
Add support to send BSS scoring params from INI to firmware.
Firmware will use these params to select best candidate during
roaming.

Change-Id: Iad0e71c770ac4f4c31ce3b19552f09fd27dc37bf
CRs-Fixed: 2121739
2017-10-12 14:22:36 -07:00