Commit Graph

241 次程式碼提交

作者 SHA1 備註 提交日期
Nagasai Bharat Gatkeshwar Sainoji
f291b79d0d qcacmn: Fixes in assert cleanup in Spectral module
Fix minor issues in assert cleanup and handle default case.

Change-Id: Ib267c2df711d56875e4f2793096958d1c8e561c3
CRs-Fixed: 3615628
2023-10-19 18:49:57 -07:00
Nagasai Bharat Gatkeshwar Sainoji
2cc88020a1 qcacmn: Clean up asserts in Spectral module - Part 8
Clean up invalid pointer/value asserts by returning the error status
to the caller in the below spectral module files
1. target_if_spectral_sim.c

Change-Id: Ibc59e7703dcad9cbc9309a6ad96f5279cafb538d
CRs-Fixed: 3591982
2023-08-31 00:13:35 -07:00
Nagasai Bharat Gatkeshwar Sainoji
2140bff4e9 qcacmn: Clean up asserts in Spectral module - Part 7
Clean up invalid pointer/value asserts by returning the error status
to the caller in the below spectral module files
1.target_if_spectral_sim.c

Change-Id: Iad4314409ee5d2037c566c9a022cbfc2444f6460
CRs-Fixed: 3591964
2023-08-30 13:40:26 -07:00
Nagasai Bharat Gatkeshwar Sainoji
843a02da37 qcacmn: Clean up asserts in Spectral module - Part 6
Modify functions to return QDF_STATUS to handle assert conditions and
return appropriate status to the caller
1. target_if_spectral_phyerr.c

Change-Id: I8f9d320b774ef172bc3dd3609581b13694e1edfd
CRs-Fixed: 3591197
2023-08-30 13:40:16 -07:00
Nagasai Bharat Gatkeshwar Sainoji
f95831ad9a qcacmn: Clean up asserts in Spectral module - Part 5
Clean up null pointer asserts by returning the error status to the
caller in the below spectral module files
1. target_if_spectral_phyerr.c

Change-Id: I8f4fc5a30b710489003888b897b756ea44dface6
CRs-Fixed: 3591187
2023-08-30 07:58:35 -07:00
Nagasai Bharat Gatkeshwar Sainoji
59d8528e00 qcacmn: Clean up asserts in Spectral module - Part 4
Clean up invalid pointer/value asserts by returning the error status
to the caller in the below spectral module files
1. target_if/spectral/target_if_spectral.c

Change-Id: I57735ce35d33011dd9041a2cd16a740673a12800
CRs-Fixed: 3589879
2023-08-30 07:58:23 -07:00
Nagasai Bharat Gatkeshwar Sainoji
a2dfe3fac7 qcacmn: Clean up asserts in Spectral module - Part 3
Modify functions to return QDF_STATUS to handle assert conditions and
return appropriate status to the caller.
1.target_if/spectral/target_if_spectral.c

Change-Id: I7704d67932b6a84853deb5c7f5dc43810124dd1f
CRs-Fixed: 3589875
2023-08-30 07:58:12 -07:00
Nagasai Bharat Gatkeshwar Sainoji
34f331aae6 qcacmn: Clean up asserts in Spectral module - Part 2
Clean up null pointer asserts by returning the error
status/appropriate value to the caller in the below spectral module
files 1. target_if/spectral/target_if_spectral.c

Change-Id: I17cb1288c030a4d0f35638da4acda8d59116f9f8
CRs-Fixed: 3589783
2023-08-30 04:53:22 -07:00
Nagasai Bharat Gatkeshwar Sainoji
93830f424d qcacmn: Clean up asserts in Spectral module - Part 1
Clean up null pointer asserts by returning the error status to the
caller in the below spectral module files
1.spectral/core/spectral_common.c
2.target_if/spectral/target_if_spectral.h
3.target_if/spectral/target_if_spectral.c

Change-Id: Ib8d49c06928379768fb41e34d721bd3840e86330
CRs-Fixed: 3587512
2023-08-29 05:21:01 -07:00
Edayilliam Jayadev
d8b480fa26 qcacmn: Add upper bound check for scan count
Add upper bound check for Spectral scan count parameter.

CRs-Fixed: 3495755
Change-Id: I31cb9313bc1abcc8323a00242a6f34b25af9ed9d
2023-05-21 22:13:50 -07:00
Edayilliam Jayadev
95bcc4cdfe qcacmn: Change the magic pattern to indicate the blanking
Change the magic pattern to indicate blanking from 0xdeadbeaf
to 0xc0debeaf.

