summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHsiu-Chang Chen <hsiuchangchen@google.com>2022-06-29 12:23:40 +0800
committerHsiu-Chang Chen <hsiuchangchen@google.com>2022-06-29 12:23:40 +0800
commit8a1e50a6317f96d39033b100e31e83ed439485dd (patch)
tree21632e39982d7895b08cdcf4cd7d0c270692cbf1
parent05b61546e41e287776584ab31c8d5925d2f5db2f (diff)
downloadwlan-8a1e50a6317f96d39033b100e31e83ed439485dd.tar.gz
WiFi-Hal: while loops to also check for clean_up
A Wi-Fi Turn OFF sets clean_up variable, expecting the Wi-Fi HAL module to exit from its event / socket processing. However, there were some instances , where Wi-FI HAL ended to be in a busy while loop though clean_up is set and further resulted to an improper Wi-Fi OFF. Thereby the further Wi-Fi ON's have failed till a restart. Address such instances by having the while loops also check for clean_up before continuing further. Bug: 231524566 Test: Regression Test Change-Id: I6af24cc38894d3ba98721acce2b147e4158134a3 CRs-Fixed: 2563190
-rw-r--r--qcwcn/wifi_hal/rb_wrapper.cpp2
-rw-r--r--qcwcn/wifi_hal/wifilogger_diag.cpp12
2 files changed, 9 insertions, 5 deletions
diff --git a/qcwcn/wifi_hal/rb_wrapper.cpp b/qcwcn/wifi_hal/rb_wrapper.cpp
index 4c9e475..9017d21 100644
--- a/qcwcn/wifi_hal/rb_wrapper.cpp
+++ b/qcwcn/wifi_hal/rb_wrapper.cpp
@@ -117,7 +117,7 @@ void push_out_rb_data(void *cb_ctx)
wifi_ring_buffer_status rbs;
wifi_ring_buffer_data_handler handler;
- while (1) {
+ while (info && !info->clean_up) {
size_t length = 0;
u8 *buf;
diff --git a/qcwcn/wifi_hal/wifilogger_diag.cpp b/qcwcn/wifi_hal/wifilogger_diag.cpp
index 5fa7777..d67ba06 100644
--- a/qcwcn/wifi_hal/wifilogger_diag.cpp
+++ b/qcwcn/wifi_hal/wifilogger_diag.cpp
@@ -896,7 +896,8 @@ static wifi_error process_fw_diag_msg(hal_info *info, u8* buf, u16 length)
buf += 4;
length -= 4;
- while (length > (count + sizeof(fw_diag_msg_fixed_hdr_t))) {
+ while ((info && !info->clean_up)
+ && (length > (count + sizeof(fw_diag_msg_fixed_hdr_t)))) {
diag_msg_fixed_hdr = (fw_diag_msg_fixed_hdr_t *)(buf + count);
switch (diag_msg_fixed_hdr->diag_event_type) {
case WLAN_DIAG_TYPE_EVENT:
@@ -1544,7 +1545,7 @@ static wifi_error populate_rx_aggr_stats(hal_info *info)
wifi_ring_per_packet_status_entry *pps_entry;
u32 index = 0;
- while (index < info->rx_buf_size_occupied) {
+ while ((info && !info->clean_up) && (index < info->rx_buf_size_occupied)) {
pps_entry = (wifi_ring_per_packet_status_entry *)(pRingBufferEntry + 1);
pps_entry->MCS = info->aggr_stats.RxMCS.mcs;
@@ -2381,6 +2382,9 @@ static wifi_error parse_stats_sw_event(hal_info *info,
rb_pkt_stats->flags |= PER_PACKET_ENTRY_FLAGS_80211_HEADER;
}
break;
+ default:
+ // TODO: Unexpected PKTLOG types
+ break;
}
if (info->pkt_stats->tx_stats_events & BIT(PKTLOG_TYPE_TX_STAT)) {
/* if bmap_enqueued is 1 ,Handle non aggregated cases */
@@ -2419,7 +2423,7 @@ static wifi_error parse_stats_sw_event(hal_info *info,
data = (u8*) (data + sizeof(wh_pktlog_hdr_v2_t) + node_pkt_len);
info->pkt_stats->tx_stats_events = 0;
}
- } while (pkt_stats_len > 0);
+ } while ((info && !info->clean_up) && (pkt_stats_len > 0));
return status;
}
@@ -2556,7 +2560,7 @@ static wifi_error parse_stats(hal_info *info, u8 *data, u32 buflen)
data += record_len;
buflen -= record_len;
- } while (buflen > 0);
+ } while ((info && !info->clean_up) && (buflen > 0));
return status;
}