From 490d3fd0677a948ace063efdb679f3f7fdbb1017 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald" Date: Thu, 16 Jun 2011 21:57:42 +0000 Subject: [PATCH] deleted unused l2cap level per channel packet counting --- src/l2cap.c | 37 ++----------------------------------- src/l2cap.h | 1 - 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/src/l2cap.c b/src/l2cap.c index 0464a29e8..9777bebf1 100644 --- a/src/l2cap.c +++ b/src/l2cap.c @@ -203,12 +203,10 @@ int l2cap_send_internal(uint16_t local_cid, uint8_t *data, uint16_t len){ // find channel for local_cid, construct l2cap packet and send l2cap_channel_t * channel = l2cap_get_channel_for_local_cid(local_cid); if (channel) { - // track sending - ++channel->packets_outgoing; if (channel->packets_granted > 0){ --channel->packets_granted; - // log_dbg("l2cap_send_internal cid %u, 1 credit used, credits left %u; outgoing count %u\n", - // local_cid, channel->packets_granted, channel->packets_outgoing); + // log_dbg("l2cap_send_internal cid %u, 1 credit used, credits left %u;\n", + // local_cid, channel->packets_granted); } else { log_err("l2cap_send_internal cid %u, no credits!\n", local_cid); } @@ -258,7 +256,6 @@ void l2cap_create_channel_internal(void * connection, btstack_packet_handler_t p // flow control chan->packets_granted = 0; - chan->packets_outgoing = 0; // set initial state chan->state = L2CAP_STATE_CLOSED; @@ -322,7 +319,6 @@ void l2cap_event_handler( uint8_t *packet, uint16_t size ){ bd_addr_t address; hci_con_handle_t handle; linked_item_t *it; - int i; switch(packet[0]){ @@ -367,35 +363,6 @@ void l2cap_event_handler( uint8_t *packet, uint16_t size ){ break; case HCI_EVENT_NUMBER_OF_COMPLETED_PACKETS: - for (i=0; inext ; it = it->next){ - l2cap_channel_t * channel = (l2cap_channel_t *) it->next; - if (channel->packets_outgoing > max_nr_pending){ - fullest_channel = channel; - max_nr_pending = channel->packets_outgoing; - } - } - - // decrease packets - if (fullest_channel) { - fullest_channel->packets_outgoing--; - // log_dbg("hci_number_completed_packet (l2cap) for cid %u, outgoing count %u\n", - // fullest_channel->local_cid, fullest_channel->packets_outgoing); - } else { - log_err("hci_number_completed_packet but no outgoing packet in records\n"); - } - - // handled! - num_packets--; - } - } l2cap_hand_out_credits(); break; diff --git a/src/l2cap.h b/src/l2cap.h index 552e589d7..421428f48 100644 --- a/src/l2cap.h +++ b/src/l2cap.h @@ -82,7 +82,6 @@ typedef struct { uint16_t psm; uint8_t packets_granted; // number of L2CAP/ACL packets client is allowed to send - uint8_t packets_outgoing; // number of L2CAP/ACL packets send to BT module // uint16_t flush_timeout_incoming; // uint16_t flush_timeout_outgoing;