Commit Graph

116 Commits

Author SHA1 Message Date
Shiva Krishna Pittala
047ac89481 qcacmn: Revert "qcacmn: Spectral init path changes for QCN9224"
As part of Spectral init, the Host sends DMA ring init command to
HALPHY. QCN9224 M2M emulation setups don't have HALPHY subsystem and
the WMI command need to be cleanly stubbed out in emulation FW image.
Until then, revert this Spectral init change.

Change-Id: I88e3e3995ee1b7103a03e4b6a38ff4117044c63c
CRs-Fixed: 3016633
2021-08-20 04:59:14 -07:00
Shiva Krishna Pittala
b33b9d857d qcacmn: Populate Spectral detector list for SBS modes
In SBS modes, there are 3 detectors shared between 2 pdevs that are operate
in 5GHz band. Global number space is used for detectors across these pdevs.
Detector list should be following in SBS modes.
For the pdev that use PHYA0:
   detector 0 for normal mode
   detector 2 for agile mode
For the pdev that use PHYA1:
   detector 1 for normal mode
   detector 2 for agile mode
There is no direct way of knowing which pdevs are using PHYA0 or PHYA1.
We need to look at the phy_id of a given pdev and compare against other
pdevs on the same psoc to figure out whether the given pdev is operating
using PHYA1.  Add the necessary support for the same.

CRs-Fixed: 2993772
Change-Id: I034fe64a7a8988e327a60684a0d008f4b22ef395
2021-08-18 07:34:44 -07:00
Jhalak Naik
d66b7693f1 qcacmn: Add check for per-session detector map validity
The per-session detector map is keyed by detector ID
from the Spectral FFT report and is only valid for one
session, ie. start scan to stop scan.

There is a possibility of receiving FFT report with
an invalid detector ID, for a particular session.
Due to this, invalid detector map information may get
accessed.

Verify that detector ID received in Spectral report is
valid for given spectral scan mode and channel width,
by checking the detector list.
Add a validity flag to the per_session_det_map, and check
whether detector map is valid for the detector ID used to
access it.

CRs-Fixed: 2998410
Change-Id: I1f38ae22b458bb1fea62b99422ec60095071b3c6
2021-08-06 17:05:21 -07:00
Shiva Krishna Pittala
207740adea qcacmn: Spectral init path changes for QCN9224
Pdev init path changes for Spectral module for target QCN9224

Change-Id: I33752f06c64c5bae480afc84386250bd8d66b073
CRs-Fixed: 2992497
2021-07-16 12:13:39 -07:00
Jhalak Naik
06764332ef qcacmn: Initialize Spectral scan detector list
Add sscan_detector_list struct to store the number
of detectors and detector list for a given Spectral
scan mode and channel width, based on the target type.

Initialize this struct during target_if_pdev_spectral_init.

CRs-Fixed: 2961954
Change-Id: Ia920438429579c096349a0170d15e288d46cf9a9
2021-07-10 13:30:43 -07:00
Jhalak Naik
4f386f38ab qcacmn: Fill per-session info for report and detector level
Fill per-session information in per_session_det_map and
per_session_report_info, with per-report and per-detector
level information, respectively.

These intermediate structures help in filling the
SAMP message.

Change-Id: Ib194fde3567ce76710e010febf729746fedf7a2c
CRs-Fixed: 2945297
2021-07-10 13:30:07 -07:00
Basamma Yakkanahalli
00bcc8cbd3 qcacmn: Initial changes for ipq9574 target compilation
Added device ID and target type checks for ipq9574 traget
compilation.

Change-Id: Ie337d1256f828987ed469a609c8fb74de2180dca
2021-06-18 11:07:50 -07:00
Ananya Barat
b76f24187d qcacmn: Do not start Spectral Scan if RCAC is enabled
Agile scans (preCAC/RCAC) use the Agile Engine which is also needed
for the Agile spectral scan. Hence, both cannot run at the same time.

Currently, if Agile preCAC is enabled, Agile spectral scan is not
started. Do not start the spectral scan if either RCAC is enabled or
preCAC is enabled.

Change-Id: I242c28c2c3f8872ceab6314dde80361c283d3ac1
CRs-Fixed: 2922250
2021-04-22 21:59:27 -07:00
Shiva Krishna Pittala
ec05e79403 qcacmn: Print an error message when Agile spectral frequency is 0
When agile spectral frequency is 0 and user tries to start agile spectral
scan, 'A parameter is not initialized' message is thrown from user space
but that message is not enough to identify that agile spectral frequency
is not initialized. To address this, print an error message from driver
when Agile spectral frequency is 0.

