summaryrefslogtreecommitdiffstats
path: root/bcmdhd/wifi_hal/common.cpp
diff options
context:
space:
mode:
authorVinit Deshpande <vinitd@google.com>2014-08-04 19:23:28 -0700
committerVinit Deshpande <vinitd@google.com>2014-08-05 03:21:10 +0000
commit68d1fb64d52132a52bcad3450d6783939d8d9726 (patch)
treefcbe9c5cb8476d6f1512018a5835dd9d1e1c58ea /bcmdhd/wifi_hal/common.cpp
parentd85d4537a7257ffb6611b30faad915c3698c494e (diff)
downloadhardware_broadcom_wlan-68d1fb64d52132a52bcad3450d6783939d8d9726.zip
hardware_broadcom_wlan-68d1fb64d52132a52bcad3450d6783939d8d9726.tar.gz
hardware_broadcom_wlan-68d1fb64d52132a52bcad3450d6783939d8d9726.tar.bz2
Workaround for RTT driver bugs
Sometimes there are no results in an RTT event; when this happens there is no HAL callback ever, and no new requests can be generated. To avoid this, we just treat this as no RTT data event. Also, there is no clean up code here; so events are returned for the first command, working around that by adding cleanup code. Renamed all incorrect instances of GSCAN event handlers with RTT event handlers. Also fixed some log entries - as they incorrectly say 'scan started'. Bug: 16637086 Change-Id: I7da27d12b0d8e82f5fcba16fa14e3c444ac1b5ae
Diffstat (limited to 'bcmdhd/wifi_hal/common.cpp')
-rw-r--r--bcmdhd/wifi_hal/common.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/bcmdhd/wifi_hal/common.cpp b/bcmdhd/wifi_hal/common.cpp
index 7d517d7..5739d4b 100644
--- a/bcmdhd/wifi_hal/common.cpp
+++ b/bcmdhd/wifi_hal/common.cpp
@@ -52,8 +52,9 @@ wifi_error wifi_register_handler(wifi_handle handle, int cmd, nl_recvmsg_msg_cb_
info->event_cb[info->num_event_cb].vendor_subcmd = 0;
info->event_cb[info->num_event_cb].cb_func = func;
info->event_cb[info->num_event_cb].cb_arg = arg;
+ ALOGI("Successfully added event handler %p:%p for command %d at %d",
+ arg, func, cmd, info->num_event_cb);
info->num_event_cb++;
- ALOGI("Successfully added event handler %p:%p for command %d", arg, func, cmd);
result = WIFI_SUCCESS;
}
@@ -77,9 +78,9 @@ wifi_error wifi_register_vendor_handler(wifi_handle handle,
info->event_cb[info->num_event_cb].vendor_subcmd = subcmd;
info->event_cb[info->num_event_cb].cb_func = func;
info->event_cb[info->num_event_cb].cb_arg = arg;
+ ALOGI("Added event handler %p:%p for vendor 0x%0x and subcmd 0x%0x at %d",
+ arg, func, id, subcmd, info->num_event_cb);
info->num_event_cb++;
- ALOGI("Added event handler %p:%p for vendor 0x%0x and subcmd 0x%0x",
- arg, func, id, subcmd);
result = WIFI_SUCCESS;
}
@@ -100,8 +101,8 @@ void wifi_unregister_handler(wifi_handle handle, int cmd)
for (int i = 0; i < info->num_event_cb; i++) {
if (info->event_cb[i].nl_cmd == cmd) {
- ALOGI("Successfully removed event handler %p:%p for cmd = 0x%0x",
- info->event_cb[i].cb_arg, info->event_cb[i].cb_func, cmd);
+ ALOGI("Successfully removed event handler %p:%p for cmd = 0x%0x from %d",
+ info->event_cb[i].cb_arg, info->event_cb[i].cb_func, cmd, i);
memmove(&info->event_cb[i], &info->event_cb[i+1],
(info->num_event_cb - i) * sizeof(cb_info));
@@ -124,8 +125,8 @@ void wifi_unregister_vendor_handler(wifi_handle handle, uint32_t id, int subcmd)
if (info->event_cb[i].nl_cmd == NL80211_CMD_VENDOR
&& info->event_cb[i].vendor_id == id
&& info->event_cb[i].vendor_subcmd == subcmd) {
- ALOGI("Successfully removed event handler %p:%p for vendor 0x%0x, subcmd = 0x%0x",
- info->event_cb[i].cb_arg, info->event_cb[i].cb_func, id, subcmd);
+ ALOGI("Successfully removed event handler %p:%p for vendor 0x%0x, subcmd 0x%0x from %d",
+ info->event_cb[i].cb_arg, info->event_cb[i].cb_func, id, subcmd, i);
memmove(&info->event_cb[i], &info->event_cb[i+1],
(info->num_event_cb - i) * sizeof(cb_info));
info->num_event_cb--;
@@ -148,8 +149,8 @@ wifi_error wifi_register_cmd(wifi_handle handle, int id, WifiCommand *cmd)
if (info->num_cmd < info->alloc_cmd) {
info->cmd[info->num_cmd].id = id;
info->cmd[info->num_cmd].cmd = cmd;
+ ALOGI("Successfully added command %d: %p at %d", id, cmd, info->num_cmd);
info->num_cmd++;
- ALOGI("Successfully added command %d: %p", id, cmd);
result = WIFI_SUCCESS;
}
@@ -169,7 +170,7 @@ WifiCommand *wifi_unregister_cmd(wifi_handle handle, int id)
cmd = info->cmd[i].cmd;
memmove(&info->cmd[i], &info->cmd[i+1], (info->num_cmd - i) * sizeof(cmd_info));
info->num_cmd--;
- ALOGI("Successfully removed command %d: %p", id, cmd);
+ ALOGI("Successfully removed command %d: %p from %d", id, cmd, i);
break;
}
}