Change-Id: Ifc72e0afe35e9f49fb27f4d5fb674af81231e196
CRs-Fixed: 3471929
2023-04-28 03:07:03 -07:00
Kannan Saravanan
e11f459ade qcacmn: Pebble bring-up changes in Umac and target_if layer
Add device Id and target type checks for qcn6432 target
compilation
Add CFR and spectral support for QCN6432

Change-Id: Ic908fa768aa1be7cfc40be7fcc7f9ca6aa85aaa6
CRs-Fixed: 3351747
2023-04-20 04:59:28 -07:00
Jhalak Naik
e7058a73c6 qcacmn: Fix invalid memory access
Fix the spectral mode check to avoid invalid memory access.

Change-Id: Id95cf19457aa2eddee90568fa567e5f7859a0a53
CRs-Fixed: 3452841
2023-04-04 19:51:50 -07:00
Jeff Johnson
abbb3f3b9d qcacmn: Fix target_if/spectral documentation
The kernel-doc script identified documentation issues in the
target_if/spectral folder, so fix them.

Change-Id: I0bb7d3632fd602450713d8521861d246ea5f33df
CRs-Fixed: 3417470
2023-03-07 14:49:59 -08:00
Edayilliam Jayadev
7f60898cfc qcacmn: Fill "blanking status" field of SAMP message
Extract the blanking status from Spectral reports and upload
it to user space via SAMP message.

CRs-Fixed: 3413925
Change-Id: Ib033b88190be6bca3dff903cf279a9883821fb10
2023-03-02 14:50:16 -08:00
Edayilliam Jayadev
bbede4e20d qcacmn: Add "blanking status" field in SAMP message
Add "blanking status" field in Spectral SAMP message.

CRs-Fixed: 3407155
Change-Id: I488a78cc06518a34b1adcf3db6ad4b3133115e9a
2023-02-21 23:59:59 -08:00
Linux Build Service Account
b6eaaa8940 Merge "qcacmn: Guard Spectral report processing with spinlock" 2023-02-09 16:44:04 -08:00
Jhalak Naik
40c8de4f24 qcacmn: Guard Spectral report processing with spinlock
There is a possibility of Spectral being stopped by user
while a report is being processed, this can lead to the data
structures becoming invalid leading to an error.
Guard API target_if_consume_spectral_report_gen3 with
spectral_lock to avoid this, and allow Spectral scan to stop
only when the ongoing report has been processed.

Change-Id: I617f66e3c5b45323f8c88e9e5e173b139a8a9241
CRs-Fixed: 3376179
2023-02-07 17:22:20 +05:30
Prakash Manjunathappa
3cde321196 qcacmn: Add PEACH device support
Add support for peach device. Add peach conditional statements.

Change-Id: Ia107e60fd00b4938984414fd92d6699d11fd3797
CRs-Fixed: 3394198
2023-02-07 00:54:44 -08:00
Edayilliam Jayadev
629e231541 qcacmn: Initialize detector id to mode table for QCA5332
Initialize Spectral Scan detector ID to Spectral mode table for
QCA5332. Detector ID 1 and 2 are not supported for QCA5332.

CRs-Fixed: 3366784
Change-Id: I7fe9b53819c649455a67957827e4f900e39257e0
2023-01-05 14:31:01 -08:00
Priyadarshnee Srinivasan
7ef4c7a634 qcacmn: Add input puncture bitmap to channel search API
Add input_punc_bitmap to struct ch_params.
Add input puncture bitmap to regualtory channel search APIs.

The non-SP channels will be punctured by ACS module so that AP
can come up in highest possible BW in Standard Power mode
with the given primary frequency. These punctured channels are not
validated (whether supported in the given power mode of operation) by
the regulatory.

CRs-Fixed: 3278013
Change-Id: I56b0495be902fd92fc6da26e1007d60f930ba687
2022-10-26 01:16:27 -07:00
Kannan Saravanan
a73234426a qcacmn: Initial changes for york bring-up in target_if layer
Add device Id and target type checks for qcn9160 target
compilation.

Change-Id: Ic28edc568c09aa5d43ba71393eca26479dd49463
CRs-Fixed: 3282639
2022-10-18 10:08:34 -07:00
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
Asutosh Mohapatra
9ab40cb89e qcacmn: Fix uninitialized var ptr issue and null check for num_pscos
1.This change fixes the use of uninitialized
variable in host driver.

2.Adds NULL check for num_psocs in mlo_peer_calculate_avg_rssi to
avoid undefined behaviour.

