Home | History | Annotate | Download | only in avct

Lines Matching refs:p_buf

52 static BT_HDR *avct_lcb_msg_asmbl(tAVCT_LCB *p_lcb, BT_HDR *p_buf)
60 p = (UINT8 *)(p_buf + 1) + p_buf->offset;
64 if (p_buf->len < avct_lcb_pkt_type_len[pkt_type])
66 GKI_freebuf(p_buf);
80 p_ret = p_buf;
91 p_lcb->p_rx_msg = p_buf;
110 GKI_freebuf(p_buf);
120 p_buf->offset += AVCT_HDR_LEN_CONT;
121 p_buf->len -= AVCT_HDR_LEN_CONT;
124 if ((p_lcb->p_rx_msg->offset + p_buf->len) > buf_len)
129 GKI_freebuf(p_buf);
135 /* copy contents of p_buf to p_rx_msg */
137 (UINT8 *)(p_buf + 1) + p_buf->offset, p_buf->len);
142 p_lcb->p_rx_msg->len += p_buf->len;
148 p_lcb->p_rx_msg->offset += p_buf->len;
149 p_lcb->p_rx_msg->len += p_buf->len;
152 GKI_freebuf(p_buf);
453 BT_HDR *p_buf;
460 while ( !p_lcb->cong && (p_buf = (BT_HDR *)GKI_dequeue(&p_lcb->tx_q)) != NULL)
462 if (L2CA_DataWrite(p_lcb->ch_lcid, p_buf) == L2CAP_DW_CONGESTED)
493 GKI_freebuf(p_data->ul_msg.p_buf);
511 BT_HDR *p_buf;
519 curr_msg_len = p_data->ul_msg.p_buf->len;
542 if (p_data->ul_msg.p_buf->len > (p_lcb->peer_mtu - hdr_len))
545 if ((p_buf = (BT_HDR *) GKI_getbuf(buf_size)) == NULL)
549 GKI_freebuf(p_data->ul_msg.p_buf);
554 p_buf->offset = L2CAP_MIN_OFFSET + hdr_len;
555 p_buf->len = p_lcb->peer_mtu - hdr_len;
557 memcpy((UINT8 *)(p_buf + 1) + p_buf->offset,
558 (UINT8 *)(p_data->ul_msg.p_buf + 1) + p_data->ul_msg.p_buf->offset, p_buf->len);
560 p_data->ul_msg.p_buf->offset += p_buf->len;
561 p_data->ul_msg.p_buf->len -= p_buf->len;
565 p_buf = p_data->ul_msg.p_buf;
568 curr_msg_len -= p_buf->len;
571 p_buf->len += hdr_len;
572 p_buf->offset -= hdr_len;
573 p = (UINT8 *)(p_buf + 1) + p_buf->offset;
588 GKI_enqueue (&p_lcb->tx_q, p_buf);
594 if (L2CA_DataWrite(p_lcb->ch_lcid, p_buf) == L2CAP_DW_CONGESTED)
627 GKI_freebuf(p_data->p_buf);
647 BT_HDR *p_buf;
649 /* this p_buf is to be reported through p_msg_cback. The layer_specific
652 p_data->p_buf->layer_specific = AVCT_DATA_CTRL;
655 if ((p_data->p_buf = avct_lcb_msg_asmbl(p_lcb, p_data->p_buf)) == NULL)
660 p = (UINT8 *)(p_data->p_buf + 1) + p_data->p_buf->offset;
669 GKI_freebuf(p_data->p_buf);
678 p_data->p_buf->offset += AVCT_HDR_LEN_SINGLE;
679 p_data->p_buf->len -= AVCT_HDR_LEN_SINGLE;
680 (*p_ccb->cc.p_msg_cback)(avct_ccb_to_idx(p_ccb), label, cr_ipid, p_data->p_buf);
686 GKI_freebuf(p_data->p_buf);
691 if ((p_buf = (BT_HDR *) GKI_getpoolbuf(AVCT_CMD_POOL_ID)) != NULL)
693 p_buf->len = AVCT_HDR_LEN_SINGLE;
694 p_buf->offset = AVCT_MSG_OFFSET - AVCT_HDR_LEN_SINGLE;
695 p = (UINT8 *)(p_buf + 1) + p_buf->offset;
698 L2CA_DataWrite(p_lcb->ch_lcid, p_buf);