提交線圖

534 次程式碼提交

作者 SHA1 備註 日期
Amith Ajith
29f49a3c4c qcacmn: Init super chan list for current power mode
When CBS scan is performed, 6 GHz channels are observed to be added to the
ACS report of 2.4 GHz & 5 GHz. This is because api reg_is_freq_idx_enabled
is iterating the complete cur chan list and it is found to be returning
true for 6 GHz channels when 2.4 GHz and 5 GHz radios are considered. In
radios that are not 6 GHz, the state of 6 GHz channels are checked in
super channel list. But for REG_CURRENT_PWR_MODE, the channel disabled
flag is not set for 6 GHz channels during super chan init. This is
resulting in the incorrect validation at reg_is_freq_idx_enabled.

In reg_init_super_chan_entry, start the iteration of disabling the chan
flags from REG_CURRENT_PWR_MODE instead of REG_AP_LPI.

Change-Id: Ide6aa667b75a37e19e0ac28bfd01786608cd8985
CRs-Fixed: 3176952
2022-05-18 09:02:05 -07:00
Vignesh U
e22d6a62b8 qcacmn: Update array boundary checks for regulatory API
The regulatory API reg_freq_to_chan_for_chlist()  uses num_chans as the
bound to access the array chan_list. While an invalid index INVALID_CHANNEL
is prevented from accessing chan_list, values that are greater than
NUM_CHANNELS are not prevented from accessing the array.

Prevent access to the array when the index is greater than NUM_CHANNELS.
Since INVALID_CHANNEL is also greater than NUM_CHANNELS, the existing
condition that prevents access to the array when num_chans is
INVALID_CHANNEL can be removed.

Change-Id: I8b9793b84fc5b3a9406389fd3482673dd4667cfc
CRs-Fixed: 3196165
2022-05-17 05:54:32 -07:00
Hariharan Basuthkar
1e745ce16a qcacmn: Initialize eirp and psd in reg_get_eirp_for_non_sp
Initialize eirp and psd in reg_get_eirp_for_non_sp to fix WHUNT failure.

Change-Id: Id2f9ca8b658648dd50d47647270ac05fd5f330c9
CRs-Fixed: 3196444
2022-05-17 00:48:54 -07:00
Surya Prakash Sivaraj
7f57fa1bd9 qcacmn: Add sta_sap_scc_on_indoor_channel var to psoc/pdev
Add the variable sta_sap_scc_on_indoor_channel in
psoc and pdev reg objmgr, to access the INI value of
sta_sap_scc_on_indoor_chan

Change-Id: Ie0c41d75d0f617274743f5196e65dab93414b7eb
CRs-Fixed: 3191788
2022-05-13 04:20:54 -07:00
Kai Chen
81f0e6a247 qcacmn: Add AFC device deployment type support
Add AFC regulatory target interface to support AFC device
deployment indoor or outdoor type in init sequence between
FW and host

Change-Id: I3caed77e943fdcaa947cb7e514c88b68604f55a3
CRs-Fixed: 3190262
2022-05-10 22:12:29 -07:00
Kai Chen
90907bdedd qcacmn: Add AFC device deployment type support
Add AFC device deployment type support in regulatory pdev
private object and add API to return the deployment type

Change-Id: I45e44766b25b21ce3024d73f4ed7a4daf3ecb026
CRs-Fixed: 3190240
2022-05-10 22:12:22 -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
Amith Ajith
19f0a435c6 qcacmn: Add AFC location structure to AFC start request
Create data structure to store the deployment type(location) of AP for
AFC. Append this structure to the end of AFC start request.

Change-Id: I19756fd3ca7a77f11b673d2bf3b0382f29732847
CRs-Fixed: 3177624
2022-05-09 22:18:45 -07:00
Amith Ajith
ecd51a1f66 qcacmn: Add AFC Deployment type enum and deployment type to pdev_priv_obj
Declare the AFC deployment type enum and add deployment type member to
pdev_priv_obj.

