Commit Graph

195 Commits

Author SHA1 Message Date
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
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
bings
7f63da092c qcacmn: Update NOL to platform even there is no nol channel
After clear nol channel, the number of nol channel is 0. We should update
this information to platform.

Change-Id: Ia39be9a2c53067629460ead6000c2661ead07f63
CRs-Fixed: 2818936
2020-11-19 22:46:18 -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
Vignesh Mohan
46be7cdcbd qcacmn: Use 80MHz as next BW after radar during 80p80MHz
With bandwidth reduction enabled, when radar is detected during
80p80MHz operation, if the primary segment is unaffected, the
next expected BW for the device is 80MHz. However, the API
reg_set_channel_params has the following bw precedence list:
80P80 -> 160 -> 80 -> 40 -> 20 MHz.

This is valid in normal channel change cases but when used for
the bandwidth reduction feature, 80P80MHz should be considered
same as 160MHz and the next bandwidth (to be checked) should be
80MHz.

Update the channel width in the channel params to 80MHz if
the current channel is 80P80MHz and call the regulatory API
to check channel availability with the updated params.

CRs-Fixed: 2805939
Change-Id: I4337a3a797d1c4b0ef19e47d0933d4dd292733b5
2020-11-02 01:47:11 -08:00
sheenam monga
ba9e7a24f6 qcacmn: Avoid excessive logging
Issue: log level for some frequent prints is set to info
those logs would be present in dmesg as well as driver logs
and System performance may get affected due to excessive
logging.

Fix: Avoid redundant logs which may affect system
performance and change default log level to debug.

Change-Id: I053e95806884eab26c37340823b818c9e3c81036
CRs-Fixed: 2771412
2020-09-24 13:19:54 -07: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
Hariharan Basuthkar
9fed3d69fb qcacmn: Do not create a DFS object for a 6G only radio
Do not create a DFS object for a radio if the channel frequency range
advertised by the target is a 6G only range.

Change-Id: Ib672902ec3945d00b53ab6d4460584ca889ae387
CRs-Fixed: 2755652
2020-09-08 00:47: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
Vijay Krishnan
8461a8d5cd qcacmn: Do not skip CAC if Spoof test is not complete
In Dependent Repeater, if the Repeater STA is connected to a Root-AP
in a DFS channel, then the Repeater AP which is configured in ETSI
domain comes up in the DFS channel doing CAC.

In FCC domain, whenever Spoof radar pulse comes, we check if the Spoof
check is done and skip the CAC accordingly. In case of other domains,
Spoof events are not present. Therefore, Spoof test can be always
considered complete for non-FCC domains. Also the test can always be
considered complete if the target/FW does not support spoof test.

CRs-Fixed: 2756845
Change-Id: Icac4dee5f3f69a2578a0a34d7aea9456aab63ece
2020-08-17 15:12:22 -07:00
Ananya Barat
f878c39090 qcacmn: Make init of dfs->dfs_soc_obj independent of the macros
With the current implementation dfs->dfs_soc_object was initialized in
function dfs_agile_soc_obj_init under the macro QCA_SUPPORT_AGILE_DFS
and ATH_SUPPORT_ZERO_CAC_DFS both of which are disabled for the low
memory profiles. Hence the dfs->dfs_soc_obj was not initialized for these
profiles, this led to a crash when the following access was made in
dfs_is_true_160mhz_supported and dfs_is_restricted_80p80mhz_supported.

psoc = dfs->dfs_soc_obj->psoc
Fix this by unconditionally initializing the dfs->dfs_soc_obj in
wlan_dfs_pdev_obj_create_notification.

Change-Id: I3438464e8efedaf2d62a68bbcf1bda5ee0579deb
2020-08-15 11:12:30 -07:00
Hariharan Basuthkar
e808bb0cce qcacmn: Add 6G support for DFS Random channel selection
Add 6G support for DFS Random channel selection to move to a 6G target
channel in the event of a radar on a radio that supports both 5G and
6G channels.

Change-Id: I1ad65b36feba65b6bbc3affc243aae1beb12960c
CRs-Fixed: 2727958
2020-08-14 10:23:04 -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
adae9cdb21 qcacmn: Do not modify radar found params while processing it
The radar found parameters processing API dfs_process_radar_ind() is
supposed to read-only the radar_found_info parameters and not modify
them. A block of code for PO platforms modify the radar_found_info
parameters.

