Fix fail to add ringdump beacause of reached max limit issue
It seems that "id == -1" case is an exception handling code in the old version. as you said, id always 0 currently.
wifi_stop_ring_dump should be called regardless of the id since wifi_start_ring_dump is also called when stars logging.
Bug: 258442247
Test: Build pass, C6T6Pro verify.
Change-Id: I4ceb5e6e8467682b7475f7377b849876c5c36060
Signed-off-by: Terry Chen <terry.chen@synaptics.corp-partner.google.com>
diff --git a/synadhd/wifi_hal/common.h b/synadhd/wifi_hal/common.h
index 1c48194..ebf6cb3 100755
--- a/synadhd/wifi_hal/common.h
+++ b/synadhd/wifi_hal/common.h
@@ -452,8 +452,7 @@
#ifdef RING_DUMP
wifi_error wifi_start_ring_dump(wifi_interface_handle iface,
wifi_ring_buffer_data_handler ring_handle);
-wifi_error wifi_stop_ring_dump(wifi_interface_handle iface,
- wifi_ring_buffer_data_handler ring_handle);
+wifi_error wifi_stop_ring_dump(wifi_interface_handle iface);
#endif /* RING_DUMP */
wifi_error wifi_hal_ota_update(wifi_interface_handle iface, uint32_t ota_version);
wifi_error wifi_hal_preInit(wifi_interface_handle iface);
diff --git a/synadhd/wifi_hal/wifi_logger.cpp b/synadhd/wifi_hal/wifi_logger.cpp
index b531838..c1a6f26 100755
--- a/synadhd/wifi_hal/wifi_logger.cpp
+++ b/synadhd/wifi_hal/wifi_logger.cpp
@@ -1192,6 +1192,10 @@
wifi_handle handle = getWifiHandle(iface);
ALOGE("Loghandler reset, wifi_request_id = %d, handle = %p", id, handle);
+#ifdef RING_DUMP
+ wifi_stop_ring_dump(iface);
+#endif /* RING_DUMP */
+
if (id == -1) {
wifi_ring_buffer_data_handler handler;
memset(&handler, 0, sizeof(handler));
@@ -1201,9 +1205,6 @@
cmd->cancel();
cmd->releaseRef();
-#ifdef RING_DUMP
- wifi_stop_ring_dump(iface, handler);
-#endif /* RING_DUMP */
return WIFI_SUCCESS;
}
@@ -1974,8 +1975,7 @@
return result;
}
-wifi_error wifi_stop_ring_dump(wifi_interface_handle iface,
- wifi_ring_buffer_data_handler ring_handle)
+wifi_error wifi_stop_ring_dump(wifi_interface_handle iface)
{
RingDump *cmd = new RingDump(iface, FILE_DUMP_REQUEST_ID);
NULL_CHECK_RETURN(cmd, "memory allocation failure", WIFI_ERROR_OUT_OF_MEMORY);