Change-Id: Ifbfef42b5930dfe15736a75a74e81155c5f1fbce
CRs-Fixed: 3297794
2022-10-06 00:22:18 -07:00
Shiva Krishna Pittala
2bef7708b1 qcacmn: Stop the spectral scan at the end of last report in finite scan
In the case of finite Spectral scan, the spectral scan will be stopped in
the target once the requested count of spectral reports got generated.
The Host will not be notified of this stop scan. To synchronize the Host
data structures in accordance with the target, we explicitly stop the scan
once the last report is received. In the current implementation, the
stop_scan() is called at the beginning of the last report processing and
we continue processing the last report. As part of the last report
processing, we could access the data structures that were reset during
the stop_scan(). To fix this, stop the spectral scan at the end of the
last report processing.

Change-Id: Iecfa4e72ccbedae77ee2a57e9283910e980121d5
CRs-Fixed: 3287136
2022-09-19 01:49:32 -07:00
Sajini R
7c7742990b qcacmn: Initial changes for IPQ5332 target compilation
Added device ID and target type checks for IPQ5332 target
compilation.

CRs-Fixed: 3273865
Change-Id: I98a768394cc539549fc41d756c9c9d90034627f5
2022-09-16 11:52:44 -07:00
Sreeramya Soratkal
057bd5f570 qcacmn: Remove unused local variables in spectral module
Remove unused local variables in the Spectral module to
address the compiler warnings.

CRs-Fixed: 3272706
Change-Id: I91c806a9bd6413eb559992a0b184d8bd9c4ea4d0
2022-08-26 14:21:26 -07:00
Naveen S
e86fc7ebe9 qcacmn: Removing error value return on event registration failure
WMI_SPECTRAL_CAPABILITIES_EVENTID registration returns QDF_STATUS_E_FAILURE
on failure which is not required as it is causing crash on failure where
event registration is failing i.e., Hawkeye + Swift

Change-Id: Id11d76941b12d0ee249d8f6e86612b351b732d78
CRs-Fixed: 3255827
2022-08-03 01:34:40 -07:00
Shiva Krishna Pittala
caa7965659 qcacmn: Update the Detector ID to mode table based on FW_PARAMS event
Currently, we are hardcoding the detector ID to mode table for different
chipsets. Starting QCN9224, the target sends information regarding the
detectors participating in that Spectral session in the FW_PARAMS event.
Use that to update the Detector ID to mode table.

Change-Id: Ic09358e0c3b9ac0166b39f5ce445a83697146d4a
CRs-Fixed: 3253076
2022-07-27 01:59:24 -07:00
Shiva Krishna Pittala
98b4eee3ac qcacmn: Add support to build Spectral detector list for split-PHY mode
Currently, the Spectral detector list building logic assumes that only
5 GHz or 6 GHz participates in SBS modes. With Split-PHY mode in QCN9224,
even a 2.4 GHz radio can participate in SBS mode.
So, consider this case as well while building the detector list.

Change-Id: I99c841584c52785e94c8ee1b0d59494cbdd37f42
CRs-Fixed: 3252986
2022-07-27 01:59:16 -07:00
Shiva Krishna Pittala
3567bb3b57 qcacmn: Add support to process Spectral capabilities event
WMI_SPECTRAL_CAPABILITIES_EVENTID event will be sent by the target SW to
indicate the different capabilities of the Spectral HW.
Add support to process this event and extract the capabilities.

Change-Id: I03b3236b6def98d24e77b2a9ea51ee866e62e6fe
CRs-Fixed: 3238450
2022-07-22 07:00:18 -07:00
Srinivas Girigowda
6d056b9959 qcacmn: Add support for Mango device id
Add support for Mango device id.

Change-Id: I2b32a39e258caab408723db77f132af364dc6b04
CRs-Fixed: 3232512
2022-07-02 09:55:56 -07:00
Divya R
33e3e1d6a8 qcacmn: Initialize the chan_params structure
chan_params structure is uninitialized, due to which variables
inside the chan_params structure have garbage values.
To avoid this, initialize the chan_params structure.

Change-Id: Ic09c0a2d24c2a1eac8f076c7bbd4d25d147370fd
CRs-Fixed: 3205502
2022-06-01 01:45:37 -07:00
Shiva Krishna Pittala
80edcddb01 qcacmn: Spectral init path changes for QCN9224
Add the Spectral init path changes required for Waikiki.

Change-Id: I6c6bb826ff4ce02988560100b187fe1acffa3f7d
CRs-Fixed: 3160798
2022-05-05 01:21:04 -07:00
Shiva Krishna Pittala
eb29b7fac2 qcacmn: Don't use packmode_fftbin_size_adj WAR for QCA9574
packmode_fftbin_size_adj is used when the reported FFT bin length from
HW is twice the actual size. This issue is fixed in HW from Pine onwards.
So, don't use this WAR on QCA9574.