The function dfs_process_radar_ind() should not modify the radar found
input parameters.

Since in this case the parameter modifications are specific to partial
offload, move the code that modifies the parameters out of the function
into a partial offload specific code.

NOTE:- The previous change I2c717219d0b0f9263734767bee6070f335032b04 also
does the same that is mentioned here but for modification of
full-offload parameters.

Change-Id: Ic438d70eaadb9ef91d28f6a0c22caf4926ed1df1
CRs-Fixed: 2737060
2020-07-29 06:40:08 -07:00
Vignesh U
ca60e2f141 qcacmn: Remove radar parameter translation for partial-offload chips
The routine 'dfs_translate_radar_params()' translates the radar found
offsets given by a 160MHz detector which ranges from -80MHz to +80MHz
to that of the offsets given by an 80MHz detector that ranges from
-40MHz to +40Mhz. The same function also translates the segment ID from a
single-detector(160MHz) model to a two-detector model(80Mhz). This routine
is unnecessarily called for partial-offload chipsets which do not support
True 160MHz.

Do not call the function 'dfs_translate_radar_params()' from
'dfs_process_radar_ind()' which is common for both partial-offload and
full-offload. Call it from the full-offload specific radar action
function 'tgt_dfs_process_radar_ind()'.

Change-Id: I2c717219d0b0f9263734767bee6070f335032b04
CRs-Fixed: 2718507
2020-07-29 06:40:04 -07:00
Vijay Krishnan
53f1d00e8f qcacmn: Remove references to CHAN_NUM_API
CONFIG_CHAN_NUM_API macro will be disabled. Remove all the references to
any function defined/declared under the macro. The function
reg_get_channel_list_with_power was placed under CHAN_NUM_API by mistake.
This API does not have any CHAN_FREQ_API counterpart. Therefore, move
this function out of CHAN_NUM_API macro.

The function dfs_send_radar_ind_for_freq is redundant as its counterpart
dfs_send_radar_ind has the same arguments and same functionality,
removing the function dfs_send_radar_ind_for_freq. The function
dfs_send_radar_ind is moved out of CHAN_NUM_API macro.

The function wlan_reg_chan_to_freq, wlan_reg_legacy_chan_to_freq is
moved out of CONFIG_CHAN_NUM_API macro. Since it is applicable for legacy
bands.

CRs-Fixed: 2711600
Change-Id: Ib29be638c17ce51f928c865e362ac5b2b8954b42
2020-07-23 21:37:06 -07:00
Vignesh Mohan
e62226ba5f qcacmn: Do not update ch_params if RCAC frequency is NULL
While selecting the next channel after radar, if RCAC is enabled,
RCAC frequency and ch params are chosen. But in case where no
RCAC frequency was found, ch params were filled with 0s which are
then used by the next channel selection logic (random channel)
to figure out the next channel.

Since the ch params were now 0s, the ch width is pointing to
20MHz (0 enum) which results in a 20MHz channel picked irrespective
of current mode.

Do not modify ch params if the RCAC frequency is NULL.

CRs-Fixed: 2729023
Change-Id: If542fb8584a767ad8d1fe6115af039e8bc2cb173
2020-07-16 02:05:35 -07:00
Ashish Kumar Dhanotiya
737eb69429 qcacmn: Add new scan type SCAN_FOR_CONNECT for conn_manager infra
Add new scan type SCAN_FOR_CONNECT to support connection manager
infrastructure.

CRs-Fixed: 2713772
Change-Id: I631f3f0324e82ef6cd8b2befbed020649c80bc4c
2020-07-02 08:48:14 -07:00
Vignesh U
e5f0e052df qcacmn: Address compilation issue
The function "ucfg_dfs_is_hw_pulses_allowed" should return bool and has
a compilation error
"return' with no value, in function returning non-void".

Return the bool type "false" when the dfs is a NULL object.

CRs-Fixed: 2715235
Change-Id: I8717aaedd1ac8208ce6257721d5890b82ca13a8f
2020-06-24 15:04:52 -07:00
Jianmin Zhu
4f9ae24e67 qcacmn: Replace channel with frequency for 6G
Replace WLAN_REG_IS_24GHZ_CH with WLAN_REG_IS_24GHZ_CH_FREQ

