Commit Graph

233 Commits

Author SHA1 Message Date
D Harilakshmi
4e8a2584da Revert "qcacmn: add recommended err/debug function"
This reverts Change-Id: I6ab2bcd19b96cbbc943a60b2736dd3ab771f0b9c

Change-Id: Iafd0b31be948bb574584dfe1c77bb73125afd0e7
CRs-Fixed: 3470494
2023-04-25 12:08:05 -07:00
KARTHIK KUMAR T
e9d807fa5e qcacmn: add recommended err/debug function
add recommended err/debug function

Change-Id: I6ab2bcd19b96cbbc943a60b2736dd3ab771f0b9c
CRs-Fixed: 3470494
2023-04-19 14:21:40 +05:30
Vijay Krishnan
c75e7910c9 qcacmn: Declare puncturing SM states, APIs
Implement the data structures for DFS puncturing and
un-puncturing state machines. For details of state
machine implementation refer to the change id
I5accbf2866a830447bd776b989c31909060c45ca.

CRs-Fixed: 3462277
Change-Id: I026228fb72302408f2992325099a31a60e986e3c
2023-04-13 16:34:53 -07:00
Priyadarshnee Srinivasan
5b3d70f9a2 qcacmn: Address memory leak in dfs_init_chan_state_array
Fix memory leak in dfs_init_chan_state_array() API.

CRs-Fixed: 3442778
Change-Id: If2d7db598077975dc33617f6c30f6f86fb2d1247
2023-03-29 02:59:48 -07:00
Priyadarshnee Srinivasan
70a7674b32 qcacmn: Retrieve DFS channel parameters such as CAC, NOL, state
Add APIs to fetch the DFS channel parameters such as CAC, NOL and the
channel state to the user application.
struct dfs_cacelem is defined to store all the CAC related information
such as cac start time, cac completed time and the cac timeout.
dfs_cacelems is stored for NUM_5GHZ_CHANS in the dfs pdev object.
dfs_handle_cac_events() API is used to handle CAC related events such
as WLAN_EV_CAC_COMPLETED, WLAN_EV_CAC_RESET and radar during CAC.

CRs-Fixed: 3428828
Change-Id: I82f7aafeb20222d9722bed5a1a8c10b5703ac975
2023-03-23 00:14:50 -07:00
Jyoti Kumari
48ed0b7680 qcacmn: Pass vdev_id as an argument in policy_mgr_get_pcl()
Pass vdev_id as an argument in policy_mgr_get_pcl()

Change-Id: I047ec205632798a3e4e0da5ada6677764ae4f203
CRs-Fixed: 3412907
2023-03-22 00:40:43 -07:00
Anbarasan Ganesan
a15ee7308e qcacmn: Export symbol when compile time macro is enabled
As function is defined under compile time macro, also
export the symbol under the same macro.

Change-Id: Id2eba221dcb9c6d8cd7503e9d473199a50508309
CRs-Fixed: 3357183
2023-02-06 08:57:09 -08:00
Jeff Johnson
f57c0cf483 qcacmn: Fix umac/dfs documentation
The kernel-doc script identified some documentation errors in the
umac/dfs folder, so fix them.

Change-Id: Ia86989a39fe502480e2d2358a6f23759f78707e0
CRs-Fixed: 3382430
2023-02-05 12:40:54 -08:00
Divya R
2c0d802926 qcacmn: Enable ADFS 320 MHz capability bit
A new capability bit from FW is introduced that provides
ADFS 320 MHz support information. supports_adfs_320 signifies
chainmask capability service bit if FW supports ADFS on 320 MHz
channel width. Add this capability bit(supports_adfs_320) in host.

Change-Id: I09c689658ef495d8a8707425ecc9ba922fce4d41
CRs-Fixed: 3317795
2022-11-09 02:03:06 -08:00
Kannan Saravanan
38f0453c6d qcacmn: Initial changes for york bring-up in umac layer
Add device Id and target type checks for qcn9160 target
compilation.

Change-Id: I2a26e1c45c61630594efd86466f19ea04300939f
CRs-Fixed: 3282641
2022-10-18 10:08:27 -07:00
Jeff Johnson
069b0bbcd9 qcacmn: umac: dfs: Fix misspellings
Fix misspellings in umac/dfs/...

