Commit Graph

149 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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