Change-Id: Ia2ff3a317f0286b0a6ca4d8642007e1a608c3e3d
CRs-Fixed: 2714721
2020-06-23 04:01:17 -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
Liangwei Dong
9051d27a9c qcacmn: Use API policy_mgr_get_can_skip_radar_event for Radar event
Dfs radar processing function dfs_process_radar_ind is called
in interrupt context. Add new API policy_mgr_get_can_skip_radar_event
to be called in interrupt context to get radar skip flag.
The policy_mgr_get_dfs_master_dynamic_enabled will acquire mutex and can't
be called in interrupt context.

Change-Id: Iffa4f56da56b991d817c36891c6f6a611f3a094e
CRs-Fixed: 2673808
2020-04-28 21:23:06 -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
Priyadarshnee S
4dab98d3ce qcacmn: Add DFS APIs for Rolling CAC feature
Feature Description:
FCC/JP domains do not support PreCAC. However, we can always start
beaconning in a channel if we have completed CAC in that channel for more
than or equal to the CAC period of that channel.
If an Agile engine is available and the next channel is known, we can
start CAC in the next channel using agile, while continuing the Tx/Rx
in the current channel. And when we want to start beaconning in the
next channel after a radar detection (or after/for a user request) we can
do so without any new CAC. This allows us to jump to the new channel
without having to disrupt any ongoing data traffic. This type of
continuous CAC in the next channel while operating in the current channel
is known as Rolling CAC.

Following changes are implemented:
I)Per DFS PDEV:
1) 'dfs_agile_rcac_freq' to store agile RCAC frequency.
2) 'dfs_agile_rcac_ucfg' to enable/disable RCAC feature.

II)Per DFS PSOC:
1) 'dfs_rcac_timer' is the only RCAC timer for the device/Psoc. This will
be shared by pdev level dfs objects.
2) 'dfs_rcac_timer_running' to indicate if RCAC is running or not.

III) New APIs:
1. A dispatcher API 'ucfg_dfs_set_rcac_enable' to set rcac config.
2. A dispatcher API 'ucfg_dfs_get_rcac_enable' to get rcac_config.
3. A dispatcher API 'ucfg_dfs_set_rcac_freq' to set user configured
rcac freq.
4. A dispatcher API 'ucfg_dfs_get_rcac_freq' to get the user configured
rcac freq.
5. Rolling CAC timer init/deinit APIs.

CRs-Fixed: 2659666
Change-Id: Iae002b2ab77964fca4faf237b0d0a4e2f2afe4c2
2020-04-19 22:04:44 -07:00
Shashikala Prabhu
ee42cb1f26 qcacmn: Use chan freq for restricted 80+80 MHz boundary check
Instead of channel number, use channel frequency for restricted 80+80MHz
boundary  check.

Change-Id: I2fa65c3b1d102acd6b64b4c6e1583d2bc29484d1
CRs-Fixed: 2645155
2020-03-27 15:00:05 -07:00
Qun Zhang
4bc614dd0c qcacmn: Replace QDF_MAX_NUM_CHAN with NUM_CHANNELS to aviod OOB access
Currently QDF_MAX_NUM_CHAN and NUM_CHANNELS aren't aligned, this unalignment
may cause many potential OOB access. So replace QDF_MAX_NUM_CHAN with
NUM_CHANNELS to keep unified.

Change-Id: I7bf7829d776f7caf5b2afbd2c9fd0c20d608e630
CRs-Fixed: 2644073
2020-03-25 07:09:34 -07:00
Vignesh U
6933f411c1 qcacmn: Add support to configure 165MHz Agile channel
The FW has updated the wmi command wmi_vdev_adfs_ch_cfg_cmd_fixed_param to
configure the Agile channel to enable the 165MHz channel as an Agile
channel by enabling 2 center frequencies.

For a 160MHz and 80MHz channel, the parameter center_freq1 will be the
center of the respective channels. For the 165MHz channel(restricted 80p80)
the parameter center_freq1 will be the center of the left 80MHz channel
(5690MHz) and the parameter center_freq2 will be the center of the right
80MHz channel (5775MHz)..

Update the ADFS parameters across UMAC, TARGET_IF and WMI layes to
update the Agile channel configuration command.

Change-Id: Ie480af9a6bb8dad87dd783ab06e17b449605b1c9
CRs-Fixed: 2642555
2020-03-24 02:42:43 -07:00