Change-Id: Icda5ab395b83ab28fa8455a08514823b971b27a6
CRs-Fixed: 3304697
2022-10-10 23:02:33 -07:00
Vijay Krishnan
ef864278aa qcacmn: Validate the proposed bitmap and enable puncturing
When radar is found in any DFS channel, a radar bitmap is
generated based on the radar infected channels. For example,
if operating channel is 100 HT160 and radar found in 112,
then the generated bitmap is B0000_0010. This proposed bitmap
is compared with the valid puncturing patterns. In this case,
the proposed bitmap is valid puncturing pattern.

In case of a valid puncturing pattern, send the final
bitmap to DFS module and the module updates the DFS channel
puncturing pattern. If an invalid puncturing pattern is
found, return value zero and do not update DFS channel
puncturing pattern.

CRs-Fixed: 3273800
Change-Id: Iee23ac267bfea1b4815a72c2728555f96bed6466
2022-09-08 07:47:25 -07:00
Jithender Miryala
969c3c5161 qcacmn: Add data and constants for frequency offset sign bit
Issue: The offset parameter in bangradar unit test parameter is only one
byte long. Whereas radar offsets has a range of [-160, 80] MHz if host
supports 320 MHz bandwidth. but with bangradar unit test command only till
-128 MHz is possible

To fix this, Add frequnecy offset sign bit(13th bit) if hosts supports
320 MHz bandwidth. Firmware will identify max range of [-160,80] with
sign bit.

Change-Id: I33ea8e9185f8d25b81cad7a18dcca6d2d6f42669
CRs-Fixed: 3270525
2022-09-04 23:14:08 -07:00
Jithender Miryala
26bf9ca291 qcacmn: set 'dfs' parameter if host and fw supports 320 MHz
Set dfs object parameter if host and fw supports 320 MHz bandwidth.
i.e. dfs->dfs_is_bangradar_320_enabled. Set to true if the host and
firmware support the bandwidth is 320 MHz. If there is no support, set
false.

Change-Id: I210823c448450f89dc65937201b4839168369d18
CRs-Fixed: 3270525
2022-09-04 23:14:01 -07:00
Vijay Krishnan
bcf7463728 qcacmn: Add Function pointer to Enable/Disable BW_Expand
When BW Expansion feature is enabled using UCI or cfg80211tool
command, the utility function to set/get the BW Expand feature
is introduced inside DFS module.

A new dfs member dfs_use_bw_expand is used to store the status
of BW Expansion feature.

CRs-Fixed: 3229250
Change-Id: If01e080f8e60e883fbeb2d7dfd599b91584bc293
2022-07-12 22:33:36 -07:00
Aravind Kishore Sukla
6932ea7f8a qcacmn: Replace kmsg logs to debug logs
Change kernel log level to debug level

Change-Id: Ib2736aff0f653d046d502d460f204bba2247246f
CRs-Fixed: 3182588
2022-05-10 09:11:47 -07:00
Jianmin Zhu
e0ace228c5 qcacmn: Revert "Fix issue that DFS NOL can't be cleared"
Replaced with "qcacmn: Do not access reg private if destroyed".

Change-Id: I636bcae59166ccd4719056c777682435a0a057bf
CRs-Fixed: 3158675
2022-03-25 19:12:34 -07:00
Jianmin Zhu
d94f0fb619 qcacmn: Fix issue that DFS NOL can't be cleared
When SAP off and psoc idle shutdown happens before NOL timeout,
DFS pdev obj is destroyed, NOL timer is cleared, NOL channel
is failed to clear for regulatory pdev obj is freed already.

To fix it, let NOL timer and NOL be cleared in dispatcher_pdev_close,
before pdev destroy and regulatory pdev obj destroyed.

Change-Id: I5818f8a0284a6c45e8a435ac59269df73507deeb
CRs-Fixed: 3151099
2022-03-21 22:01:25 -07: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
Jithender Miryala
102c051570 qcacmn: removal of pre-lithium Spooftest code
Add spoof test code under the macros : Spoof and partial offload

Change-Id: I17c2c911b41cefc9160885cd028cdebb0225d0da
2022-01-31 22:57:49 -08:00
Vignesh Mohan
ab3624cc01 qcacmn: Remove legacy preCAC core APIs
Remove the legacy preCAC feature core APIs from the DFS component.

Change-Id: Id88f47931fceebe37f1d249502cd52c609cf4668
2022-01-27 08:54:22 -08:00
Amith Ajith
f3c393d735 qcacmn: Move partial offload dfs code under macro
Move partial offload dfs code under WLAN_DFS_PARTIAL_OFFLOAD macro.

