qcacmn: Enable/Disable 6G edge channels ch2 and ch233

Enable lower 6G edge channel ch2 (5935MHz) for APL2 6G regdmn
using a service bit WMI_SERVICE_ENABLE_LOWER_6G_EDGE_CH_SUPP,
which is not enabled by default.
Also, disable upper 6G edge channel (7115MHz) using another
service bit WMI_SERVICE_DISABLE_UPPER_6G_EDGE_CH_SUPP, that
is enabled by default.

Change-Id: Ia7cb7f7d3165375178adbe70adb19b8671496b6d
CRs-Fixed: 2885623
This commit is contained in:
Gururaj Pandurangi
2021-02-22 15:46:35 -08:00
committed by snandini
parent a2ac29d45c
commit 08148f21fa
13 changed files with 376 additions and 1 deletions

View File

@@ -312,6 +312,10 @@ static int init_deinit_service_ext2_ready_event_handler(ol_scn_t scn_handle,
target_if_regulatory_set_ext_tpc(psoc); target_if_regulatory_set_ext_tpc(psoc);
target_if_reg_set_lower_6g_edge_ch_info(psoc);
target_if_reg_set_disable_upper_6g_edge_ch_info(psoc);
/* send init command */ /* send init command */
init_deinit_set_send_init_cmd(psoc, tgt_hdl); init_deinit_set_send_init_cmd(psoc, tgt_hdl);

View File

@@ -100,4 +100,36 @@ QDF_STATUS target_if_regulatory_set_ext_tpc(struct wlan_objmgr_psoc *psoc);
*/ */
struct wlan_lmac_if_reg_tx_ops * struct wlan_lmac_if_reg_tx_ops *
target_if_regulatory_get_tx_ops(struct wlan_objmgr_psoc *psoc); target_if_regulatory_get_tx_ops(struct wlan_objmgr_psoc *psoc);
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT)
/**
* target_if_reg_set_lower_6g_edge_ch_info() - populate lower 6ghz edge channel
* enablement info
* @psoc: psoc pointer
* Return: Success or Failure
*/
QDF_STATUS
target_if_reg_set_lower_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc);
/**
* target_if_reg_set_disable_upper_6g_edge_ch_info() - populate upper 6ghz
* edge channel disablement info
* @psoc: psoc pointer
* Return: Success or Failure
*/
QDF_STATUS
target_if_reg_set_disable_upper_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc);
#else
static inline QDF_STATUS
target_if_reg_set_lower_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc)
{
return QDF_STATUS_E_FAILURE;
}
static inline QDF_STATUS
target_if_reg_set_disable_upper_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc)
{
return QDF_STATUS_E_FAILURE;
}
#endif
#endif /* __TARGET_IF_REG_H__ */ #endif /* __TARGET_IF_REG_H__ */

View File

