qcacld-3.0: Refactor 11AC override CFG items

Refactor following CFG items
1. CFG_SAP_11AC_OVERRIDE
2. CFG_GO_11AC_OVERRIDE

Change-Id: I63497fcc4440fb079fa0f8d8879758baad2d8fc2
CRs-Fixed: 2391667
This commit is contained in:
Sandeep Puligilla
2019-01-04 17:42:42 -08:00
committed by nshrivas
parent a7f08d8ef9
commit 3461878302
12 changed files with 248 additions and 83 deletions

View File

@@ -1174,6 +1174,10 @@ static void mlme_init_sap_cfg(struct wlan_objmgr_psoc *psoc,
cfg_get(psoc, CFG_AP_ENABLE_RANDOM_BSSID);
sap_cfg->sap_mcc_chnl_avoid =
cfg_get(psoc, CFG_SAP_MCC_CHANNEL_AVOIDANCE);
sap_cfg->sap_11ac_override =
cfg_get(psoc, CFG_SAP_11AC_OVERRIDE);
sap_cfg->go_11ac_override =
cfg_get(psoc, CFG_GO_11AC_OVERRIDE);
}
static void mlme_init_obss_ht40_cfg(struct wlan_objmgr_psoc *psoc,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2019 The Linux Foundation. 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
@@ -626,7 +626,59 @@
CFG_VALUE_OR_DEFAULT, \
"SAP MCC channel avoidance")
#define CFG_SAP_ALL \
/*
* <ini>
* gSAP11ACOverride - Override bw to 11ac for SAP in driver even if supplicant
* or hostapd configures HT.
* @Min: 0
* @Max: 1
* @Default: 0
*
* This ini is used to enable/disable 11AC override for SAP.
* Android UI does not provide advanced configuration options
* for SoftAP for Android O and below.
* Default override disabled for android. Can be enabled from
* ini for Android O and below.
*
*
* Supported Feature: SAP
*
*
* Usage: Internal/External
*
* </ini>
*/
#define CFG_SAP_11AC_OVERRIDE CFG_INI_BOOL( \
"gSAP11ACOverride", \
0, \
"Override bw to 11ac for SAP")
/*
* <ini>
* gGO11ACOverride - Override bw to 11ac for P2P GO
* @Min: 0
* @Max: 1
* @Default: 1
*
* This ini is used to enable/disable 11AC override for GO.
* P2P GO also follows start_bss and since P2P GO could not be
* configured to setup VHT channel width in wpa_supplicant, driver
* can override 11AC.
*
*
* Supported Feature: P2P
*
*
* Usage: Internal/External
*
* </ini>
*/
#define CFG_GO_11AC_OVERRIDE CFG_INI_BOOL( \
"gGO11ACOverride", \
1, \
"Override bw to 11ac for P2P GO")
#define CFG_SAP_ALL \
CFG(CFG_AP_ENABLE_RANDOM_BSSID) \
CFG(CFG_SSID) \
CFG(CFG_BEACON_INTERVAL) \
@@ -656,6 +708,8 @@
CFG(CFG_COUNTRY_CODE_PRIORITY) \
CFG(CFG_SAP_PREF_CHANNEL_LOCATION) \
CFG(CFG_SAP_FORCE_11N_FOR_11AC) \
CFG(CFG_GO_FORCE_11N_FOR_11AC)
CFG(CFG_SAP_11AC_OVERRIDE) \
CFG(CFG_GO_FORCE_11N_FOR_11AC) \
CFG(CFG_GO_11AC_OVERRIDE)
#endif /* __CFG_MLME_SAP_H */

View File