Change-Id: Id11a0aac4fcc1b655436d9dbd876607178f27bd4
CRs-Fixed: 3186216
2022-05-09 20:45:31 -07:00
Vignesh U
1fe27938f7 qcacmn: Add array out of bound access checks
- Add NULL check of the pointer "afc_req" in the function
reg_get_partial_afc_req_info() before it is dereferencedi to avoid
NULL pointer derefernce.

- Add array size check in the reg_compute_chan_to_freq_for_chlist()
API to avoid the array out of bound access to "chan_list" array.

- Make use of the function reg_is_supp_pwr_mode_invalid() which
does the boundary check for the arrays chan_info->state_arr[] and
chan_info->chan_flags_arr[] to avoid out of bound array access.

- Add a check in the reg_freq_to_chan_for_chlist() API to avoid chan_list[]
array out of bound access.

Change-Id: Ifcade9e971a77f483d5c5138206eab47454f28ad
CRs-Fixed: 3184214
2022-05-06 16:39:15 -07:00
Hariharan Basuthkar
263d5b8138 qcacmn: Add an API to get best power mode based on freq and bw
Add an API wlan_reg_get_best_pwr_mode, to get the best_power_mode
based on AP's primary channel center frequency and AP's operating
bandwidth. The best power mode that has the maximum EIRP power
allowed for operation among the 3 AP types, i.e, LPI, SP and VLP is
chosen as the best power mode.

For example:

If primary channel center frequency = 6115 MHz and AP's operating bandwidth
is 80 dbm. If,
LPI EIRP = 30 dbm
SP EIRP = 33 dbm,
VLP EIRP = 27 dbm,
then the best power mode returned is SP.

Also, remove the static declaration of reg_get_subchannels_for_opclass
so that it can be called by wlan_reg_get_best_pwr_mode.

Change-Id: I89b6bc35b5c15a49e2d49265c8685f9d291fb48e
CRs-Fixed: 3163714
2022-04-27 13:01:54 -07:00
Sriranjani N
bd723869dd qcacmn: Change the datatype of resp_id
The datatype of resp_id in
wmi_afc_power_event_param is 32 bit.

Change the datatype of resp_id from
uint8_t to uint32_t
in the structure reg_fw_afc_power_event,
to write
QCA_WLAN_VENDOR_ATTR_AFC_POWER_EVT_RESP_ID
in the
QCA_WLAN_VENDOR_AFC_POWER_UPDATE_COMPLETE_EVENT

Change-Id: I910921908ddc24290e2b89732fa223a16aeb9981
CRs-Fixed: 3159542
2022-04-14 05:09:11 -07:00
Priyadarshnee Srinivasan
2534a0683e qcacmn: Get opclass details for current hwmode
Iterate through the opclass table and fetch the opclass
details for the channel widths supported by the current
hardware mode.

CRs-Fixed: 3168892
Change-Id: I9b418999e3745529e3db5bae3a46569e0d1bdc02
2022-04-11 13:02:23 -07:00
Will Huang
56579a6a5a qcacmn: Fix build error when enable AFC from MCL
&p_range->lowfreq, 'reg_assign_vars_with_range_vals' from incompatible
pointer type.
'low_limit_enum', 'high_limit_enum' may be used uninitialized.
'reg_is_val_within_range' defined but not used.

Change-Id: Id5ff2e0fa18555e4d27e955e6508bd23da280aff
CRs-Fixed: 3153499
2022-04-11 04:09:58 -07:00
Bing Sun
37a48b157f qcacmn: provide is_create_punc_bitmap when generateing puncture
Puncture is one of 11be feature. Even 11be compile macro is defined,
Dut can start AP with non-11be mode. Regulatory component has no idea
whether it should consider puncture or not. Puncture should be a
configurable parameter from caller.
When updating channel state, puncture should be considered for 11BE
AP. is_create_punc_bitmap should be set in struct ch_params and pass
it to reg_get_5g_bonded_channel_state_for_pwrmode.