CRs-Fixed: 2921000
Change-Id: Ibbb144a57774ad274b31015c7a04aa6097daf09f
2021-04-14 00:52:29 -07:00
Rakshith Suresh Patkar
6fa61a5368 qcacmn: Make agile center freq 0 in stop sscan
In agile spectral scan scenario, if there is a chan switch,
it is possible for the new operating span to overlap with
the agile frequency, which results in erroneous outcome.

Make agile center freq 0 as part of every stop agile
scan. This ensures that a new frequency is mandated
as part of every agile scan.

Change-Id: I4531aa0636a62b918bace66098c2c287e72d55d3
CRs-Fixed: 2910449
2021-04-02 15:03:24 -07:00
Shwetha G K
4ff5e4ef13 qcacmn: change get spectral handle to non-inline
Change the get_target_if_spectral_handle_from_pdev() api to
non-inline for code size reduction.

CRs-Fixed: 2896467
Change-Id: Icb92643a9c0d85a1b4328cd0c516d6d771877a4f
2021-03-22 09:31:56 -07:00
Edayilliam Jayadev
6ed59fa1e3 qcacmn: Initialize agile Spectral capability for legacy targets
TLV targets advertises the agile Spectral capability in the
chain mask table of extended service ready event.
For legacy targets, mac phy capabilities, which holds the
chain mask table is null. This leads to a load time crash
for some legacy platforms. To fix this, initialize
agile Spectral as disabled for the targets which doesn't
support extended service ready message.

CRs-Fixed: 2854348
Change-Id: I09a64259b31e3e5eb0441f35dbb9451dec001780
2021-01-22 05:31:40 -08:00
Pavankumar Nandeshwar
ff041723c7 qcacmn: change qcn9100 to qcn6122 in target_if
Change the name of target type qcn9100
to qcn6122 target_if.

Change-Id: Icfdcd2c8d872b5305687884b7d9186fb85274bd4
CRs-Fixed: 2849577
2021-01-18 21:45:42 -08:00
Edayilliam Jayadev
9b98e19b51 qcacmn: Add Spectral disabled checks in some APIs
Add Spectral feature disable checks in some APIs
used by other modules.

CRs-Fixed: 2845252
Change-Id: I74d66da2aa85ab0f116ad1a6d2e859f3ee8eeeb9
2020-12-30 07:06:41 -08:00
Edayilliam Jayadev
445c0a42c3 qcacmn: Fix return values of Spectral target APIs
Return type of "target_if_is_spectral_active" and
"target_if_is_spectral_enabled" is bool. Wrong return values
are send for this APIs in case of errors.

CRs-Fixed: 2845250
Change-Id: I2344676a1ada51e041bb5f7acac8aa22847bee5c
2020-12-30 07:06:33 -08:00
Edayilliam Jayadev
80a12b81ed qcacmn: Skip init/deinit/config if Spectral is disabled
If Spectral scan is disabled(agile and normal mode disabled)
skip init/deinit of Spectral module. Also avoid user requests
to configure/start/stop scan. If either agile or normal mode
is disabled block user requests for that mode alone.

CRs-Fixed: 2840335
Change-Id: I81148e5580fe4bf991b97cd086c8e3a9ca78e77d
2020-12-30 07:06:29 -08:00
Edayilliam Jayadev
b3affda43a qcacmn: Add APIs to check Spectral feature is disabled
Add utility APIs to check Spectral scan is disabled for
a given pdev/psoc/mode.

CRs-Fixed: 2840317
Change-Id: I6820cfc056c697434a138ddf9d8d93b5796a4722
2020-12-30 07:06:24 -08:00
Edayilliam Jayadev
3e679f9176 qcacmn: Add APIs to init Spectral feature caps in the upper layer
Add APIs to init Spectral feature caps in the upper layer of the
Spectral module.

CRs-Fixed: 2840249
Change-Id: Idfb34a9eec3a66c6d193be7bb828eeec30548ae7
2020-12-30 07:06:20 -08:00
Edayilliam Jayadev
19aaca7ff9 qcacmn: Add target if APIs to initialize spectral feature caps
Add target if APIs to initialize normal and agile Spectral
feature caps for a pdev.