@@ -723,7 +723,8 @@ tgt_if_regulatory_is_ext_tpc_supported(struct wlan_objmgr_psoc *psoc)
if (!wmi_handle) if (!wmi_handle)
return false; return false;
return wmi_service_enabled(wmi_handle, wmi_service_ext_tpc_reg_support); return wmi_service_enabled(wmi_handle,
wmi_service_ext_tpc_reg_support);
} }
QDF_STATUS target_if_regulatory_set_ext_tpc(struct wlan_objmgr_psoc *psoc) QDF_STATUS target_if_regulatory_set_ext_tpc(struct wlan_objmgr_psoc *psoc)
@@ -744,6 +745,96 @@ QDF_STATUS target_if_regulatory_set_ext_tpc(struct wlan_objmgr_psoc *psoc)
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT)
/**
* tgt_if_regulatory_is_lower_6g_edge_ch_supp() - Check if lower 6ghz
* edge channel (5935MHz) is supported
* @psoc: Pointer to psoc
*
* Return: true if channel is supported, else false
*/
static bool
tgt_if_regulatory_is_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc)
{
wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
if (!wmi_handle)
return false;
return wmi_service_enabled(wmi_handle,
wmi_service_lower_6g_edge_ch_supp);
}
/**
* tgt_if_regulatory_is_upper_6g_edge_ch_disabled() - Check if upper
* 6ghz edge channel (7115MHz) is disabled
* @psoc: Pointer to psoc
*
* Return: true if channel is disabled, else false
*/
static bool
tgt_if_regulatory_is_upper_6g_edge_ch_disabled(struct wlan_objmgr_psoc *psoc)
{
wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
if (!wmi_handle)
return false;
return wmi_service_enabled(wmi_handle,
wmi_service_disable_upper_6g_edge_ch_supp);
}
QDF_STATUS
target_if_reg_set_lower_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc)
{
struct wlan_lmac_if_reg_rx_ops *reg_rx_ops;
reg_rx_ops = target_if_regulatory_get_rx_ops(psoc);
if (!reg_rx_ops) {
target_if_err("reg_rx_ops is NULL");
return QDF_STATUS_E_FAILURE;
}
if (reg_rx_ops->reg_set_lower_6g_edge_ch_supp)
reg_rx_ops->reg_set_lower_6g_edge_ch_supp(
psoc,
tgt_if_regulatory_is_lower_6g_edge_ch_supp(psoc));
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
target_if_reg_set_disable_upper_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc)
{
struct wlan_lmac_if_reg_rx_ops *reg_rx_ops;
reg_rx_ops = target_if_regulatory_get_rx_ops(psoc);
if (!reg_rx_ops) {
target_if_err("reg_rx_ops is NULL");
return QDF_STATUS_E_FAILURE;
}
if (reg_rx_ops->reg_set_disable_upper_6g_edge_ch_supp)
reg_rx_ops->reg_set_disable_upper_6g_edge_ch_supp(
psoc,
tgt_if_regulatory_is_upper_6g_edge_ch_disabled(psoc));
return QDF_STATUS_SUCCESS;
}
#else
static inline bool
tgt_if_regulatory_is_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc)
{
return false;
}
static inline bool
tgt_if_regulatory_is_upper_6g_edge_ch_disabled(struct wlan_objmgr_psoc *psoc)
{
return false;
}
#endif
QDF_STATUS target_if_register_regulatory_tx_ops( QDF_STATUS target_if_register_regulatory_tx_ops(
struct wlan_lmac_if_tx_ops *tx_ops) struct wlan_lmac_if_tx_ops *tx_ops)
{ {

View File

@@ -1249,6 +1249,14 @@ struct wlan_lmac_if_reg_rx_ops {
uint8_t *bitmap); uint8_t *bitmap);
QDF_STATUS (*reg_set_ext_tpc_supported)(struct wlan_objmgr_psoc *psoc, QDF_STATUS (*reg_set_ext_tpc_supported)(struct wlan_objmgr_psoc *psoc,
bool val); bool val);
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT)
QDF_STATUS
(*reg_set_lower_6g_edge_ch_supp)(struct wlan_objmgr_psoc *psoc,
bool val);
QDF_STATUS
(*reg_set_disable_upper_6g_edge_ch_supp)(struct wlan_objmgr_psoc *psoc,
bool val);
#endif
}; };
#ifdef CONVERGED_P2P_ENABLE #ifdef CONVERGED_P2P_ENABLE

View File

