Commit Graph

149 Commits

Author SHA1 Message Date
Jianmin Zhu
f6fa6b6729 qcacmn: Pass hopping radar test when DFS puncture enabled
Hopping radar happens on whole band, hope all DFS sub channels are put to
NOL, but F/W only reports single radar event on special freq to host.
When DFS puncture enabled, sub channel marking is enabled, host only put
single affected 20M sub channel to NOL instead of all current bonded sub
channel, AP still stays on current freq for valid puncture bitmap
instead of leave DFS freq.

If the radar is a frequency hopping radar that truly hops over entire DFS
band, then the AP and clients are best served by moving out of the DFS
band. But it could well be that only part of the band is used. It is
difficult to find product specifications with info on the total bandwidth.
Mostly military systems use frequency hopping to avoid jamming. So a middle
ground would be to put full bandwidth of current AP to NOL for FCC type 6
frequency hopping radar.

When frequency hopping radar happens, F/W set flag that full bandwidth need
put to NOL in new added tlv radar_flags of event
WMI_PDEV_DFS_RADAR_DETECTION_EVENT, When find the flag is set, host will
put full bandwidth of current AP to NOL even sub channel marking is
enabled.

To avoid compatibility issue between old/new F/W and new/old host, add a
F/W service bit wmi_service_radar_flags_support and host service flag
is_full_bw_nol_supported.
If the wmi_service WMI_SERVICE_RADAR_FLAGS_SUPPORT is enabled by FW, host
shall set/unset a bit in the host service flag is_full_bw_nol_supported
based on host capabilities. This host service flag is then sent to FW via
WMI_INIT_CMDID.

Change-Id: I6e280ca4ab00dce97c5aec90c7a4b4fc7c4a440a
CRs-Fixed: 3595476
2023-08-28 05:44:04 -07:00
Thirusenthil Kumaran J
f1ea292064 qcacmn: Set the VAP flag to block Tx after radar is hit
The change 'I4acd2f70707386f731e9b8fa2ef90a37868cbe23'
makes modifications in MLME and DP (Data Path) to optimize
the check for radar in per packet transmission path to
reduce CPU processing overheads. This new check is based on
a VAP variable that indicates whether radar is detected
or not.

Upon radar detection, send an indication to MLME through the
registered callbacks to update the status of the flag.

Change-Id: Id0582b5d79be672949f150907eb9ee64fa17d4f7
CRs-Fixed: 3528956
2023-07-05 17:18:41 -07:00
Priyadarshnee Srinivasan
596b68de2e qcacmn: Add APIs to support RCSA and puncturing
Add API utils_dfs_get_radar_bitmap_from_nolie() to fetch the puncture
bitmap from NOL IE. Also, move dfs_convert_wlan_phymode_to_chwidth()
from oss to common code. Also, add a 11BE version of
utils_dfs_convert_wlan_phymode_to_chwidth() API.

CRs-Fixed: 3538818
Change-Id: I258452e122d259c7b16655b760f217073b8e2e9b
2023-07-05 08:36:22 -07:00
Thirusenthil Kumaran J
1301454202 qcacmn: Enumerate OCAC completion status
Currently, OCAC status in DFS SOC object is defined as a boolean type,
whereas, individual OCAC status types are defined as macros. Hence, it
becomes difficult to differentiate between various status values.

To solve this issue, enumerate OCAC status types together and change
the OCAC status in the DFS SOC object from boolean to the enumerated
type.

Also, create a new object 'adfs_completion_params' to store the Off
channel CAC completion parameters within the wlan_dfs structure.

Create a new api 'dfs_agile_cleanup_rcac' to clear the agile RCAC
parameters.

Change-Id: Id95014f4f81b4a2137092a5dd107c570d70058b6
CRs-Fixed: 3501679
2023-06-17 17:02:38 -07:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Vijay Krishnan
901ac719a7 qcacmn: Move WIN specific DFS features to WIN code
Move the WIN only DFS features from common code to WIN specific
Component dev. The following features are moved.
1. WIN Hardware mode switch.
2. StaDFS
3. dfs_set_nol
4. nol_history

CRs-Fixed: 2834311
Change-Id: I6c74dd13a16acb2a67bb3b477b13bc0e4ee165ce
2020-12-17 15:41:45 -08:00
Vijay Krishnan
607a31ed7e qcacmn: Move the post NOL feature to win code
The macro QCA_SUPPORT_DFS_CHAN_POSTNOL is specific to WIN code.
Therefore remove the macro QCA_SUPPORT_DFS_CHAN_POSTNOL and
associated code from Common code and add it to component dev.

CRs-Fixed: 2829537
Change-Id: Ib49424c44817d6af5e485c87d6f7b08afee4fa11
2020-12-15 09:50:27 -08:00
Vignesh U
336f699034 qcacmn: Store and populate the DFS channel state array
Add an enum to encode various DFS channel states.

The dfs channel states are represented using a per dfs array object rather
than maintaining a channel state field for each channel (since dfs channel
states are not required for 2G and 6G channels).

