summaryrefslogtreecommitdiffstats
path: root/bcmdhd/wifi_hal
diff options
context:
space:
mode:
authorVinit Deshpande <vinitd@google.com>2014-08-27 15:18:46 -0700
committerVinit Deshpande <vinitd@google.com>2014-09-03 17:05:44 -0700
commitcc370437327c04d82dc8b3addc556d5bc30efc77 (patch)
tree336ad99a8e7fd16788c717de55b721b57f77f883 /bcmdhd/wifi_hal
parent290c22f37406de9957f9168baaa3642aaf957924 (diff)
downloadhardware_broadcom_wlan-cc370437327c04d82dc8b3addc556d5bc30efc77.zip
hardware_broadcom_wlan-cc370437327c04d82dc8b3addc556d5bc30efc77.tar.gz
hardware_broadcom_wlan-cc370437327c04d82dc8b3addc556d5bc30efc77.tar.bz2
Recover from socket POLLERR
This happens because socket buffer is full. Since this is just an eventing socket, and if data loss is equivalent to an event loss, we can live with the data loss. All we really need to do is to reset the socket error - an explicit read on the socket does that. Bug: 17226060 Change-Id: I5a008e09fd59c1ebab4feaa99e63681fbc80eca7
Diffstat (limited to 'bcmdhd/wifi_hal')
-rw-r--r--bcmdhd/wifi_hal/wifi_hal.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp
index 87bc87b..a99b156 100644
--- a/bcmdhd/wifi_hal/wifi_hal.cpp
+++ b/bcmdhd/wifi_hal/wifi_hal.cpp
@@ -234,20 +234,6 @@ static int internal_pollin_handler(wifi_handle handle)
return res;
}
-static void internal_event_handler(wifi_handle handle, int events)
-{
- if (events & POLLERR) {
- ALOGE("Error reading from socket");
- } else if (events & POLLHUP) {
- ALOGE("Remote side hung up");
- } else if (events & POLLIN) {
- // ALOGI("Found some events!!!");
- internal_pollin_handler(handle);
- } else {
- ALOGE("Unknown event - %0x", events);
- }
-}
-
/* Run event handler */
void wifi_event_loop(wifi_handle handle)
{
@@ -273,8 +259,19 @@ void wifi_event_loop(wifi_handle handle)
int result = poll(&pfd, 1, -1);
if (result < 0) {
ALOGE("Error polling socket");
- } else if (pfd.revents & (POLLIN | POLLHUP | POLLERR)) {
- internal_event_handler(handle, pfd.revents);
+ } else if (pfd.revents & POLLERR) {
+ ALOGE("POLL Error; error no = %d", errno);
+ char buf[2048];
+ int result2 = read(pfd.fd, buf, sizeof(buf));
+ ALOGE("Read after POLL returned %d, error no = %d", result2, errno);
+ } else if (pfd.revents & POLLHUP) {
+ ALOGE("Remote side hung up");
+ break;
+ } else if (pfd.revents & POLLIN) {
+ // ALOGI("Found some events!!!");
+ internal_pollin_handler(handle);
+ } else {
+ ALOGE("Unknown event - %0x", pfd.revents);
}
} while (!info->clean_up);