summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-01-20 23:41:29 -0800
committerLinux Build Service Account <lnxbuild@localhost>2016-01-20 23:41:29 -0800
commit61c2177f38a26577890d722ede10bc3ebba88c5e (patch)
tree7837979a286fc8662d7a5abcb67787045e4d6628
parent0b5f4708281e134339e122e68b08d062f1374aa3 (diff)
parent0eb12198916fbc3ab03cce27ea41914eef447b65 (diff)
downloadandroid_hardware_qcom_bt-61c2177f38a26577890d722ede10bc3ebba88c5e.tar.gz
android_hardware_qcom_bt-61c2177f38a26577890d722ede10bc3ebba88c5e.tar.bz2
android_hardware_qcom_bt-61c2177f38a26577890d722ede10bc3ebba88c5e.zip
Promotion of bt.lnx.1.0-00027.
CRs Change ID Subject -------------------------------------------------------------------------------------------------------------- 959206 Ia31e397ddc522140d9ed28019b2700a3dd8d074e Delay the operation to vote off UART clock in libbtvendo Change-Id: I50ea0bcddcf2fdd20b877133aafa3a90d2b138b4 CRs-Fixed: 959206
-rw-r--r--libbt-vendor/src/bt_vendor_qcom.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/libbt-vendor/src/bt_vendor_qcom.c b/libbt-vendor/src/bt_vendor_qcom.c
index 15901bb..d1ca184 100644
--- a/libbt-vendor/src/bt_vendor_qcom.c
+++ b/libbt-vendor/src/bt_vendor_qcom.c
@@ -730,7 +730,7 @@ static int op(bt_vendor_opcode_t opcode, void *param)
case BT_VND_OP_USERIAL_OPEN:
{
int (*fd_array)[] = (int (*)[]) param;
- int idx, fd;
+ int idx, fd = -1, fd_filter = -1;
ALOGI("bt-vendor : BT_VND_OP_USERIAL_OPEN");
switch(btSocType)
{
@@ -843,14 +843,10 @@ static int op(bt_vendor_opcode_t opcode, void *param)
}
if(rome_soc_init(fd, (char*)vnd_local_bd_addr)<0) {
retval = -1;
- userial_clock_operation(fd, USERIAL_OP_CLK_OFF);
} else {
ALOGV("rome_soc_init is completed");
property_set("wc_transport.soc_initialized", "1");
- userial_clock_operation(fd, USERIAL_OP_CLK_OFF);
skip_init = false;
- /*Close the UART port*/
- close(fd);
}
}
}
@@ -864,40 +860,46 @@ static int op(bt_vendor_opcode_t opcode, void *param)
start_hci_filter();
if (is_ant_req) {
ALOGV("connect to ant channel");
- ant_fd = fd = connect_to_local_socket("ant_sock");
+ ant_fd = fd_filter = connect_to_local_socket("ant_sock");
}
else
#endif
{
ALOGV("connect to bt channel");
- vnd_userial.fd = fd = connect_to_local_socket("bt_sock");
+ vnd_userial.fd = fd_filter = connect_to_local_socket("bt_sock");
}
- if (fd != -1) {
+ if (fd_filter != -1) {
ALOGV("%s: received the socket fd: %d is_ant_req: %d\n",
- __func__, fd, is_ant_req);
+ __func__, fd_filter, is_ant_req);
if((strcmp(emb_wp_mode, "true") == 0) && !is_ant_req) {
if (rome_ver >= ROME_VER_3_0) {
/* get rome supported feature request */
ALOGE("%s: %x08 %0x", __FUNCTION__,rome_ver, ROME_VER_3_0);
- rome_get_addon_feature_list(fd);
+ rome_get_addon_feature_list(fd_filter);
}
}
if (!skip_init) {
/*Skip if already sent*/
- enable_controller_log(fd, is_ant_req);
+ enable_controller_log(fd_filter, is_ant_req);
skip_init = true;
}
- for (idx=0; idx < CH_MAX; idx++)
- (*fd_array)[idx] = fd;
- retval = 1;
+
+ for (idx=0; idx < CH_MAX; idx++) {
+ (*fd_array)[idx] = fd_filter;
}
+
+ retval = 1;
+ }
else {
retval = -1;
}
- } else {
- if (fd >= 0)
- close(fd);
+ }
+
+ if (fd >= 0) {
+ userial_clock_operation(fd, USERIAL_OP_CLK_OFF);
+ /*Close the UART port*/
+ close(fd);
}
}
break;