Эх сурвалжийг харах

qcacld-3.0: Enable pktlog after SSR/PDR if previously enabled

Implement a flag in hdd context to track the state of
pktlog events. Pktlog will be enabled/disabled after SSR/PDR,
depending upon the state of Pktlog events just before SSR/PDR
is triggered.

Change-Id: I18999d7fcf3677a86c21559d7d443ba1cd086528
CRs-Fixed: 2151296
Poddar, Siddarth 7 жил өмнө
parent
commit
61fbc93f6e

+ 2 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -1483,6 +1483,8 @@ struct hdd_context {
 
 	bool hdd_wlan_suspended;
 	bool suspended;
+	/* flag to start pktlog after SSR/PDR if previously enabled */
+	bool is_pktlog_enabled;
 
 	/* Lock to avoid race condition during start/stop bss */
 	struct mutex sap_lock;

+ 14 - 1
core/hdd/src/wlan_hdd_main.c

@@ -8999,6 +8999,11 @@ int hdd_pktlog_enable_disable(struct hdd_context *hdd_ctx, bool enable,
 		return -EINVAL;
 	}
 
+	if (enable == true)
+		hdd_ctx->is_pktlog_enabled = 1;
+	else
+		hdd_ctx->is_pktlog_enabled = 0;
+
 	return 0;
 }
 #endif /* REMOVE_PKT_LOG */
@@ -9582,7 +9587,15 @@ static int hdd_features_init(struct hdd_context *hdd_ctx, struct hdd_adapter *ad
 		goto deregister_frames;
 	}
 
-	if (cds_is_packet_log_enabled())
+	/**
+	 * In case of SSR/PDR, if pktlog was enabled manually before
+	 * SSR/PDR, Then enabled it again automatically after Wlan
+	 * device up.
+	 */
+	if (cds_is_driver_recovering()) {
+		if (hdd_ctx->is_pktlog_enabled)
+			hdd_pktlog_enable_disable(hdd_ctx, true, 0, 0);
+	} else if (cds_is_packet_log_enabled())
 		hdd_pktlog_enable_disable(hdd_ctx, true, 0, 0);
 
 	hddtxlimit.txPower2g = hdd_ctx->config->TxPower2g;