Commit Graph

385 Commits

Author SHA1 Message Date
Huashan Qu
77f09f7272 qcacmn: Define rp_rssithresh for QCN7605 chip to different value
In dfs test mode, bandwidth detection test on dfs channel fails
with QCN7605 chip, reason is some pulses will be discarded due to
low rssi reported on some frequency channel, it's different halphy
design for QCN7605 chip, so need to define rp_rssithresh for QCN7605
chip to different value.

Fix is define rp_rssithresh for QCN7605 chip to different value for
FCC/ETSI/JP W56 table which are used for dfs certification.

Change-Id: I9132cf82e6d8d97f83ebb4cd8586f8d8ff48066e
CRs-Fixed: 2986947
2021-09-10 22:29:00 -07:00
Vignesh Mohan
6d3d7d5f11 qcacmn: Enable 149 to 177 HT160 channels in random channel selection
During random channel selection after radar, channels 149 to 177 are
not considered as a potential random HT160 channel after the
introduction of the 5.9G channels. This is because, the last 80MHz
band (165, 169, 173, 177) are not added to the list of 80MHz band
list that is used to find the next random channel.

Update the 80MHz band list with 165-177 and update the band count.

Change-Id: Id881adaa07dab07400435d559940f4bdf837eb75
2021-09-08 03:08:47 -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
Gururaj Pandurangi
5c4ead3c06 qcacmn: Fix byte alignment in struct dfs_nolelem
Fix byte alignment in struct dfs_nolelem by removing
structure packing (qdf_packed).

Change-Id: I83ca71fe019a2482283655b1b8837844a8afb007
CRs-Fixed: 3017791
2021-08-20 19:38:12 -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
Gururaj Pandurangi
f5673aa2a4 qcacmn: Avoid calling qdf_timer_mod after qdf_timer_stop
Avoid calling qdf_timer_mod after qdf_timer_stop as the
node is deleted after timer is stopped and qdf_timer_mod
dereferences the deleted node leading to data abort.

Replace 'qdf_timer_mod' by the sequence
'qdf_timer_sync_cancel, qdf_timer_start' to be SMP safe.
If a timer is being started for the first time, use only
'qdf_timer_start' and not the sequence
'qdf_timer_sync_cancel, qdf_timer_start'

Change-Id: Ida5440d4a54d49aa97f57fbda57ab1ef2cce16e6
CRs-Fixed: 3005699
2021-08-10 06:14:47 -07:00
Vignesh U
d746469888 qcacmn: Add domain checks for precac and rcac
Write two new functions to check if preCAC and RCAC are supported in the
current DFS domain.

Currently, the preCAC is supported in the following DFS domains:
1. ETSI Domain

Currently, the RCAC is supported in the following DFS domains:
1. FCC Domain
2. MKK Domain
3. MKKN Domain

Change-Id: I2996e4d5b26e1a57ebb00e415fa41108af997b21
CRs-Fixed: 3005416
2021-08-05 12:58:15 -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
Liangwei Dong
ee47c12a75 qcacmn: Add 5720 to outdoor frequency for JP
New regdomain of MKKN added channel 144 to JP.
Add 144 (5720Mhz) to JP outdoor frequency.

Change-Id: Ic50dd3aeb4e192672b71c7173b9fd4b4072b0e0a
CRs-fixed: 2943076
2021-05-17 10:51:39 -07:00
Hariharan Basuthkar
84952bbe19 qcacmn: Increase the host DFS status timeout value
On a partial offload chipset, when radar is detected on a DFS channel,
the host dfs wait timer (timeout of 200ms) is started, but there is a
delay in sending the avg_params to the FW. This delay happens for approx
330ms due to some high priority interrupt, due to this, the thread that
sends the avg_params to the FW seems to be suspended.

Host timer expiry is seen, and due to this there is a new target channel
chosen and multivdev restart is sent to the FW (the vdev is in restart
progress state). At this moment, the FW spoof timer (timeout is 300ms)
gets expired and a status code of 1 (indicating spoof failure) is sent
in the host dfs status WMI event. Due to this, the DFS channels are
blocked and the channel list is rebuilt with only non-DFS channels.
A non-DFS channel is chosen as the target channel. Since the vdev SM is
currently in restart progress state, when radar event is posted to the
vdev SM, assert is triggered and this leads to a crash.

The timeout value of the host timer is 200ms and the FW timer is 300ms.
The Host timer should be greater than the FW timer.