Change-Id: Ibbda6b5935deb3e165aa26a01b1ee32f40ee8a6f
2022-01-24 15:50:23 -08:00
Vignesh U
b7b42cc588 qcacmn: Expand sub-channel array storage for 11be chipsets
The sub-channel array size was maximum of 8 sub-channels corresponding
to a maximum channel width of 160MHz. But with the introduction of 11be
higher channel width of 320MHz is possible.

Expand the size of sub-channel array to 16 to accommodate the sub-channels
of 320MHz in case of 11be chipsets.

Change-Id: I7ffd1a7c0f05085edff74b92e47ab5a0dab42ef0
CRs-Fixed: 3068405
2021-12-13 23:25:00 -08:00
Vignesh U
dd76700b7d qcacmn: Update dfs channel punc pattern from mlme
With the introduction of 11BE, channel puncturing becomes possible.
Hence, the DFS channel structure should be updated with channel puncturing
information.

Change-Id: Ia1bccd55e7fadde2a49fb08bd30ff6b5b2cc6ba1
2021-10-18 09:43:29 -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
Vignesh U
23be35ae70 qcacmn: Set "agile_precac_active" for all applicable pdevs
Currently, "agile_precac_active" is set only after receiving the start
event in the init state. "agile_precac_active" indicates whether adfs is
supported in the radio or not. This has to be set based on the agile precac
enabled check when the vap is brought up and when the event
DFS_AGILE_SM_EV_AGILE_START is sent to DFS Agile State Machine.

Change-Id: I2084d6d413ee11fa9f77026326dab79aafcd64fb
2021-09-24 02:14:43 -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
Vignesh Mohan
5fc1705df5 qcacmn: Avoid switching to spur channels in UNII-1 band
When operating in 20/40MHz modes in channels 52/56/60/64, spur
is found on adjacent channels (40, 44, 48) if we switch to those
channels after radar. To avoid this issue, add a SW WAR to ignore
selecting the adjacent channels if radar is found on the UNII-2
channels (52-64).

Change-Id: I4d02c53bf57171b9e5e5704d36552d0d5c6423b9
2021-09-22 07:37:31 -07:00
Liangwei Dong
116aba71e2 qcacmn: Fix DFS_RANDOM_CH_FLAG_NO_DFS_CH not working
When DFS_RANDOM_CH_FLAG_NO_DFS_CH set, the random channel
selection will pick non-dfs channel. But currently the
MCL API utils_dfs_get_channel_list doesn't populate
the DFS flags "WLAN_CHAN_DFS" for dfs channel.
That causes the dfs_prepare_random_channel_for_freq API
can't identify DFS channel.
Fix by set WLAN_CHAN_DFS for dfs channel

Change-Id: I7ead760ddc77c198a630d12960e775961840796c
CRs-Fixed: 3016746
2021-08-23 19:09:17 -07:00
Vignesh Mohan
10ca017ae0 qcacmn: Check if pdev only supports 6G for DFS check
While checking if the pdev is 5G for DFS APIs, only 11A mode
support is checked which is also present for 6G radios which do not
have DFS. Check if the radio is only 6G in addition to the 11A check,
and if it's only 6G supported, return false.

Change-Id: I80008de610a93eeac326da36da43a747bafad2d9
2021-08-23 13:26:40 -07:00
Huashan Qu
83065ffe1e qcacmn: Fix multiple radar founds for a single burst
In dfs test mode, 18 pulses are injected in a single burst, the host
driver reports the radar found event two or three times to
upper layer. For a single burst of radar pulses, radar found event
should be reported only once.

Fix the multiple radar founds for a single burst by disabling radar
detection and flushing the existing radar pulses from all queues
while processing the current radar found indication event in dfs test
mode (usenol=0).

Change-Id: I70c7c15147a5cde038773fd97735c113ca385932
CRs-Fixed: 2981217
2021-08-16 03:18:29 -07:00
Vignesh U
171c65dccd qcacmn: Prevent random channel selection to choose UNII1 channels
Spur or leakage transmissions is observed in Spruce HW in
frequencies from 5260MHz to 5320MHz when one of the following
conditions is true,
i) The AP is transmitting in 52/56/60/64 in 80MHz mode and then the  AP
moves to the adjacent channel 36/44/48 in 80MHz mode and starts
transmitting.
ii) The AP is transmitting in 36/44/48/52/56/60/64 in 160MHz mode and then
the  AP moves to the adjacent channel 36/44/48 in 80MHz mode and starts
transmitting.
In order to prevent random channel selection to cause spur restrict the
above given channel movements for Spruce target alone.