Change-Id: I43a4bcb6f238fac6a14c1f6459d7ad24a7a99b2d
CRs-Fixed: 3165085
2022-04-22 06:10:19 -07:00
Bing Sun
37a48b157f qcacmn: provide is_create_punc_bitmap when generateing puncture
Puncture is one of 11be feature. Even 11be compile macro is defined,
Dut can start AP with non-11be mode. Regulatory component has no idea
whether it should consider puncture or not. Puncture should be a
configurable parameter from caller.
When updating channel state, puncture should be considered for 11BE
AP. is_create_punc_bitmap should be set in struct ch_params and pass
it to reg_get_5g_bonded_channel_state_for_pwrmode.

Change-Id: I96fb131f2df201a827ab7d98ca099a38b008e0d3
CRs-Fixed: 3160259
2022-04-08 01:57:29 -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
Abhijit Pradhan
3f95481d0e qcacmn: Add powermode APIs under a new macro
Use  CONFIG_REG_ 6G_PWR_MODE for the new API.
Use "_for_pwrmode" as suffix for the new functions.

Change-Id: I9b84944a59062277b76bc48877c47ea5afada0ec
CRs-Fixed: 3133023
2022-02-28 12:57:10 -08:00
Hariharan Basuthkar
e7b559d010 qcacmn: Replace reg curchan with 6g ap power based chan list
The consumers of the current channel list may want to search through 6G
channels that are not part of current channel list and belong to channel
list of different power mode.

Therefore, replace the regulatory current channel list with that of 6G
power based channel list.

Change-Id: Ie2ff8bbfb50a5f95f584b134b18246cb28b1c406
CRs-Fixed: 3110987
2022-02-28 12:57:03 -08:00
Shiva Krishna Pittala
0878b6eaf9 qcacmn: Fix FFT bin values for pack mode 0
While copying FFT bins from the target, Spectral Host driver reads
one DWORD (32-bits) at a time and extracts FFT bins out of those DWORDs.
This extraction uses standard bit shift and mask operations as below.

    #define QDF_GET_BITS(_val, _index, _num_bits) \
                    (((_val) >> (_index)) & ((1 << (_num_bits)) - 1))

For a chipset that uses pack mode 0 i.e., packs 1 FFT bin per DWORD,
_num_bits in the above operation will be 32. So, we try to left shift the
integer constant '1' by 32. If the integer constant is represented by
32-bit integer, we could have issues in the result of shift operation.
As per C standard, the result of shifting an operand by a count greater
than or equal to width (in bits) of the operand is undefined.
This is because some platforms could optimize the shift operation by
masking the shift count to 5 bits. That means, the shift actually
performed is 32 & 31, which is 0.

Fix this by using 64-bit integer constant '1' in the above operation.

Change-Id: Ic7fe4de7917f3069d78a2ff29d86009cbf381e3f
CRs-Fixed: 3125158
2022-02-14 12:46:05 -08:00
Jhalak Naik
2588f440fb qcacmn: Fix synchronisation between process and tasklet contexts
Currently, qdf_spin_lock/qdf_spin_unlock is used to protect
spectral_lock. This can lead to a deadlock when the process
context is holding the lock and gets pre-empted by the tasklet.
To avoid this use qdf_spin_lock_bh/qdf_spin_unlock_bh.

Change-Id: Ibd2be7b7f3faf2dea9d7df8d6468c7a8fda512f2
CRs-Fixed: 3124199
2022-02-13 22:01:54 -08:00
Wu Gao
8d1d470a91 qcacmn: Enable spectral scan support for HMT
This change enables spectral scan support for HMT.

Change-Id: I031dd2392b39aebb9281e7dbf42132b5dc150f25
CRs-Fixed: 3118332
2022-02-01 08:55:51 -08:00
Shiva Krishna Pittala
a9948f7e23 qcacmn: Fix fft end bin index for Spectral report modes 0 and 1
For reports modes 0 and 1, the number of FFT bins in a detector will be 0.
We calculate end_bin_idx as start_bin_idx + num_bins - 1.
When start_bin_idx is 0 for these report modes, end_bin_idx will be -1.
Since bin indices are unsigned integers, end_bin_idx becomes a very big
value and we will try to copy unintended large number of bytes.
Fix this by forcing end_bin_idx to start_bin_idx when num_bins is 0.

Change-Id: I11e5dd673fc95a1ce3823ef977fd70c34a4ec67e
CRs-Fixed: 3096955
2022-01-28 00:54:00 -08: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