diff options
author | Vinit Deshpande <vinitd@google.com> | 2014-09-09 01:26:01 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-09 01:26:02 +0000 |
commit | 24b998183845ea92deaa65a41720cbee61f474d4 (patch) | |
tree | acf6ece70d5b5e8385aa58ce6e73028e23a3c676 | |
parent | 2b3bba862a761730c739958b821ca19c59fccc3b (diff) | |
parent | cc370437327c04d82dc8b3addc556d5bc30efc77 (diff) | |
download | hardware_replicant_wlan-24b998183845ea92deaa65a41720cbee61f474d4.tar.gz hardware_replicant_wlan-24b998183845ea92deaa65a41720cbee61f474d4.tar.bz2 hardware_replicant_wlan-24b998183845ea92deaa65a41720cbee61f474d4.zip |
Merge "Recover from socket POLLERR" into lmp-dev
-rw-r--r-- | bcmdhd/wifi_hal/wifi_hal.cpp | 29 |
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); |