Change-Id: I27b558ec5544076430f66c84b056ab65f9e43c8c
CRs-Fixed: 2975473
2021-07-16 03:55:15 -07:00
Jyoti Kumari
aab3676557 qcacmn: Don't use dfs_find_target_channel_in_channel_matrix()
As part of regulatory cleanup, remove
dfs_find_target_channel_in_channel_matrix()

Use dfs_find_target_channel_in_channel_matrix_for_freq() instead
of dfs_find_target_channel_in_channel_matrix()

Change-Id: I8750b95d5cf4a4fa3d738c2209edf1328794d486
CRs-Fixed: 2959916
2021-06-28 02:59:24 -07:00
Ananya Barat
a63dd03feb qcacmn: Increment num_radar_detects for FO everytime radar is detected
With the current implementation, dfs->wlan_dfs_stats.num_radar_detects
is incremented for radar detections in partial offload alone. For FO,
this stat was not incremented. As a result, when the number of times
radar has been detected is queried with radartool, the stat always
returns 0.

Fix this by incrementing this stat for FO chipsets as well.

CRs-Fixed: 2967882
Change-Id: Ibf5ea3f9f358476a2b21eeae782c44e0d53ada52
2021-06-25 14:15:20 -07:00
Ashish Kumar Dhanotiya
433c6f024a qcacmn: Cleanup code under CONFIG_CHAN_NUM_API feature flag
As part of regulatory cleanup, Cleanup code under
CONFIG_CHAN_NUM_API feature flag.

Change-Id: I3add81605ea939b3631396154ed3f07f59493f24
CRs-Fixed: 2953646
2021-06-22 03:54:03 -07:00
Priyadarshnee Srinivasan
70279dce34 qcacmn: Redefine conditions to skip CAC
Find out if a VAP is going through restart transition and skip CAC.
All other cases, do not skip CAC based on subset logic.
Also, if the channel is non-DFS, do not do CAC.

CRs-Fixed: 2945741
Change-Id: I5a9de47a879eb8d294dfed126a77970c52b2b546
2021-06-21 01:17:33 -07:00
Vignesh Mohan
dcd62f697c qcacmn: Remove redundant DFS APIs
Remove the redundant DFS APIs dfs_mlme_get_dfs_channels_for_freq and
dfs_nol_timeout.

Change-Id: I9c93c27c3d575228a2e8102660b395beb040dcce
2021-06-17 07:19:45 -07:00
Venkateswara Swamy Bandaru
2376885753 qcacmn: API change to support cfreq2
Add cfreq2 along with preimary frequency to support 320MHz
bandwidth.

Change-Id: Ibc0a093a42658c128d032eeb4e14c07bb8a8c6e1
CRs-Fixed: 2962023
2021-06-08 18:17:32 -07:00
Priyadarshnee Srinivasan
1227b651fb qcacmn: Do not prohibit aspectral if DFS is NULL
Bring up a 5GHZ AP on HKV2 board and enable agile spectral scan
using "athssd -i wifi0 -j ath0 -a -f 5180" cmd. Agile spectral
scan fails to begin.

Agile spectral scan must not begin if RCAC is enabled as both cannot
run simultaneously. All the pdevs of the current PSOC are passed as an
input to 'target_if_is_aspectral_prohibited_by_adfs' to validate if
rcac is enabled on any of them. In case of HKV2, both 2G/5G PDEVs belong
to the same PSOC, when 2G PDEV is given as input, ucfg_dfs_get_rcac_enable
returns a failure as DFS is NULL.
Hence target_if_is_aspectral_prohibited_by_adfs returns a failure and
agile scan does not begin.

RCAC feature is only for 5GHZ channels and need not be validated for
2G PDEV. Hence do not block aspectral scan if DFS is NULL for 2G PDEV.

CRs-Fixed: 2947887
Change-Id: Icce2300f7ca2a4caf7d46cc23fe055f07f90266c
2021-05-25 16:54:14 -07:00
Jianmin Zhu
ef56741282 qcacmn: Remove the unused CHAN_NUM functions
Clean up following functions:
dfs_mark_precac_done
dfs_unmark_precac_nol/utils_dfs_unmark_precac_nol
dfs_mlme_start_csa/mlme_start_csa
dfs_mlme_get_extchan/mlme_get_extchan
dfs_fill_chan_info
utils_dfs_get_channel_list
dfs_clear_nolhistory
dfs_getchanstate
dfs_radar_enable
os_timer_func
dfs_cac_timeout

