Parcourir la source

qcacld-3.0: Add INI param to configure wow-mode logging

Add an INI to configure the wow-mode logging config.

So that,the fw would use this bitmap for logging when it
is in wow mode.

Change-Id: Ib2fbd0c5c9cc573b2f5b12dcdf06682c16550cb2
CRs-Fixed: 2810372
Aditya Kodukula il y a 4 ans
Parent
commit
d4456eeac6

+ 5 - 1
components/fw_offload/core/inc/wlan_fw_offload_main.h

@@ -197,7 +197,9 @@ struct wlan_fwol_neighbor_report_cfg {
  * @enable_fw_log_level: Set the FW log level
  * @enable_fw_log_type: Set the FW log type
  * @enable_fw_module_log_level: enable fw module log level
- * @enable_fw_module_log_level_num: enablefw module log level num
+ * @enable_fw_module_log_level_num: enable fw module log level num
+ * @enable_fw_mod_wow_log_level: enable fw wow module log level
+ * @enable_fw_mod_wow_log_level_num: enable fw wow module log level num
  * @sap_xlna_bypass: bypass SAP xLNA
  * @is_rate_limit_enabled: Enable/disable RA rate limited
  * @tsf_gpio_pin: TSF GPIO Pin config
@@ -235,6 +237,8 @@ struct wlan_fwol_cfg {
 	uint16_t enable_fw_log_type;
 	uint8_t enable_fw_module_log_level[FW_MODULE_LOG_LEVEL_STRING_LENGTH];
 	uint8_t enable_fw_module_log_level_num;
+	uint8_t enable_fw_mod_wow_log_level[FW_MODULE_LOG_LEVEL_STRING_LENGTH];
+	uint8_t enable_fw_mod_wow_log_level_num;
 	bool sap_xlna_bypass;
 #ifdef FEATURE_WLAN_RA_FILTERING
 	bool is_rate_limit_enabled;

+ 7 - 0
components/fw_offload/core/src/wlan_fw_offload_main.c

@@ -498,6 +498,7 @@ QDF_STATUS fwol_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
 	struct wlan_fwol_psoc_obj *fwol_obj;
 	struct wlan_fwol_cfg *fwol_cfg;
 	qdf_size_t enable_fw_module_log_level_num;
+	qdf_size_t enable_fw_wow_mod_log_level_num;
 
 	fwol_obj = fwol_get_psoc_obj(psoc);
 	if (!fwol_obj) {
@@ -534,6 +535,12 @@ QDF_STATUS fwol_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
 			      &enable_fw_module_log_level_num);
 	fwol_cfg->enable_fw_module_log_level_num =
 				(uint8_t)enable_fw_module_log_level_num;
+	qdf_uint8_array_parse(cfg_get(psoc, CFG_ENABLE_FW_WOW_MODULE_LOG_LEVEL),
+			      fwol_cfg->enable_fw_mod_wow_log_level,
+			      FW_MODULE_LOG_LEVEL_STRING_LENGTH,
+			      &enable_fw_wow_mod_log_level_num);
+	fwol_cfg->enable_fw_mod_wow_log_level_num =
+				(uint8_t)enable_fw_wow_mod_log_level_num;
 	ucfg_fwol_init_tsf_ptp_options(psoc, fwol_cfg);
 	ucfg_fwol_init_sae_cfg(psoc, fwol_cfg);
 	fwol_cfg->lprx_enable = cfg_get(psoc, CFG_LPRX);

+ 40 - 2
components/fw_offload/dispatcher/inc/cfg_fwol_generic.h

@@ -394,6 +394,44 @@
 	"29,1,31,1,36,1,38,1,46,1,47,1,50,1,52,1,53,1,56,1,60,1,61,1", \
 	"Set modulized firmware debug log level")
 
+/*
+ * <ini>
+ * gFwDebugWowModuleLoglevel - modulized firmware wow debug log level
+ * @Min: N/A
+ * @Max: N/A
+ * @Default: N/A
+ *
+ * This ini is used to set modulized firmware wow debug log level.
+ * FW module log level input string format looks like below:
+ * gFwDebugWowModuleLoglevel="<FW Module ID>,<Log Level>,..."
+ * For example:
+ * gFwDebugWowModuleLoglevel="1,0,2,1,3,2,4,3,5,4,6,5,7,6"
+ * The above input string means:
+ * For FW module ID 1 enable log level 0
+ * For FW module ID 2 enable log level 1
+ * For FW module ID 3 enable log level 2
+ * For FW module ID 4 enable log level 3
+ * For FW module ID 5 enable log level 4
+ * For FW module ID 6 enable log level 5
+ * For FW module ID 7 enable log level 6
+ * For valid values of log levels check enum DBGLOG_LOG_LVL and
+ * for valid values of module ids check enum WLAN_MODULE_ID.
+ *
+ * Related: None
+ *
+ * Supported Feature: Debugging
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_ENABLE_FW_WOW_MODULE_LOG_LEVEL CFG_INI_STRING( \
+	"gFwDebugWowModuleLoglevel", \
+	0, \
+	FW_MODULE_LOG_LEVEL_STRING_LENGTH, \
+	"5,3,18,3,31,3,36,3", \
+	"Set modulized firmware wow debug log level")
+
 #ifdef FEATURE_WLAN_RA_FILTERING
 /* <ini>
  * gRAFilterEnable
@@ -776,6 +814,6 @@
 	CFG(CFG_TX_SCH_DELAY) \
 	CFG(CFG_ENABLE_SECONDARY_RATE) \
 	CFG(CFG_SET_SAP_XLNA_BYPASS) \
-	CFG(CFG_SET_ENABLE_ILP)
-
+	CFG(CFG_SET_ENABLE_ILP) \
+	CFG(CFG_ENABLE_FW_WOW_MODULE_LOG_LEVEL)
 #endif

+ 18 - 1
components/fw_offload/dispatcher/inc/wlan_fwol_ucfg_api.h

@@ -343,7 +343,7 @@ QDF_STATUS ucfg_fwol_get_enable_fw_log_type(struct wlan_objmgr_psoc *psoc,
  * @enable_fw_module_log_level:
  * pointer to enable_fw_module_log_level array
  * @enable_fw_module_log_level_num:
- * pointer to enable_fw_module_log_leve array element num
+ * pointer to enable_fw_module_log_level array element num
  *
  * Return: QDF Status
  */
@@ -352,6 +352,23 @@ QDF_STATUS ucfg_fwol_get_enable_fw_module_log_level(
 				uint8_t **enable_fw_module_log_level,
 				uint8_t *enable_fw_module_log_level_num);
 
+/**
+ * ucfg_fwol_wow_get_enable_fw_module_log_level() - Assigns
+ * enable_fw_module_log_level string
+ *
+ * @psoc: pointer to the psoc object
+ * @enable_fw_wow_module_log_level:
+ * pointer to enable_fw_wow_module_log_level array
+ * @enable_fw_wow_module_log_level_num:
+ * pointer to enable_fw_wow_module_log_level array element num
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS ucfg_fwol_wow_get_enable_fw_module_log_level(
+				struct wlan_objmgr_psoc *psoc,
+				uint8_t **enable_fw_wow_module_log_level,
+				uint8_t *enable_fw_wow_module_log_level_num);
+
 /**
  * ucfg_fwol_get_sap_xlna_bypass() - Assigns sap_xlna_bypass value
  * @psoc: pointer to the psoc object

+ 20 - 0
components/fw_offload/dispatcher/src/wlan_fwol_ucfg_api.c

@@ -577,6 +577,26 @@ QDF_STATUS ucfg_fwol_get_enable_fw_module_log_level(
 	return QDF_STATUS_SUCCESS;
 }
 
+QDF_STATUS ucfg_fwol_wow_get_enable_fw_module_log_level(
+				struct wlan_objmgr_psoc *psoc,
+				uint8_t **enable_fw_wow_module_log_level,
+				uint8_t *enable_fw_wow_module_log_level_num)
+{
+	struct wlan_fwol_psoc_obj *fwol_obj;
+
+	fwol_obj = fwol_get_psoc_obj(psoc);
+	if (!fwol_obj) {
+		fwol_err("Failed to get FWOL obj");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	*enable_fw_wow_module_log_level =
+				fwol_obj->cfg.enable_fw_mod_wow_log_level;
+	*enable_fw_wow_module_log_level_num =
+				fwol_obj->cfg.enable_fw_mod_wow_log_level_num;
+	return QDF_STATUS_SUCCESS;
+}
+
 QDF_STATUS ucfg_fwol_get_sap_xlna_bypass(struct wlan_objmgr_psoc *psoc,
 					 bool *sap_xlna_bypass)
 {

+ 34 - 14
core/sme/src/common/sme_api.c

@@ -15516,22 +15516,15 @@ void sme_update_score_config(mac_handle_t mac_handle, eCsrPhyMode phy_mode,
 	wlan_psoc_set_phy_config(mac_ctx->psoc, &config);
 }
 
-void sme_enable_fw_module_log_level(mac_handle_t mac_handle, int vdev_id)
+static void
+__sme_enable_fw_module_log_level(uint8_t *enable_fw_module_log_level,
+				 uint8_t enable_fw_module_log_level_num,
+				 int vdev_id, int param_id)
 {
-	QDF_STATUS status;
-	struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
-	uint8_t *enable_fw_module_log_level;
-	uint8_t enable_fw_module_log_level_num;
 	uint8_t count = 0;
 	uint32_t value = 0;
 	int ret;
 
-	status = ucfg_fwol_get_enable_fw_module_log_level(
-			mac_ctx->psoc, &enable_fw_module_log_level,
-			&enable_fw_module_log_level_num);
-	if (QDF_IS_STATUS_ERROR(status))
-		return;
-
 	while (count < enable_fw_module_log_level_num) {
 		/*
 		 * FW module log level input array looks like
@@ -15562,9 +15555,7 @@ void sme_enable_fw_module_log_level(mac_handle_t mac_handle, int vdev_id)
 
 		value = enable_fw_module_log_level[count] << 16;
 		value |= enable_fw_module_log_level[count + 1];
-		ret = sme_cli_set_command(vdev_id,
-					  WMI_DBGLOG_MOD_LOG_LEVEL,
-					  value, DBG_CMD);
+		ret = sme_cli_set_command(vdev_id, param_id, value, DBG_CMD);
 		if (ret != 0)
 			sme_err("Failed to enable FW module log level %d ret %d",
 				value, ret);
@@ -15573,6 +15564,35 @@ void sme_enable_fw_module_log_level(mac_handle_t mac_handle, int vdev_id)
 	}
 }
 
+void sme_enable_fw_module_log_level(mac_handle_t mac_handle, int vdev_id)
+{
+	QDF_STATUS status;
+	struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
+	uint8_t *enable_fw_module_log_level;
+	uint8_t enable_fw_module_log_level_num;
+
+	status = ucfg_fwol_get_enable_fw_module_log_level(
+			mac_ctx->psoc, &enable_fw_module_log_level,
+			&enable_fw_module_log_level_num);
+	if (QDF_IS_STATUS_ERROR(status))
+		return;
+	__sme_enable_fw_module_log_level(enable_fw_module_log_level,
+					 enable_fw_module_log_level_num,
+					 vdev_id,
+					 WMI_DBGLOG_MOD_LOG_LEVEL);
+
+	enable_fw_module_log_level_num = 0;
+	status = ucfg_fwol_wow_get_enable_fw_module_log_level(
+			mac_ctx->psoc, &enable_fw_module_log_level,
+			&enable_fw_module_log_level_num);
+	if (QDF_IS_STATUS_ERROR(status))
+		return;
+	__sme_enable_fw_module_log_level(enable_fw_module_log_level,
+					 enable_fw_module_log_level_num,
+					 vdev_id,
+					 WMI_DBGLOG_MOD_WOW_LOG_LEVEL);
+}
+
 #ifdef WLAN_FEATURE_MOTION_DETECTION
 /**
  * sme_set_md_bl_evt_cb - Register/set motion detection baseline callback

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

@@ -1018,6 +1018,13 @@ static void wma_process_cli_set_cmd(tp_wma_handle wma,
 				wma_err("dbglog_module_log_enable failed ret %d",
 					ret);
 			break;
+		case WMI_DBGLOG_MOD_WOW_LOG_LEVEL:
+			ret = dbglog_set_mod_wow_log_lvl(wma->wmi_handle,
+							 privcmd->param_value);
+			if (ret)
+				wma_err("WMI_DBGLOG_MOD_WOW_LOG_LEVEL failed ret %d",
+					ret);
+			break;
 		case WMI_DBGLOG_TYPE:
 			ret = dbglog_parser_type_init(wma->wmi_handle,
 							privcmd->param_value);