The size of the array is approximately 30 because
first_dfs_chan = 52
last_dfs_chan = 161(in case of ETSI EN302 502)
channel_spacing = difference between 2 consecutive 5G channels = 4

size_of_the_array = (last_dfs_chan - first_dfs_chan) / channel_spacing
                  = (161 - 52) / 4
                  = 27.25
                  ~= 30;

The dfs channel array is indexed by hashing the frequency. The conversion
(hash function) is as follows:

given_chan_number = (given_chan_frequency - 5000) / 5;
where 5 is: 5Mhz  = minimum IEEE chan bandwidth.

array_index = (given_chan_number - first_dfs_chan) / channel_spacing;

Add the following functionalities:
1) initialize the DFS channel state array.
2) update the channel state array.
3) read the channel state array.
4) convert the channel frequency to channel state array index.
5) convert the dfs channel event to dfs channel state.

Change-Id: I7921571fcc80b43a7ef7caf92c34b016fe396e45
CRs-Fixed: 2823529
2020-12-05 07:27:49 -08:00
gaurank kathpalia
fe1cbc425d qcacmn: Filter out the 6ghz chan freq from valid freq list
Currently the driver does not have a support to
filter out the 6ghz frequencies from the valid freq
list, and hence there is a high chance of selecting
the 6ghz freq as an operating freq for SAP, which
the legacy clients won't be able to scan.

Fix is to add a support for filtering out the 6ghz
frequencies from the valid freq list.

Change-Id: I8e3552a254e2b79cc1fc09da3e1e06ac378cbb07
CRs-Fixed: 2801414
2020-11-10 04:57:42 -08:00
Vijay Krishnan
30d4093334 qcacmn: Remove dfs_mlme_mark_dfs_for_freq function
The function dfs_mlme_mark_dfs_for_freq was introduced as a counterpart of
dfs_mlme_mark_dfs but both implement same functionality. In order to remove
redundancy, remove dfs_mlme_mark_dfs_for_freq. Replace the references to
dfs_mlme_mark_dfs_for_freq with dfs_mlme_mark_dfs.

CRs-Fixed: 2738831
Change-Id: I567861e4491802d73549670dfd30113b1a773d07
2020-09-18 07:30:08 -07:00
Hariharan Basuthkar
b820d97f13 qcacmn: Check if inter-band switch is allowed in random channel selection
During DFS random channel selection, in the function
utils_dfs_get_channel_list, check if inter-band channel switch is
allowed before adding the inter-band channels in the channel list,
from which a random channel is selected as the target channel.

Change-Id: I3f6c88788819039c4b562b462a922edf1baafe12
CRs-Fixed: 2771640
2020-09-09 09:58:36 -07:00
Vignesh Mohan
cb9f7ad948 qcacmn: Add APIs to find preCAC status of the given channel
Introduce DFS utils APIs to find preCAC status of the given
channel.

Change-Id: If47411af82b43b9dcff04ba2f84cdb10ec9ca1f1
2020-08-18 11:01:02 -07:00
Vignesh U
d96e6d0356 qcacmn: Move RCSA and NOL IE related code under a function
The RCSA and NOL IE are win specific and need to be moved into a function.

Change-Id: I5bb68279b4747ca61a4e4a7c4a6d78818ee4be86
CRs-Fixed: 2737134
2020-08-10 01:58:10 -07:00
Vijay Krishnan
c70a7a8d0f qcacmn: Send VDEV_UP after spoof radar in Rep-AP
In Partial-Offload, when a repeater is associated with Root-AP in
DFS channel. The Repeater STA will get connected with Root-AP and then
Repeater-AP comes up in the DFS channel but it does not send beacons.

The reason is, when a STA vap is UP and in connected state, CAC is
skipped. So, for Repeater-AP we send VDEV_UP before Spoof radar
pulses event. FW rejects the VDEV_UP sent by host and therefore
Repeater-AP will be in UP state but it does not send any beacons.

The fix is, while checking the condition if STA vap is set to true, we
also check whether spoof radar event is completed. If the spoof radar
event is not completed, then we will not skip CAC and then VDEV UP
will be sent after the Spoof radar event.

CRs-Fixed: 2748740
Change-Id: If63f3118d3e40785b375a0bd59d46783c14fe433
2020-08-06 06:34:50 -07:00
Vignesh Mohan
1e876d8f14 qcacmn: Add APIs to configure and switch to postNOL channel
Introduce APIs to perform postNOL channel switch to user
configured channel after the NOL expiry of said channel.

This channel change will involve regular CAC after vdev start.

Change-Id: I426b0c4b51c84789870841dd4c3af942be185f20
2020-08-06 04:24:55 -07:00
Ananya Barat
b63669d9e2 qcacmn: Handle Agile PreCAC in the same SM as RCAC
Following are a part of this change:-

1. Add an API to check if PreCAC/RCAC is enabled. This API is used before
   delivering an external event to Agile SM.
2. Post an event to the Agile PreCAC SM if Radar is found on
   agile channel. Radar on primary channel is taken care of by the
   ensuing channel change.
3. Move all Agile PreCAC changes under macro QCA_SUPPORT_AGILE_DFS,
   only RCAC specific changes remain under QCA_SUPPORT_ADFS_RCAC.

