qcacld-3.0: Add ini support to control update cw

Add support for INI update_cw_allowed to enable or
disable update channel width via vendor command
QCA_WLAN_VENDOR_ATTR_CONFIG_CHANNEL_WIDTH

Change-Id: I1f4ab2c7ca8dacb93442803336d59a4a5ffb1b47
CRs-Fixed: 3659655
This commit is contained in:
Abhinav Kumar
2023-11-07 01:45:15 -08:00
gecommit door Ravindra Konda
bovenliggende ecdb21e4d0
commit f8a690b38f
8 gewijzigde bestanden met toevoegingen van 93 en 1 verwijderingen

Bestand weergeven

@@ -1969,6 +1969,8 @@ static void mlme_init_feature_flag_in_cfg(
cfg_get(psoc, CFG_CHANNEL_BONDING_MODE_24GHZ);
feature_flags->channel_bonding_mode_5ghz =
cfg_get(psoc, CFG_CHANNEL_BONDING_MODE_5GHZ);
feature_flags->update_cw_allowed =
cfg_get(psoc, CFG_ALLOW_UPDATE_CHANNEL_WIDTH);
}
static void mlme_init_sap_protection_cfg(struct wlan_objmgr_psoc *psoc,

Bestand weergeven

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -222,6 +223,29 @@
CFG_VALUE_OR_DEFAULT, \
"Configures Channel Bonding in 5 GHz")
/*
* <ini>
* update_cw_allowed - process set channel width or not
* @Min: 0
* @Max: 1
* @Default: 1
*
* This ini is used to check whether driver allowed to process set channel
* width request from upper layer or not.
*
* Related: None
*
* Supported Feature: STA
*
* Usage: External
*
* </ini>
*/
#define CFG_ALLOW_UPDATE_CHANNEL_WIDTH CFG_INI_BOOL( \
"update_cw_allowed", \
1, \
"is update chan width allowed")
#define CFG_FEATURE_FLAG_ALL \
CFG(CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY) \
CFG(CFG_HCF_ENABLED) \
@@ -235,7 +259,8 @@
CFG(CFG_BLOCK_ACK_ENABLED) \
CFG(CFG_ENABLE_AMPDUPS) \
CFG(CFG_CHANNEL_BONDING_MODE_24GHZ) \
CFG(CFG_CHANNEL_BONDING_MODE_5GHZ)
CFG(CFG_CHANNEL_BONDING_MODE_5GHZ) \
CFG(CFG_ALLOW_UPDATE_CHANNEL_WIDTH)
#endif /* __CFG_MLME_FEATURE_FLAG_H */

Bestand weergeven

@@ -4569,6 +4569,18 @@ QDF_STATUS
wlan_mlme_get_tx_retry_multiplier(struct wlan_objmgr_psoc *psoc,
uint32_t *tx_retry_multiplier);
/**
* wlan_mlme_get_update_chan_width_allowed - Get value of INI
* is_update_chan_width_allowed
* @psoc: pointer to psoc object
* @value: pointer to the value which will be filled for the caller
*
* Return: QDF Status
*/
QDF_STATUS
wlan_mlme_get_update_chan_width_allowed(struct wlan_objmgr_psoc *psoc,
bool *value);
/**
* wlan_mlme_get_channel_bonding_5ghz - Get the channel bonding
* val for 5ghz freq

Bestand weergeven

@@ -1199,6 +1199,7 @@ struct wlan_mlme_rates {
* @enable_block_ack: enable block ack feature
* @channel_bonding_mode_24ghz: configures Channel Bonding in 24 GHz
* @channel_bonding_mode_5ghz: configures Channel Bonding in 5 GHz
* @update_cw_allowed: to check update chan width allowed or not
*/
struct wlan_mlme_feature_flag {
bool accept_short_slot_assoc;
@@ -1214,6 +1215,7 @@ struct wlan_mlme_feature_flag {
uint32_t enable_block_ack;
uint32_t channel_bonding_mode_24ghz;
uint32_t channel_bonding_mode_5ghz;
bool update_cw_allowed;
};
/**

Bestand weergeven

@@ -4681,6 +4681,18 @@ QDF_STATUS ucfg_mlme_set_restricted_80p80_bw_supp(struct wlan_objmgr_psoc *psoc,
*/
bool ucfg_mlme_get_restricted_80p80_bw_supp(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_mlme_get_update_chan_width_allowed - Get value of INI
* is_update_chan_width_allowed
* @psoc: pointer to psoc object
* @value: pointer to the value which will be filled for the caller
*
* Return: QDF Status
*/
QDF_STATUS
ucfg_mlme_get_update_chan_width_allowed(struct wlan_objmgr_psoc *psoc,
bool *value);
/**
* ucfg_mlme_get_channel_bonding_24ghz() - get channel bonding mode of 24ghz
* @psoc: pointer to psoc object
@@ -4702,6 +4714,7 @@ ucfg_mlme_get_channel_bonding_24ghz(struct wlan_objmgr_psoc *psoc,
QDF_STATUS
ucfg_mlme_set_channel_bonding_24ghz(struct wlan_objmgr_psoc *psoc,
uint32_t value);
/**
* ucfg_mlme_get_channel_bonding_5ghz() - get channel bonding mode of 5ghz
* @psoc: pointer to psoc object

Bestand weergeven

@@ -6822,6 +6822,23 @@ wlan_mlme_get_tx_retry_multiplier(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
wlan_mlme_get_update_chan_width_allowed(struct wlan_objmgr_psoc *psoc,
bool *value)
{
struct wlan_mlme_psoc_ext_obj *mlme_obj;
mlme_obj = mlme_get_psoc_ext_obj(psoc);
if (!mlme_obj) {
*value = cfg_default(CFG_ALLOW_UPDATE_CHANNEL_WIDTH);
return QDF_STATUS_E_INVAL;
}
*value = mlme_obj->cfg.feature_flags.update_cw_allowed;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
wlan_mlme_get_channel_bonding_5ghz(struct wlan_objmgr_psoc *psoc,
uint32_t *value)

Bestand weergeven

@@ -1865,6 +1865,13 @@ ucfg_mlme_set_channel_bonding_24ghz(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
ucfg_mlme_get_update_chan_width_allowed(struct wlan_objmgr_psoc *psoc,
bool *value)
{
return wlan_mlme_get_update_chan_width_allowed(psoc, value);
}
QDF_STATUS
ucfg_mlme_get_channel_bonding_5ghz(struct wlan_objmgr_psoc *psoc,
uint32_t *value)

Bestand weergeven

@@ -11100,6 +11100,20 @@ static int hdd_set_channel_width(struct wlan_hdd_link_info *link_info,
struct nlattr *chn_bd = NULL;
struct nlattr *mlo_link_id;
enum eSirMacHTChannelWidth chwidth;
struct wlan_objmgr_psoc *psoc;
bool update_cw_allowed;
psoc = wlan_vdev_get_psoc(link_info->vdev);
if (!psoc) {
hdd_debug("psoc is null");
return -EINVAL;
}
ucfg_mlme_get_update_chan_width_allowed(psoc, &update_cw_allowed);
if (!update_cw_allowed) {
hdd_debug("update_channel_width is disabled via INI");
return -EINVAL;
}
if (!tb[QCA_WLAN_VENDOR_ATTR_CONFIG_MLO_LINKS])
goto skip_mlo;