Commit Graph

314 Commits

Author SHA1 Message Date
Arif Hussain
4c6f33a07e qcacmn: Add 2G channel active dwell time CFG/INI items
Add ini item to configure active dwell time of 2.4GHz band channels,
This will help to reduce AP search failure probability & hence
connection latency in 2.4GHz band channels especially in noisy
condition by increasing active dwell time.

Change-Id: I05259a8f1fd4a5c67da42e516721a01d32fa652e
CRs-Fixed: 2283692
2018-07-27 01:21:39 -07:00
Yeshwanth Sriram Guntuka
dad6b5beb3 qcacmn: Change log levels in scan component
Change log level for few scm and cfg80211 logs from info
to debug.

Change-Id: I595ddd54c51a601fa2e985c8a221c5dea2e698d8
CRs-Fixed: 2279511
2018-07-21 12:05:49 -07:00
Basamma Yakkanahalli
ab48ce3502 qcacmn: Fix connection issue with hidden ssid in DFS channel
Repeater AP failed to associate to Root AP with
hidden ssid in DFS channel.

Normally probe request is sent in passive channels if beacon
from AP is found. With strict passive scan, probe request is
not sent in passive channels even after beacon is found in that
channel.

If AP is configured in hidden ssid, Client/STA does not get the
Probe Response and thus, no SSID information is present in the
scan table to start authentication.

To overcome this, user needs to set the desired {BSSID, SSID} pair,
Example: Desired pair = {00:03:7F:AA:BB:CC, MOON1},
so that when driver receives a beacon it compares the
BSSID and updates the SSID field to update the scan table.

In general, we already set the ssid in sta configuration
But in this case, we also need to configure BSSID of the hidden AP.
This can be configured through iwpriv cmd.
Example: iwpriv athx conf_bssid 11:03:7F:46:03:17

Change-Id: I03e1efed1168c911fc8f6358d6ad8a8c0b40ba61
CRs-Fixed: 2274105
2018-07-20 09:31:14 -07:00
Abhiram Jogadenu
c7f6224588 qcacmn: Host changes to enable Scan Offset time
Pass offset value to the Firmware to support split scanning
of total dwell time in smaller chunks. Offset passed is
calculated from TBTT.

Change-Id: I8114acd1147d468aa6471f672307d8ea0ec8611d
CRs-Fixed: 2134748
2018-07-19 04:29:32 -07:00
Sandeep Puligilla
13699a1bd8 qcacmn: Add CFG items to scan component
Add following CFG/INI items to scan component(part-2)
CFG_SCAN_NUM_PROBES
CFG_SCAN_PROBE_REPEAT_TIME
CFG_ADAPTIVE_SCAN_DWELL_MODE
CFG_IS_BSSID_HINT_PRIORITY

Change-Id: Ib355d898260c660cd07103390adbfef921599c3d
CRs-Fixed: 2277184
2018-07-18 19:07:16 -07:00
Sandeep Puligilla
ba6526d5a5 qcacmn: Add CFG/INI items to scan component
Add following scan CFG items to common scan component

1.CFG_ACTIVE_MAX_CHANNEL_TIME:Max active dwell time
2.CFG_PASSIVE_MAX_CHANNEL_TIME:Max passive dwell time

Change-Id: I3aeed28a404984812ebbc56f2a8d28e7e9ab7de2
CRs-Fixed: 2277105
2018-07-17 22:44:24 -07:00
Nirav Shah
a175314c51 qcacmn: Map all module logs to per-level log APIs
Map all module level log APIs to per-level log APIs
to compile out specific log level if required.

Change-Id: I4072b6740cb43200fd95c40943b66e1d5f8f1847
CRs-Fixed: 2266719
2018-07-13 10:36:22 -07:00
Rathees kumar Chinannan
b8f2d083bd qcacmn: Add support to extract Extender IE in beacon
Added support to extract extender IE in beacon receive.

Change-Id: I04ee63a6c1280e2e3858eb665c549de800d672f4
CRs-Fixed: 2258771
2018-07-10 15:40:06 -07:00
gaurank kathpalia
cb5ce20e28 qcacmn: Remove DBS logic from scm_calculate_nss_score
Driver calculates nss score for BSS, depending upon the
current DBS status. Thus it does not give more preference
to 2x2 and considers it the same as 1x1.
But the DBS condition can change and driver
can move to single mac.

Fix to give more preference to 2x2 BSS so that
better throughput can be achieved in single mac.

