Commit Graph

66 Commits

Author SHA1 Message Date
Sandeep Puligilla
f57464c549 qcacmn: Add an API to check if scan is completed
Add a new scan util API to check if scan is completed and
if scan is success.

Change-Id: Id60056b999a7ec23df3d3458d4498d547f6ec4d9
CRs-Fixed: 2248972
2018-06-14 23:54:10 -07:00
Om Prakash Tripathi
9b56f5dc1c qcacmn: Use atomic allocation for all scheduler context scan allocations
In low memory environments using GFP_KERNEL flag may cause
scheduler thread to sleep. Scheduler thread callback handlers
are expected to be atomic in nature to ensure timely execution
of different commands. Move all allocations done by scan module
in scheduler thread context to atomic allocation.

Change-Id: Iee3eafbc00a3afea0687ba67b3041ec0816094cc
CRs-Fixed: 2232553
2018-06-13 21:00:59 -07:00
Rhythm Patwa
a6ba9eefb4 qcacmn: Add support to parse MU-EDCA IE from beacons
Made changes to add support for parsing MU-EDCA IE from beacons.

Change-Id: I6e9b76c82f9048858df3fe0c259182b5df070f30
CRs-fixed: 2247879
2018-06-01 14:54:05 -07:00
Jeff Johnson
090ee9206c qcacmn: umac: Fix misspellings
Address the following issues in the umac folder:
CHECK: 'defintions' may be misspelled - perhaps 'definitions'?
CHECK: 'destory' may be misspelled - perhaps 'destroy'?
CHECK: 'faild' may be misspelled - perhaps 'failed'?
CHECK: 'initilization' may be misspelled - perhaps 'initialization'?
CHECK: 'managment' may be misspelled - perhaps 'management'?
CHECK: 'muticast' may be misspelled - perhaps 'multicast'?
CHECK: 'ouput' may be misspelled - perhaps 'output'?
CHECK: 'segement' may be misspelled - perhaps 'segment'?
CHECK: 'successfull' may be misspelled - perhaps 'successful'?
CHECK: 'untill' may be misspelled - perhaps 'until'?

Change-Id: If60c276c134ef10ce6be26cd5a4036d53d5724b6
CRs-Fixed: 2241586
2018-05-19 19:40:48 -07:00
Abhishek Singh
c176a5241b qcacmn: Use cookie instead of bool to check if scan node is active
Currently bool is used to check if scan node is active or not, and
if it is active the deletion can happen. Now if two thread tries to
delete the same node at same time, the first one to get the node
will delete the node and set the active bool to false. If the
delete operation leads to node being freed, the 2nd thread when gets
the lock tries to check the bool, if node is active and then return
if node is not active.

Now if before the 2nd thread check the bool, the memory is reallocate
and the byte pointing to the bool is overwritten with non-zero value
the 2nd thread will assume that node is still active and try to delete
and access an already freed node.

To fix this use cookie instead of bool to check if scan node is active.

Change-Id: Id6b9dc9d0ff8f091eef0bd648abc9d3198c3ad4b
CRs-Fixed: 2219667
2018-04-14 07:37:45 -07:00
Shashikala Prabhu
7edbb05f11 qcacmn: Temporary WAR to bypass beacon channel mismatch check
For 4.9GHz, firmware converts the frequency to old regulatory channel
numbers and sends it to host. But host uses new regulatory channel numbers.
Since the received fw channel and beacon channel number is different,
host drops the received beacon and scan entry doesnot get updated.

As a temporary fix, bypass the beacon mismatch check in host.

Change-Id: Ib3e6b7b39ef2feaa1bcf0e0b16a702caccbf6744
2018-04-13 14:51:34 -07:00
Shashikala Prabhu
48ecda84bf qcacmn: Fix 4.9GHz cfg80211 issues
Send correct channel list to Firmware. When cfg80211 is enabled, STA
is scanning in a set of wrong channels. When scan callback happens
from cfg80211 module the cfg80211 module gives us the channel numbers.
There are some channel numbers which are same in both 5GHz and in
2.4Ghz bands. For example, channel number 1 maps to frequency 4942MHz
in 5GHz band, but in 2.4GHz band channel number 1 maps to frequency
2412MHz. So cfg80211 may give us a wrong channel number. Since we have
the exact frequency of the channel we should use that instead of the
one given by cfg80211.
The channel object given to the driver by cfg80211 during scan callback
is the same as the one registered to cfg80211 by the driver. So we can
use the channel frequency inside the channel object for scan which is
not changed by the cfg80211 module.

