Commit Graph

100 Commitit

Tekijä SHA1 Viesti Päivämäärä
Jeff Johnson
c359185095 qcacmn: target_if: Fix misspellings
Fix misspellings in target_if/...

Change-Id: I405f4c709ffd70b1927970ebd51a215c49f6dc88
CRs-Fixed: 3304693
2022-10-07 22:42:16 -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
8f5372788b qcacmn: Add the spectral detector map valid flag per scan mode
For per-session detector map, maintain a different
det_map_valid flag for Normal and Agile spectral scan
mode.

Change-Id: I5a2a0253624a393feba966641d518e59a48f4a8a
2022-01-26 23:23:12 -08:00
Shiva Krishna Pittala
a739a0cabb qcacmn: Add support to extract FFT size capabilities
WMI_SPECTRAL_CAPABILITIES_EVENTID event will be sent by the FW to
indicate different capabilities of the Spectral HW.
Add support to extract the FFT size capabilities from this event.

Change-Id: I9640fa51e4249b9d1c2d9d3ac5da7f1d56c9d006
CRs-Fixed: 3098880
2022-01-09 23:10:04 -08:00
Shiva Krishna Pittala
861c4e29aa qcacmn: Add support to extract sscan bandwidth capabilities
WMI_SPECTRAL_CAPABILITIES_EVENTID event will be sent by the FW to
indicate different capabilities of the Spectral HW.
Add support to extract the sscan bandwidth capabilities from this event.

Change-Id: I6ff6e5a8d80271fa62a430c986f53a321d46c66b
CRs-Fixed: 3098832
2022-01-06 10:40:06 -08:00
Shiva Krishna Pittala
a9547b0f25 qcacmn: Add support to extract fixed params from Spectral Caps event
WMI_SPECTRAL_CAPABILITIES_EVENTID event will be sent by the FW to
indicated the different capabilities of the Spectral HW block.
Add support to extract the fixed parameters from this event.

Change-Id: Ib13108f078de008b6a76a25a010e85a7fdb6f5fe
CRs-Fixed: 3098203
2021-12-28 06:43:12 -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
Wu Gao
9fba485d3c qcacmn: Check function pointer to avoid NULL point dereference
It calls spectral_process_phyerr of spectral operations without any
check. Which cause null point dereference potentially. So, check this
pointer before calling.

Change-Id: Iae246f847dd41e62b628223652a9527a65b43799
CRs-Fixed: 3055246
2021-10-15 15:32:08 -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
Shiva Krishna Pittala
409ffbfda0 qcacmn: Pass report parameters to FFT bin byte swap function
Pass report parameters to FFT bin byte swap function instead of
FFT bin length adjustment WAR.

Change-Id: I02a280bc4e8e0839c894a70258e1f16a784c08a6
CRs-Fixed: 3051559
2021-10-11 02:35:48 -07:00
Shiva Krishna Pittala
61f4418d7a qcacmn: Add support to process spectral scan detector info tlv
FW sends Spectral scan detector info TLV in WMI_PDEV_SSCAN_FW_PARAM
event to indicate the information of a detector participating in a sscan
session. FW sends one TLV of this type for each detector participating
in a spectral scan session. Add support to process the TLV and update
the spectral host data structures accordingly.

CRs-Fixed: 3044193
Change-Id: Ie17b6ea9336ada7a00e4594fa2f7f49ef3d443e5
2021-09-30 18:16:42 -07:00
Shiva Krishna Pittala
e991ce3cdd qcacmn: Add support to process spectral scan chan info TLV
FW sends Spectral scan chan info TLV in WMI_PDEV_SSCAN_FW_PARAM_EVENTID
event to indicate the channel information for a spectral scan session.
Add support to process the TLV and update the spectral host data structures
accordingly.

CRs-Fixed: 3044162
Change-Id: Ibbf7f6bbbb267123bbdf44bcfffa2cfb1c2926df
2021-09-30 18:16:37 -07:00
Shiva Krishna Pittala
d36115b849 qcacmn: Big-endian mode changes for Beryllium Spectral
On Beryllium architecture, PHY DMA applies a 32-bit byte swap to assist
in efficient Host reads when connected to a big-endian Host.
This is done to avoid byte swapping at the Host.
So, if the Host reads this data 32-bit word at a time, the byte order
would be intact. Report headers are not a problem because as they are
composed of 32-bit words. For FFT bins, read each DWORD at a time and
extract FFT bins out of that DWORD. Make this change in a generic way to
keep the design uniform across different chipsets and endian modes.