Change-Id: I96fb131f2df201a827ab7d98ca099a38b008e0d3
CRs-Fixed: 3160259
2022-04-08 01:57:29 -07:00
Hariharan Basuthkar
49ce65bf57 qcacmn: Reset super chan list and allow same power mode config
Consider the case where the AFC server response initially,
has only one 20 MHZ channel available for operation and AP is operating
on SP on that channel. In the next response, the AFC server response
advertises support for all UNII-5 and UNII-7 channel. In this case,
the AP VAP does not come up in the new channel chosen by ACS.

The super channel list is not being reset on every AFC response received
from the target. Also, if the current power mode is SP, and the target
power is also SP, reg_set_ap_pwr_and_update_chan_list does not the same
power mode configuration. Due to this, the current channel list and
super channel list are not updated, and therefore the VAP fails to come
up in the new channel chose by ACS.

To fix this issue, reset the super chan list on every AFC response
received and remove the check to prevent the same power mode setting
in reg_set_ap_pwr_and_update_chan_list.

Change-Id: I52f24038ef904e4f8ede6861b7e4a0cdcd9607b0
CRs-Fixed: 3154057
2022-04-01 06:40:21 -07:00
Hariharan Basuthkar
50c862e9a3 qcacmn: Add NULL check in reg_get_pwrmode_chan_list API
The regulatory pdev private object is used directly without a NULL pointer
check in the API reg_get_pwrmode_chan_list.

Add a NULL pointer check for the regulatory pdev private object to prevent
NULL pointer dereference.

Change-Id: If6f9daf5d88a8fb9fba1b184721ba10e96ad0e2e
CRs-Fixed: 3159429
2022-03-31 05:46:43 -07:00
Lincoln Tran
15fa2d30d7 qcacmn: Fix regulatory compilation issue
Add empty definition for function in the case where the
6G feature is disabled. This fixes a compilation issue.

Change-Id: Idef12549cdfa9b3cb75b06fe04888e7c50356042
CRs-Fixed: 3162125
2022-03-30 13:43:26 -07:00
Linux Build Service Account
a8a9edfab6 Merge "qcacmn: Add non-6g definitions of regulatory API" 2022-03-29 19:37:45 -07:00
Linux Build Service Account
ca30b20446 Merge "qcacmn: Remove conditional compilation" 2022-03-29 19:37:45 -07:00
Vignesh U
07a565b1a1 qcacmn: Add non-6g definitions of regulatory API
The API reg_get_ch_state_based_on_nol_flag() is a common API and in its
definition it calls the API
wlan_reg_get_5g_bonded_channel_state_for_pwrmode() which is defined for
the 6G specific macro CONFIG_REG_6G_PWRMODE. For non-6G callers, this
function is not defined and will lead to implicit declaration compilation
error.

Add a non-6G version of the API
wlan_reg_get_5g_bonded_channel_state_for_pwrmode() so that, it can be
called in reg_get_ch_state_based_on_nol_flag() even for non-6G PFs.

Change-Id: I810af65c7580f9a5dbfb2df25530dd95261e2a80
CRs-Fixed: 3161629
2022-03-29 16:59:58 -07:00
Vignesh U
8917e2dc1a qcacmn: Remove conditional compilation
The API reg_get_ch_state_based_on_nol_flag() calls the function
wlan_reg_get_5g_bonded_channel_state_for_pwrmode() which is part of the
header wlan_reg_services_api.h. This header is conditionally included
using the macro CONFIG_AFC_SUPPORT which is not enabled for all the PFs.

Remove the condition header file inclusion as
reg_get_ch_state_based_on_nol_flag() is a common API for all PFs.

Change-Id: I3f6cc301474648fdd6a2937421ee0421a0788856
CRs-Fixed: 3161629
2022-03-29 16:59:52 -07:00
Hariharan Basuthkar
17078fff36 qcacmn: Rename is_treat_nol_as_disabled to treat_nol_chan_as_disabled
Rename is_treat_nol_as_disabled and is_treat_nol_as_dis to
treat_nol_chan_as_disabled in the regulatory component.