Change-Id: Ib684abe423fd21a81cb13db5f741fdfbb750328d
CRs-Fixed: 2271976
2018-07-04 00:57:47 -07:00
Abhinav Kumar
bfbf4422a7 qcacmn: Fix qbss calculation in case of good RSSI threshold
Currently, when Current RSSI is better than good RSSI threshold
first driver calculates qbss percentage and set qbss score accordingly
and when current RSSI is weaker than or equal to good RSSI threshold
(-70dBm) driver directly sets 10% as qbss score. But as per requirement
Driver should calulate qbss percentage in order to set qbss score for
RSSI = -70db

Fix is to allow driver to ignore qbss percentag calculation only
when current RSSI is less than good RSSI threshold.

Change-Id: I1be2ab71016d779a60d21923a34340ae19d6c7f5
CRs-Fixed: 2261635
2018-07-02 16:08:58 -07:00
Jingxiang Ge
c5f0bd188c qcacmn: Bypass QBSS IE length check
Some old ap's QBSS IE length is 4Bytes, in latest 802.11e
spec, the expected length is 5Bytes.

If stop parsing beacon&probe with 4Bytes QBSS IE, DUT can't
scan and connect with AP, so change it to bypass QBSS IE
if AP uses the old format.

Change-Id: Ib6727f5f77c5e5543e862277e1d2d35273f62d59
CRs-Fixed: 2257707
2018-06-28 04:51:53 -07:00
Krunal Soni
3bdf380c03 qcacmn: Don't process scan command when vdev delete is in process
When driver performs vdev delete operation, it changes vdev state
to logically deleted or physically deleted only after receiving vdev
delete command's response from FW. In between (sending vdev del req
and receiving vdev del rsp) if thread gets pre-empted and other thread
start posting command (like scan command) to process then it could
lead to use after free scenario.

Notify scan component when vdev delete is intiated and let scan
component record that in to vdev's scan private object as one of the
flags.

check this flag before processing the scan command.

CRs-Fixed: 2261704
Change-Id: Id884d6c42cd8766e70835808863632e096158487
2018-06-27 16:14:24 -07:00
wadesong
d58eaf419e qcacmn: Fix incorrect indention
Fix the incorrect indention in function
util_scan_populate_bcn_ie_list, which causes newer versions of
gcc complaining.

Change-Id: I2ea0f2ea5bf3e381a789ae832f56a43d511e898e
CRs-Fixed: 2247021
2018-06-15 21:31:21 -07:00
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
Nachiket Kukade
49f9618acc qcacmn: Allow broadcast probe req for p2p scan with empty SSID
In case where driver receives a scan request with a single SSID with
an empty string, it must be treated as an active scan with broadcast
probe requests. In case of p2p search, driver treats this as a passive
scan. With this the P2P Client fails to detect existing P2P GO or
Autonomous GO devices, leading to connection failure.

Set flag WMI_SCAN_ADD_BCAST_PROBE_REQ for this type of p2p scan req.
P2P GO devices will respond to probe requests with wildcard SSID
and Cli will be able to connect to them.

Change-Id: Iacb44fb0cb5363f5af6cf7f6efb219857a799075
CRs-Fixed: 2235604
2018-06-14 11:47:05 -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
Sandeep Puligilla
719f933642 qcacmn: Remove scan event log
Duplicate information is logged
while processing scan event.

Removed the duplicate log from scan
event handler API.

Change-Id: I3d58e594c683875fa82349d47103cc1de67ae18a
CRs-Fixed: 2255904
2018-06-13 14:11:03 -07:00
Wu Gao
dd58f63b13 qcacmn: pmo feature flag disable
In case PMO feature flag disable, add this change. Change
WLAN_PMO_ENABLE  to WLAN_POWER_MANAGEMENT_OFFLOAD.

Change-Id: I875e568dcb239da1b86d1a76cb8cbc925bb13cde
CRs-Fixed: 2243948
2018-06-08 08:31:10 -07:00
Dustin Brown
03f2ec07f7 qcacmn: Use configured value for channel_prediction
The scan component is currently using an unrelated field to populate
the PNO channel prediction enabled field sent to firmware. Use
channel_prediction instead.

Change-Id: I88b066c1b61e7ce49fcee889dfed9b1208d2862f
CRs-Fixed: 2252153
2018-06-06 20:28:36 -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
Min Liu
f0f7310142 qcacmn: Potential memory leak in scan manager
When the scan start message in scheduler message queue is
flushed in scm_scan_start_flush_callback, no scan complete
event will be sent. It will lead to vendor scan request is
not free and end up with memory leak eventually.

Change-Id: Iba748adddff6264b04a63fe82c4b0e2f0ffc2a4b
CRs-Fixed: 2243835
2018-05-28 16:48:11 -07:00
Paul Zhang
8e04fa7fce qcacmn: Remove the 11d error log
The unnecessary and iterative log may cause unexpected
issue. So remove it.