CRs-Fixed: 2840247
Change-Id: I6c5385c2050007a5ff3f668ab3d6176328294549
2020-12-30 07:06:16 -08:00
Edayilliam Jayadev
dac2af9a3b qcacmn: Add APIs to get Spectral scan capability
Add APIs to check the agile and normal Spectral scan
capability of the target. This information is derived from
the advertisements from halphy via WMI events.

CRs-Fixed: 2840227
Change-Id: I2aae79b3342d8d74a1f4c00e813cae843a71106a
2020-12-30 07:06:12 -08:00
Edayilliam Jayadev
b3e677f722 qcacmn: Add WMI API to Spectral module's interface
Add WMI API "wmi_service_enabled" to Spectral module's
interface.

CRs-Fixed: 2840141
Change-Id: I2cb6363fd37c858f2a84ba1904c89033720d1a0a
2020-12-30 07:06:04 -08:00
Shiva Krishna Pittala
8f049e633b qcacmn: Spectral changes to support big-endian Host platforms
WLAN chip components are little-endian based. When such a chip is attached
to a big-endian Host platform, there will be a mismatch in the order of
bytes for the data that is transferred between the Host and target.

Spectral HW module transfers the Spectral report directly to the Host DDR.
This transfer doesn't go through any byte-order conversion at the HW side.
So, to avoid invalid reads at the Host side on a big-endian platform,
convert the Spectral report to the Host byte-order before using it.

Change-Id: I742537f3a95ffca2e12b83535e83e2870ad06b10
CRs-Fixed: 2838371
2020-12-18 13:35:46 -08:00
Rakshith Suresh Patkar
4b8e53fb7a qcacmn: Remove QCN9100 from application of fft bin size adjust
fft bin size adjust parameter is no longer applicable for
QCN9100. Remove QCN9100 in the check for setting this paramenter.

Change-Id: Ibff3d2d618e20563add79e65e31a442d8d36ba61
CRs-Fixed: 2804120
2020-10-26 23:37:55 -07:00
Pavankumar Nandeshwar
403a1b89cd qcacmn: Add target type checks in spectral for QCN9100
Add target type checks in spectral for QCN9100
at required places

Change-Id: I21c6c2f3e33245540e754e018098dca9c1fc353f
2020-10-26 23:37:51 -07:00
Wu Gao
9471529a96 qcacmn: Don't reset vdev id if stop spectral scan
Host gets spectral scan data after stopped spectral scan, then it
can't find out current vdev since vdev id is reset when stopping
spectral scan.

Change-Id: I082b784e998a7600c7f8ef14bf67b790942f3a5f
CRs-Fixed: 2779397
2020-10-11 05:06:16 -07:00
Edayilliam Jayadev
8c77df3b7a qcacmn: Fix synchronisation between process context and tasklet
Spectral parameter state information is accessed in both
process context and tasklet context. Currently
qdf_spin_lock/qdf_spin_unlock is used to protect these data structures.
This can lead to deadlock in the scenario where the process holding the
lock gets preempted by the tasklet. To avoid this use
qdf_spin_lock_bh/qdf_spin_unlock_bh.

CRs-Fixed: 2776902
Change-Id: I6d188e55d5066241b5f38a655f4a587c9edb0b8b
2020-09-18 10:38:10 -07:00
Alok Sing
40502e26b4 qcacmn: Change return type to QDF_STATUS
wmi_unified_register_event return QDF_STATUS
Handle same return type in caller function

CRs-Fixed: 2764185
Change-Id: I87b1e6ee5e06e4e6af81395d977595335fe0bc5c
2020-09-15 18:24:35 -07:00
Edayilliam Jayadev
8afea1031d qcacmn: Stop finite Spectral scan internally in host
When user programs a non-zero scan count(say N), after receiving  N
samples Spectral scan is supposed to be stopped. This change keeps track
of number of Spectral reports received from target and stops the
Spectral scan when programmed number of samples arrives at host.

CRS-Fixed: 2764935
Change-Id: Ibea0eeece4577fd6e0da302716869b05c900f917
2020-09-03 05:58:03 -07:00
Pavankumar Nandeshwar
42c974a68d qcacmn: Target_if changes for QCN9100 bringup
Initial changes for bring up of QCN9100 in
target_if layer

Change-Id: I216cb52001b6e0c87a1c4b45990aad0ea83b4933
2020-09-01 01:49:54 -07:00
Wu Gao
b43c68dedf qcacmn: Gets vdev by id in spectral component
It starts spectral scan without vdev object, and uses the first vdev
as current vdev. which cause vdev mismatch in some platforms. So pass
vdev object or id when finding current vdev.

