Commit Graph

67 Commits

Author SHA1 Message Date
Jeff Johnson
9c3acb0121 qcacmn: spectral: Fix misspellings
Fix misspellings in spectral/...

Change-Id: I2477dbd5ecccc508d5dfdfc8006fe2255ba0dda8
CRs-Fixed: 3304692
2022-10-06 21:31:52 -07:00
Shiva Krishna Pittala
aeb2ffde14 qcacmn: Add stats in Spectral report processing path
Add the following stats.
 - Number of Spectral events received from the target
 - Number of consume_spectral_report() invocations
 - Number of fill_samp_msg() invocations
 - Number of SAMP messages that are ready to be sent to the user-space
 - Number of SAMP messages queued to the user-space

Change-Id: I53fda4b309620043a77bc2bc87573941d7fb0bcb
CRs-Fixed: 3156151
2022-03-23 13:01:40 -07:00
Jhalak Naik
055dfbe881 qcacmn: Add Host support for Spectral FFT recapture
Add support to receive the fft_recapture arg value
from spectraltool, handle the FFT recapture config and
pass this to FW. The recapture feature must be
enabled only for spectral scan period > 52 us and
Normal Spectral scans.

Change-Id: Ied637704d25bb15bff2139a215da7481d4f80e4f
CRs-Fixed: 3140890
2022-03-09 06:51:27 -08:00
Jhalak Naik
24174b7be8 qcacmn: Add support for Spectral FFT recapture config
Add support to handle the FFT recapture config and
pass this to FW. The recapture feature must be
enabled only for spectral scan period > 52 us and
Normal Spectral scan.

Change-Id: I6b92fcd674ae95bcd0a23892ef9ccc6ba487d6ad
CRs-Fixed: 3140890
2022-03-04 13:45:00 -08:00
Edayilliam Jayadev
aaf4382daf qcacmn: Increase the Spectral payload size
Increase the Spectral payload size to account for
FFT size 11.

CRs-Fixed: 3073239
Change-Id: I5c6db642267a96cbc535bf6842c8f9ac90b1a335
2021-12-01 04:23:19 -08:00
Edayilliam Jayadev
31da41ae4e qcacmn: Clamp the FFT bin values before filling SAMP message
Each FFT bin value is represented as an 8 bit integer
in SAMP message. But depending on the configuration,
the FFT bin value reported by HW might exceed 8 bits.
Clamp the FFT bin value between the min and max value
which can be represented by 8 bits. For linear mode,
min and max FFT bin value which can be represented by
8 bit is 0 and U8_MAX respectively. For dBm mode,  min
and max FFT bin value which can be represented by 8 bit
is S8_MIN and S8_MAX respectively.

CRs-Fixed: 3056458
Change-Id: I9ec75f781a130d3ed0d0d9393975fd5874961ce0
2021-11-02 14:56:21 -07:00
Shiva Krishna Pittala
de13832745 qcacmn: Populate and expose 320MHz spectral capabilities
Populate and expose the following 320MHz spectral capabilities.
  - Agile spectral scan support for 320MHz mode.
  - Number of detectors used for spectral scan in 320MHz mode.

Change-Id: Ibea77d4ec8b1d9322ef82d1d48236836ffad24ec
CRs-Fixed: 3053059
2021-10-13 02:57:24 -07:00
Jhalak Naik
b65b4ae703 qcacmn: APIs to convert phy_ch_width to nl80211_chan_width and vice-versa
Add Spectral APIs to convert channel width values
from enum phy_ch_width to nl80211_chan_width and
vice-versa.

CRs-Fixed: 3029184
Change-Id: I60fb7fb04b943b0d70c569ff6587e5e8efd7722b
2021-09-29 15:05:37 -07:00
Shiva Krishna Pittala
aead8c4d39 qcacmn: Add support to configure spectral scan bandwidth
Add support to configure spectral scan bandwidth as provided by the user.
Validate the user configured value before applying it. As the spectral scan
bandwidth is an optional parameter, when the user doesn't configure it, use
configure the spectral scan bandwidth to the maximum value supported by the
target for the current operating bandwidth.
Also, populate the spectral scan bandwidths supported for different
operating bandwidths on different targets.

CRs-Fixed: 3042424
Change-Id: I266aa5489b0ce5c149968067a06e1cc65bb4e3b7
2021-09-28 03:43:21 -07:00
Jhalak Naik
d63e03e207 qcacmn: Add a new Spectral-specific channel width enum
Add a new Spectral channel width enum which will be
specific to Spectral applications.