Change-Id: If164c48bee2ba221cf05c47ca5e186541b798758
CRs-Fixed: 2231615
2018-05-23 20:45:41 -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
Sandeep Puligilla
593c110239 qcacmn: Scan duration is longer
Default scan type is configured as non-dbs
mode because of that scan is taking longer
duration to complete.

Modified default scan type to DBS.

Change-Id: I7f274ea34780b196fa0269968cb8ad76ee239c9f
CRs-Fixed: 2239341
2018-05-18 16:47:12 -07:00
Jeff Johnson
2b2ed37d86 qcacmn: Fix typo "doesnt"
Replace typo "doesnt" with correct spelling "doesn't".

Change-Id: I10c7e288056ca296d4e69ec7ad47404482cbf6f3
CRs-Fixed: 2238309
2018-05-17 00:47:39 -07:00
Sandeep Puligilla
008d66251d qcacmn: Add NULL validation check in tgt_scan_cancel() API
Add NULL validation check for psoc, pdev, vdev object pointers
in tgt_scan_cancel() API

Change-Id: I7853d8bba439d40a1413b951d8aa799c932b887c
CRs-Fixed: 2232802
2018-05-12 06:28:12 -07:00
Sandeep Puligilla
e4430b559d qcacmn: Add NULL validation check in tgt_scan_start() API
Add NULL validation check for psoc, pdev, vdev object pointers
in tgt_scan_start() API.

Change-Id: Ia5b6e5de26e4ad3386fbcef2fa1a5abb52198a1b
CRs-Fixed: 2232783
2018-05-11 22:40:11 -07:00
Sandeep Puligilla
659fecb9fc qcacmn: Dereference vdev object only after validation check
Dereference vdev object only after validation check to
avoid null pointer derefernce in ucfg_scan_get_pno_def_params()
API.

Change-Id: I88e9a206ef0a948c4b2e35b05ffd74aee82e2961
CRs-Fixed: 2232809
2018-05-11 13:23:05 -07:00
Krunal Soni
acd250c4af qcacmn: Add NULL pointer check in tgt_scan_pno_stop() API
Add NULL pointer check in tgt_scan_pno_stop() API.

CRs-Fixed: 2232787
Change-Id: I9b3c88af8d4d719a4a6fe097e7994ecd4bbddcbd
2018-05-07 06:37:02 -07:00
Krunal Soni
c61d48d886 qcacmn: Add NULL pointer check in tgt_scan_pno_start() API
Add NULL pointer check in tgt_scan_pno_start() API.

CRs-Fixed: 2232784
Change-Id: Ie63ac4eea9d45e9bf8ea305fd26abed1361a03f8
2018-05-07 06:36:59 -07:00
Om Prakash Tripathi
8e9beaef6b qcacmn: Change IE parse failure prints to debug level
In some environments its found that IE's received are not
as expected and console gets flooded with pare failure prints.
Move these prints to debug level.

Change-Id: Ic25bdff65f340f47179a7ac6dd79731b80c805ff
CRs-Fixed: 2232553
2018-04-29 23:44:07 -07:00
Vignesh Viswanathan
6ecd284e5a qcacmn: Add handlers for scan queue in scheduler core
Add scheduler message handler function for QDF_MODULE_ID_SCAN queue.

Also post scan beacon/probe frames and scan events to SCAN queue instead
of TARGET_IF queue.

Change-Id: I94e3ea2f0eb5c9592f5cfcd91738778fa65ba815
CRs-Fixed: 2214554
2018-04-23 00:30:55 -07:00
Santosh Anbu
9d32d1dfc5 qcacmn: Move retrieval of wmi_handle to target_if layer
Remove inconsistent API for scan start and stop, where pdev_wmi_handle
is derived from psoc_handle at the WMI layer instead of using
the wmi_handle passed from the above layer i.e target_if

Change-Id: If259260e6f8cf77bf68748a8130db4440b88588a
CRs-Fixed: 2203048
2018-04-15 23:15:26 -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
Zhu Jianmin
832737116d qcacmn: Fix scan db mem leak in race condition
During module stop, scan db is cleared before scheduler thread
stop, new beacon can be handled and scan node still can be added
into scan db after scan db clear in race condition, result in
mem leak.

Fixed by moving scm_db_deinit from ucfg_scan_psoc_disable to
ucfg_scan_psoc_close, which is called after scheduler thread
stop

To be symmetrical, move scm_db_init from ucfg_scan_psoc_enable
to ucfg_scan_psoc_open.

