Commit Graph

781 Commits

Author SHA1 Message Date
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
Vignesh U
350da55314 qcacmn: Find radar found frequency for 11BE Chipset
The "wmi_pdev_dfs_radar_detection_event" has an unused field "chan_freq".
It currently holds the value of primary 20MHz channel. With the
introduction of 11BE chipsets, this field is changed to hold the value of
the center frequency of the channel width on which the radar is found.

This new change is indicated by a wmi service
"wmi_is_radar_found_chan_freq_eq_center_freq".

For the Chipsets that support this service, the radar found frequency
can be calculated by mere addition of the fields "chan_freq" and
"freq_offset" field.

Change-Id: I8d2ce0023e2feb6e749ca8d7d5f547fafc0fdf98
2021-10-04 13:53:50 -07:00
Edayilliam Jayadev
3038a860fc qcacmn: Fix compilation issues in MGMT RX REO module
Fix compilation issues in management rx reorder module.

Change-Id: I4eb7e2e3421f107607c6d99aa737fe3643e2ed12
CRs-Fixed: 3046412
2021-10-03 22:55:54 -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
Pavankumar Nandeshwar
0a3d522550 qcacmn: tgt_if changes for wds in Beryllium
tgt_if changes for wds in Beryllium code.

Change-Id: Ie18f29f087b532ed983a474faebbc4c2863f1aee
2021-09-30 15:15:30 -07:00
Edayilliam Jayadev
29fe92fbd7 qcacmn: Add fixes in wait count calculation
1. Add fixes in wait count calculation logic.
2. Add necessary debug logs in wait count calculation.

CRs-Fixed: 3026035
Change-Id: I5aad3a5b56ae1db7b00e17240bb768f35cd83abc
2021-09-30 08:38:35 -07:00
Edayilliam Jayadev
9fd7fb390c qcacmn: Add fixes in snapshot read logic
1. Initialize the temporary variable to read snapshot to zero.
2. Read correct number of shared snapshot values.

CRs-Fixed: 3026029
Change-Id: I6f4fc9d1d2bfe4818304be16f7c80830b4fb260b
2021-09-30 08:38:30 -07:00
Edayilliam Jayadev
2a8aff65e1 qcacmn: Export symbols for other modules
Export symbols("mlo_glb_h_shmem_arena_ctx_init" and
"mlo_glb_h_shmem_arena_ctx_deinit") for other modules.

CRs-Fixed: 3026023
Change-Id: I2a7c55f119be531b495a0f42a9b058734feb0ebb
2021-09-30 08:38:26 -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
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
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
Debasis Das
db135c6eac qcacmn: Fix use of uninitialized variable in phyerr processing
Initialize the variable "segid" to prevent the usage of junk value.
Dont dereference the spectral-lmac object if the same is NULL.

Change-Id: I5206a99017f77e5c94368d91171a7eb05745933c
2021-09-29 08:59:22 -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
Shiva Krishna Pittala
29817dce94 qcacmn: Move REGDMN and wireless modes to reg_services_public_struct.h
There is a requirement to use REGDMN and wireless modes in UMAC layer of
the cmndev component. As the WMI_HOST_REGDMN modes currently are defined in
WMI layer, we can't use them directly in the UMAC layer. Hence move them
to the reg_services_public_struct.h and rename them as HOST_REGDMN modes.
Replace all WMI_HOST_REGDMN instances with HOST_REGDMN. Wireless modes are
currently defined in WIN component, use them to cmndev component.

CRs-Fixed: 3044590
Change-Id: Iee5fa1745a1a44b834334746b10bdbb6f6563a0a
2021-09-27 22:22:23 -07:00
Shiva Krishna Pittala
81f3009593 qcacmn: Add support for run-time enablement of MGMT Rx REO feature
Add INI and WMI service bit based enablement support for
MGMT Rx REO feature.

CRs-Fixed: 3014353
Change-Id: I95650718d69b70f119621a9481dbf1518bc5500b
2021-09-27 17:58:04 -07:00
Shiva Krishna Pittala
b0384b31da qcacmn: Expose the external APIs from MLO global shared memory handling
Expose the following APIs from MLO global shared memory handling
    - APIs required by the REO logic
    - APIs required to invoke the MLO global shared memory parsing

