extern fixed_queue_t *btu_general_alarm_queue;
-static BOOLEAN l2c_link_send_to_lower (tL2C_LCB *p_lcb, BT_HDR *p_buf);
+static BOOLEAN l2c_link_send_to_lower (tL2C_LCB *p_lcb, BT_HDR *p_buf, UINT16 fixed_cid);
/*******************************************************************************
**
{
int xx;
BOOLEAN single_write = FALSE;
+ UINT16 fixed_cid;
/* Save the channel ID for faster counting */
if (p_buf)
/* Loop through, starting at the next */
for (xx = 0; xx < MAX_L2CAP_LINKS; xx++, p_lcb++)
{
+ /* Check for wraparound */
+ if (p_lcb == &l2cb.lcb_pool[MAX_L2CAP_LINKS])
+ p_lcb = &l2cb.lcb_pool[0];
+
/* If controller window is full, nothing to do */
if (p_lcb->transport == BT_TRANSPORT_BR_EDR &&
(l2cb.controller_xmit_window == 0 ||
}
#endif
- /* Check for wraparound */
- if (p_lcb == &l2cb.lcb_pool[MAX_L2CAP_LINKS])
- p_lcb = &l2cb.lcb_pool[0];
-
if ( (!p_lcb->in_use)
|| (p_lcb->partial_segment_being_sent)
|| (p_lcb->link_state != LST_CONNECTED)
if (!list_is_empty(p_lcb->link_xmit_data_q)) {
p_buf = (BT_HDR *)list_front(p_lcb->link_xmit_data_q);
list_remove(p_lcb->link_xmit_data_q, p_buf);
- l2c_link_send_to_lower (p_lcb, p_buf);
+ l2c_link_send_to_lower (p_lcb, p_buf, 0);
}
else if (single_write)
{
break;
}
/* If nothing on the link queue, check the channel queue */
- else if ((p_buf = l2cu_get_next_buffer_to_send (p_lcb)) != NULL)
+ else if ((p_buf = l2cu_get_next_buffer_to_send (p_lcb, &fixed_cid)) != NULL)
{
- l2c_link_send_to_lower (p_lcb, p_buf);
+ l2c_link_send_to_lower (p_lcb, p_buf, fixed_cid);
}
}
p_buf = (BT_HDR *)list_front(p_lcb->link_xmit_data_q);
list_remove(p_lcb->link_xmit_data_q, p_buf);
- if (!l2c_link_send_to_lower (p_lcb, p_buf))
+ if (!l2c_link_send_to_lower (p_lcb, p_buf, 0))
break;
}
while ((l2cb.controller_xmit_window != 0) && (p_lcb->sent_not_acked < p_lcb->link_xmit_quota))
#endif
{
- if ((p_buf = l2cu_get_next_buffer_to_send (p_lcb)) == NULL)
+ if ((p_buf = l2cu_get_next_buffer_to_send (p_lcb, &fixed_cid)) == NULL)
break;
- if (!l2c_link_send_to_lower (p_lcb, p_buf))
+ if (!l2c_link_send_to_lower (p_lcb, p_buf, fixed_cid))
break;
}
}
** Returns TRUE for success, FALSE for fail
**
*******************************************************************************/
-static BOOLEAN l2c_link_send_to_lower (tL2C_LCB *p_lcb, BT_HDR *p_buf)
+static BOOLEAN l2c_link_send_to_lower (tL2C_LCB *p_lcb, BT_HDR *p_buf, UINT16 fixed_cid)
{
UINT16 num_segs;
UINT16 xmit_window, acl_data_size;
}
#endif
+ if (fixed_cid != 0)
+ {
+ L2CAP_TRACE_DEBUG("%s: fixed_cid = %d, send tx complete", __func__, fixed_cid);
+ /* send tx complete */
+ if (l2cb.fixed_reg[fixed_cid - L2CAP_FIRST_FIXED_CHNL].pL2CA_FixedTxComplete_Cb)
+ {
+ (*l2cb.fixed_reg[fixed_cid - L2CAP_FIRST_FIXED_CHNL].pL2CA_FixedTxComplete_Cb)(fixed_cid, 1);
+ }
+ }
return TRUE;
}
** Returns pointer to buffer or NULL
**
*******************************************************************************/
-BT_HDR *l2cu_get_next_buffer_to_send (tL2C_LCB *p_lcb)
+BT_HDR *l2cu_get_next_buffer_to_send (tL2C_LCB *p_lcb, UINT16 *fixed_cid)
{
tL2C_CCB *p_ccb;
BT_HDR *p_buf;
#if (L2CAP_NUM_FIXED_CHNLS > 0)
int xx;
+ *fixed_cid = 0;
for (xx = 0; xx < L2CAP_NUM_FIXED_CHNLS; xx++)
{
if ((p_ccb = p_lcb->p_fixed_ccbs[xx]) == NULL)
L2CAP_TRACE_ERROR("l2cu_get_buffer_to_send: No data to be sent");
return (NULL);
}
- /* send tx complete */
- if (l2cb.fixed_reg[xx].pL2CA_FixedTxComplete_Cb)
- (*l2cb.fixed_reg[xx].pL2CA_FixedTxComplete_Cb)(p_ccb->local_cid, 1);
+ if (fixed_cid != NULL)
+ {
+ *fixed_cid = p_ccb->local_cid;
+ L2CAP_TRACE_DEBUG("l2cu_get_buffer_to_send: fixed_cid = %d", *fixed_cid);
+ }
l2cu_check_channel_congestion (p_ccb);
l2cu_set_acl_hci_header (p_buf, p_ccb);