Change-Id: Id0775ba34b6f1f6c7fedaea9711d81ca07956c70
CRs-Fixed: 2946423
2021-05-19 01:26:00 -07:00
Amruta Kulkarni
7fe3773331 qcacmn: Remove wlan_reg_set_channel_params
- Remove wlan_reg_set_channel_params and the callers
 associated code.
- Clean up part of CONFIG_CHAN_NUM_API functions.

Change-Id: If9583e674752d6f47de8d7d6bc946909509957b5
CRs-Fixed: 2883773
2021-03-11 19:42:48 +05:30
Ananya Barat
7c33a279fd qcacmn: Do not enable all the dfs error prints by default
A huge number of prints come under dfs_err. Enabling all of these
unnecessarily floods the console and some of these prints show up for
expected behavior such as  the dfs object being null for a 6GHz radio.
Only memory specific prints could be enabled specifically later.

CRs-Fixed: 2887966
Change-Id: I27091924450d1cc3d4e3df38e49f1a537e080bc6
2021-03-07 02:27:41 -08:00
Vijay Krishnan
31dfdf84bf qcacmn: Enable dfs_err logs on default
During wifi load and unload, multiple memory allocations and deallocations
are done in the path of dfs_deinit_precac_list, and at a particular
instance there is a crash seen due to an invalid paging request.

The QDF_TRACE_LEVEL_ERROR logs are not enabled by default. These prints
can be useful in debugging the issue when it occurs the next time.
Hence, the dfs_err prints are enabled by default.

When a crash occurs with the dfs_precac list functionality, debugging the
crash with dumps in T32 is difficult. During wifi unload, the api
wlan_dfs_pdev_obj_destroy_notification is called. On first step, the pdev
component is detached making the pdev component as NULL and after that
dfs component is detached. So when crash happens at this point, pdev
component is already NULL and analysing dumps with T32 is useless at this
stage.

Therefore, modify the order of dfs detach in
wlan_dfs_pdev_obj_destroy_notification. First detach the dfs component and
then detach the pdev component.

CRs-Fixed: 2872097
Change-Id: I157c6e6272bf4dd3676588b7ee6889fdb2efa5dc
2021-02-18 07:47:00 -08:00
Priyadarshnee
ae12eefb50 qcacmn: Add an API to process spoof completion
Add function declaration for mlme_proc_spoof_success API and its
corresponding function pointers. This API is used to process spoof
completion status from FW.

Change-Id: Ia25ffd01619a0c9d1e5a1bc4c20623b75ee8d75e
2021-02-01 00:52:06 -08:00
Vijay Krishnan
63f4a150bb qcacmn: Debug prints to check Average params
During DFS_SPOOF_FAILURE Check, the reason for failure is unknown.
So for debugging analysis purposes, add debug prints to print the
average params that are sent to FW.

CRs-Fixed: 2847047
Change-Id: If1e20352f62f4286396a9f93f49c528bbf38f95e
2021-01-28 21:57:15 -08:00
sheenam monga
5743559888 qcacmn: Remove utils_dfs_bw_reduced_channel
Remove utils_dfs_bw_reduced_channel as this
function is not used by MCL or WIN.

Change-Id: I042578fea76cd845b90f240fa3e814e50f2eaf5b
CRs-Fixed: 2859799
2021-01-28 06:19:41 -08:00
Edayilliam Jayadev
1dfb6de288 qcacmn: Return agile precac enable as false when DFS object is null
DFS component's pdev private object allocation is skipped in
few scenarios. In this case return agile precac enable as false.

CRs-Fixed: 2853435
Change-Id: I7725e9bcbd05b2c9f1b1ee217cc8eb8a2df8144a
2021-01-19 06:00:18 -08:00
Ananya Barat
6b309b7dbe qcacmn: Enable STA DFS in F/W
If STA DFS is enabled before vdev creation through etc/config/wireless
then VDEV START is sent to F/W as a part of the normal flow to bring
the VAP up. However, if STA DFS is enabled/disabled on the fly for a
running VAP then do a VDEV STOP, followed by a VDEV START of the STA
VAP and set/unset WMI_CHAN_FLAG_STA_DFS flag in VDEV start.

Change-Id: I032ffa53d89eaafcb43c648670af3b3f2134561f
CRs-Fixed: 2843248
2021-01-13 02:34:49 -08:00
Vijay Krishnan
d56177bd21 qcacmn: Add macro QCA_SUPPORT_DFS_CAC
Conditional compile dfs_cac functionalities to
avoid compilation issues.

Change-Id: Id81b51f071f9abfb666231f2b2005d3c594b7d1a
CRs-Fixed: 2843645
2020-12-24 09:52:34 -08:00