Therefore, increase the Host status timeout value from 200ms to 350ms.

Change-Id: I86858377fd5041922f232a1ac3d5ab781c7a63c1
CRs-Fixed: 2936809
2021-05-13 22:30:01 -07:00
bings
8144d64a26 qcacmn: Set NOL left time as 0 in print nol if it is negative
In some platform the timer is not precise. NOL timer may take more
than expected. During this time When print nol is called, NOL left
time is negative.

Set NOL left time as 0 in print nol if it is negative.

Change-Id: Ic6aec5f7ee080625adb39ae75785a271ad782f6c
CRs-Fixed: 2926548
2021-04-22 21:59:32 -07:00
Tushnim Bhattacharyya
f9a9545d64 qcacmn: Remove all CONFIG_CHAN_NUM_API instances
Replace below APIs used under CONFIG_CHAN_NUM_API
in DFS module with corresponding channel frequency
APIs as part of regulatory cleanup effort,

dfs_get_bonding_channels
dfs_is_en302_502_applicable
dfs_nol_timer_cleanup
dfs_remove_spoof_channel_from_nol
dfs_tlv_calc_freq_info
dfs_print_radar_found_freq
dfs_compute_radar_found_cfreq

Change-Id: I962449264fa76783ea83b271ca2e5fa67dfe478c
CRs-Fixed: 2916463
2021-04-22 13:13:46 -07:00
Liangwei Dong
94310d764e qcacmn: Fix debug print to use channel frequency
Use "Chan freq" string for channel frequency value debug
message print.

Change-Id: Ie9e2d2d38b8e7bad2c7fcaa052e5fa5b555fb7ea
CRs-Fixed: 2903498
2021-04-01 01:24:25 -07:00
Vignesh U
1bcf72f3f8 qcacmn: Reset radar queues after disabling phyerror processing
When the phyerrors get accumulated in the radar queue and matches a filter,
the radar queues is  reset. But the phyerror reception is not disabled
immediately, instead only done after taking radar action. In this interval,
the radar queue still continues to accumulate pulses until phyerror
reception is disabled.
When radar action is completed, channel is changed and phyerror reception
is re-enabled, the existing pulses in the radar queue continue to exist
and cause false radar on the newly changed channel. This will potentially
add all the dfs channels to NOL.

In order to avoid such a scenario, reset all the delaylines, radar queues
and the associated stats variables after disabling the phyerror
reception.

CRs-Fixed: 2891715
Change-Id: I6ad202a6d99d313895b347119fcae0a2a2651ca1
2021-03-31 14:14:51 -07:00
Will Huang
8307cb1ba1 qcacmn: Add MKK-N condition when check whether W53 disabled
DFS_MKKN_REGION was updated as JP's new DFS region, it also support
W53 radar pattern, so add this DFS region to conditions of checking
whether W53/indoor/outdoor is disabled.

Remove redundant dfs region defines.

Change-Id: I9c823fe815416eac30f440fb3e61246c5ef7e675
CRs-Fixed: 2906139
2021-03-31 06:05:04 -07:00
Vijay Krishnan
0e98aa285b qcacmn: Modify dmesg prints on channel change
When Swift Radio change its channel multiple times, there are some
dmesg prints in the console. These prints will come in default. Therefore
modified in such a way that these prints are enabled only through
debug level.

CRs-Fixed: 2902742
Change-Id: I7e4c40ec934fb920bf9e769afb40426b593345c8
2021-03-25 05:37: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
Will Huang
cb60cd6b2b qcacmn: Add back dfs_set_nol() to common code
dfs_set_nol function is also required by MCC DFS function, Change-Id
I6c74dd13a16acb2a67bb3b477b13bc0e4ee165ce move implementation from
common code to WIN, add back it.

Change-Id: I46c16eec82024c3af4b4cee02ff19edb0023d3b6
CRs-Fixed: 2875061
2021-02-28 20:00:49 -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 Srinivasan
9f20356fa4 qcacmn: Unmark 'NOL chan' before channel list update
After NOL expiry of the radar hit channel, the scan channel list
of the FW is updated to include 'NOL expired' channel as well
so that FW can initiate subsequent scan on this channel.
Only those channels which are not marked as NOL in regulatory
are updated in the scan channel list.

However, in the current flow of events, the scan channel list is
first updated via dfs_nol_update() API and then channel is
unmarked as NOL in utils_dfs_reg_update_nol_chan_for_freq() API.
Hence the NOL expired channel is not updated to FW and subsequent
scanning does not happen on this channel.
Ensured that the channel is cleared of NOL flag before updating
the scan channel list.