Change-Id: Iab55afbe2c98906021a008918f186d3d2dce5871
CRS-Fixed: 2716460
2020-07-24 02:01:08 -07:00
Wu Gao
5a754eb0c4 qcacmn: Enable spectral scan gen3 for QCA6490
Enble host sopport of spectral scan gen3 for QCA6490 target.

Change-Id: Ic99520bb6db94a0f41c2cd4c94b77e9795617f4c
CRs-Fixed: 2716598
2020-07-20 21:54:21 -07:00
Basamma Yakkanahalli
81e70bb153 qcacmn: Enable Spectral feature for ipq5018 target
a. Enable DDMA support and FFT bin length adjustment SWARs
b. Similar to QCN9000,
Skip 16 bytes of unused padding added after Spectral summary report
FFT report header length is 24

Change-Id: I870f198511771dccbb0300ff62fc15ab0d64ee7f
2020-07-09 15:54:29 -07:00
Abhishek Ambure
080bb9eeb9 qcacmn: Enable spectral scan support for QCA6750
Enable host support of spectral scan for QCA6750 target.

Change-Id: I0629e6f4563bd42ca07b7c5d82a71b8198b48c07
CRs-Fixed: 2702868
2020-06-18 03:44:04 -07:00
Edayilliam Jayadev
e3b05ae8ae qcacmn: Initialize start scan related parameters before sending WMI command
Host maintains a flag variable for ensuring that the start scan
response WMI event is received from FW before the spectral reports.

Following are the expected sequence of operations.
	1) is_resp_event_received = false
	2) start scan WMI command
	3) start scan response WMI event
           (is_resp_event_received is set to true here)

Current sequence of operations are the following.
        a) start scan WMI command
        b) is_event_received = false

If the start scan response WMI event is received in between a) and b)
there is a possibility that the flag is_resp_event_received is overwritten
to false by b). This can lead to an assert during the spectral
report processing.

CRs-Fixed: 2708320
Change-Id: I18020bf866b9cb3a3cc64df56398d751c91dd2f2
2020-06-16 16:23:45 -07:00
Edayilliam Jayadev
fb564225fb qcacmn: Check agile frequency forms a valid 80+80 channel
For agile scan request in 80 + 80 MHz check whether the user given
agile frequency forms a valid 80+80 channel.

CRs-Fixed: 2690964
Change-Id: Ia374333118d4f06861a1cfe0a75db349bca9e879
2020-06-09 06:29:08 -07:00
Edayilliam Jayadev
fd38ce125c qcacmn: release spinlock in the exit path
spinlock is not released in one of the exit paths
of target_if_start_spectral_scan function.
Fix it by releasing the spinlock before return.

CRs-Fixed: 2699762
Change-Id: I012c4151b3968ffbedb68eba64b30bc4c08cf44f
2020-06-09 01:00:33 -07:00
Paul Zhang
a027a582cc qcacmn: fix null-ptr-deref Read issue
Add sanity check in function target_if_init_spectral_capability
to avoid null-ptr-deref read issue.

Change-Id: Iccd79051ee8294f421704eadbedf6c9d9bf9a7b9
CRs-Fixed: 2692688
2020-06-02 03:22:49 -07:00
Neha Bisht
466c04dee9 qcacmn: remove dependency of public files from wlan_objmgr_psoc_obj.h
Remove dependency of wlan_lmac_if_def headerfile from
wlan_objmgr_psoc_obj.h

Change-Id: Ida8472e6f05a90b3930b5a13a2bf89ea8b3e938f
2020-05-15 10:41:46 -07:00
Edayilliam Jayadev
abdb33bb00 qcacmn: Add start scan response WMI event
Add support for processing the start scan response
WMI event. FW provides the necessary information to
segregate FFT bins to pri80, 5 MHz and sec80 in
160/165 MHz. Also, cfreq2 and the channel width is
provided to FW via WMI command.

CRs-Fixed: 2672081
Change-Id: I666b6c18a63d5d01117aa9cbd611691c6f8b2793
2020-05-13 01:30:40 -07:00
Edayilliam Jayadev
1de47959b6 qcacmn: Enable Agile Spectral in single synth targets
Some targets have a single synthesizer and it allows
a single Spectral detector to scan in 160 MHz /165 MHz.
Enable Agile Spectral scanning in 160 MHz / 165 MHz for
such targets. Agile creq2 will be populated in the WMI
command after WMI interface changes are merged.

