summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinit Deshpande <vinitd@google.com>2014-08-05 21:53:54 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-05 00:34:22 +0000
commitd86e48bfb7ce3826d427510bff9b38a04f9d3afd (patch)
treeaba06acc4148e6be30aa2354b5150af8566ce642
parent327f6e10e75d2dc925f83ba0f5bda97647bd2431 (diff)
parent68d1fb64d52132a52bcad3450d6783939d8d9726 (diff)
downloadhardware_replicant_wlan-d86e48bfb7ce3826d427510bff9b38a04f9d3afd.tar.gz
hardware_replicant_wlan-d86e48bfb7ce3826d427510bff9b38a04f9d3afd.tar.bz2
hardware_replicant_wlan-d86e48bfb7ce3826d427510bff9b38a04f9d3afd.zip
Merge "Workaround for RTT driver bugs" into lmp-dev
-rw-r--r--bcmdhd/wifi_hal/common.cpp19
-rw-r--r--bcmdhd/wifi_hal/rtt.cpp18
2 files changed, 20 insertions, 17 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;
}
}
diff --git a/bcmdhd/wifi_hal/rtt.cpp b/bcmdhd/wifi_hal/rtt.cpp
index 1673aca..da3e920 100644
--- a/bcmdhd/wifi_hal/rtt.cpp
+++ b/bcmdhd/wifi_hal/rtt.cpp
@@ -195,7 +195,7 @@ public:
return result;
}
int start() {
- ALOGD("Setting configuration");
+ ALOGD("Setting RTT configuration");
WifiRequest request(familyId(), ifaceId());
int result = createSetupRequest(request);
if (result != WIFI_SUCCESS) {
@@ -205,17 +205,17 @@ public:
result = requestResponse(request);
if (result != WIFI_SUCCESS) {
- ALOGE("failed to configure setup; result = %d", result);
+ ALOGE("failed to configure RTT setup; result = %d", result);
return result;
}
registerVendorHandler(GOOGLE_OUI, RTT_EVENT_COMPLETE);
- ALOGI("successfully restarted the scan");
+ ALOGI("Successfully started RTT operation");
return result;
}
virtual int cancel() {
- ALOGD("Stopping scan");
+ ALOGD("Stopping RTT");
WifiRequest request(familyId(), ifaceId());
int result = createTeardownRequest(request, 0, NULL);
@@ -228,7 +228,7 @@ public:
}
}
- unregisterVendorHandler(GOOGLE_OUI, GSCAN_EVENT_SCAN_RESULTS_AVAILABLE);
+ unregisterVendorHandler(GOOGLE_OUI, RTT_EVENT_COMPLETE);
return WIFI_SUCCESS;
}
@@ -242,11 +242,11 @@ public:
} else {
result = requestResponse(request);
if (result != WIFI_SUCCESS) {
- ALOGE("failed to stop scan; result = %d", result);
+ ALOGE("failed to stop RTT; result = %d", result);
}
}
- unregisterVendorHandler(GOOGLE_OUI, GSCAN_EVENT_SCAN_RESULTS_AVAILABLE);
+ unregisterVendorHandler(GOOGLE_OUI, RTT_EVENT_COMPLETE);
return WIFI_SUCCESS;
}
@@ -265,9 +265,11 @@ public:
if (vendor_data == NULL || len == 0) {
ALOGI("No rtt results found");
- return NL_SKIP;
}
+ unregisterVendorHandler(GOOGLE_OUI, RTT_EVENT_COMPLETE);
+ wifi_unregister_cmd(wifiHandle(), id());
+
memset(rttResults, 0, sizeof(wifi_rtt_result) * MAX_RESULTS);
int num = len / sizeof(wifi_rtt_result);