diff options
author | Chris Manton <cmanton@google.com> | 2014-05-06 10:35:42 -0700 |
---|---|---|
committer | Andre Eisenbach <eisenbach@google.com> | 2015-03-16 16:51:29 -0700 |
commit | fe7216ca12f91baae733e7c93063db73121af308 (patch) | |
tree | 03a66f188e1fd2e8daa48d5be04220b80422d7bf /stack/l2cap/l2c_main.c | |
parent | 284440f0c9f9fe15b162e37ef2bf6af439407447 (diff) | |
download | android_system_bt-fe7216ca12f91baae733e7c93063db73121af308.tar.gz android_system_bt-fe7216ca12f91baae733e7c93063db73121af308.tar.bz2 android_system_bt-fe7216ca12f91baae733e7c93063db73121af308.zip |
Enforce GKI API buffer usage
Also add another API GKI_queue_length(BUFFER_Q *)
Diffstat (limited to 'stack/l2cap/l2c_main.c')
-rwxr-xr-x | stack/l2cap/l2c_main.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/stack/l2cap/l2c_main.c b/stack/l2cap/l2c_main.c index 325f7af8e..1b45713e0 100755 --- a/stack/l2cap/l2c_main.c +++ b/stack/l2cap/l2c_main.c @@ -152,11 +152,11 @@ void l2c_rcv_acl_data (BT_HDR *p_msg) { L2CAP_TRACE_WARNING ("L2CAP - holding ACL for unknown handle:%d ls:%d cid:%d opcode:%d cur count:%d", handle, p_msg->layer_specific, rcv_cid, cmd_code, - l2cb.rcv_hold_q.count); + GKI_queue_length(&l2cb.rcv_hold_q)); p_msg->layer_specific = 2; GKI_enqueue (&l2cb.rcv_hold_q, p_msg); - if (l2cb.rcv_hold_q.count == 1) + if (GKI_queue_length(&l2cb.rcv_hold_q) == 1) btu_start_timer (&l2cb.rcv_hold_tle, BTU_TTYPE_L2CAP_HOLD, BT_1SEC_TIMEOUT); return; @@ -164,7 +164,7 @@ void l2c_rcv_acl_data (BT_HDR *p_msg) else { L2CAP_TRACE_ERROR ("L2CAP - rcvd ACL for unknown handle:%d ls:%d cid:%d opcode:%d cur count:%d", - handle, p_msg->layer_specific, rcv_cid, cmd_code, l2cb.rcv_hold_q.count); + handle, p_msg->layer_specific, rcv_cid, cmd_code, GKI_queue_length(&l2cb.rcv_hold_q)); } GKI_freebuf (p_msg); return; @@ -816,7 +816,7 @@ void l2c_process_held_packets (BOOLEAN timed_out) BT_HDR *p_buf, *p_buf1; BUFFER_Q *p_rcv_hold_q = &l2cb.rcv_hold_q; - if (!p_rcv_hold_q->count) + if (GKI_queue_is_empty(p_rcv_hold_q)) return; if (!timed_out) @@ -842,7 +842,7 @@ void l2c_process_held_packets (BOOLEAN timed_out) } /* If anyone still in the queue, restart the timeout */ - if (p_rcv_hold_q->count) + if (!GKI_queue_is_empty(p_rcv_hold_q)) btu_start_timer (&l2cb.rcv_hold_tle, BTU_TTYPE_L2CAP_HOLD, BT_1SEC_TIMEOUT); } @@ -984,7 +984,7 @@ UINT8 l2c_data_write (UINT16 cid, BT_HDR *p_data, UINT16 flags) if (p_ccb->cong_sent) { L2CAP_TRACE_ERROR ("L2CAP - CID: 0x%04x cannot send, already congested xmit_hold_q.count: %u buff_quota: %u", - p_ccb->local_cid, p_ccb->xmit_hold_q.count, p_ccb->buff_quota); + p_ccb->local_cid, GKI_queue_length(&p_ccb->xmit_hold_q), p_ccb->buff_quota); GKI_freebuf (p_data); return (L2CAP_DW_FAILED); |