فهرست منبع

qcacld-3.0: Add ini param to control the crash inject

qcacld-2.0 to qcacld-3.0 propagation

Currently the crash can be injected by iwpriv command and FW
gets crashed.
Changes are done to add the gEnableCrashInject ini parameter

1) This ini param is disabled by default.
2) If this param is disabled the crash inject is ignored.

Change-Id: I7e908be1e37090a9d343dc04411fe387f776a937
CRs-Fixed: 864932
SaidiReddy Yenuga 8 سال پیش
والد
کامیت
cc733aff70

+ 2 - 0
core/cds/inc/cds_config.h

@@ -106,6 +106,7 @@ enum active_bpf_mode {
  *	active mode for MC/BC packets
  * @auto_power_save_fail_mode: auto detect power save failure mode
  * @ito_repeat_count: Indicates ito repeated count
+ * @force_target_assert_enabled: Indicate whether target assert enabled or not
  * Structure for holding cds ini parameters.
  */
 
@@ -163,6 +164,7 @@ struct cds_config_info {
 	enum active_bpf_mode active_mc_bc_bpf_mode;
 	bool auto_power_save_fail_mode;
 	uint8_t ito_repeat_count;
+	bool force_target_assert_enabled;
 };
 
 #ifdef WLAN_FEATURE_FILS_SK

+ 11 - 0
core/hdd/inc/wlan_hdd_cfg.h

@@ -6688,6 +6688,15 @@ enum hdd_link_speed_rpt_type {
 #define CFG_TDLS_EXTERNAL_CONTROL_MAX               (1)
 #define CFG_TDLS_EXTERNAL_CONTROL_DEFAULT           (1)
 
+/*
+ * This INI item is used to control subsystem restart(SSR) test framework
+ * Set it's value to 1 to enable APPS trigerred SSR testing
+ */
+#define CFG_ENABLE_CRASH_INJECT         "gEnableForceTargetAssert"
+#define CFG_ENABLE_CRASH_INJECT_MIN     (0)
+#define CFG_ENABLE_CRASH_INJECT_MAX     (1)
+#define CFG_ENABLE_CRASH_INJECT_DEFAULT (0)
+
 /*
  * <ini>
  * gEnableTDLSOffChannel - Enables off-channel support for TDLS link.
@@ -12521,6 +12530,8 @@ struct hdd_config {
 	uint32_t egap_inact_time;
 	uint32_t egap_wait_time;
 #endif
+	/* Flag to indicate crash inject enabled or not */
+	bool crash_inject_enabled;
 	uint8_t force_sap_acs;
 	uint8_t force_sap_acs_st_ch;
 	uint8_t force_sap_acs_end_ch;

+ 7 - 0
core/hdd/src/wlan_hdd_cfg.c

@@ -3298,6 +3298,13 @@ struct reg_table_entry g_registry_table[] = {
 		     CFG_ENABLE_EGAP_FLAGS_FEATURE_MAX),
 #endif
 
+	REG_VARIABLE(CFG_ENABLE_CRASH_INJECT, WLAN_PARAM_Integer,
+		     struct hdd_config, crash_inject_enabled,
+		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		     CFG_ENABLE_CRASH_INJECT_DEFAULT,
+		     CFG_ENABLE_CRASH_INJECT_MIN,
+		     CFG_ENABLE_CRASH_INJECT_MAX),
+
 	REG_VARIABLE(CFG_IGNORE_CAC_NAME, WLAN_PARAM_Integer,
 		     struct hdd_config, ignoreCAC,
 		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,

+ 4 - 0
core/hdd/src/wlan_hdd_hostapd.c

@@ -2930,6 +2930,10 @@ static int __iw_softap_set_two_ints_getnone(struct net_device *dev,
 	case QCSAP_IOCTL_SET_FW_CRASH_INJECT:
 		hdd_err("WE_SET_FW_CRASH_INJECT: %d %d",
 		       value[1], value[2]);
+		if (!hdd_ctx->config->crash_inject_enabled) {
+			hdd_err("Crash Inject ini disabled, Ignore Crash Inject");
+			return 0;
+		}
 		if (value[1] == 3) {
 			cds_trigger_recovery();
 			return 0;

+ 3 - 0
core/hdd/src/wlan_hdd_main.c

@@ -8129,6 +8129,9 @@ static int hdd_update_cds_config(struct hdd_context *hdd_ctx)
 	if (hdd_ctx->config->ssdp)
 		cds_cfg->ssdp = hdd_ctx->config->ssdp;
 
+	cds_cfg->force_target_assert_enabled =
+		hdd_ctx->config->crash_inject_enabled;
+
 	cds_cfg->enable_mc_list = hdd_ctx->config->fEnableMCAddrList;
 	cds_cfg->ap_maxoffload_peers = hdd_ctx->config->apMaxOffloadPeers;
 

+ 4 - 0
core/hdd/src/wlan_hdd_wext.c

@@ -12999,6 +12999,10 @@ static int __iw_set_two_ints_getnone(struct net_device *dev,
 		       value[1], value[2]);
 		pr_err("SSR is triggered by iwpriv CRASH_INJECT: %d %d\n",
 			   value[1], value[2]);
+		if (!hdd_ctx->config->crash_inject_enabled) {
+			hdd_err("Crash Inject ini disabled, Ignore Crash Inject");
+			return 0;
+		}
 		if (value[1] == 3) {
 			cds_trigger_recovery();
 			return 0;

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

@@ -2588,6 +2588,8 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
 			wma_fw_mem_dump_event_handler,
 			WMA_RX_SERIALIZER_CTX);
 
+	wmi_set_tgt_assert(wma_handle->wmi_handle,
+			   cds_cfg->force_target_assert_enabled);
 	/* Firmware debug log */
 	qdf_status = dbglog_init(wma_handle->wmi_handle);
 	if (qdf_status != QDF_STATUS_SUCCESS) {