Change-Id: I3f372ee1707b40e2bdcd5ca53b77e6b8f76c456b
CRs-Fixed: 3157756
2022-03-29 05:07:43 -07:00
Jianmin Zhu
ba015feedc qcacmn: Do not access reg private if destroyed
When SAP off and psoc idle shutdown happens before NOL timeout,
DFS pdev obj is destroyed, NOL timer is cleared, since regulatory
pdev private obj is destroyed before DFS, psoc master channel list
nol flag isn't cleared for regulatory pdev private obj is NULL.
When pdev current channel list is populated from psoc master channel
list, nol channel becomes disabled,  can't be used any more.

To fix it, when DFS private pdev obj is destroyed, don't access
regulatory pdev private if destroyed, but still clear psoc
mas_chan_list nol flag.

Change-Id: I79dad84631179d78d05c2738ce0aa4f863def7d4
CRs-Fixed: 3158675
2022-03-25 19:12:40 -07:00
Hariharan Basuthkar
788dc6401f qcacmn: Rectify issues in super channel list construction
1) Currently, the channel state and chan flags of the super channel list
   are not initialized. To fix this issue, initialize the channel state
   and chan flags of the super channel list entries to
   CHANNEL_STATE_DISABLE and REGULATORY_CHAN_DISABLED respectively.
2) The best power mode calculated in reg_fill_best_pwr_mode is incorrect.
   To fix this issue, pass the reference of max_eirp_pwr to
   reg_update_sup_ch_entry_for_mode to avoid the reset of max_eirp_pwr.

Change-Id: I624333f8fb89682771bd48e3f203509f7dadb41f
CRs-Fixed: 3145006
2022-03-25 03:00:44 -07:00
Vignesh U
dda26d83bf qcacmn: Compute chan from freq considering all 6G power types
For a 6G frequency, if it is not part of the current power mode's
master channel list, then it is not possible to convert the frequency
to a channel number and is return as 0.

The input frequency might be part of some other power mode's master
channel list. So consider all the power mode to calculate channel
number from frequency.

Change-Id: I5810744504b5b11d728cc2abacc02e64a4accfcd
CRs-Fixed: 3142048
2022-03-23 21:09:59 -07:00
Vignesh U
9e1d5d198b qcacmn: Get all the channel list for 6G band
Get the channel list for 6G band for a given power mode. When the power
mode is REG_BEST_PWR_MODE the 6G channels will contain all the channels
supported by the reg domain irrespective of the power mode.

Change-Id: Ia1a3757685d477a2a2565eb89422fc039ca3b5dd
CRs-Fixed: 3141999
2022-03-23 04:49:54 -07:00
Jianmin Zhu
ee27003447 qcacmn: Fix build issue on kernel5.10
Fix build issue on kernel5.10.

error: implicit conversion from enumeration type 'enum reg_6g_ap_type'
to different enumeration type 'enum supported_6g_pwr_types'
[-Werror,-Wenum-conversion].

Change-Id: Ib15ed20036f2472b567acee2e4d24d3e6bfe1956
CRs-Fixed: 3154541
2022-03-21 22:01:30 -07:00
Hariharan Basuthkar
b844c62799 qcacmn: Add reg API to treat NOL chan as disabled/enabled
By default, the regulatory module considers NOL channels as disabled
and these channels are excluded in channel search algorithm.

However, there are use cases where a search for NOL channel
is done and regulatory module fails to fetch the channel param.
Hence create an infrastructure to consider NOL channels
as "enabled" / "disabled" as per user's choice during channel search.
Setting "is_treat_nol_chan_as_disabled" flag to true considers
NOL channels as disabled and punctured.

The callers of reg_fill_channel_list() and
reg_set_channel_params_for_freq() APIs should set the flag
"is_treat_nol_chan_as_disabled" as per the desired use case.

