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
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
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
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
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
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
Declare the AFC deployment type enum and add deployment type member to
pdev_priv_obj.
Change-Id: Id11a0aac4fcc1b655436d9dbd876607178f27bd4
CRs-Fixed: 3186216
- 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
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
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
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
&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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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