summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmarnath Hullur Subramanyam <amarnath@codeaurora.org>2015-09-09 21:10:54 +0530
committerVineeta Srivastava <vsrivastava@google.com>2015-09-09 15:20:14 -0700
commitbdf16c2266e7e1f5de2cb38eb2d83895154b5689 (patch)
tree6272e680445f1a75dc3971952325cb2bf0c89aae
parent57db12bad7921f7e4efa148f1a3a8ed37e92d5d4 (diff)
downloadandroid_hardware_qcom_wlan-bdf16c2266e7e1f5de2cb38eb2d83895154b5689.tar.gz
android_hardware_qcom_wlan-bdf16c2266e7e1f5de2cb38eb2d83895154b5689.tar.bz2
android_hardware_qcom_wlan-bdf16c2266e7e1f5de2cb38eb2d83895154b5689.zip
WiFi-HAL: Consider min threshold only if complete record available
Buffers will be read if ring buffer reaches minimum configured threshold. It is possible to reach minimum threshold after writing header to the buffer and before writing actual payload. Incomplete buffer will be read out in this case. This commit ensures to read the data from buffer only if complete record is available. Change-Id: I0c558e4cf73ea31892c8c086f2310405ebc49c74 CRs-Fixed: 904848 Bug: 23934884
-rw-r--r--qcwcn/wifi_hal/ring_buffer.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/qcwcn/wifi_hal/ring_buffer.cpp b/qcwcn/wifi_hal/ring_buffer.cpp
index 790b007..f346b2d 100644
--- a/qcwcn/wifi_hal/ring_buffer.cpp
+++ b/qcwcn/wifi_hal/ring_buffer.cpp
@@ -325,6 +325,7 @@ enum rb_status rb_write (void *ctx, u8 *buf, size_t length, int overwrite,
/* check if valid bytes is going more than threshold */
if ((rbc->threshold_reached == RB_FALSE) &&
(rbc->cur_valid_bytes >= rbc->num_min_bytes) &&
+ ((length == record_length) || !record_length) &&
rbc->threshold_cb) {
/* Release the lock before calling threshold_cb as it might call rb_read
* in this same context in order to avoid dead lock