CRs-Fixed: 2648480
Change-Id: I8522cbeeab29ac41479e3041eea376b081c0758a
2020-04-30 01:51:14 -07:00
Edayilliam Jayadev
f76792f311 qcacmn: Add Spectral detector count in capability info
Populate number of Spectral detectors per BW in the
Spectral capability vendor command response.

CRs-Fixed: 2659587
Change-Id: I2eba5df02a5f70556d65e689aece1f0fbd8bba93
2020-04-09 11:31:53 -07:00
Rongjing Liao
ed684a92f9 qcacmn: add pointer NULL check in spectral module
Add pointer NULL check before use in spectral module.

Change-Id: I018c52a175157605463c23cce95d78ffea23b867
CRs-Fixed: 2643196
2020-04-01 09:06:17 -07:00
Edayilliam Jayadev
12b6e9d07f qcacmn: Initialize FFT bin boundaries in 165 MHz
Initialize FFT bin boundaries of primary 80 MHz, 5 MHz
and secondary 80 MHz based on the relative position of
primary 80 MHz and secondary 80 MHz segment.

CRs-Fixed: 2653675
Change-Id: I0c9f1fbb55d1023b437c9787e753f3e154b5e08e
2020-04-01 04:15:54 -07:00
Rongjing Liao
cff463564e qcacmn: fix null pointer 'err' reference issue
When 'err' is null pointer, QDF_ASSERT(0) will not return
directly, then null pointer reference will occur. To fix this
issue, return failure when 'err' is null pointer.

Change-Id: I5912571795ae55c6729ae06d5e06496598c21fbb
CRs-Fixed: 2642581
2020-03-21 21:56:10 -07:00
Edayilliam Jayadev
01106d6458 qcacmn: Enable 165 MHz Spectral scan
QCN9000 has the capability to Spectral scan in 165 MHz/
restricted 80p80 mode of operation. Host filters the FFT bins
corresponding to the additional 5 MHz and exports to the
user space via SMAP message.

CRs-Fixed: 2630960
Change-Id: I54ec36968cb0c8d5a68ff39029004b08936cb91e
2020-03-21 02:03:45 -07:00
Basamma Yakkanahalli
9def5df14a qcacmn: device ID and target type checks for ipq5018 target
Initial changes for ipq5018 compilation.
Added device ID and target type checks for ipq5018 traget.

Change-Id: Ib86a371fbe66749fcb6d114e7a4a9931b684e03d
2020-03-20 23:45:43 -07:00
Edayilliam Jayadev
49de9e2d3c qcacmn: Handle 80p80 and 160 MHz separately
Currently 160 and 80+80 MHz modes are handled together in
Spectral module. Differentiate between 160 and 80+80 MHz
to support new features like restricted 80+80
which are applicable only with 80+80 MHz.

CRs-Fixed: 2630729
Change-Id: I3e9fdd0e2d22a0bca7d37445df7fb1f1bab023c8
2020-03-16 08:05:34 -07:00
Edayilliam Jayadev
4e5b760643 qcacmn: Enable 160 MHz Spectral scan in QCN9000
Till IPQ8074/IPQ8074_V2 each Spectral detector was capable of
doing scan up to 80 MHz. But in QCN9000 each Spectral detector
is capable of doing scan up to 160 MHz. As a result there will
be only one Spectral report in 160/80p80 MHz. Modify Spectral
Rx path to support single Spectral report in 160 MHz.

Change-Id: I9639cdc6adc6ad80e2769571b06d2a2021d699bc
CRs-Fixed: 2619544
2020-03-14 18:16:25 -07:00
Edayilliam Jayadev
ec5e46507e qcacmn: FFT size max based on band width
For QCN9000 max FFT size supported is 9 for 20 MHz and 10
for all other bandwidths. Add FFT bin size max based on
bandwidth to support this requirement.

Change-Id: If383dc914937d68c9f4781463a3a965c73bc78f1
CRs-Fixed: 2617674
2020-02-11 02:09:20 -08:00
Edayilliam Jayadev
d0113009aa qcacmn: Cleanup in Spectral time stamp WAR logic
Add a function to encapsulate Spectral time stamp WAR logic which corrects
the Spectral time stamp reported by target.

Change-Id: I490c9f2109f36831cd8de47b8165749e93d9b5cb
CRs-Fixed: 2600170
2020-02-01 09:08:25 -08:00