Change-Id: Ia2fb0b0fee5d3904bae8cd70ce3364360d5ea16e
CRs-Fixed: 3014343
2021-09-25 17:22:07 -07:00
Shiva Krishna Pittala
97fe9889b6 qcacmn: Parsing logic for MLO global shared memory arena
MLO global shared memory arena contains MGMT Rx REO snapshots in the
form of TLVs. Parse the shared memory and store the address of these
snapshots. These addresses will be required by the MGMT Rx REO algorithm.

CRs-Fixed: 3035491
Change-Id: Ica1b72cd8cf4083acdeefaee41df0da4a1f57f4f
2021-09-25 15:15:09 -07:00
Kani M
2c41328915 qcacmn: Enable code under WLAN_CONV_CRYPTO_SUPPORTED
This incorporates and enables the code under the flag
WLAN_CONV_CRYPTO_SUPPORTED.

Change-Id: I5be4606fac8dbf172b017cc91ba6e19af03e282b
2021-09-24 18:27:48 -07:00
Huashan Qu
88c125a678 qcacmn: Rename QCA_MCL_DFS_SUPPORT to MOBILE_DFS_SUPPORT
Rename QCA_MCL_DFS_SUPPORT to MOBILE_DFS_SUPPORT.

Change-Id: Ic209f76e3a9b1a7a524d7036a0fef7ca044d4ca8
CRs-Fixed: 3038271
2021-09-23 21:35:24 -07:00
Sridhar Selvaraj
04c1a548a5 qcacmn: Convert vdev set mlme enum id to wmi id
Currently when sending multi vdev set param from MLME
vdev set param id is not converted to wmi layer id
resulting in incorrect mlme param update in firmware
for mbss common vap params.

Convert vdev set mlme enum id to wmi layer id when
setting multi vdev param from MLME.

CRs-Fixed: 3039992
Change-Id: Ibaeb974729f1ae9c272e203d1288229aca74b803
2021-09-23 02:11:37 -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
Jhalak Naik
e59d430af2 qcacmn: Move edge extrabins at the end of bin_pwr array
Move the left band and right band edge extra bins to
the end of the Spectral bin_pwr array.

CRs-Fixed: 3002177
Change-Id: Iea93879763a7e2c56cdb5f4d3d163e2d4b082b26
2021-09-21 04:18:47 -07:00
Wu Gao
8e18b21f89 qcacmn: Check smode value to avoid OOB read
It doesn't check smode before used as array index, the potential risk
is that OOB read or write once get invalid value from target. So, this
change checks smode value before using.

Change-Id: Ibc0625f43e31bc8b49694cca778726c6528290a8
CRs-Fixed: 3034136
2021-09-17 16:53:36 -07:00
Shiva Krishna Pittala
01c079b17b qcacmn: Add handlers for FW consumed and Host dropped MGMT frames
Consider the management frames that are consumed/dropped in the FW and also
the frames that are received at the Host but dropped in lower layers.
The host has the MGMT Rx REO parameters about these frames via WMI events.

There could be frames waiting in the MGMT Rx REO list for the above-said
frames. If we update the waiting frames with the MGMT Rx REO parameters of
the above-said frames, the waiting frames could be released and sent for
processing. Add the logic for the same.

Change-Id: I6be4577d30c4aefe2e964aefbb56472749a90cb4
CRs-Fixed: 2987941
2021-09-17 05:54:06 -07:00
sheenam monga
a554290f06 qcacmn: Fetch fw cap to support p2p + p2p concurrency
Fetch fw capability to support p2p+p2p concurrency and
store cap info in 29th bit of soc_fw_ext_caps.

Change-Id: Id8e4c0310f8db503a2997e8aed5a6f1ce813dcc7
CRs-Fixed: 3032068
2021-09-16 22:58:23 -07:00
Shiva Krishna Pittala
7c49199b38 qcacmn: Fix uninitialized variable in target_if_process_sfft_report_gen3
Uninitialized detector ID is passed to the get_spectral_mode API. Fix it.