@@ -303,6 +303,23 @@ static inline void wlan_lmac_if_register_master_list_ext_handler(
} }
#endif #endif
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT)
static void wlan_lmac_if_register_6g_edge_chan_supp(
struct wlan_lmac_if_rx_ops *rx_ops)
{
rx_ops->reg_rx_ops.reg_set_lower_6g_edge_ch_supp =
tgt_reg_set_lower_6g_edge_ch_supp;
rx_ops->reg_rx_ops.reg_set_disable_upper_6g_edge_ch_supp =
tgt_reg_set_disable_upper_6g_edge_ch_supp;
}
#else
static inline void wlan_lmac_if_register_6g_edge_chan_supp(
struct wlan_lmac_if_rx_ops *rx_ops)
{
}
#endif
static void wlan_lmac_if_umac_reg_rx_ops_register( static void wlan_lmac_if_umac_reg_rx_ops_register(
struct wlan_lmac_if_rx_ops *rx_ops) struct wlan_lmac_if_rx_ops *rx_ops)
{ {
@@ -373,6 +390,8 @@ static void wlan_lmac_if_umac_reg_rx_ops_register(
rx_ops->reg_rx_ops.reg_set_ext_tpc_supported = rx_ops->reg_rx_ops.reg_set_ext_tpc_supported =
tgt_reg_set_ext_tpc_supported; tgt_reg_set_ext_tpc_supported;
wlan_lmac_if_register_6g_edge_chan_supp(rx_ops);
} }
#ifdef CONVERGED_P2P_ENABLE #ifdef CONVERGED_P2P_ENABLE

View File

@@ -845,6 +845,50 @@ reg_modify_chan_list_for_5dot9_ghz_channels(struct wlan_objmgr_pdev *pdev,
} }
} }
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT)
/**
* reg_modify_chan_list_for_6g_edge_channels() - Modify 6 GHz edge channels
*
* @pdev: Pointer to pdev object
* @chan_list: Current channel list
*
* This function disables lower 6G edge channel (5935MHz) if service bit
* wmi_service_lower_6g_edge_ch_supp is not set. If service bit is set
* the channels remain enabled. It disables upper 6G edge channel (7115MHz)
* if the service bit wmi_service_disable_upper_6g_edge_ch_supp is set, it
* is enabled by default.
*
*/
static void
reg_modify_chan_list_for_6g_edge_channels(struct wlan_objmgr_pdev *pdev,
struct regulatory_channel
*chan_list)
{
struct wlan_objmgr_psoc *psoc;
psoc = wlan_pdev_get_psoc(pdev);
if (!reg_is_lower_6g_edge_ch_supp(psoc)) {
chan_list[CHAN_ENUM_5935].state = CHANNEL_STATE_DISABLE;
chan_list[CHAN_ENUM_5935].chan_flags |=
REGULATORY_CHAN_DISABLED;
}
if (reg_is_upper_6g_edge_ch_disabled(psoc)) {
chan_list[CHAN_ENUM_7115].state = CHANNEL_STATE_DISABLE;
chan_list[CHAN_ENUM_7115].chan_flags |=
REGULATORY_CHAN_DISABLED;
}
}
#else
static inline void
reg_modify_chan_list_for_6g_edge_channels(struct wlan_objmgr_pdev *pdev,
struct regulatory_channel
*chan_list)
{
}
#endif
#ifdef DISABLE_UNII_SHARED_BANDS #ifdef DISABLE_UNII_SHARED_BANDS
/** /**
* reg_is_reg_unii_band_1_set() - Check UNII bitmap * reg_is_reg_unii_band_1_set() - Check UNII bitmap
@@ -1065,6 +1109,10 @@ void reg_compute_pdev_current_chan_list(struct wlan_regulatory_pdev_priv_obj
reg_modify_chan_list_for_max_chwidth(pdev_priv_obj->pdev_ptr, reg_modify_chan_list_for_max_chwidth(pdev_priv_obj->pdev_ptr,
pdev_priv_obj->cur_chan_list); pdev_priv_obj->cur_chan_list);
reg_modify_chan_list_for_6g_edge_channels(pdev_priv_obj->pdev_ptr,
pdev_priv_obj->
cur_chan_list);
} }
void reg_reset_reg_rules(struct reg_rule_info *reg_rules) void reg_reset_reg_rules(struct reg_rule_info *reg_rules)

View File

@@ -105,6 +105,10 @@ struct chan_change_cbk_entry {
* @domain_code_6g_ap: domain code for 6G AP * @domain_code_6g_ap: domain code for 6G AP
* @domain_code_6g_client: domain code for 6G client * @domain_code_6g_client: domain code for 6G client
* @is_ext_tpc_supported: Whether FW supports new WMI command for TPC * @is_ext_tpc_supported: Whether FW supports new WMI command for TPC
* @is_lower_6g_edge_ch_supported: whether lower 6ghz edge channel 5935MHz is
* supported
* @is_upper_6g_edge_ch_disabled: whether upper 6ghz edge channel 7115MHz is
* disabled
*/ */
struct wlan_regulatory_psoc_priv_obj { struct wlan_regulatory_psoc_priv_obj {
struct mas_chan_params mas_chan_params[PSOC_MAX_PHY_REG_CAP]; struct mas_chan_params mas_chan_params[PSOC_MAX_PHY_REG_CAP];
@@ -162,6 +166,10 @@ struct wlan_regulatory_psoc_priv_obj {
uint8_t domain_code_6g_client[REG_CURRENT_MAX_AP_TYPE][REG_MAX_CLIENT_TYPE]; uint8_t domain_code_6g_client[REG_CURRENT_MAX_AP_TYPE][REG_MAX_CLIENT_TYPE];
#endif #endif
bool is_ext_tpc_supported; bool is_ext_tpc_supported;
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT)
bool is_lower_6g_edge_ch_supported;
bool is_upper_6g_edge_ch_disabled;
#endif
}; };
/** /**

View File

@@ -4531,3 +4531,67 @@ bool reg_is_ext_tpc_supported(struct wlan_objmgr_psoc *psoc)
return psoc_priv_obj->is_ext_tpc_supported; return psoc_priv_obj->is_ext_tpc_supported;
} }
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT)
QDF_STATUS
reg_set_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc, bool val)
{
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
psoc_priv_obj = reg_get_psoc_obj(psoc);
if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
reg_err("psoc reg component is NULL");
return QDF_STATUS_E_FAILURE;
}
psoc_priv_obj->is_lower_6g_edge_ch_supported = val;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
reg_set_disable_upper_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc, bool val)
{
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
psoc_priv_obj = reg_get_psoc_obj(psoc);
if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
reg_err("psoc reg component is NULL");
return QDF_STATUS_E_FAILURE;
}
psoc_priv_obj->is_upper_6g_edge_ch_disabled = val;
return QDF_STATUS_SUCCESS;
}
bool reg_is_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc)
{
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
psoc_priv_obj = reg_get_psoc_obj(psoc);
if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
reg_err("psoc reg component is NULL");
return false;
}
return psoc_priv_obj->is_lower_6g_edge_ch_supported;
}
bool reg_is_upper_6g_edge_ch_disabled(struct wlan_objmgr_psoc *psoc)
{
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
psoc_priv_obj = reg_get_psoc_obj(psoc);
if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
reg_err("psoc reg component is NULL");
return false;
}
return psoc_priv_obj->is_upper_6g_edge_ch_disabled;
}
#endif

View File

@@ -1614,4 +1614,45 @@ bool reg_is_ext_tpc_supported(struct wlan_objmgr_psoc *psoc);
*/ */
const struct bonded_channel_freq * const struct bonded_channel_freq *
reg_get_bonded_chan_entry(qdf_freq_t freq, enum phy_ch_width chwidth); reg_get_bonded_chan_entry(qdf_freq_t freq, enum phy_ch_width chwidth);
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT)
/**
* reg_set_lower_6g_edge_ch_supp() - Set if lower 6ghz edge channel is
* supported by FW
*
* @psoc: Pointer to psoc
* @val: value
*/
QDF_STATUS reg_set_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc,
bool val);
/**
* reg_set_disable_upper_6g_edge_ch_supp() - Set if upper 6ghz edge channel is
* disabled by FW
*
* @psoc: Pointer to psoc
* @val: value
*/
QDF_STATUS
reg_set_disable_upper_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc,
bool val);
/**
* reg_is_lower_6g_edge_ch_supp() - Check whether 6GHz lower edge channel
* (5935 MHz) is supported.
* @psoc: pointer to psoc
*
* Return: true if edge channels are supported, else false
*/
bool reg_is_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc);
/**
* reg_is_upper_6g_edge_ch_disabled() - Check whether 6GHz upper edge
* channel (7115 MHz) is disabled.
* @psoc: pointer to psoc
*
* Return: true if edge channels are supported, else false
*/
bool reg_is_upper_6g_edge_ch_disabled(struct wlan_objmgr_psoc *psoc);
#endif
#endif #endif

