summaryrefslogtreecommitdiffstats
path: root/hci
diff options
context:
space:
mode:
authorMatthew Xie <mattx@google.com>2012-04-07 04:41:39 -0700
committerMatthew Xie <mattx@google.com>2012-07-14 11:19:23 -0700
commit595bced8e7c280e37a75b9bf9c1f36263434041c (patch)
treeb5edc7d472aa7ce62cf8204646c9c569da547945 /hci
parent2c79674ef766378464559c8645c74db5687280a9 (diff)
downloadexternal_bluetooth_bluedroid-595bced8e7c280e37a75b9bf9c1f36263434041c.zip
external_bluetooth_bluedroid-595bced8e7c280e37a75b9bf9c1f36263434041c.tar.gz
external_bluetooth_bluedroid-595bced8e7c280e37a75b9bf9c1f36263434041c.tar.bz2
replace logx with alogx
Conflicts: btif/src/btif_core.c btif/src/btif_dm.c btif/src/btif_hh.c btif/src/btif_sock.c gki/ulinux/gki_ulinux.c hci/include/bt_hci_bdroid.h hci/src/bt_hci_bdroid.c hci/src/btsnoop.c hci/src/hci_h4.c hci/src/userial.c vendor/libvendor/src/hardware.c vendor/libvendor/src/upio.c
Diffstat (limited to 'hci')
-rw-r--r--hci/include/bt_hci_bdroid.h1
-rw-r--r--hci/src/bt_hci_bdroid.c14
-rw-r--r--hci/src/bt_hw.c2
-rw-r--r--hci/src/btsnoop.c26
-rw-r--r--hci/src/hci_h4.c12
-rw-r--r--hci/src/lpm.c12
-rw-r--r--hci/src/userial.c33
7 files changed, 49 insertions, 51 deletions
diff --git a/hci/include/bt_hci_bdroid.h b/hci/include/bt_hci_bdroid.h
index 2345e74..76d438c 100644
--- a/hci/include/bt_hci_bdroid.h
+++ b/hci/include/bt_hci_bdroid.h
@@ -179,4 +179,3 @@ extern bt_hc_callbacks_t *bt_hc_cbacks;
extern void bthc_signal_event(uint16_t event);
#endif /* BT_HCI_BDROID_H */
-
diff --git a/hci/src/bt_hci_bdroid.c b/hci/src/bt_hci_bdroid.c
index 7e075cb..2450ed5 100644
--- a/hci/src/bt_hci_bdroid.c
+++ b/hci/src/bt_hci_bdroid.c
@@ -68,7 +68,7 @@
#endif
#if (BTHC_DBG == TRUE)
-#define BTHCDBG(param, ...) {LOGD(param, ## __VA_ARGS__);}
+#define BTHCDBG(param, ...) {ALOGD(param, ## __VA_ARGS__);}
#else
#define BTHCDBG(param, ...) {}
#endif
@@ -154,11 +154,11 @@ static int init(const bt_hc_callbacks_t* p_cb, unsigned char *local_bdaddr)
struct sched_param param;
int policy, result;
- LOGI("init");
+ ALOGI("init");
if (p_cb == NULL)
{
- LOGE("init failed with no user callbacks!");
+ ALOGE("init failed with no user callbacks!");
return BT_HC_STATUS_FAIL;
}
@@ -176,7 +176,7 @@ static int init(const bt_hc_callbacks_t* p_cb, unsigned char *local_bdaddr)
if (lib_running)
{
- LOGW("init has been called repeatedly without calling cleanup ?");
+ ALOGW("init has been called repeatedly without calling cleanup ?");
}
lib_running = 1;
@@ -188,7 +188,7 @@ static int init(const bt_hc_callbacks_t* p_cb, unsigned char *local_bdaddr)
if (pthread_create(&hc_cb.worker_thread, &thread_attr, \
bt_hc_worker_thread, NULL) != 0)
{
- LOGE("pthread_create failed!");
+ ALOGE("pthread_create failed!");
lib_running = 0;
return BT_HC_STATUS_FAIL;
}
@@ -202,7 +202,7 @@ static int init(const bt_hc_callbacks_t* p_cb, unsigned char *local_bdaddr)
result = pthread_setschedparam(hc_cb.worker_thread, policy, &param);
if (result != 0)
{
- LOGW("libbt-hci init: pthread_setschedparam failed (%s)", \
+ ALOGW("libbt-hci init: pthread_setschedparam failed (%s)", \
strerror(result));
}
}
@@ -224,7 +224,7 @@ static void set_power(bt_hc_chip_power_state_t state)
if (bt_vnd_if)
bt_vnd_if->op(BT_VND_OP_POWER_CTRL, &pwr_state);
else
- LOGE("vendor lib is missing!");
+ ALOGE("vendor lib is missing!");
}
diff --git a/hci/src/bt_hw.c b/hci/src/bt_hw.c
index 1c4a20f..89afa51 100644
--- a/hci/src/bt_hw.c
+++ b/hci/src/bt_hw.c
@@ -244,7 +244,7 @@ void init_vnd_if(unsigned char *local_bdaddr)
}
else
{
- LOGE("!!! Failed to get BtVendorInterface !!!");
+ ALOGE("!!! Failed to get BtVendorInterface !!!");
}
}
diff --git a/hci/src/btsnoop.c b/hci/src/btsnoop.c
index 8160963..9b829dc 100644
--- a/hci/src/btsnoop.c
+++ b/hci/src/btsnoop.c
@@ -90,7 +90,7 @@
#endif
#if (BTSNOOP_DBG == TRUE)
-#define SNOOPDBG(param, ...) {LOGD(param, ## __VA_ARGS__);}
+#define SNOOPDBG(param, ...) {ALOGD(param, ## __VA_ARGS__);}
#else
#define SNOOPDBG(param, ...) {}
#endif
@@ -485,13 +485,13 @@ int ext_parser_accept(int port)
int size_n;
int result = 0;
- LOGD("waiting for connection on port %d", port);
+ ALOGD("waiting for connection on port %d", port);
s_listen = socket(AF_INET, SOCK_STREAM, 0);
if (s_listen < 0)
{
- LOGE("listener not created: listen fd %d", s_listen);
+ ALOGE("listener not created: listen fd %d", s_listen);
return -1;
}
@@ -530,7 +530,7 @@ int ext_parser_accept(int port)
return -1;
}
- LOGD("connected (%d)", s);
+ ALOGD("connected (%d)", s);
return s;
}
@@ -557,7 +557,7 @@ static int send_ext_parser(char *p, int len)
static void ext_parser_detached(void)
{
- LOGD("ext parser detached");
+ ALOGD("ext parser detached");
if (ext_parser_fd>0)
close(ext_parser_fd);
@@ -571,7 +571,7 @@ static void ext_parser_detached(void)
static void interruptFn (int sig)
{
- LOGD("interruptFn");
+ ALOGD("interruptFn");
pthread_exit(0);
}
@@ -583,7 +583,7 @@ static void ext_parser_thread(void* param)
sigemptyset (&sigSet);
sigaddset (&sigSet, sig);
- LOGD("ext_parser_thread");
+ ALOGD("ext_parser_thread");
prctl(PR_SET_NAME, (unsigned long)"BtsnoopExtParser", 0, 0, 0);
@@ -599,19 +599,19 @@ static void ext_parser_thread(void* param)
ext_parser_fd = fd;
- LOGD("ext parser attached on fd %d\n", ext_parser_fd);
+ ALOGD("ext parser attached on fd %d\n", ext_parser_fd);
} while (1);
}
void btsnoop_stop_listener(void)
{
- LOGD("btsnoop_init");
+ ALOGD("btsnoop_init");
ext_parser_detached();
}
void btsnoop_init(void)
{
- LOGD("btsnoop_init");
+ ALOGD("btsnoop_init");
/* always setup ext listener port */
if (pthread_create(&thread_id, NULL,
@@ -622,7 +622,7 @@ void btsnoop_init(void)
void btsnoop_open(char *p_path)
{
#if defined(BTSNOOPDISP_INCLUDED) && (BTSNOOPDISP_INCLUDED == TRUE)
- LOGD("btsnoop_open");
+ ALOGD("btsnoop_open");
btsnoop_log_open(p_path);
#endif // BTSNOOPDISP_INCLUDED
}
@@ -630,14 +630,14 @@ void btsnoop_open(char *p_path)
void btsnoop_close(void)
{
#if defined(BTSNOOPDISP_INCLUDED) && (BTSNOOPDISP_INCLUDED == TRUE)
- LOGD("btsnoop_close");
+ ALOGD("btsnoop_close");
btsnoop_log_close();
#endif
}
void btsnoop_cleanup (void)
{
- LOGD("btsnoop_cleanup");
+ ALOGD("btsnoop_cleanup");
pthread_kill(thread_id, SIGUSR2);
pthread_join(thread_id, NULL);
ext_parser_detached();
diff --git a/hci/src/hci_h4.c b/hci/src/hci_h4.c
index e18ee6a..b10d173 100644
--- a/hci/src/hci_h4.c
+++ b/hci/src/hci_h4.c
@@ -259,7 +259,7 @@ void get_acl_data_length_cback(void *p_mem)
if (bt_hc_cbacks)
{
bt_hc_cbacks->dealloc((TRANSAC) p_buf, (char *) (p_buf + 1));
- LOGE("vendor lib postload completed");
+ ALOGE("vendor lib postload completed");
bt_hc_cbacks->postload_cb(NULL, BT_HC_POSTLOAD_SUCCESS);
}
}
@@ -389,7 +389,7 @@ static HC_BT_HDR *acl_rx_frame_buffer_alloc (void)
* Drop it. */
if (p_return_buf)
{
- LOGW("H4 - dropping incomplete ACL frame");
+ ALOGW("H4 - dropping incomplete ACL frame");
utils_remove_from_queue(&(p_cb->acl_rx_q), p_return_buf);
@@ -788,7 +788,7 @@ uint16_t hci_h4_receive_msg(void)
{
/* Unknown HCI message type */
/* Drop this byte */
- LOGE("[h4] Unknown HCI message type drop this byte 0x%x", byte);
+ ALOGE("[h4] Unknown HCI message type drop this byte 0x%x", byte);
break;
}
@@ -871,7 +871,7 @@ uint16_t hci_h4_receive_msg(void)
if (p_cb->p_rcv_msg == NULL)
{
/* Unable to acquire message buffer. */
- LOGE( \
+ ALOGE( \
"H4: Unable to acquire buffer for incoming HCI message." \
);
@@ -1003,7 +1003,7 @@ uint8_t hci_h4_send_int_cmd(uint16_t opcode, HC_BT_HDR *p_buf, \
{
if (h4_cb.int_cmd_rsp_pending > INT_CMD_PKT_MAX_COUNT)
{
- LOGE( \
+ ALOGE( \
"Allow only %d outstanding internal commands at a time [Reject 0x%04X]"\
, INT_CMD_PKT_MAX_COUNT, opcode);
return FALSE;
@@ -1067,7 +1067,7 @@ void hci_h4_get_acl_data_length(void)
if (bt_hc_cbacks)
{
- LOGE("vendor lib postload aborted");
+ ALOGE("vendor lib postload aborted");
bt_hc_cbacks->postload_cb(NULL, BT_HC_POSTLOAD_FAIL);
}
}
diff --git a/hci/src/lpm.c b/hci/src/lpm.c
index c07b37c..74d0809 100644
--- a/hci/src/lpm.c
+++ b/hci/src/lpm.c
@@ -70,7 +70,7 @@
#endif
#if (BTLPM_DBG == TRUE)
-#define BTLPMDBG(param, ...) {LOGD(param, ## __VA_ARGS__);}
+#define BTLPMDBG(param, ...) {ALOGD(param, ## __VA_ARGS__);}
#else
#define BTLPMDBG(param, ...) {}
#endif
@@ -187,7 +187,7 @@ static void lpm_start_transport_idle_timer(void)
status = timer_settime(bt_lpm_cb.timer_id, 0, &ts, 0);
if (status == -1)
- LOGE("[START] Failed to set LPM idle timeout");
+ ALOGE("[START] Failed to set LPM idle timeout");
}
}
@@ -214,7 +214,7 @@ static void lpm_stop_transport_idle_timer(void)
status = timer_settime(bt_lpm_cb.timer_id, 0, &ts, 0);
if (status == -1)
- LOGE("[STOP] Failed to set LPM idle timeout");
+ ALOGE("[STOP] Failed to set LPM idle timeout");
}
}
@@ -316,19 +316,19 @@ void lpm_enable(uint8_t turn_on)
{
if ((bt_lpm_cb.state!=LPM_DISABLED) && (bt_lpm_cb.state!=LPM_ENABLED))
{
- LOGW("Still busy on processing prior LPM enable/disable request...");
+ ALOGW("Still busy on processing prior LPM enable/disable request...");
return;
}
if ((turn_on == TRUE) && (bt_lpm_cb.state == LPM_ENABLED))
{
- LOGI("LPM is already on!!!");
+ ALOGI("LPM is already on!!!");
if (bt_hc_cbacks)
bt_hc_cbacks->lpm_cb(BT_HC_LPM_ENABLED);
}
else if ((turn_on == FALSE) && (bt_lpm_cb.state == LPM_DISABLED))
{
- LOGI("LPM is already off!!!");
+ ALOGI("LPM is already off!!!");
if (bt_hc_cbacks)
bt_hc_cbacks->lpm_cb(BT_HC_LPM_DISABLED);
}
diff --git a/hci/src/userial.c b/hci/src/userial.c
index 7385480..988f2f8 100644
--- a/hci/src/userial.c
+++ b/hci/src/userial.c
@@ -75,7 +75,7 @@
#endif
#if (USERIAL_DBG == TRUE)
-#define USERIALDBG(param, ...) {LOGD(param, ## __VA_ARGS__);}
+#define USERIALDBG(param, ...) {ALOGD(param, ## __VA_ARGS__);}
#else
#define USERIALDBG(param, ...) {}
#endif
@@ -154,7 +154,7 @@ static inline int create_signal_fds(fd_set* set)
{
if(signal_fds[0]==0 && socketpair(AF_UNIX, SOCK_STREAM, 0, signal_fds)<0)
{
- LOGE("create_signal_sockets:socketpair failed, errno: %d", errno);
+ ALOGE("create_signal_sockets:socketpair failed, errno: %d", errno);
return -1;
}
FD_SET(signal_fds[0], set);
@@ -233,15 +233,15 @@ static int select_read(int fd, uint8_t *pbuf, int len)
{
ret = read(fd, pbuf, (size_t)len);
if (0 == ret)
- LOGW( "read() returned 0!" );
+ ALOGW( "read() returned 0!" );
return ret;
}
}
else if (n < 0)
- LOGW( "select() Failed");
+ ALOGW( "select() Failed");
else if (n == 0)
- LOGW( "Got a select() TIMEOUT");
+ ALOGW( "Got a select() TIMEOUT");
}
@@ -290,7 +290,7 @@ static void *userial_read_thread(void *arg)
{
rx_length = 0;
utils_delay(100);
- LOGW("userial_read_thread() failed to gain buffers");
+ ALOGW("userial_read_thread() failed to gain buffers");
continue;
}
@@ -303,7 +303,7 @@ static void *userial_read_thread(void *arg)
}
else /* either 0 or < 0 */
{
- LOGW("select_read return size <=0:%d, exiting userial_read_thread",\
+ ALOGW("select_read return size <=0:%d, exiting userial_read_thread",\
rx_length);
/* if we get here, we should have a buffer */
bt_hc_cbacks->dealloc((TRANSAC) p_buf, (char *) (p_buf + 1));
@@ -369,7 +369,7 @@ uint8_t userial_open(uint8_t port, tUSERIAL_CFG *p_cfg)
if (port >= MAX_SERIAL_PORT)
{
- LOGE("Port > MAX_SERIAL_PORT");
+ ALOGE("Port > MAX_SERIAL_PORT");
return FALSE;
}
@@ -380,18 +380,17 @@ uint8_t userial_open(uint8_t port, tUSERIAL_CFG *p_cfg)
}
else
{
- LOGE("userial_open: missing vendor lib interface !!!");
- LOGE("userial_open: unable to open UART port");
+ ALOGE("userial_open: missing vendor lib interface !!!");
+ ALOGE("userial_open: unable to open UART port");
return FALSE;
}
if (userial_cb.sock == -1)
{
- LOGE("userial_open: failed to open UART port");
+ ALOGE("userial_open: failed to open UART port");
return FALSE;
}
-
USERIALDBG( "sock = %d", userial_cb.sock);
userial_cb.port = port;
@@ -402,7 +401,7 @@ uint8_t userial_open(uint8_t port, tUSERIAL_CFG *p_cfg)
if (pthread_create(&(userial_cb.read_thread), &thread_attr, \
userial_read_thread, NULL) != 0 )
{
- LOGE("pthread_create failed!");
+ ALOGE("pthread_create failed!");
return FALSE;
}
@@ -415,7 +414,7 @@ uint8_t userial_open(uint8_t port, tUSERIAL_CFG *p_cfg)
result = pthread_setschedparam(userial_cb.read_thread, policy, &param);
if (result != 0)
{
- LOGW("userial_open: pthread_setschedparam failed (%s)", \
+ ALOGW("userial_open: pthread_setschedparam failed (%s)", \
strerror(result));
}
}
@@ -521,14 +520,14 @@ void userial_close(void)
send_wakeup_signal(USERIAL_RX_EXIT);
if ((result=pthread_join(userial_cb.read_thread, NULL)) < 0)
- LOGE( "pthread_join() FAILED result:%d", result);
+ ALOGE( "pthread_join() FAILED result:%d", result);
/* Calling vendor-specific part */
if (bt_vnd_if)
bt_vnd_if->op(BT_VND_OP_USERIAL_CLOSE, NULL);
if ((result=close(userial_cb.sock)) < 0)
- LOGE( "close(sock:%d) FAILED result:%d", userial_cb.sock, result);
+ ALOGE( "close(sock:%d) FAILED result:%d", userial_cb.sock, result);
userial_cb.sock = -1;
@@ -560,7 +559,7 @@ void userial_change_baud(uint8_t baud)
/* change baud rate in settings - leave everything else the same */
userial_cb.cfg.baud = baud;
- LOGI("userial_change_rate: Attempting to reopen the UART Port at %i", \
+ ALOGI("userial_change_rate: Attempting to reopen the UART Port at %i", \
(unsigned int)userial_baud_tbl[baud]);
userial_open(userial_cb.port, &userial_cb.cfg);