@@ -684,6 +684,50 @@ QDF_STATUS wlan_mlme_get_sap_force_11n_for_11ac(struct wlan_objmgr_psoc
QDF_STATUS wlan_mlme_get_go_force_11n_for_11ac(struct wlan_objmgr_psoc
*psoc, bool *value);
/**
* wlan_mlme_is_go_11ac_override() - Override 11ac bandwdith for P2P GO
*
* @psoc: pointer to psoc object
* @value: pointer to the value which will be filled for the caller
*
* Return: QDF Status
*/
QDF_STATUS wlan_mlme_is_go_11ac_override(struct wlan_objmgr_psoc *psoc,
bool *value);
/**
* wlan_mlme_is_sap_11ac_override() - Override 11ac bandwdith for SAP
*
* @psoc: pointer to psoc object
* @value: pointer to the value which will be filled for the caller
*
* Return: QDF Status
*/
QDF_STATUS wlan_mlme_is_sap_11ac_override(struct wlan_objmgr_psoc *psoc,
bool *value);
/**
* wlan_mlme_set_go_11ac_override() - set override 11ac bandwdith for P2P GO
*
* @psoc: pointer to psoc object
* @value: pointer to the value which will be filled for the caller
*
* Return: QDF Status
*/
QDF_STATUS wlan_mlme_set_go_11ac_override(struct wlan_objmgr_psoc *psoc,
bool value);
/**
* wlan_mlme_set_sap_11ac_override() - set override 11ac bandwdith for SAP
*
* @psoc: pointer to psoc object
* @value: pointer to the value which will be filled for the caller
*
* Return: QDF Status
*/
QDF_STATUS wlan_mlme_set_sap_11ac_override(struct wlan_objmgr_psoc *psoc,
bool value);
/**
* wlan_mlme_get_oce_sta_enabled_info() - Get the OCE feature enable
* info for STA

View File

@@ -580,6 +580,8 @@ struct wlan_mlme_wps_params {
* @country_code_priority: Country code priority.
* @sap_pref_chan_location: SAP Preferred channel location.
* @sap_mcc_chnl_avoid: SAP MCC channel avoidance flag
* @sap_11ac_override: Overrirde SAP bandwidth to 11ac
* @go_11ac_override: Override GO bandwidth to 11ac
*/
struct wlan_mlme_cfg_sap {
uint8_t cfg_ssid[MLME_CFG_SSID_LEN];
@@ -613,6 +615,8 @@ struct wlan_mlme_cfg_sap {
bool go_force_11n_for_11ac;
bool ap_random_bssid_enable;
uint8_t sap_mcc_chnl_avoid;
bool sap_11ac_override;
bool go_11ac_override;
};
/**

View File

@@ -1610,6 +1610,66 @@ QDF_STATUS ucfg_mlme_get_go_force_11n_for_11ac(struct wlan_objmgr_psoc
return wlan_mlme_get_go_force_11n_for_11ac(psoc, value);
}
/**
* ucfg_mlme_is_sap_11ac_override() - Override 11ac bandwdith for SAP
*
* @psoc: pointer to psoc object
* @value: Value that needs to be set from the caller
*
* Return: QDF Status
*/
static inline
QDF_STATUS ucfg_mlme_is_sap_11ac_override(struct wlan_objmgr_psoc *psoc,
bool *value)
{
return wlan_mlme_is_sap_11ac_override(psoc, value);
}
/**
* ucfg_mlme_is_go_11ac_override() - Override 11ac bandwdith for P2P GO
*
* @psoc: pointer to psoc object
* @value: pointer to the value which will be filled for the caller
*
* Return: QDF Status
*/
static inline
QDF_STATUS ucfg_mlme_is_go_11ac_override(struct wlan_objmgr_psoc *psoc,
bool *value)
{
return wlan_mlme_is_go_11ac_override(psoc, value);
}
/**
* ucfg_mlme_set_sap_11ac_override() - Set override 11ac bandwdith for SAP
*
* @psoc: pointer to psoc object
* @value: Value that needs to be set from the caller
*
* Return: QDF Status
*/
static inline
QDF_STATUS ucfg_mlme_set_sap_11ac_override(struct wlan_objmgr_psoc *psoc,
bool value)
{
return wlan_mlme_set_sap_11ac_override(psoc, value);
}
/**
* ucfg_mlme_set_go_11ac_override() - Set override 11ac bandwdith for P2P GO
*
* @psoc: pointer to psoc object
* @value: pointer to the value which will be filled for the caller
*
* Return: QDF Status
*/
static inline
QDF_STATUS ucfg_mlme_set_go_11ac_override(struct wlan_objmgr_psoc *psoc,
bool value)
{
return wlan_mlme_set_go_11ac_override(psoc, value);
}
/**
* ucfg_mlme_get_oce_sta_enabled_info() - Get OCE feature enable/disable
* info for STA

View File

@@ -1769,6 +1769,62 @@ QDF_STATUS wlan_mlme_get_go_force_11n_for_11ac(struct wlan_objmgr_psoc
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_mlme_is_sap_11ac_override(struct wlan_objmgr_psoc *psoc,
bool *value)
{
struct wlan_mlme_psoc_obj *mlme_obj;
mlme_obj = mlme_get_psoc_obj(psoc);
if (!mlme_obj) {
*value = cfg_default(CFG_SAP_11AC_OVERRIDE);
return QDF_STATUS_E_FAILURE;
}
*value = mlme_obj->cfg.sap_cfg.sap_11ac_override;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_mlme_is_go_11ac_override(struct wlan_objmgr_psoc *psoc,
bool *value)
{
struct wlan_mlme_psoc_obj *mlme_obj;
mlme_obj = mlme_get_psoc_obj(psoc);
if (!mlme_obj) {
*value = cfg_default(CFG_GO_11AC_OVERRIDE);
return QDF_STATUS_E_FAILURE;
}
*value = mlme_obj->cfg.sap_cfg.go_11ac_override;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_mlme_set_sap_11ac_override(struct wlan_objmgr_psoc *psoc,
bool value)
{
struct wlan_mlme_psoc_obj *mlme_obj;
mlme_obj = mlme_get_psoc_obj(psoc);
if (!mlme_obj)
return QDF_STATUS_E_FAILURE;
mlme_obj->cfg.sap_cfg.sap_11ac_override = value;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_mlme_set_go_11ac_override(struct wlan_objmgr_psoc *psoc,
bool value)
{
struct wlan_mlme_psoc_obj *mlme_obj;
mlme_obj = mlme_get_psoc_obj(psoc);
if (!mlme_obj)
return QDF_STATUS_E_FAILURE;
mlme_obj->cfg.sap_cfg.go_11ac_override = value;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_mlme_get_oce_sta_enabled_info(struct wlan_objmgr_psoc *psoc,
bool *value)
{

View File

@@ -199,58 +199,6 @@ enum hdd_dot11_mode {
#define CFG_DHCP_SERVER_IP_DEFAULT ""
#endif /* DHCP_SERVER_OFFLOAD */
/*
* <ini>
* gSAP11ACOverride - Override bw to 11ac for SAP in driver even if supplicant
* or hostapd configures HT.
* @Min: 0
* @Max: 1
* @Default: 0
*
* This ini is used to enable/disable 11AC override for SAP.
* Android UI does not provide advanced configuration options
* for SoftAP for Android O and below.
* Default override disabled for android. Can be enabled from
* ini for Android O and below.
*
*
* Supported Feature: SAP
*
*
* Usage: Internal/External
*
* </ini>
*/
#define CFG_SAP_11AC_OVERRIDE_NAME "gSAP11ACOverride"
#define CFG_SAP_11AC_OVERRIDE_MIN (0)
#define CFG_SAP_11AC_OVERRIDE_MAX (1)
#define CFG_SAP_11AC_OVERRIDE_DEFAULT (0)
/*
* <ini>
* gGO11ACOverride - Override bw to 11ac for P2P GO
* @Min: 0
* @Max: 1
* @Default: 1
*
* This ini is used to enable/disable 11AC override for GO.
* P2P GO also follows start_bss and since P2P GO could not be
* configured to setup VHT channel width in wpa_supplicant, driver
* can override 11AC.
*
*
* Supported Feature: P2P
*
*
* Usage: Internal/External
*
* </ini>
*/
#define CFG_GO_11AC_OVERRIDE_NAME "gGO11ACOverride"
#define CFG_GO_11AC_OVERRIDE_MIN (0)
#define CFG_GO_11AC_OVERRIDE_MAX (1)
#define CFG_GO_11AC_OVERRIDE_DEFAULT (1)
#ifdef CONFIG_DP_TRACE
/* Max length of gDptraceConfig string. e.g.- "1, 6, 1, 62" */
#define DP_TRACE_CONFIG_STRING_LENGTH (20)
@@ -352,8 +300,6 @@ struct hdd_config {
#ifdef DHCP_SERVER_OFFLOAD
uint8_t dhcpServerIP[IPADDR_STRING_LENGTH];
#endif /* DHCP_SERVER_OFFLOAD */
uint8_t sap_11ac_override;
uint8_t go_11ac_override;
bool apf_enabled;
enum scan_dwelltime_adaptive_mode extscan_adaptive_dwell_mode;
uint16_t sap_tx_leakage_threshold;

View File

@@ -84,22 +84,6 @@ struct reg_table_entry g_registry_table[] = {
(void *)CFG_DHCP_SERVER_IP_DEFAULT),
#endif /* DHCP_SERVER_OFFLOAD */
REG_VARIABLE(CFG_SAP_11AC_OVERRIDE_NAME, WLAN_PARAM_Integer,
struct hdd_config, sap_11ac_override,
VAR_FLAGS_OPTIONAL |
VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
CFG_SAP_11AC_OVERRIDE_DEFAULT,
CFG_SAP_11AC_OVERRIDE_MIN,
CFG_SAP_11AC_OVERRIDE_MAX),
REG_VARIABLE(CFG_GO_11AC_OVERRIDE_NAME, WLAN_PARAM_Integer,
struct hdd_config, go_11ac_override,
VAR_FLAGS_OPTIONAL |
VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
CFG_GO_11AC_OVERRIDE_DEFAULT,
CFG_GO_11AC_OVERRIDE_MIN,
CFG_GO_11AC_OVERRIDE_MAX),
REG_VARIABLE(CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_NAME, WLAN_PARAM_Integer,
struct hdd_config, extscan_adaptive_dwell_mode,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,

View File

@@ -2535,6 +2535,8 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
bool sap_force_11n_for_11ac = 0;
bool go_force_11n_for_11ac = 0;
bool etsi13_srd_chan;
bool go_11ac_override = 0;
bool sap_11ac_override = 0;
/* ***Note*** Donot set SME config related to ACS operation here because
* ACS operation is not synchronouse and ACS for Second AP may come when
@@ -2765,15 +2767,17 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
goto out;
}
ucfg_mlme_is_go_11ac_override(hdd_ctx->psoc, &go_11ac_override);
ucfg_mlme_is_sap_11ac_override(hdd_ctx->psoc, &sap_11ac_override);
/* ACS override for android */
if (ht_enabled &&
sap_config->acs_cfg.end_ch >= WLAN_REG_CH_NUM(CHAN_ENUM_36) &&
((adapter->device_mode == QDF_SAP_MODE &&
!sap_force_11n_for_11ac &&
hdd_ctx->config->sap_11ac_override) ||
sap_11ac_override) ||
(adapter->device_mode == QDF_P2P_GO_MODE &&
!go_force_11n_for_11ac &&
hdd_ctx->config->go_11ac_override))) {
go_11ac_override))) {
vht_enabled = 1;
sap_config->acs_cfg.hw_mode = eCSR_DOT11_MODE_11ac;
qdf_status =
@@ -13060,8 +13064,10 @@ void wlan_hdd_update_wiphy(struct hdd_context *hdd_ctx)
*
* Return: void
*/
void wlan_hdd_update_11n_mode(struct hdd_config *cfg)
void wlan_hdd_update_11n_mode(struct hdd_context *hdd_ctx)
{
struct hdd_config *cfg = hdd_ctx->config;
if (sme_is_feature_supported_by_fw(DOT11AC)) {
hdd_debug("support 11ac");
} else {
@@ -13069,8 +13075,8 @@ void wlan_hdd_update_11n_mode(struct hdd_config *cfg)
if ((cfg->dot11Mode == eHDD_DOT11_MODE_11ac_ONLY) ||
(cfg->dot11Mode == eHDD_DOT11_MODE_11ac)) {
cfg->dot11Mode = eHDD_DOT11_MODE_11n;
cfg->sap_11ac_override = 0;
cfg->go_11ac_override = 0;
ucfg_mlme_set_sap_11ac_override(hdd_ctx->psoc, 0);
ucfg_mlme_set_go_11ac_override(hdd_ctx->psoc, 0);
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2019 The Linux Foundation. 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
@@ -268,7 +268,7 @@ void wlan_hdd_cfg80211_deinit(struct wiphy *wiphy);
void wlan_hdd_update_wiphy(struct hdd_context *hdd_ctx);
void wlan_hdd_update_11n_mode(struct hdd_config *cfg);
void wlan_hdd_update_11n_mode(struct hdd_context *hdd_ctx);
int wlan_hdd_cfg80211_register(struct wiphy *wiphy);

View File

@@ -4367,6 +4367,8 @@ static int wlan_hdd_sap_p2p_11ac_overrides(struct hdd_adapter *ap_adapter)
bool sap_force_11n_for_11ac = 0;
bool go_force_11n_for_11ac = 0;
uint32_t channel_bonding_mode;
bool go_11ac_override = 0;
bool sap_11ac_override = 0;
ucfg_mlme_get_sap_force_11n_for_11ac(hdd_ctx->psoc,
&sap_force_11n_for_11ac);
@@ -4393,6 +4395,11 @@ static int wlan_hdd_sap_p2p_11ac_overrides(struct hdd_adapter *ap_adapter)
return -EIO;
}
ucfg_mlme_is_go_11ac_override(hdd_ctx->psoc,
&go_11ac_override);
ucfg_mlme_is_sap_11ac_override(hdd_ctx->psoc,
&sap_11ac_override);
if (!sub_20_chan_width &&
(sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11n ||
sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac ||
@@ -4401,10 +4408,10 @@ static int wlan_hdd_sap_p2p_11ac_overrides(struct hdd_adapter *ap_adapter)
sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ax_ONLY) &&
((ap_adapter->device_mode == QDF_SAP_MODE &&
!sap_force_11n_for_11ac &&
hdd_ctx->config->sap_11ac_override) ||
sap_11ac_override) ||
(ap_adapter->device_mode == QDF_P2P_GO_MODE &&
!go_force_11n_for_11ac &&
hdd_ctx->config->go_11ac_override))) {
go_11ac_override))) {
hdd_debug("** Driver force 11AC override for SAP/Go **");
/* 11n only shall not be overridden since it may be on purpose*/

View File

@@ -11954,7 +11954,7 @@ int hdd_wlan_startup(struct hdd_context *hdd_ctx)
goto unregister_netdev;
}
wlan_hdd_update_11n_mode(hdd_ctx->config);
wlan_hdd_update_11n_mode(hdd_ctx);
hdd_lpass_notify_wlan_version(hdd_ctx);