View File

@@ -116,4 +116,39 @@ QDF_STATUS tgt_reg_set_5dot9_ghz_supported(struct wlan_objmgr_psoc *psoc,
QDF_STATUS tgt_reg_set_ext_tpc_supported(struct wlan_objmgr_psoc *psoc, QDF_STATUS tgt_reg_set_ext_tpc_supported(struct wlan_objmgr_psoc *psoc,
bool val); bool val);
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT)
/**
* tgt_reg_set_lower_6g_edge_ch_supp() - Assign the value set by FW for lower
* 6ghz edge channel (5935 MHz) support
* @psoc: Pointer to psoc
* @val: value
*/
QDF_STATUS tgt_reg_set_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc,
bool val);
/**
* tgt_reg_set_disable_upper_6g_edge_ch_supp() - Assign the value set by FW
* for upper 6G edge channel {7115MHz) disablement
* @psoc: Pointer to psoc
* @val: value
*/
QDF_STATUS
tgt_reg_set_disable_upper_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc,
bool val);
#else
static inline
QDF_STATUS tgt_reg_set_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc,
bool val)
{
return QDF_STATUS_E_FAILURE;
}
static inline QDF_STATUS
tgt_reg_set_disable_upper_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc,
bool val)
{
return QDF_STATUS_E_FAILURE;
}
#endif
#endif #endif

