summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerryLee <jerrylee@broadcom.com>2015-06-17 19:16:50 -0700
committerVinit Deshpande <vinitd@google.com>2015-06-24 11:39:33 -0700
commitc604b53461cfea0a1e6f6f5ad84b0a35be69b8e0 (patch)
tree810296a83440abf87c979d5ea4633e917484c8c5
parentfef13c11034313585be68c32322b9a53c43a37b2 (diff)
downloadhardware_broadcom_wlan-c604b53461cfea0a1e6f6f5ad84b0a35be69b8e0.zip
hardware_broadcom_wlan-c604b53461cfea0a1e6f6f5ad84b0a35be69b8e0.tar.gz
hardware_broadcom_wlan-c604b53461cfea0a1e6f6f5ad84b0a35be69b8e0.tar.bz2
Add a debuggability interface: stop logging
bug: 21730601 Change-Id: Icdc4e118884ec16a8b1a52ed60c9e49fa521a9fd Signed-off-by: JerryLee <jerrylee@broadcom.com>
-rw-r--r--bcmdhd/wifi_hal/wifi_hal.cpp1
-rw-r--r--bcmdhd/wifi_hal/wifi_logger.cpp36
2 files changed, 36 insertions, 1 deletions
diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp
index 22912f9..51cf7d6 100644
--- a/bcmdhd/wifi_hal/wifi_hal.cpp
+++ b/bcmdhd/wifi_hal/wifi_hal.cpp
@@ -143,6 +143,7 @@ wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn)
fn->wifi_set_country_code = wifi_set_country_code;
fn->wifi_get_firmware_memory_dump = wifi_get_firmware_memory_dump;
fn->wifi_set_log_handler = wifi_set_log_handler;
+ fn->wifi_reset_log_handler = wifi_reset_log_handler;
fn->wifi_set_alert_handler = wifi_set_alert_handler;
fn->wifi_get_firmware_version = wifi_get_firmware_version;
fn->wifi_get_ring_buffers_status = wifi_get_ring_buffers_status;
diff --git a/bcmdhd/wifi_hal/wifi_logger.cpp b/bcmdhd/wifi_hal/wifi_logger.cpp
index e93ae97..3fb1399 100644
--- a/bcmdhd/wifi_hal/wifi_logger.cpp
+++ b/bcmdhd/wifi_hal/wifi_logger.cpp
@@ -36,6 +36,7 @@ typedef enum {
LOGGER_GET_RING_STATUS,
LOGGER_GET_RING_DATA,
LOGGER_GET_FEATURE,
+ LOGGER_RESET_LOGGING,
} DEBUG_SUB_COMMAND;
typedef enum {
@@ -445,6 +446,9 @@ public:
SetLogHandler(wifi_interface_handle iface, int id, wifi_ring_buffer_data_handler handler)
: WifiCommand(iface, id), mHandler(handler)
{ }
+ SetLogHandler(wifi_interface_handle iface, int id)
+ : WifiCommand(iface, id)
+ { }
int start() {
ALOGD("Register log handler");
@@ -453,10 +457,26 @@ public:
}
virtual int cancel() {
- /* TODO: send a command to driver to stop generating logging events */
+ /* Send a command to driver to stop generating logging events */
+ ALOGD("Reset event handler");
+
+ WifiRequest request(familyId(), ifaceId());
+ int result = request.create(GOOGLE_OUI, LOGGER_RESET_LOGGING);
+
+ if (result != WIFI_SUCCESS) {
+ ALOGE("failed to create reset request; result = %d", result);
+ return result;
+ }
+
+ result = requestResponse(request);
+ if (result != WIFI_SUCCESS) {
+ ALOGE("failed to request reset; result = %d", result);
+ return result;
+ }
/* unregister event handler */
unregisterVendorHandler(GOOGLE_OUI, GOOGLE_DEBUG_RING_EVENT);
+ ALOGD("Success to reset event handler");
return WIFI_SUCCESS;
}
@@ -520,6 +540,20 @@ wifi_error wifi_set_log_handler(wifi_request_id id, wifi_interface_handle iface,
}
}
+wifi_error wifi_reset_log_handler(wifi_request_id id, wifi_interface_handle iface)
+{
+ wifi_handle handle = getWifiHandle(iface);
+ SetLogHandler *cmd = new SetLogHandler(iface, id);
+
+ ALOGI("Logger reset, handle = %p", handle);
+ if (cmd) {
+ cmd->cancel();
+ cmd->releaseRef();
+ return WIFI_SUCCESS;
+ }
+ return WIFI_ERROR_INVALID_ARGS;
+}
+
///////////////////////////////////////////////////////////////////////////////
class SetAlertHandler : public WifiCommand
{