Use regdb function to convert channel number to frequency while receiving
scan entries from FW. Use pdev band (5/2.4GHz) information to map to
correct 2.4Ghz/5Ghz channel frequency.

Half/Quarter rate flags in the scan_ctrl_flags are not set. Set
Half/Quarter rate flags in scan_ctrl_flags.

Change-Id: I9df8f0e90938f86f6987574f8259a5cf66b672aa
CRs-Fixed: 2180273
2018-04-13 14:51:30 -07:00
Om Prakash Tripathi
8a4564f221 qcacmn: Add support to restrict scan to preconfigured chans
Some times we need to scan only some pre configured
channels irrespective of channels requested in scan
start command.
Add support for pre specified list of scan channels
and scan only these channels if configured.

Change-Id: I7fa9ef9d626fd25d7855a7eb458818d8e2314fa5
CRs-Fixed: 2218494
2018-04-11 09:15:18 -07:00
Sandeep Puligilla
e062e82352 qcacmn: Never ageout connected AP scan entry
Connected AP scan entry is aged out if beacon
is not recieved within scan age out time.

Update mlme information of the connected AP/BSSID
scan entry so that scan age out hanlder will not
age it out even though the last beacon recieved
time is greater than the configured scan age out value.

Change-Id: I14c68c28459080623ca62c0bad9052e38d7fb348
CRs-Fixed: 2183379
2018-03-28 06:26:51 -07:00
Om Prakash Tripathi
581297b4d9 qcacmn: Fix null pointer dereference in scan
Make sure passed pointer is non null before accessing it.

Change-Id: I62fd051f13265070954d1e6ae7d9e9ea7efe3ba3
CRs-Fixed: 2212629
2018-03-26 16:32:26 -07:00
gaurank kathpalia
74f2a30e7d qcacmn: Modify dwell time and DBS scan based on scan request
Based on the scan request flags from kernel, modify the
adaptive dwell time and DBS scan request policy.
In high accuracy mode, disable DBS scan and adaptive dwell
time scan mode.
In a low power/span mode, enable aggressive adaptive dwell time
and DBS scan to save power and time.

Change-Id: I23498799c05a252cbc9c9f6d50b847130dd0ceac
CRs-Fixed: 2197171
2018-03-24 02:51:22 -07: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
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
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
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
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
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
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
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
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
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
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
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
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
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
Manjeet Singh
c73cd7db11 qcacmn: Follow spec for NL80211_CMD_START_SCHED_SCAN
qcacld-2.0 to qca-wifi-host-cmn propagation

If no SSID are passed to NL80211_CMD_START_SCHED_SCAN cmd,
interface spec requires that an active scan is not needed.
Therefore a passive scan is now requested by cfg80211_sched_scan_request
for this case.

Change-Id: I1b1b9232ffb9d8d5c0bc9a1d75145d39c9fe9e6b
CRs-Fixed: 902092
2017-10-12 14:22:11 -07:00
Abhishek Singh
b80af7e971 qcacmn: Select best candidate at first connection
Best candidate at first connection is a mechanism
to select best possible candidate for making Wi-Fi
connection based on the scan results provided.
Driver use Scan results to calculate score for each
BSS and select the best candidate to connect.

This enhances the user experience by connection
to better AP, based on certain parameters.

Change-Id: Iebb4ce009b23cae8ad7cbff83628e01633bbf3fe
CRs-Fixed: 2018585
2017-10-03 05:36:13 -07:00
Varun Reddy Yeturu
f56e59833c qcacmn: Configure MAWC NLO parameters from host to firmware
Get the MAWC based NLO parameters from HDD/UMAC and pass them to
firmware via target/if

Change-Id: I76d7c8677ee73f9a3c54b7af4943b74a6b23323d
CRs-Fixed: 2064837
2017-09-18 19:38:22 -07:00
Om Prakash Tripathi
1d1525db36 qcacmn: Add API to check if scan entry is from hidden AP
Add API to check if scan entry is for a hidden AP.

Change-Id: I51115eb1601754d3d920029687ab6211b351c48a
CRs-Fixed: 2106447
2017-09-18 03:31:37 -07:00
Sreelakshmi Konamki
77dd1efb64 qcacmn: Add support for PNO scan in connected state
qcacld-2.0 to qcacmn propagation