CRs-Fixed: 3042188
Change-Id: Idff1ac7eb5e18c692c9ee8b19b9ae9e6b962d486
2021-09-30 06:27:26 -07:00
Shiva Krishna Pittala
8e8df4a411 qcacmn: Populate the list of supported sscan bandwidths and detectors
Populate the list of supported spectral scan bandwidths for different
targets and use that in populating the detector list.

CRs-Fixed: 3042448
Change-Id: I5dac2c845843698bbafac64a01517acfbe120180
2021-09-29 12:42:32 -07:00
Shiva Krishna Pittala
e5255c7253 qcacmn: Populate supported FFT sizes for Beryllium Spectral
Beryllium chipsets support FFT sizes as follows for different sscan widths.
    20MHz:-   Min FFT size: 5, Max FFT size: 9
    40MHz:-   Min FFT size: 5, Max FFT size: 10
    > 40MHz:- Min FFT size: 5, Max FFT size: 11
Populate these FFT sizes for Beryllium targets.

CRs-Fixed: 3042443
Change-Id: Id7052e3513b29789e96c351aa4cdede499ef2578
2021-09-28 03:43:28 -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
0405359a6c qcacmn: Lock Spectral detector list and session info structs
Add locks for detector list, per-session report info
and per-session detector map, to avoid inconsistent
concurrent accesses.
Using spin_lock_bh for locking between Process and
Tasklet context.

CRs-Fixed: 2983801
Change-Id: If709fd91f193072f07b9dae19bf48e6da2d369d3
2021-09-22 05:27:23 -07:00
Shiva Krishna Pittala
ef337fbe1f qcacmn: Unify Spectral cfreq formats across different chipsets
Different chipsets are reporting cfreq1 and cfreq2 in different formats in
Spectral reports. This leads to confusion at the user-interface level.
Convert the cfreq1 and cfreq2 representations as follows before sending the
Spectral report to upper layers.
For a contiguous channel, cfreq1 will represent the center of the entire
span and cfreq2 will be 0. For a discontiguous channel like 80p80, cfreq1
will represent the center of the first segment whereas cfreq2 will
represent the center of the second segment.

CRs-Fixed: 3020790
Change-Id: I86e330c9a3a66701f274e20db2d8bc5934608a6b
2021-09-07 04:28:05 -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
Jhalak Naik
8a5bf47771 qcacmn: Add new function free_samp_msg_skb()
Add a new API free_samp_msg_skb(), to free
SAMP msg buffer, if error in phyerr processing
for 160/80p80 MHz modes. Call this API from
reset_160mhz_delivery_state_machine(), to
avoid redundancy.

CRs-Fixed: 2961987
Change-Id: I3a0488997e474fef6f4f57e3fbfd1a163c91ac7b
2021-07-10 13:31:13 -07:00
Jhalak Naik
a66fec0ada qcacmn: Populate target_if_samp_msg_params for Spectral gen2
Add API target_if_spectral_populate_samp_params_gen2() to
populate fields in target_if_samp_msg_params, using
search fft report and target_if_spectral_rfqual_info
fields.

CRs-Fixed: 2961986
Change-Id: Iad970483f6183d2e52d97e6c3ddf8f146845fbe4
2021-07-10 13:31:09 -07:00
Jhalak Naik
e50fe45a74 qcacmn: Modify target_if_samp_msg_params for new SAMP msg
Modify struct target_if_samp_msg_params to only include
fields to fill the new SAMP message format, which
are not present in the per-session report-level
info and detector map structures.

CRs-Fixed: 2961956
Change-Id: I54f69bb63c5b64a59cb83b9f205c74c83475fc14
2021-07-10 13:30:48 -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
555875b09b qcacmn: Populate start and end frequencies in detector map
Add API target_if_spectral_get_start_end_freq to set
start and end frequencies in the per-session
detector level map, based on spectral scan
cfreq1/cfreq2 and operating BW.

API target_if_populate_detector_start_end_freqs handles
population of the start and end frequencies per-detector,
in a session.