Change-Id: I45d4b9f826d36e9e4093879b394165a15a52f324
2020-08-04 03:54:39 -07:00
Ananya Barat
bc798a3c5c qcacmn: Rename the RCAC State Machine events, states & APIs
Both (ETSI) PreCAC and RCAC are going to use use the same state
machine. The state machine drives the Agile engine and not very specific
to RCAC or PreCAC, therefore let the state machine be called agile state
machine and change the names of all the associated variables accordingly.

In this preparatory change, modify names of all APIs, states and events
to make them common to Agile RCAC and Agile PreCAC

Change-Id: I67858839589145bf4377a7eafec7c21ca4823141
CRs-Fixed: 2711104
2020-08-02 08:57:54 -07:00
Vignesh U
ace59f2d1f qcacmn: Update OCAC completion Host structure and processing routine
The OCAC completion event 'wmi_vdev_adfs_ocac_complete_event_fixed_param'
has been updated to include center frequencies of 2 segments in MHz for
165Mhz Agile mode.

Update the corresponding Host OCAC completion data structure
'vdev_adfs_complete_status' to include 2 center frequencies to support
165MHz Agile mode.

Also FW might send a delayed OCAC completion status after the Host has
configured a new agile channel. So all the OCAC completion events should be
validated if the status is received for the current agile channel.

Update the OCAC completion processing API to include 2 center frequencies
and chwidth so that, it is possible to check if the OCAC completion status
is received on current agile channel or an obsolete agile channel.

CRs-Fixed: 2705671
Change-Id: Iab8980f8d030120d107f068d890c9694d28ee98c
2020-06-19 21:47:30 -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
Priyadarshnee S
78bb108d7c qcacmn: Add a dispatcher API to determine if RCAC is supported
Add a dispatcher API ucfg_dfs_is_agile_rcac_enabled() to determine
if RCAC is supported for the given pdev.
Change the prototype of dfs_get_rcac_enable() to store rcac
config in a bool datatype.
Also, do a structure copy of ch_params of RCAC channel in
utils_dfs_get_rcac_channel().

CRs-Fixed: 2679975
Change-Id: I4b033463fc8111144bfffd3bb7e7d2bef6568c46
2020-05-08 09:07:13 -07:00
Vignesh Mohan
a208da2cfc qcacmn: Post various events to the RCAC state machine
Trigger Rolling CAC SM events from
 - NOL expiry (EV_RCAC_START) to trigger RCAC START with a
   new channel if possible and not already running.
 - Agile radar (EV_ADFS_RADAR_FOUND) to restart RCAC with a
   new random channel.
 - vdev restart (EV_RCAC_STOP) to stop the running RCAC when
   the primary channel changes. Start will be based on the
   availability of the new channel.

In case of the rolling CAC feature, a channel is programmed to
the agile detector on which CAC is running continuously.
Introduce an API that finds an RCAC completed channel and return
the channel params which will be used for the next channel
change.

Also add a boolean argument in  dfs_set_current_channel api to
indicate if the dfs current channel is updated in the API
"dfs_set_current_channel".

CRs-Fixed: 2674621
Change-Id: Ica54a57f131cd54e47138f1cbeef2dd0023390ed
2020-05-01 07:00:26 -07:00
Priyadarshnee S
4c6b5c6f69 qcacmn: DFS API support for Rolling CAC
An extension of preCAC feature is Rolling CAC. The distinct difference
between these features is that the FW runs the off channel CAC
timer for a "finite" time for preCAC and runs the timer for "infinite"
time on an off channel. Hence the infrastructure built for
preCAC feature is being modified to accommodate RCAC feature as well.
Following are the modifications done:

1. Add an enum to represent various off-channel CAC modes.
2. Remove the 'static' declaration of few APIS so as to re-use them.
3. Add 'dfs_rcac_ch_params' to DFS PDEV object to store the RCAC
channel params so as to use the channel params after radar detect.
4. Rename DFS APIs to match its functionality.

CRs-Fixed: 2670419
Change-Id: I0bf0d33955706941cffb4e9cf6fcebfb465a6c74
2020-04-28 03:59:10 -07:00
bings
868ce7c912 qcacmn: Include device sleep time in the NOL timeout value
'jiffies' does not include the device sleep time.
Use qdf_get_monotonic_boottime to monitor lapse of time for nol.

Change-Id: I6e00e003b8ee3d456ac4ec62b23fdaa02d577672
CRs-Fixed: 2652692
2020-04-27 21:32:17 -07:00
Vignesh Mohan
a23f9384c4 qcacmn: Add states events and API declarations for RCAC SM
As part of the Rolling CAC State Machine, introduce three state
enums (INIT, RUNNING and COMPLETE) and the corresponding state
events.

Introduce generic APIs such as dfs_rcac_sm_create,
dfs_rcac_sm_destroy and dfs_rcac_sm_deliver_evt for rolling
CAC State machine operations.

CRs-Fixed: 2659666
Change-Id: I528db71aa7d21dced7e47ff4f9cccfbfe94c8c21
2020-04-24 01:29:16 -07:00