Call stack:

hdd_wlan_stop_modules
 ->hdd_deconfigure_cds
    ->cds_disable
       ->dispatcher_psoc_disable
          ->ucfg_scan_psoc_disable
             ->scm_db_deinit
 ->cds_close
    ->dispatcher_disable
       ->scheduler_disable
    ->dispatcher_psoc_close
       ->ucfg_scan_psoc_close

scheduler_thread
 ->scheduler_thread_process_queues
    ->scheduler_target_if_mq_handler
       ->target_if_msg_handler
          ->scm_handle_bcn_probe
             ->scm_add_update_entry
                ->scm_add_scan_entry

Change-Id: I911751a247ae3ccb489755c30ffbe078a93ca4db
CRs-Fixed: 2205354
2018-04-09 19:24:29 -07:00
Naveen Rawat
4ef4fb339c qcacmn: Process scan event for 11d only if event indicates completion
Process scan event for 11d only if event indicates completion. Else in
case of dequeue due to failure or timeout will also cause scan event
handling for 11d which might have undefined effects.

Change-Id: I9d3599a9c60bccebea8ded9922dd3ddf995d8d61
CRs-Fixed: 2210347
2018-04-08 16:08:51 -07:00
Tushnim Bhattacharyya
f940918d4f qcacmn: Use enum type policy_mgr_con_mode instead of enum QDF_OPMODE
Use enum type policy_mgr_con_mode instead of enum QDF_OPMODE.

Change-Id: Ia7a6bb5e05c6dac650dc6386734462547365a4eb
CRs-Fixed: 2214003
2018-04-02 16:41:50 -07:00
Abhishek Singh
dba772b9c8 qcacmn: Fix OCE WAN scoring logic for initial connection
Set the range of score index to 1-15 as 0 is used for the AP
which does not advertise the OCE WAN. Also if OCE WAN downlink
capability is 0 return 0 score.

Change-Id: I8c6757458c542050a6a31cb03fad0ce17d60aa16
CRs-Fixed: 2208282
2018-04-02 15:22:01 -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
Bala Venkatesh
2438a563c5 qcacmn: Add ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN
Add ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN option for the ini
gDualMacFeatureDisable. To enable DBS support for the
connection and disable DBS support for the scan.

Change-Id: I05c613467195fffac98e79b7e4a2991471ac1d80
CRs-Fixed: 2207820
2018-03-27 00:25:38 -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
Arif Hussain
6fcc790e98 qcacmn: Add correct api call to get proper boot time
Propagation from qcacld-2.0 to qcacmn
Missing changes from Ibcc628c315201fa3ced7e1ad96753772d91707b2

Currently to get clock boottime, qdf_get_monotonic_boottime_ns
api is getting used which does not include the suspend time.
To include the system suspend time also in clock boottime, use
qdf_get_bootbased_boottime_ns api which uses ktime_get_boot_ns
kernel api.

Change-Id: I4a9a783ce0cc164404d89c23d57b02746154aa46
CRs-Fixed: 2203527
2018-03-23 21:38:52 -07:00
Amir Patel
2b2435e564 qcacmn: Avoid memory use after free in scan node delete
Scan node del API is modified to check refcnt before
deleting node. Mark node delete with scan node del before
releasing ref to avoid get ref

Change-Id: I1cde576cd47eb4effe8af38c2d77f02a21349dfb
CRs-Fixed: 2208987
2018-03-21 03:39:33 -07:00
Om Prakash Tripathi
dc56b1e39a qcacmn: Detach scan object on release memory callback
Detach scan start request object from serialization object
on release memory callback. It's requred as some times
serialization ends up calling callback funtcions even after
calling release memory command due to race conditions.

Change-Id: Id0f74032de40bad679c27fe3e5ab1bf83e6dfcf5
CRs-Fixed: 2208227
2018-03-20 05:59:04 -07:00
Abhishek Singh
93809fdc42 qcacmn: Fix band scoring logic for 5Ghz channels
Use proper macro to check if channel is 5Ghz while calculating the
band scoring logic for 5Ghz channels.

Change-Id: Ib394f3ed0db6c64286a44b15c38fa3ffdcf8bdfb
CRs-Fixed: 2205658
2018-03-15 23:35:51 -07:00
Amir Patel
7c1a52ca7a qcacmn: Fix duplicate scan entry visit while iterating scan database
Add an API for inserting new scan node before duplicate node
and modification in API to flush oldest entry in SCAN database.

Change-Id: I76018c994ad16f7fb1e52bceafacd82f78f756e5
CRs-Fixed: 2168481
2018-03-15 08:05:09 -07:00