CRs-Fixed: 2961957
Change-Id: I68a052db6643d92c22e7ee671f4e46af33c2fa08
2021-07-10 13:30:38 -07:00
Jhalak Naik
86ff67088d qcacmn: Replace numbers with macros in FFT report processing
Replace numerical values with macros, for indicating
position and size of Spectral FFT report fields, in
target_if_consume_sfft_report_gen3().

Change-Id: I81994ebb0d642bc4cbebe2b24aabcae567ae6a9c
CRs-Fixed: 2945319
2021-07-10 13:30:34 -07:00
Jhalak Naik
2ae296f522 qcacmn: Support timestamp verification per-detector
Modify prev_tstamp variable in target_if_spectral
structure to an array and index it based on detector ID.
Also, modify target_if_spectral_verify_ts() to include
detector_id parameter and compare current timestamp with previously
received sample on per-detector level, to check discrepancy.

Change-Id: I9f6382909ac0661323db54f160f1350cb8bd8153
CRs-Fixed: 2945318
2021-07-10 13:30:29 -07:00
Jhalak Naik
d75eec9e92 qcacmn: Add helper function target_if_spectral_get_num_fft_bins()
Add target_if_spectral_get_num_fft_bins() to find the
number of FFT bins, from the Spectral FFT size.
It will adjust the number of FFT bins according to
Spectral report mode.

Change-Id: I8f81f2b784d71387f951c38701af6cf4443246e0
CRs-Fixed: 2945316
2021-07-10 13:30:25 -07:00
Jhalak Naik
89adfb27cf qcacmn: Find adjusted timestamps in FFT report processing
Find the last_raw_timestamp and adjusted_timestamp
as part of the FFT report processing API.

Change-Id: Ibc7fd524ca897ead3b4b8ca25ba6e6487154305d
CRs-Fixed: 2945307
2021-07-10 13:30:12 -07:00
Jhalak Naik
399fdd15c0 qcacmn: Add API to fill the Spectral SAMP message
Add a new API target_if_fill_samp_msg, to populate
the Spectral SAMP message and detector level
information, using  pdev_spectral_det_map
and per_session_report_info. Send the SAMP message
to upper layers when completely filled.

Change-Id: If43494fe4a09dbfeb9aea6cb0fa20b406d81e390
CRs-Fixed: 2945282
2021-07-10 13:30:03 -07:00
Jhalak Naik
f3008debc9 qcacmn: Modify state machine for 160/80p80 MHz gen3 spectral
A state machine checks if spectral reports are
in order for gen3 spectral 160/80p80. Currently,
this state machine has four states.
Modify this state machine to have only two states and
change associated APIs accordingly.

Change-Id: I754758fdf0529394c63fe371f54db79d52459999
CRs-Fixed: 2945161
2021-07-10 13:29:54 -07:00
Jhalak Naik
a366a6f29e qcacmn: Add structs for Spectral per-detector and per-report info
Define a map with per-detector information, that is
keyed by the detector ID from Spectral FFT report.
Use per-detector information from this map to fill
the Spectral SAMP message.

Define struct per_session_report_info, for per session
info that needs to be filled at report level within
SAMP message.

Change-Id: I9f73bd904cc3d4cac42d21b89b1ceb586da7f911
CRs-Fixed: 2945158
2021-07-10 13:29:50 -07:00
Jhalak Naik
1de0695e47 qcacmn: Modify target_if_process_sfft_report_gen3()
Modify the API to include Validation and
processing of Spectral search FFT report.

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

Change-Id: I250867e2c002f491f51a36416ea9ca5ae0bc5508
CRs-Fixed: 2945132
2021-07-10 13:29:45 -07:00
Jhalak Naik
40bce64102 qcacmn: Modify target_if_consume_sscan_summary_report_gen3()
Modify target_if_consume_sscan_summary_report_gen3() to
include validation and processing of Spectral summary
report.

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

Change-Id: Ice88b8e74ed714515f21b9b232aa0088fbb54d1d
CRs-Fixed: 2945124
2021-07-10 13:29:40 -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
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
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
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
Jhalak Naik
04188da78f qcacmn: Cap the FFT bin values to 255
FFT bin values can span 10 bits for HKv1, HKv2 and Pine.
This change is to cap the values to 8 bits for such case
on these platforms.

Change-Id: I144b00b1ed21a3281f79050bb1ab63bd857e47b1
CRs-Fixed: 2804192
2020-11-18 07:46:30 -08: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
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
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
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
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