Просмотр исходного кода

qcacld-3.0: Add new ini item enable_dynamic_pcie_gen_speed_switch

Add new ini item enable_dynamic_pcie_gen_speed_switch for enabling
dynamic PCIe gen speed change.

Change-Id: I7dde4e40e56bf894c7edd0805d09425444648e6b
CRs-Fixed: 2977079
Alan Chen 3 лет назад
Родитель
Сommit
62341748f0

+ 2 - 0
components/pmo/core/src/wlan_pmo_main.c

@@ -240,6 +240,8 @@ static void wlan_pmo_init_cfg(struct wlan_objmgr_psoc *psoc,
 		cfg_get(psoc, CFG_ENABLE_BUS_SUSPEND_IN_SAP_MODE);
 	psoc_cfg->is_bus_suspend_enabled_in_go_mode =
 		cfg_get(psoc, CFG_ENABLE_BUS_SUSPEND_IN_GO_MODE);
+	psoc_cfg->is_dynamic_pcie_gen_speed_change_enabled =
+		cfg_get(psoc, CFG_ENABLE_DYNAMIC_PCIE_GEN_SPEED_SWITCH);
 	psoc_cfg->default_power_save_mode = psoc_cfg->power_save_mode;
 	psoc_cfg->max_ps_poll = cfg_get(psoc, CFG_PMO_MAX_PS_POLL);
 

+ 24 - 2
components/pmo/dispatcher/inc/wlan_pmo_common_cfg.h

@@ -525,6 +525,27 @@
 		0, \
 		"This ini is used to enable bus suspend in P2PGO mode")
 
+/*
+ * <ini>
+ * enable_dynamic_pcie_gen_speed_switch - enable dynamic PCIe gen speed change
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * This ini is used to enable dynamic PCIe gen speed change
+ *
+ * 0: Dynamic PCIe gen speed change is not enabled
+ * 1: Dynamic PCIe gen speed change is enabled
+ *
+ * Usage: Internal
+ *
+ * </ini>
+ */
+#define CFG_ENABLE_DYNAMIC_PCIE_GEN_SPEED_SWITCH CFG_INI_BOOL( \
+		"enable_dynamic_pcie_gen_speed_switch", \
+		0, \
+		"This ini is used to enable dynamic PCIe gen speed change")
+
 /*
  * <ini>
  * igmp_version_support - Configure igmp version
@@ -591,7 +612,8 @@
 	CFG(CFG_PMO_MOD_DTIM_ON_SYS_SUSPEND) \
 	CFG(CFG_ENABLE_BUS_SUSPEND_IN_SAP_MODE) \
 	CFG(CFG_ENABLE_BUS_SUSPEND_IN_GO_MODE)\
-	CFG(CFG_IGMP_VERSION_SUPPORT) \
-	CFG(CFG_DISCONNECT_SAP_TDLS_IN_WOW)
+	CFG(CFG_DISCONNECT_SAP_TDLS_IN_WOW) \
+	CFG(CFG_ENABLE_DYNAMIC_PCIE_GEN_SPEED_SWITCH) \
+	CFG(CFG_IGMP_VERSION_SUPPORT)
 
 #endif /* WLAN_PMO_COMMON_CFG_H__ */

+ 1 - 0
components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h

@@ -416,6 +416,7 @@ struct pmo_psoc_cfg {
 	bool is_mod_dtim_on_sys_suspend_enabled;
 	bool is_bus_suspend_enabled_in_sap_mode;
 	bool is_bus_suspend_enabled_in_go_mode;
+	bool is_dynamic_pcie_gen_speed_change_enabled;
 #ifdef WLAN_ENABLE_GPIO_WAKEUP
 	bool enable_gpio_wakeup;
 	uint32_t gpio_wakeup_pin;

+ 10 - 0
components/pmo/dispatcher/inc/wlan_pmo_ucfg_api.h

@@ -2217,6 +2217,16 @@ ucfg_pmo_get_go_mode_bus_suspend(struct wlan_objmgr_psoc *psoc);
 enum pmo_suspend_mode
 ucfg_pmo_get_suspend_mode(struct wlan_objmgr_psoc *psoc);
 
+/**
+ * ucfg_pmo_get_dynamic_pcie_gen_switch_cfg() - get PMO config for
+ * dynamic PCIe gen speed change
+ * @psoc: pointer to psoc object
+ *
+ * Return: bool
+ */
+bool
+ucfg_pmo_get_dynamic_pcie_gen_switch_cfg(struct wlan_objmgr_psoc *psoc);
+
 #ifdef SYSTEM_PM_CHECK
 /**
  * ucfg_pmo_notify_system_resume() - system resume notification to pmo

+ 8 - 0
components/pmo/dispatcher/src/wlan_pmo_ucfg_api.c

@@ -947,6 +947,14 @@ ucfg_pmo_get_suspend_mode(struct wlan_objmgr_psoc *psoc)
 	return pmo_psoc_ctx->psoc_cfg.suspend_mode;
 }
 
+bool
+ucfg_pmo_get_dynamic_pcie_gen_switch_cfg(struct wlan_objmgr_psoc *psoc)
+{
+	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
+
+	return pmo_psoc_ctx->psoc_cfg.is_dynamic_pcie_gen_speed_change_enabled;
+}
+
 QDF_STATUS ucfg_pmo_core_txrx_suspend(struct wlan_objmgr_psoc *psoc)
 {
 	return pmo_core_txrx_suspend(psoc);

+ 2 - 0
core/wma/src/wma_main.c

@@ -377,6 +377,8 @@ static void wma_set_default_tgt_config(tp_wma_handle wma_handle,
 		ucfg_pmo_get_sap_mode_bus_suspend(wma_handle->psoc);
 	tgt_cfg->is_go_connected_d3wow_enabled =
 		ucfg_pmo_get_go_mode_bus_suspend(wma_handle->psoc);
+	tgt_cfg->dynamic_pcie_gen_speed_change =
+		ucfg_pmo_get_dynamic_pcie_gen_switch_cfg(wma_handle->psoc);
 
 	cfg_nan_get_max_ndi(wma_handle->psoc,
 			    &tgt_cfg->max_ndi);