CRs-Fixed: 3134870
Change-Id: Iae7cea18ecfd5e9972ea8e6934828898a6cd1e74
2022-03-21 01:28:30 -07:00
Hariharan Basuthkar
a42a26bfac qcacmn: Add APIS that consider NOL channel state as enabled
Move the following APIS from component dev to cmndev.
1. reg_get_nol_channel_state
2. reg_get_5g_chan_state
3. reg_get_5g_bonded_chan_state

The purpose of these APIS is to consider NOL channels' state
as "enabled". This is used in reg_set_5g_channel_params_for_freq() and
reg_fill_channel_list() API to get the channel state based on
user flag "is_treat_nol_chan_as_disabled".

Change-Id: I174e365e7e5ece8ac5fb082dd92eb76be3126cc6
CRs-Fixed: 3149470
2022-03-21 01:28:04 -07:00
Vijay Krishnan
9bc8adec02 qcacmn: Store the threshold freq in regulatory
If a Radio supports 6G band channels, the ACS is expected to give
priority to a set of channels that are above a certain (threshold)
frequency.

Store the extracted threshold frequency from WMI into regulatory
component.

Add a new API reg_get_thresh_priority_freq to get the threshold
frequency received from the target.

CRs-Fixed: 3143318
Change-Id: I8676ce56e68b5a4eb4e4b64415dc293e086472f0
2022-03-17 03:44:52 -07:00
Sheenam Monga
b17d8fc57f qcacmn: Avoid compilation error when 6G disabled
Currently definition of wlan_reg_get_power_string is
present for 6G only which may cause compilation issue
when 6G is disabled.

Fix is to add definition of wlan_reg_get_power_string
for both 6g enable and disable case to avoid any compilation
issue.

Change-Id: Iaad8f16543306e6ac09e76546062fae554124c1e
CRs-Fixed: 3150997
2022-03-16 11:14:21 -07:00
Priyadarshnee Srinivasan
307e380442 qcacmn: Add reg opclass changes for 320MHZ
Add opclass changes to support 320MHZ in 11BE

CRs-Fixed: 3135023
Change-Id: I57827cf0f5f056df0dceee0a6225d4ea7219cce9
2022-03-15 20:44:09 -07:00
Jianmin Zhu
5be34e1968 qcacmn: Fix build error
For platforms which CONFIG_BAND_6GHZ undefined, build failed for
implicit declaration of function
reg_convert_supported_6g_pwr_type_to_ap_pwr_type.

Change-Id: Iefaef8ea64f76f07e040403ada145c99c29db19a
CRs-Fixed: 3147319
2022-03-11 04:53:03 -08:00
Amith Ajith
c3bb3fb37a qcacmn: Fix incorrect 6g supported channels reported for opclass 133 & 134
API reg_get_channels_from_opclassmap populates channels from opclass map to
reg_ap_cap as supported and non-supported channels. But for 6g opclass 133
and 134, non-supported channels were also getting reported as supported
channels.

This was due to an error in the logic of reg_get_channels_from_opclassmap
API for opclass 133 and 134. The 20Mhz channels towards the end of the
channel list in the op_class_tbl were causing the issue.

To address this issue, add a logic to get the supported and non-supported
channels from the cfi list object of op_class_tbl for 6GHz in the
reg_get_channels_from_opclassmap API. Also remove the 40MHz centre channel
calculation condition for 6GHz in reg_get_chan_or_chan_center API as it is
being handled in the new API.

CRs-Fixed: 3133022
Change-Id: If6ea18f79786c8549a1c75c557adffa178dd5c71
2022-03-09 17:44:59 -08:00
Vignesh U
1f1b921796 qcacmn: Add supported 6g power types dispatcher APIS
Add the supported 6g power types dispatcher APIs to
i) get the best 6g power for a given frequency.
ii) convert input 6g ap power type to supported 6g power type enum.
iii) get the 6g ap power type from supported 6g power type enum.