CRs-Fixed: 3029175
Change-Id: Ibfe4f336552978364eb89add25861edd30d33000
2021-09-23 00:05:45 -07:00
Jhalak Naik
8cc1b89b17 qcacmn: Optimize the SAMP message structures
Refactor the current SAMP message for memory efficiency
and scalability. Introduce per-span and per-detector
information structures, in place of separate static
arrays for each 80MHz segment in SAMP message structure.
Also, remove members in the SAMP message that are no
longer in use.

The new structures will be under OPTIMIZED_SAMP_MESSAGE
flag, which is unset by default for all profiles, till
development is complete.

CRs-Fixed: 2912498
Change-Id: Ie176f762cee811efa5c257faebc57af7f3166f85
2021-07-08 09:02:27 -07:00
Harsh Kumar Bijlani
a496f14ebe qcacmn: Add forward declaration of structures to fix warnings
Add forward declaration of structures wlan_objmgr_pdev and
wlan_objmgr_vdev in file wlan_spectral_public_structs.h in
order to fix compiler warnings.

Change-Id: Ida73f3d3d808977ba1e813de3dd85e329fc13cd4
CRs-Fixed: 2907580
2021-06-02 06:58:26 -07:00
Edayilliam Jayadev
398e80bacf qcacmn: Add Spectral scan priority definitions
Add Spectral scan priority definitions to the Spectral
driver-application interface header file.

CRs-Fixed: 2857143
Change-Id: If49d692dcf29430ac00d9e319d3de8253d4fcd7b
2021-01-20 23:35:58 -08:00
Edayilliam Jayadev
8c199ecfc5 qcacmn: Fix compilation error when Spectral is disabled
Fix the compilation error which occurs when Spectral
feature is disabled.

CRs-Fixed: 2847001
Change-Id: I133aff14cc069864ca5b4ce3bc9c5a225c2b0c05
2021-01-06 17:58:01 -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
Wu Gao
80df191a1a qcacmn: Add API to get spectral version
Since struct spectral_samp_msg may be modified, so provide API to get
version information, then spectraltool can compatible with different
host based on version information.

Change-Id: If68dbd0d85b28f46056208d849fe2db4faea493a
CRs-Fixed: 2575818
2020-07-27 09:03:49 -07:00
Edayilliam Jayadev
6c76bce586 qcacmn: Modify vendor command handler to accept vdev
The Spectral module uses the first vdev of a pdev for scanning.
For MCL platforms all the vdevs are associated with a single pdev
and this may cause a mismatch between the vdev intended by user and
the vdev used by driver. To avoid this MCL platforms pass a reference
to vdev on which Spectral scan is triggered. WIN platforms
can continue to use the old approach of using the first vdev of a
pdev by passing NULL for vdev to vendor command handlers.

CRS-Fixed: 2725777
Change-Id: I1a7278bdcbcc2b706aa292b33c17546190dac082
2020-07-24 02:01:11 -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
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
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
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
17ecd7493a qcacmn: Enable Spectral feature for Pine
1) Enable DDMA support, FFT bin length adjustment SWARs
2) Skip 16 bytes of padding added after Spectral summary report.
3) FFT report header length is 24 instead of 16 in Pine.
4) Max FFT size is changed to 10.

CRs-Fixed: 2608215
Change-Id: If32a8995f814140f5b61041031fb842d01d24c94
2020-02-01 06:25:04 -08:00
Edayilliam Jayadev
b3a66311cc qcacmn: Add Agile channel width to SAMP message
Add a new member to SAMP structure describing the channel width of
Agile Spectral scan.

Change-Id: Ib27fe9ed63bf8f89c59762150fb58943e6bcf7ea
CRs-Fixed: 2582670
2019-12-12 18:14:27 +05:30
Shwetha G K
7887593414 qcacmn: Log Spectral FFT timestamp WAR parametrs
Log Spectral FFT timestamp WAR related parameters

Change-Id: I11e3107f41049e9fb05c3f9f7960279b88392598
CRs-Fixed: 2556803
2019-12-03 04:52:57 -08:00
Shwetha G K
8b236c153f qcacmn: INI support to poison spectral buffers
Add INI support to enable the poisoning of spectral buffers during init

Change-Id: I599f7d85a4756a216d24144e1e8bf2a113a26abb
CRs-Fixed: 2554855
2019-12-03 03:26:44 -08:00
Shwetha G K
8db4b4ac32 qcacmn: Control path support for Spectral DMA debug
All gen III chipsets use Direct-DMA mechanism to copy Spectral reports to
the Host for further processing. This mechanism involves ring and buffer
management in the Host, FW, and uCode, where improper/incomplete DMA and
improper tail update issues are seen. DBR framework provides support to
debug such issues. Add Spectral control path support to facilitate the
configuration of these debug options.

