Commit Graph

52 Commits

Author SHA1 Message Date
Arif Hussain
083d9da267 qcacmn: Add kernel backport versions
Add kernel backport versions for below kernel flag
- CFG80211_REPORT_BETTER_BSS_IN_SCHED_SCAN

Change-Id: Ie89b8c639070ffe25c4410088c0e154801f5f07d
CRs-Fixed: 2232251
2018-05-01 21:37:31 -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
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
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
Om Prakash Tripathi
8a54599b3a qcacmn: put bss reference taken in cfg80211_inform_bss_frame
cfg80211_inform_bss_frame_data() takes an extra reference of
bss and it shall be freed by caller.

Change-Id: I6e2a37327fc369d01d237e7ff57221333709b53f
CRs-Fixed: 2205608
2018-03-21 03:39:31 -07:00
Soumya Bhat
8b2a535e7a qcacmn: Extend cfg80211 scan cleanup API to support netdev level cleanup
In existing code scan queue cleanup is done during radio detach,
leading to access of freed vdev netdev.

Extend cfg80211 scan cleanup API to support netdev level cleanup.

Change-Id: Ice6b6d262788e71c6d229ed7de6ab0e17f270b6c
CRs-Fixed: 2185302
2018-03-05 04:28:19 -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
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
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
Jiachao Wu
a00b71b980 qcacmn: Use after free when clean up scan queue
When invoked wlan_cfg80211_cleanup_scan_queue, it will try to clean
up pending scan requests in queue from kernel. However, when the
netdevice is down, this request could be already freed by kernel.
To fix this issue, also add the pointer to netdevice in scan_req
so what we can check the status of netdevice in scan_req instead
of cfg80211_scan_request which might already be freed for this case.

Change-Id: I6189c52b638bc4f408e4d4c694c178c7d2f3de52
CRs-Fixed: 2164404
2018-01-14 21:27:44 -08:00
Sandeep Puligilla
4bd7f8c513 qcacmn: Clear the scan list before destroy
cfg80211 scan list is not empty during the
scan priv deinit/list destroy because of that
qdf mem module triggered an assert.

Clear the cfg80211 scan list before
destroying the list.

Change-Id: I391d3b91869d085ec6ff405b7ddca37d7002e5ca
CRs-Fixed: 2136702
2017-11-15 23:37:06 -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
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
Yue Ma
04dfab5ac6 qcacmn: Add API to init scan runtime suspend lock
Commit fb9d5acfed and 645749571d introduce an API to deinit scan
runtime suspend lock in order to fix a memory leak issue. However,
it breaks SSR because scan lock init and deinit are not matching
during SSR which results double free happens in the rmmod after
SSR. Add the API to init scan runtime suspend lock so that it can
be added in the correct place during SSR.

Change-Id: Ied85b16b199fdbf43fef4c966bed56c9f7bb0e86
CRs-fixed: 2120661
2017-10-12 14:21:48 -07:00
Jeff Johnson
6a1a0dafb4 qcacmn: os_if: Replace instances of unadorned %p
Replace instances of unadorned %p in os_if.

Change-Id: Iddbd3deb6562e462358ed7bd0f51b18a027eee5a
CRs-Fixed: 2111274
2017-10-03 16:02:35 -07:00
yeshwanth sriram guntuka
074f5e91b8 qcacmn: Send default ies in scan request to fw
On framework initiated scan, ies are not sent in
scan request from upper layer and default scan ies are
not sent as part of scan request sent to firmware. This
results in not including oce ie in probe requests for
framework initated scans

Fix is to copy default ies to ie field in scan request
sent to firmware.

Change-Id: I895563bafc2a2b6e483d08cb28ee44ad34f5af70
CRs-Fixed: 2087124
2017-09-21 23:30:19 -07:00
Dustin Brown
bbc972659d qcacmn: Remove name indirection for ieee80211_get_channel()
Versions 4.11+ of the Linux kernel removed '__' from the beginning of
ieee80211_get_channel(). Migrate all calls from __ieee80211_get_channel
to ieee80211_get_channel instead.

