summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorOscar Shu <xshu@google.com>2020-08-04 20:49:52 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-08-04 20:49:52 +0000
commitcb07b80c3c42db10520208ba54410e2bce1a6379 (patch)
treebbf8f7971148db8f9f12e87b9ca5e3a5628f0592 /wifi
parent6d85ac62101411bbece80b4377c50ebfd75bd8c9 (diff)
parenta46114dfb9d7a7f986855776a4a17577f135e6c7 (diff)
downloadplatform_hardware_interfaces-cb07b80c3c42db10520208ba54410e2bce1a6379.tar.gz
platform_hardware_interfaces-cb07b80c3c42db10520208ba54410e2bce1a6379.tar.bz2
platform_hardware_interfaces-cb07b80c3c42db10520208ba54410e2bce1a6379.zip
Merge "Ringbuffer stops logging after wifi toggle" into rvc-qpr-dev
Diffstat (limited to 'wifi')
-rw-r--r--wifi/1.4/default/wifi_chip.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/wifi/1.4/default/wifi_chip.cpp b/wifi/1.4/default/wifi_chip.cpp
index 8747e61992..8cba464757 100644
--- a/wifi/1.4/default/wifi_chip.cpp
+++ b/wifi/1.4/default/wifi_chip.cpp
@@ -624,6 +624,15 @@ Return<void> WifiChip::getCapabilities_1_3(getCapabilities_cb hidl_status_cb) {
Return<void> WifiChip::debug(const hidl_handle& handle,
const hidl_vec<hidl_string>&) {
if (handle != nullptr && handle->numFds >= 1) {
+ {
+ std::unique_lock<std::mutex> lk(lock_t);
+ for (const auto& item : ringbuffer_map_) {
+ forceDumpToDebugRingBufferInternal(item.first);
+ }
+ // unique_lock unlocked here
+ }
+ usleep(100 * 1000); // sleep for 100 milliseconds to wait for
+ // ringbuffer updates.
int fd = handle->data[0];
if (!writeRingbufferFilesInternal()) {
LOG(ERROR) << "Error writing files to flash";
@@ -1120,6 +1129,9 @@ WifiStatus WifiChip::stopLoggingToDebugRingBufferInternal() {
legacy_hal::wifi_error legacy_status =
legacy_hal_.lock()->deregisterRingBufferCallbackHandler(
getFirstActiveWlanIfaceName());
+ if (legacy_status == legacy_hal::WIFI_SUCCESS) {
+ debug_ring_buffer_cb_registered_ = false;
+ }
return createWifiStatusFromLegacyError(legacy_status);
}
@@ -1335,7 +1347,7 @@ WifiStatus WifiChip::registerDebugRingBufferCallback() {
LOG(ERROR) << "Ringname " << name << " not found";
return;
}
- // unlock
+ // unique_lock unlocked here
}
};
legacy_hal::wifi_error legacy_status =
@@ -1637,7 +1649,7 @@ bool WifiChip::writeRingbufferFilesInternal() {
}
}
}
- // unlock
+ // unique_lock unlocked here
}
return true;
}