CRs-Fixed: 3033507
Change-Id: Ifa621791c19adef2de41cb53ef8581aabff7725f
2021-09-13 01:02:25 -07:00
Huashan Qu
77f09f7272 qcacmn: Define rp_rssithresh for QCN7605 chip to different value
In dfs test mode, bandwidth detection test on dfs channel fails
with QCN7605 chip, reason is some pulses will be discarded due to
low rssi reported on some frequency channel, it's different halphy
design for QCN7605 chip, so need to define rp_rssithresh for QCN7605
chip to different value.

Fix is define rp_rssithresh for QCN7605 chip to different value for
FCC/ETSI/JP W56 table which are used for dfs certification.

Change-Id: I9132cf82e6d8d97f83ebb4cd8586f8d8ff48066e
CRs-Fixed: 2986947
2021-09-10 22:29:00 -07:00
Debasis Das
800b5ae375 qcacmn: Fix wrong memory access in spectral phyerr processing
In target_if_process_phyerr_gen2(), initialize variables
to prevent usage of junk values.
In target_if_process_sfft_report_gen3(), add check to
ensure the index doesn't exceed the size of the array.

Change-Id: Ie738d1fc836e1a2ec1358b635a4b6c64a424b894
2021-09-08 06:54:55 -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
Kiran Venkatappa
7aaef9935d qcacmn: Extract hw_link_id and store in target_if pdev context
hw_link_id is unique across psoc to identify pdev in multi-soc ML cases.
Exract hw_link_id from mac_phy_cap and provide APIs in target_if to set
and get this for pdev

Change-Id: I9dcc4c1e4b515e83151ca88f5f026c0dd0b04646
CRs-Fixed: 3023496
2021-09-01 17:13:27 -07:00
Wu Gao
64da7093a2 qcacmn: Not change RSSI of cfr meta data to dBm
Since target already converts RSSI from SNR to dBm for QCA6490 and
WCN7850, so don't convert them again in host side.

Change-Id: Ie35f3821a802f2e65b61f4891f2ca9c632fa1477
CRs-Fixed: 3024119
2021-08-31 20:04:45 -07:00
Hariharan Basuthkar
258d7f4c16 qcacmn: Implement the 6G AFC power event processing
Add regulatory functions to handle the WMI_AFC_EVENTID. This
includes processing the AFC power information received from the FW,
and constructing the AFC channel list in the regulatory component.

Change-Id: I5da8fc7faae847476f88ff35b20e6444115af7f1
CRs-Fixed: 3023789
2021-08-31 14:44:50 -07:00
Edayilliam Jayadev
9ccbe5a0fb qcacmn: Add API to get address of mgmt Rx REO snapshots
Add APIs to get address of management rx-reordering snapshots.

CRs-Fixed: 2963485
Change-Id: Idfe13425ad5f95f1a3d92edfc2d6d41aded5aec9
2021-08-23 13:26:36 -07:00
Shiva Krishna Pittala
93c0702c78 qcacmn: Add support for MGMT Rx REO filter config command
WMI_MGMT_RX_REO_FILTER_CONFIGURATION_CMD is used to the configure re-order
criterion for incoming management frames.
Add target_if and tgt layer support for the same command.

Change-Id: I5daaf4d095774d751d98a27fd77dec9daaa6b16a
CRs-Fixed: 2960488
2021-08-21 15:17:33 -07:00
abhinav kumar
86812026a0 qcacmn: Possible Integer overflow in wifi_pos_oem_rsp_handler
API "target_if_wifi_pos_oem_rsp_ev_handler" is the handler for
the event with WMI_OEM_RESPONSE_EVENTID. Host receives
"rsp->dma_len" from fw. The integer overflow occurs if
"oem_rsp->dma_len" is big enough while calculating the total
length of the Oem Data response buffer.

Fix is to add a sanity check for rsp->dma_len to avoid integer
overflow.

Change-Id: Idfbd358f62534eae0147f03505ced5728877a269
CRs-Fixed: 3001191
2021-08-21 15:17:29 -07:00
Shiva Krishna Pittala
361f45dd82 qcacmn: Add APIs to extract MGMT Rx REO params tlv
When MGMT Rx REO feature is enabled, FW will be sending MGMT Rx REO
parameters TLV as part of WMI_MGMT_RX_EVENTID for the frames that require
reordering. Add APIs to extract the same.