Change-Id: I0548259beb59f0a3cb27fe6fee1dd9626cc624cc
CRs-Fixed: 2098795
2017-09-18 12:21:19 -07:00
Dustin Brown
9feb201862 qcacmn: Fix compile error for cfg80211_sched_scan_results()
The 4.12 Linux kernel adds a request id parameter to
cfg80211_sched_scan_results(). Add conditional compilation to provide
the correct parameters based on the kernel version.

Change-Id: I2008895e390af88af0b22df6bfd7ef753d25b419
CRs-Fixed: 2092073
2017-09-18 12:21:05 -07:00
Dustin Brown
1b57dba257 qcacmn: Add wrapper for nla_parse()
The Linux kernel version 4.12 introduced an API change to nla_parse().
Add conditional compilation to call nla_parse with the correct
parameters based on the version of the linux kernel being compiled
against.

Change-Id: Ie904d217a42a2396f8245251a9c90a15dac2c0c9
CRs-Fixed: 2093354
2017-09-15 15:26:31 -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
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
Prashanth Bhatta
65b0eaa24b qcacmn: Change semantics of Runtime Lock APIs
Runtime PM lock init API right now returns pointer to a context
but this would cause confusion to the caller if feature is not
defined and dummy function return NULL as caller can't find real
failure versus dummy function returning because feature not being
enabled.

Fix declaring a data structure in QDF layer that caller can use
but it hides the internal details of HIF implementation for
Runtime PM locks.

CRs-fixed: 1116509
Change-Id: I4dcba604e803faa0e14fac6403610391895e382e
2017-08-15 13: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
Vivek
b02a649f89 qcacmn: Remove vdev/peer locks for trivial APIs
Remove vdev/peer locks from trivial API's. This follows the changes from
which the lock requirement from few simple APIs are removed.

Change-Id: I9972d51dfd1a42bdedbfd0fd4e67af03d030a1f5
CRs-Fixed: 2060880
2017-06-26 23:32:22 -07:00
Vivek
5ec0bd3636 qcacmn: Remove psoc/pdev locks for trivial APIs
Remove psoc/pdev locks from trivial API's. This follows the changes from
which the lock requirement from few simple APIs are removed.

Change-Id: Ib5769c2234c8d57f485c0eef5a4e3c61fa170508
CRs-Fixed: 2060880
2017-06-26 23:32:19 -07:00
Jeff Johnson
f155c675e5 qcacmn: Validate vendor abort scan command
In wlan_vendor_abort_scan(), nla_parse() is invoked without specifying
a policy. This can result in a buffer overread when processing the
QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE attribute. To avoid this issue
introduce a "scan_policy" (replicated from qcacld-3.0) and use this
policy when invoking nla_parse().

Change-Id: Ia3e5cb7535bf0f700399e4a49c9c5da362a3ccf6
CRs-Fixed: 2059857
2017-06-26 11:07:16 -07:00
Ajit Pal Singh
890fc8d420 qcacmn: Filter sched_scan channels when DNBS set
Filter channels passed to firmware for scheduled/offloaded scans,
when Do_Not_Break_Stream is set.

Change-Id: I36d434b9f7c25ff7de5ccb4d20a2ae41b2712662
CRs-Fixed: 2064380
2017-06-22 09:51:07 -07:00
Abhishek Singh
fb9d5acfed qcacmn: Add API to deint scan runtime suspend lock
Add API to deint scan runtime suspend lock, which can be called
before HIF is closed, to avoid crash while acessing HIF pointer.

Change-Id: Ida9269cdaea33a387e2acd1e3d9670d152b6016f
CRs-Fixed: 2065228
2017-06-22 06:35:01 -07:00
Sandeep Puligilla
0014f6238e qcacmn: Add validation check at NL scan event callback
Scan event is updated to NL on a closed
wireless dev.

Add validation check at scan event callback
before updating the scan events to NL.