CRs-Fixed: 2478596 2478595
Change-Id: I094616c4137145389b6984ccab933e5ebd0aa1ab
2019-12-03 03:26:22 -08:00
Wu Gao
a32b831887 qcacmn: Not register spectral to dbr when load wlan
When loading wlan host, memory alloc takes too long when registering
spectral to direct buffer rx component and affect wmi ready event
handling. So avoid to register spectral to dbr when loading wlan.

Change-Id: If48aab2cf424c41af1427f350734690918291d69
CRs-Fixed: 2558477
2019-11-25 16:15:44 -08:00
Edayilliam Jayadev
97b8676b4e qcacmn: WMI changes for Agile Spectral
1) Add Spectral scan mode and agile center frequency in WMI
   commands to indicate the current mode.
2) Obtain the Agile Spectral capability from the chain mask table.

CRs-Fixed: 2455967
Change-Id: I88ba6fc1ecf9b530a6b516d0c1e4ce88702c6d1f
2019-11-12 04:03:58 -08:00
Krishna Rao
5304724e59 qcacmn: Add Agile Spectral frequency to Spectral SAMP message
Add Agile Spectral frequency to Spectral SAMP message and populate the
same. This coexists with the pre-existing operational frequency in
SAMP message for the sake of flexibility.

Change-Id: Iadb8efeaac924df5b0ac9a83f630206b2ef93052
CRs-Fixed: 2545763
2019-10-27 17:28:49 -07:00
Edayilliam Jayadev
faeec1bf8d qcacmn: Add separate aSpectral cap for 160, 80p80 and non 160 mode
Some chip sets don't have the capability to run agile Spectral with
160/80p80 modes. For this add separate agile Spectral capability for
160 MHz, 80p80 and non 160 MHz modes.

CRs-Fixed: 2536823
Change-Id: Ic5b2335e3183688b7a007cf0380f0c3644e50219
2019-10-04 00:37:34 -07:00
Krishna Rao
54a3931f9f qcacmn: Add and populate Spectral pri80 indication
Spectral generation III hardware sets the Spectral primary 80 MHz
(pri80) indication in Spectral Summary reports to inform software
whether the Spectral sample was gathered on the primary 80 MHz
segment. But this may also be set in the case of Spectral scans
intended to be carried out on the Agile frequency or secondary 80 MHz,
due to a channel switch of the Spectral chain from Agile/secondary 80
MHz to primary 80 MHz. Software can ignore samples for which the pri80
indication is set for Agile mode or for secondary 80 MHz in normal
mode.

Add and populate fields for pri80 indication, one intended for primary
80 MHz/Agile and the other for secondary 80 MHz.

CRs-Fixed: 2524733
Change-Id: If592d664cebfe1e08026e55d4031c74d9a9db2e0
2019-09-28 23:41:01 -07:00
Edayilliam Jayadev
499d29e713 qcacmn: Add API to get center frequency of sec80 seg
Add helper API to get the center frequency of secondary 80 MHz
segment. Make this API available to Spectral target if layer
via rxops.

CRs-Fixed: 2523690
Change-Id: If1cad90d9b27d1461e802b921aecda07031b1e0b
2019-09-11 18:40:28 -07:00
Edayilliam Jayadev
9217a212bb qcacmn: Add error handling in the Spectral control path
Add an attribute which describes the error code
in the response to set config, start scan and stop
scan.

CRs-Fixed: 2500481
Change-Id: I491cd6e061d2d08ceb4d9af2a7de5223e229c280
2019-08-29 12:51:37 -07:00
Edayilliam Jayadev
8e74a62e72 qcacmn: Change Spectral control path to support Agile mode
Modify Spectral control path APIs to support Agile mode.

CRs-Fixed: 2450620
Change-Id: Id6cf48c1288b157932ab5ce0535293e466a87783
2019-07-27 00:31:31 -07:00
Edayilliam Jayadev
cd6f190963 qcacmn: Make RX path changes for Agile Spectral
Change Spectral report processing logic to handle
Agile Spectral reports. 160 MHz state machine is not
affected by Agile Spectral reports.

CRs-Fixed: 2458359
Change-Id: Iead6427f57edddd61f7d64a961cc6d936d54ab9e
2019-06-21 03:09:19 -07:00
Edayilliam Jayadev
14f9bd4194 qcacmn: Spectral control path changes
Add a new request structure for Specteral control path.
This structure packages all the commands and their
required inputs. Response to the commands are filled
in this structure by the command handlers in lower
layers.

CRs-Fixed: 2446466
Change-Id: I3113e8721382d284b4e03e0f8fdab1e68d5cfaa1
2019-06-08 06:29:44 -07:00
Edayilliam Jayadev
327257e9dd qcacmn: Public definitions for agile Spectral
Add agile Spectral capability, Spectral scan frequency parameter,
and Spectral mode.