Add changes to support PNO scan in connected state to find better Ap's
based on rssi threshold, band and rssi preference.

Change-Id: I0744297cc5269f0fe37613247c911102e293d8e9
CRs-Fixed: 2000342
2017-09-08 15:46:55 -07:00
Sathish Kumar
7f9408bacc qcacmn: Add timestamp param and enable foreign channel exit in scan event
Add timestamp parameter in scan event received from FW to aid
in calculating dwell time and overall channel switch time in
off-channel operations.

Enable foreign channel exit event inorder to be notified
by FW through the scan event.

Change-Id: I4ba028756ee7db35f6528c0554b09c73087184a7
CRs-Fixed: 2056330
2017-08-31 00:20:20 -07:00
Vishwajith Upendra
e098ebd3e0 qcacmn: FILS changes for scan path
Add changes to match FILS realm info present in FILS indication IE
with the connection info.

Change-Id: I1ed6081f3320ecee8f86f7d87597b343230923b3
CRs-Fixed: 2093637
2017-08-29 20:54:08 -07:00
Varun Reddy Yeturu
34a374603c qcacmn: Configure MAWC NLO parameters to the firmware
Get the MAWC based NLO parameters from HDD/WMA and pass them
to firmware

Change-Id: I16ce12d36df7f3ccab4db32b4d7f72a0f9762795
CRs-Fixed: 2064837
2017-08-25 18:46:30 -07:00
Rajeev Kumar Sirasanagandla
a3f4a29130 qcacmn: Add support to include selective scan IEs only
qcacld-2.0 to qcacmn propagation

Add support to include only selective IEs in probe requests in
order to improve user's privacy.

Change-Id: I59cf4181f60f5b4cd87a32fbcf29160d87ca59c8
CRs-Fixed: 1105495
2017-08-19 01:27:07 -07:00
Rajeev Kumar Sirasanagandla
d8d18f187a qcacmn: Add support to randomize probe req SA and Seq number
qcacld-2.0 to qcacmn propagation

Randomize probe request's source address and sequence number to
improve user's privacy.

Change-Id: I265f15476f1a23a268f159a44b6a3e4243fb9068
CRs-Fixed: 1105081
2017-08-14 20:07:22 -07:00
Om Prakash Tripathi
c3fcb680f1 qcacmn: Add support to update mlme info in scan db
Add missing support to update mlme related info in scan db

Change-Id: Ib69a07012536b9b423992f5f4199925febabcb91
CRs-Fixed: 2086351
2017-08-11 06:40:07 -07:00
Kapil Gupta
de02d4f62b qcacmn: FILS indication IE changes
Add changes to add FILS indication info element in scan result.

Change-Id: I341c30fe23ac8bfe518752d783d23094cbc2ac98
CRs-Fixed: 2068436
2017-07-18 23:35:06 -07:00
Nitesh Shah
b256bb0e81 qcacmn: Add support to send DBS Scan command to firmware
This change adds support to send the DBS Scan command to
the firmware.

Change-Id: I147855690f09af03a43f85f2e57626d7f73998de
CRs-Fixed: 2029402
2017-06-14 08:23:51 -07:00
Dustin Brown
f3351d97d7 qcacmn: Expose scan_backoff_multiplier for NLO/PNO
For Network Listen Offload and Perfered Network Offload, the fast scan
period is multiplied by scan_backoff_multiplier after max cycles have
occurred. Expose scan_backoff_multiplier to consumers of the WMI API,
so this parameter can be configured.

Change-Id: I478fb61cd096d3496205f4ff556e180dabf99b77
CRs-Fixed: 2035201
2017-06-09 21:36:26 -07:00
Sandeep Puligilla
d9ac9a2abe qcacmn: Increase scan cancel sync time
Scan command timeout value is 30secs and scan
cancel sync waiting time is 5sec due to this
in failure scenario scan timeout callback is
getting triggered very late and causing crash
in HDD.

Increase scan cancel sync timeout value equal to
scan command timeout value.

Change-Id: I7b98d26ac5d97039714a431030e47c463d3a670e
CRs-Fixed: 2048167
2017-06-06 10:26:18 -07:00
Abhishek Singh
9f6058d24d qcacmn: Add support for PMO suspend and resume scan API
Register PMO suspend and resume scan API. In suspend API, abort
all pending scans.

Change-Id: Iec03383a958f1bf93d77a86c351532270c7fdcb8
CRs-Fixed: 2038163
2017-05-19 13:51:42 -07:00