Change-Id: I4b8bce5f23c7c0b95f9192ff20d90a908b3e0bd7
CRs-Fixed: 3110989
2022-03-08 04:20:07 -08:00
nakul kachhwaha
dff43f12ea qcacmn: Add support for 6ghz relaxed connection policy
Adding new API to bypass scanning and connection
restrictions to bss operating in 6GHz with different
country code.
This API is based on a cfg item which can be configured
separately from safe mode or rf test mode.

Change-Id: I47396ac8793172e94499377cb0b980f7eee0f39e
CRs-Fixed: 3135147
2022-03-08 01:19:59 -08:00
Deeksha Gupta
8944151a4b qcacmn: Add reg API to check for enable channel state
Add new reg API to check if frequency is active (non-passive) 
or not from the secondary channel list.
The API checks the channel state against CHANNEL_STATE_ENABLE.

Change-Id: If41850563e680659ea815f09207ec0b854a2f040
CRs-Fixed: 3136785
2022-03-02 16:15:22 -08:00
Abhijit Pradhan
3f95481d0e qcacmn: Add powermode APIs under a new macro
Use  CONFIG_REG_ 6G_PWR_MODE for the new API.
Use "_for_pwrmode" as suffix for the new functions.

Change-Id: I9b84944a59062277b76bc48877c47ea5afada0ec
CRs-Fixed: 3133023
2022-02-28 12:57:10 -08:00
Hariharan Basuthkar
e7b559d010 qcacmn: Replace reg curchan with 6g ap power based chan list
The consumers of the current channel list may want to search through 6G
channels that are not part of current channel list and belong to channel
list of different power mode.

Therefore, replace the regulatory current channel list with that of 6G
power based channel list.

Change-Id: Ie2ff8bbfb50a5f95f584b134b18246cb28b1c406
CRs-Fixed: 3110987
2022-02-28 12:57:03 -08:00
Hariharan Basuthkar
9ae0959d63 qcacmn: Rectify compilation error when CONFIG_BAND_6GHZ is disabled
When CONFIG_BAND_6GHZ is disabled, compilation error is observed
due to the absence of the declaration of reg_convert_enum_to_6g_idx
and reg_get_reg_maschan_lst_frm_6g_pwr_mode.

To fix this issue, add static declarations for
reg_convert_enum_to_6g_idx and reg_get_reg_maschan_lst_frm_6g_pwr_mode
when CONFIG_BAND_6GHZ is disabled.

Change-Id: I616de6cd2630be1897da6cd87a29569e51bf058e
CRs-Fixed: 3131119
2022-02-17 05:03:35 -08:00
Balaji Pothunoori
37411ce595 qcacmn: disable reg channels based on ini check
Disable ini channels based on coex_unsafe_chan_reg_disable
ini configuration.

Change-Id: Ia3acbc133cab4865d8ad69992e893be91439f837
CRs-Fixed: 3129049
2022-02-16 22:27:07 -08:00
Vignesh Mohan
43f535bce4 qcacmn: Update pdev freq ranges after every country set
During mode switch no new service ready happens. However,
a mode switch function re-inits the regulatory channel list
with appropriate chip ranges.
After driver insmod and during device creation the chip
ranges (2g+5g) are initialized. However, if a sequence of wifi down
and ini mode change and wifi up happens, the chip ranges for pdev
are not updated (as it happens for dynamic mode switch command)
and we continue to use the old device object and the old chip ranges.
Since the mode has changed we also need to change the ranges in
the device object. Since the country code event comes for every
wifi up and down, Update the 2G and 5G frequency ranges supported by
the pdev in the regulatory pdev private object from the service
ready values for every country set to make sure that changes in
HW mode are also handled during wifi down and up.

Change-Id: Id1f486e73d792f77c591e39e216556e512a8b59f
CRs-Fixed: 3088128
2022-02-15 17:28:29 -08:00
Ananya Barat
6ee7701aab qcacmn: Add APIs to query min and max chanwidth supported by channel
1. Add reg_get_min_chwidth to return the max chanwidth supported by
regulatory given the primary frequency and the pdev.