CRs-Fixed: 2446467
Change-Id: I8e82469bb362228a029583ec4b7a29b2404e47df
2019-06-08 06:29:40 -07:00
Edayilliam Jayadev
b292dd7b1a qcacmn: Use common Spectral config definition
Today Driver and applications maintain a separate copy of
spectral config definitions, which is error prone. Solution is to
expose the definitions via a header file from driver and include
them in all applications using Spectral.

CRs-Fixed: 2432011
Change-Id: I107c2db05e1cb71b379d6f15a282a889882da2f8
2019-05-01 00:39:58 -07:00
Edayilliam Jayadev
f6e599fbad qcacmn: Use common Spectral SAMP message definition
Today Driver and applications maintain a separate copy of SAMP
message definitions, which is error prone. Solution is to
expose the definitions via a header file from driver and include
them in all applications using Spectral.

CRs-Fixed: 2431820
Change-Id: Icf7e6d6bfa1e7bfaa1f2cb4756e69edbac6bfb33
2019-04-30 20:45:20 -07:00
Kiran Venkatappa
6c879d4c76 qcacmn: Add direct rx buffer changes for CFR requirements
CFR needs to correlate data received from direct dma ring and WMI event
for tx completion. These two events can come in any order. To facilitate
correlation CFR module has to hold on to the buffer until both events
are received and then replenish buffer back to direct dma ring. To
facilitate this requirement direct rx buf module is modified to change
callback return to bool to indicate whether buffer can be replenished
immediatley or not. Also add API to indiciate buffer release/replenish
later.

Change-Id: I40d3fdff82fd2828ada14b584da33a66052c6773
CRs-Fixed: 2403398
2019-03-04 04:00:47 -08:00
Edayilliam Jayadev
d4b7e3b572 qcacmn: Populate spectral capability and send via cfg80211
Populate Spectral capability structure with scaling parameters
from extended service ready event parameters. Send the spectral caps
via cf80211 interface.

CRs-Fixed: 2379652
Change-Id: Id0372bdd40843c2101df32d2e71920027a24909f
2019-02-05 04:02:20 -08:00
Edayilliam Jayadev
2bee1aa8ad qcacmn: Add unregister API for direct buf ring
Add Unregister API to de-register and free resources in direct buf
module. Existing logic of freeing all resources as part of pdev destroy
does not take care of soc_start and soc_stop scenarios. Add this API to
enable modules to de-register as part of soc_stop and register during
start.

CRs-Fixed: 2385313
Change-Id: Ibe6f6bc5f4bd2acc5a9fe71eee09c151853073bc
2019-02-01 10:33:51 -08:00
Shashikala Prabhu
7eb2d08e3b qcacmn: Add INI support to disable spectral feature
Add INI support to disable spectral feature and do not process the spectral
user commands if spectral feature is  disabled.

Change-Id: Id353131675454652d59fd5d5f8fd3d732a07b777
Acked-by: Shashikala Prabhu <pshashik@codeaurora.org>
CRs-Fixed: 2343947
2018-12-27 13:28:00 -08:00
Edayilliam Jayadev
2256850e61 qcacmn: 160 MHz/80p80 support for gen III Spectral
For generation 3 spectral reports for the 80 MHz segments
come as part of different events. To deal with this a
state machine is added to report handler. Noise floor
value of the lowest chain in the chain mask is populated
in the SAMP message.

CRs-Fixed: 2236331
Change-Id: Ie24426449cf8503c9d7f7c30ca617a6697ca2b5e
2018-10-05 02:14:07 -07:00
Krishna Rao
3fa42be5d4 qcacmn: Add definitions for Spectral linear bin scaling
Add definitions for Spectral linear bin scaling, including conversion
functions, RF parameter definitions, and hardware generation
specifiers.

CRs-Fixed: 2294176
Change-Id: I6e1eb2ce3ec19d8734facb88c6329fe0026ecce0
2018-10-01 02:37:18 -07:00
Edayilliam Jayadev
8e3eb14984 qcacmn: Add more fields to SAMP message
Add new fields such as agc_total_gain, sscan_gainchange
to the Spectral SAMP message.

CRs-Fixed: 2291499
Change-Id: Ia6a9fd742c2ee98fd9d7102f0d8c66dcd22a1614
2018-08-14 05:01:16 -07:00
Sandeep Puligilla
6f083bace3 qcacmn: Fix spectral scan compilation issue
Forward declare 'struct wmi_spectral_cmd_ops' in
file wlan_spectral_utils_api.h to avoid
compilation issue when spectral feature flag
is disabled.

Change-Id: Iba8dfbb2007f20d409fbb2d67ee29f702264e50d
CRs-Fixed: 2269005
2018-07-11 23:36:30 -07:00