Change-Id: I57b132927cf413384d680b5778bfe6a2e2737adf
CRs-Fixed: 2960471
2021-08-21 13:06:43 -07:00
Shiva Krishna Pittala
593e206028 qcacmn: Add target_if layer functionality for FW consumed event handling
Add register and unregister handlers to MGMT Rx FW consumed event handlers.
Add target if layer handlers for the event.

Change-Id: I3b70f86811c562a3be75353585dc1f6cf43c02ac
CRs-Fixed: 2959925
2021-08-20 15:13:17 -07:00
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
fa7d919cbc qcacmn: Drop gen2 spectral samples after spectral scan is stopped
The host can receive some spectral samples even after stopping the scan
as there could be some samples already sitting in the WMI event pipe.
Drop those frames in the driver itself.

CRs-Fixed: 3014336
Change-Id: I8aece67b46aa84e974b538f40ffcb937c855f5a3
2021-08-19 04:59:56 -07:00
Edayilliam Jayadev
ff18a53051 qcacmn: Add API to read mgmt Rx REO snapshots
Add APIs to read management rx-reordering snapshots.

CRs-Fixed: 2955865
Change-Id: I1f36705607b0bae92d422d85223f825ed0b96ef9
2021-08-19 04:59:46 -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
Sridhar Selvaraj
c9c8ccb8cb qcacmn: Adding multi vdev set param WMI API
Adding multi vdev set param WMI API support to send
vdev param update for multiple VAPs.

Change-Id: I6f331d4179afa2b331abef9b857365c60c0a64b3
2021-08-17 20:19:00 -07:00
Arun Kumar Khandavalli
09cd3e0dd9 qcacmn: fill htt peer data version as part of init cmd
With latest architecture there are different HTT peer
data versions supported by the firmware, supported htt peer
version will be sent in the service ready and need to feedback
to the firmware in the init command.

Change-Id: Icd0470843198387cd7e0192cbe3821d45ef0534e
CRs-Fixed: 3008706
2021-08-12 03:14:29 -07:00
Jhalak Naik
4149a48ae9 qcacmn: Use correct start bin index to copy bin_pwr array for SAMP msg
Use lb_edge_bins->start_bin_idx as the bin_pwr array start bin
index, when left band edge extra bins are present.
In all other cases, use the detector start bin index
detector_info->start_bin_idx.

CRs-Fixed: 3005949
Change-Id: Ic91c3eb386d693b3f929c687e269e882b6bd8f59
2021-08-06 17:05:26 -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
Shwetha G K
9a723da9a5 qcacmn: Fix CFR pdef ref leak issue
Fix the CFR pdev ref leak issue

Change-Id: I6ba9068ae395fdbab8af4f6117dd31c72281ca5d
CRs-Fixed: 3008801
2021-08-06 14:08:51 -07:00
sheenam monga
727bee12fc qcacmn: Fix possible OOB in wmi_extract_dbr_buf_release_entry
Currently in function wmi_extract_dbr_buf_release_entry,
num_buf_release_entry & num_meta_data_entry are copied
to direct_buf_rx_rsp structure without any validation which
may cause out of bound issue if num_buf_release_entry or
num_meta_data_entries provided in fixed param becomes greater
than actual number of entries.

Fix is to validate num_entries and num_meta_data before populating
param->num_buf_release_entry and param->num_meta_data_entry.

Change-Id: I18050fd4f90f8815d7eceb5f715fdbaa09130d3a
CRs-Fixed: 3000875
2021-08-05 08:29:06 -07:00
Edayilliam Jayadev
ceacfdf8ae qcacmn: Add txops support for MGMT txrx module
1. Add txops APIs in mgmt txrx module
2. Register the txops APIs of mgmt txrx module.

CRs-Fixed: 2927742
Change-Id: I9b226d9f2b85b4ef92527315cb08047563b9ebdd
2021-08-04 05:52:52 -07:00