CRs-Fixed: 2877337
Change-Id: I7331bcc12c1dd6a26407c0753f28481cee1ce628
2021-02-17 02:10:26 -08:00
Priyadarshnee
86e7dac64c qcacmn: Add an API to restart RCAC on NOL expiry
Add function declaration for  dfs_restart_rcac_on_nol_expiry()
API. This API helps to restart RCAC on NOL expired channel
with interCAC and RCAC feature enabled.

CRs-Fixed: 2860727
Change-Id: Ifc06ed938ebc7cc6ccbe68989158939d6f399c46
2021-02-05 09:49:34 -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
Vignesh U
9ad985593b qcacmn: Remove unwanted header files from common DFS
The sm engine header files are required only for ADFS sm handling.
Move the header file to the ADFS sm source file.

Change-Id: Icc77a889d6bf28d8c0b20a12944f9be78d1a8c27
CRs-Fixed: 2853428
2021-01-19 21:16:14 -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
Pavankumar Nandeshwar
1adba0a413 qcacmn: change qcn9100 to qcn6122 in hif and umac
Change the name of target type qcn9100
to qcn6122 in hif and umac.

Change-Id: Ia473c531a0903fd514dacf645d23bec3886fd719
CRs-Fixed: 2849577
2021-01-18 21:45:34 -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
Vignesh Mohan
7bf41957c0 qcacmn: Use 160MHz center while calculating subchannels
Use 160MHz center while calculating subchannels.

Change-Id: I2059ebce90624a5bddfc8787380de6c59625d44e
2021-01-07 14:36:04 -08:00
Wu Gao
f9ead26a48 qcacmn: Add dfs macros to avoid compilation issue
There is compilation issue since dfs macros only defined with
WLAN_COMP_CHAN_MODE. So adds related definitions for the case without
WLAN_COMP_CHAN_MODE.

Change-Id: I4b9f16b5000304157067be565864cc79c510770f
CRs-Fixed: 2848979
2021-01-06 17:58:05 -08:00
Surya Prakash Raajen
21e219fe2f qcacmn: Reorder and optimize channel mode macros
Reorder channel mode macros to have macros in logical
order, and to optimize the channel modes to use
bit specific enums instead of single bit to reduce
the usage of number of bits. The changes are specific
to host

Example for Channel mode: IEEE80211_CHAN_HE20
Channel modes represents only the information regarding
to channel such as band, width, passive, DFS, blocked
40MHz_intolerant and so. It doesn't have information
regarding hwmode like 11ac,11ax.

CRs-Fixed: 2846331
Change-Id: I197de032a4d677a27b46028fa090a6eabe0c6086
2021-01-05 02:59:30 -08:00
Vignesh Mohan
d32051f608 qcacmn: Replace radar checks to use regulatory channel list
In DFS, to check if a channel is radar, we use the flags that
are filled from UMAC to check for radar. Since the channel list
in UMAC are dynamically calculated, the dynamic flags will not be
consistent over multiple channel pointers.

Use the radar information in regulatory for individual subchannels
to check for radar in a given channel. Define these new APIs
under a feature specific macro.

Change-Id: I7f86560c3d29d2366c6506ccf63204263cbc0ef1
CRs-Fixed: 2841168
2020-12-28 10:57:47 -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
Vijay Krishnan
7136aa40cb qcacmn: Move DFS_BANGRADAR from common code to WIN
Remove the following functions from Common dev to component-dev:
1) dfs_bangradar
2) dfs_start_host_based_bangradar
3) dfs_fill_emulate_bang_radar_test
4) dfs_check_bangradar_sanity
5) dfs_start_host_based_bangradar

CRs-Fixed: 2829438
Change-Id: I5d3564bcb89e60629ee7fddc9827e03e9d9da6a2
2020-12-15 09:50:23 -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
Vijay Krishnan
6be2aca5a4 qcacmn: Remove QCA_DFS_RCSA_SUPPORT from cmndev
The macro QCA_DFS_RCSA_SUPPORT is currently residing inside common
code. But this feature is not used by MCL, therefore in order to
reduce code approval process, this macro and associated code is moved
to WIN specific component-dev git repository.

CRs-Fixed: 2822626
Change-Id: I43a9e63ede5958f8641be1be45f7c5cd71820667
2020-12-02 20:49:33 -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