2. Add reg_get_max_chwidth to return the max chanwidth supported by
regulatory given the primary frequency and the pdev.

3. Add dispatcher functions for both

Change-Id: Ia21198fe778d32b1673e5dd30c8cd621cded2c45
CRs-Fixed: 3098311
2022-02-15 17:27:45 -08:00
Hariharan Basuthkar
8d8e72cf71 qcacmn: Compute freq for channels in other 6G power type
The API reg_compute_chan_to_freq() computes frequencies only for channels
present in master channel list. A 6G channel may not belong to the current
(current power type's) master channel but be present in different 6g power
type's master channel list.

So if a 6G channel is not found in the current (current power type's)
master channel list, then search for the channel in all the 6g power's
master channel list to compute the frequency.

Change-Id: I7ccdaeb1f9de8d9baabe59ad673d445ed36a6a2d
2022-02-14 14:47:25 -08:00
Balaji Pothunoori
76b13083fb qcacmn: update chan avoid ind for wmi_wlan_freq_avoid_event_id
If coex_unsafe_chan_nb_user_prefer ini is not set then
avoid_freq_ind becoming NULL for "wmi_wlan_freq_avoid_event_id"
which results in sending regulatory update event to user space
and reduces PNO scan timeline.

This change is to update ch_avoid_ind for
wmi_wlan_freq_avoid_event_id.

Fixes regression : 7192d90810 ("qcacmn: update unsafe channel
list for SAP for freq extcmd")

Change-Id: I57ff334e9cf47468c30bc6884a9ead0a65a92b23
CRs-Fixed: 3119140
2022-02-11 07:36:42 -08:00
Vignesh U
809a5a3602 qcacmn: Address compilation error in non-6G PFs
The structure members of regulatory pdev private object,
is_6g_channel_list_populated and super_chan_list are 6G specific but are
used outside the 6G macro 'CONFIG_BAND_6GHZ'. It is used in get channel
list API reg_get_pwrmode_chan_list(), that is commonly called for all the
bands.

Move the 6G portion of get channel list API to a separate API
reg_get_6g_pwrmode_chan_list() that is empty for non-6G platforms.

Change-Id: If9aeedbf157536d10912f4ee1d92f42146b19759
2022-02-08 15:05:34 -08:00
Shashikala Prabhu
4905072179 qcacmn: Use the correct datatype for wireless modes
Wireless mode is of datatype uint64_t but in some places, it is used
as uint32_t.

In this change, replaced 'uint32_t wireless_modes' with
'uint64_t wireless_modes'.

Change-Id: I13b5781ddb14fc0131668e1710df19ae75eb1e34
CRs-Fixed: 3119562
2022-02-08 07:44:41 -08:00
Bing Sun
fd0ac6014b qcacmn: Refine 5g bonded channel state with static puncturing
Refine reg_get_5g_bonded_channel_state_for_freq with static puncturing.
Update channel state as CHANNEL_STATE_DFS or CHANNEL_STATE_ENABLE if
its puncture bitmap is valid with given bandwidth.

Change-Id: I3503c8bcf6094b9c98056809f1c304747ba97667
CRs-Fixed: 3106240
2022-02-07 20:22:11 -08:00
Vignesh U
2806fac2c3 qcacmn: Add reg_get_pwrmode_chan_list API
Add reg_get_pwrmode_chan_list() which will take an input 6G power mode
and will use super channel list to build the 6G power mode based channel
list.

The 2G and 5G portion of this channel list will be same as the current
channel list and if the input power mode is REG_CURRENT_PWR_MODE, then
also the current channel list is copied to the given buffer.

If the input 6G power mode is REG_BEST_PWR_MODE then all the 6G frequencies
supported by the current country will be present and will indicate the
power values of the best power mode possible for that entry.

For other 6G power types only the 6G portion of the channel list is
modified as per the input 6g power mode.

Change-Id: Ib22399ac950af87ee64ecdb78089bb2ff5221f69
2022-02-07 16:41:35 -08:00