Change-Id: I979b53ecb481007f663feb927b6e3e96cf73616b
CRs-Fixed: 2057127
2017-06-16 07:33:35 -07:00
Sandeep Puligilla
15677ec859 qcacmn: Add protection to access scan queue
scan request queue is accessed in multiple
process contexts so added mutex to scan request
queue. Scan request mutex needs to be acquired
before accessing the scan request queue.

Change-Id: I3f0fe0513d5846f4eaf313848f00f86d29a66e35
CRs-Fixed: 2057127
2017-06-16 07:33:34 -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
Ajit Pal Singh
7c24ceadfb qcacmn: Fill the frequencies in the SCAN req correctly
Out of the list of scan channels passed by the application,
if the driver skips some channels, then the frequency list sent to
firmware was not correctly filled.
For example if supplicant passes channels 1, 6, 11 and we want to skip
1 and 6, then "req->scan_req.chan_list[0] = 0,
req->scan_req.chan_list[1] = 0 and req->scan_req.chan_list[2] = 11".
It should have been "req->scan_req.chan_list[0] = 11"
Fixes the same.

Change-Id: Idcef090169b8848c2576e620aa0fbe93918c219c
CRs-fixed: 2053866
2017-06-05 11:41:38 -07:00
yeshwanth sriram guntuka
7375b0b3f5 qcacmn: Do not flush scan results for sched scan
Scan results are flushed as part of sched scan start
which could result in subsequent connect to fail as
bss is removed from scan list.

Fix is to not flush scan results as part of sched
scan start.

Change-Id: I0cbc0fb707db0be4890b840b72c8126a7c5ff54b
CRs-Fixed: 2045834
2017-05-29 05:01:17 -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
Abhishek Singh
ac80309005 qcacmn: Add runtime suspend logic for scan
Add runtime suspend logic for scan, to block runtime suspend when
scan is started and unblock when scan is completed.

Change-Id: I61c9afaf996d1ac97bfb5ffb0cd8a3abc971051e
CRs-Fixed: 2035675
2017-05-11 06:25:40 -07:00
Abhishek Singh
f95b9e4248 qcacmn: Add wait for cancel scan on pdev and vdev
Add cancel scan sync api which will wait for scan to be aborted on
pdev or vdev.

Change-Id: Ie02eb981154856cda38ef70f42fdfcf82bb88961
CRs-Fixed: 2038092
2017-05-11 02:13:25 -07:00
Ajit Pal Singh
2563e838ea qcacmn: Use macro WLAN_POLICY_MGR_ENABLE around policy_mgr API usage
Policy manager API usage in common scan module should be enclosed in
macro WLAN_POLICY_MGR_ENABLE, so that it can be optionally used along
with policy manager.

Change-Id: I76602657b4945a973f30d6b129a6b3896b9fdf9e
CRs-Fixed: 2042734
2017-05-08 14:58:59 -07:00
Om Prakash Tripathi
7d867d6729 qcacmn: cfg80211 scan change for WIN
Change-Id: I2d2863c7193de8e79c7ff76039f9b64ecaf90100
CRs-Fixed: 2001106
2017-04-28 03:43:53 -07:00
Ajit Pal Singh
ec973b0aa7 qcacmn: Add API to check Do Not Break Stream eligibility
1) Adds new policy mgr API 'policy_mgr_is_chan_ok_for_dnbs' to check
if a channel is OK for "Do Not Break Stream".
It means that if Do_Not_Switch_Channel is set for AP/GO vdev,
the channel passed should be either the AP/GO channel or a channel
from the other band.
2) Adds a new function policy_mgr_get_mode_specific_conn_info() to get
the mode specific connection count.

Change-Id: I4da6f7d56d01b01761a5f3557b8acbb84226a6fd
CRs-Fixed: 2037302
2017-04-28 01:18:55 -07:00
Arif Hussain
d6b243219d qcacmn: Fix compilation with scheduled scan start delay
cfg80211_sched_scan_request start delay is added from
KERNEL_VERSION 4.4, and schedule scan plans is backported but
not the start delay.

