bcmdhd: Disable LOGSET_BEYOND memdump for customer platform

As this logset beyond range memdump is only useful for debug purpose of the fw logs and no specific use of functionality.
Disable this memdump collection for customer platform and keep it only for our reference platforms.

Bug: 270914537
Bug: 270587504
Test: Verified with pa/2407362 which mimics the issue

Change-Id: Ic79b7800bf56daff32aa777c46c265b1f0413de9
Signed-off-by: Dennis Jeon <dennis.jeon@broadcom.corp-partner.google.com>
diff --git a/Kbuild b/Kbuild
index fd6ceaf..1c08c93 100644
--- a/Kbuild
+++ b/Kbuild
@@ -947,6 +947,9 @@
 	# Allow wl event forwarding as network packet
 	DHDCFLAGS += -DWL_EVENT_ENAB
 
+	# Enable memdump for logset beyond range only internal builds
+	DHDCFLAGS += -DDHD_LOGSET_BEYOND_MEMDUMP
+
 ifneq ($(CONFIG_BCMDHD_PCIE),)
 	# LB RXP Flow control to avoid OOM
 	DHDCFLAGS += -DLB_RXP_STOP_THR=200 -DLB_RXP_STRT_THR=199
diff --git a/dhd_debug.c b/dhd_debug.c
index a7f4933..72e9689 100644
--- a/dhd_debug.c
+++ b/dhd_debug.c
@@ -1129,6 +1129,7 @@
 	if (logset >= event_log_max_sets) {
 		DHD_ERROR(("%s logset: %d max: %d out of range queried: %d\n",
 			__FUNCTION__, logset, event_log_max_sets, event_log_max_sets_queried));
+#ifdef DHD_LOGSET_BEYOND_MEMDUMP
 #ifdef DHD_FW_COREDUMP
 		if (event_log_max_sets_queried && !dhd_memdump_is_scheduled(dhdp)) {
 			DHD_ERROR(("%s: collect socram for DUMP_TYPE_LOGSET_BEYOND_RANGE\n",
@@ -1137,6 +1138,9 @@
 			dhd_bus_mem_dump(dhdp);
 		}
 #endif /* DHD_FW_COREDUMP */
+#else
+		goto exit;
+#endif /* DHD_LOGSET_BEYOND_MEMDUMP */
 	}
 
 	block = ltoh16(*((uint16 *)(data + 2)));