View File

@@ -123,3 +123,18 @@ QDF_STATUS tgt_reg_set_ext_tpc_supported(struct wlan_objmgr_psoc *psoc,
{ {
return reg_set_ext_tpc_supported(psoc, val); return reg_set_ext_tpc_supported(psoc, val);
} }
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT)
QDF_STATUS tgt_reg_set_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc,
bool val)
{
return reg_set_lower_6g_edge_ch_supp(psoc, val);
}
QDF_STATUS
tgt_reg_set_disable_upper_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc,
bool val)
{
return reg_set_disable_upper_6g_edge_ch_supp(psoc, val);
}
#endif

View File

@@ -5109,6 +5109,10 @@ typedef enum {
wmi_service_ext_tpc_reg_support, wmi_service_ext_tpc_reg_support,
wmi_service_ndi_txbf_support, wmi_service_ndi_txbf_support,
wmi_service_reg_cc_ext_event_support, wmi_service_reg_cc_ext_event_support,
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT)
wmi_service_lower_6g_edge_ch_supp,
wmi_service_disable_upper_6g_edge_ch_supp,
#endif
wmi_services_max, wmi_services_max,
} wmi_conv_service_ids; } wmi_conv_service_ids;
#define WMI_SERVICE_UNAVAILABLE 0xFFFF #define WMI_SERVICE_UNAVAILABLE 0xFFFF

View File

@@ -15768,6 +15768,12 @@ static void populate_tlv_service(uint32_t *wmi_service)
WMI_SERVICE_NDI_TXBF_SUPPORT; WMI_SERVICE_NDI_TXBF_SUPPORT;
wmi_service[wmi_service_reg_cc_ext_event_support] = wmi_service[wmi_service_reg_cc_ext_event_support] =
WMI_SERVICE_REG_CC_EXT_EVENT_SUPPORT; WMI_SERVICE_REG_CC_EXT_EVENT_SUPPORT;
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT)
wmi_service[wmi_service_lower_6g_edge_ch_supp] =
WMI_SERVICE_ENABLE_LOWER_6G_EDGE_CH_SUPP;
wmi_service[wmi_service_disable_upper_6g_edge_ch_supp] =
WMI_SERVICE_DISABLE_UPPER_6G_EDGE_CH_SUPP;
#endif
} }
/** /**