This change is to make sure start delay accessed from request
only for KERNEL_VERSION 4.4 to avoid compilation issues with
CFG80211_MULTI_SCAN_PLAN_BACKPORT.

Change-Id: I3469ef457bb1f97fdddfb7491fbcaa2e64a16e8a
CRs-Fixed: 2038458
2017-04-26 15:11:45 -07:00
Sandeep Puligilla
ea68a2c6f2 qcacmn: Deinitialize the pdev scan private member
Added api to support the deinitialization of pdev scan
private member

Change-Id: Id887eab16f195fc5052f30900451625a586ed9fa
CRs-Fixed: 2033622
2017-04-14 15:06:52 -07:00
Abhishek Singh
5468c57437 qcacmn: Register PNO callback only when PNO req is sent
PNO can be initiated from IOCTL with different calback and
thus register the callback while sending the PNO req.

Change-Id: I74109fc88cfbd082ce2ba5ca0a2396ab08b82b42
CRs-Fixed: 2032434
2017-04-13 16:27:01 -07:00
Wu Gao
5126329e8c qcacmn: support dequeue and start failed event for scan from STA
It doesn't process scan dequeue and start failed event, which cause
STA scan doesn't complete and blocking next scan work in
wpa_supplicant. For scan dequeue and start failed event with match
reason, indicate scan aborted to up layer.

Change-Id: I8861e277143116878f6714e50b600d77df69eeb1
CRs-Fixed: 2029955
2017-04-11 11:45:13 -07:00
Abhishek Singh
8c6e82d763 qcacmn: Add PNO changes for converged scan
Adds PNO related changes for converged scan

Change-Id: Ia18e48645d511134698777b334348d68daf2dbee
CRs-Fixed: 1095299
2017-04-11 11:04:33 -07:00
Abhishek Singh
673bd512f3 qcacmn: Fix QDF assert in wlan_abort_scan if vdev is NULL
If vdev is NULL calling calling wlan_objmgr_vdev_release_ref
cause assert.

To fix avoid calling wlan_objmgr_vdev_release_ref if vdev is NULL.

Change-Id: I8bd40ac27a6733177ac55c791c7c3ddfe5bbba30
CRs-Fixed: 1095299
2017-03-15 04:26:40 -07:00
Abhishek Singh
f9297e523b qcacmn: Add changes in scan req to support P2P search scan
Add changes to support P2P search using new scan module.
To support p2p search added vdev id and Broadcast mac address
in scan req also enable flags depending on scan req type.

Change-Id: I597f9f353da1b8b129f0ee16cd8eb7b7bbad2625
CRs-Fixed: 1095299
2017-03-10 04:27:24 -08:00
Abhishek Singh
54c28ccd14 qcacmn: Add vdev in abort scan request
Abort scan req requires vdev pointer to remove the cmd from
serialization. Thus add the vdev pointer in the abort scan req.
If vdev id is invalid to abort all scan on a pdev use the first
vdev of the pdev.

Change-Id: I4462ceb24084e68dfc6b20f5b69d050c0daff2d1
CRs-Fixed: 1095299
2017-03-07 10:49:45 -08:00
Abhishek Singh
483d914ab7 qcacmn: Improve logging in scan done callback and BSS ageout
Improve logging in cfg80211 scan done callback, by decreasing the
log level to info from error and printing only the scan complete
events.
Also print a log when BSS is aged out.

Change-Id: If2734df1168bd354415305211b50f6c79bee2df0
CRs-Fixed: 1095299
2017-03-07 10:49:44 -08:00
Sandeep Puligilla
7acd31fa33 qcacmn: Add cfg80211 scan start and stop command
Add cfg80211 scan start and scan stop commands.

Change-Id: I20b6c7743496ae82cc3a93befb5b68812047ec1a
CRs-Fixed: 1095299
2017-03-02 16:11:46 +05:30