Home | History | Annotate | Download | only in avct

Lines Matching refs:p_lcb

53 static BT_HDR *avct_lcb_msg_asmbl(tAVCT_LCB *p_lcb, BT_HDR *p_buf)
75 if (p_lcb->p_rx_msg != NULL)
77 GKI_freebuf(p_lcb->p_rx_msg);
78 p_lcb->p_rx_msg = NULL;
87 if (p_lcb->p_rx_msg != NULL)
89 GKI_freebuf(p_lcb->p_rx_msg);
92 p_lcb->p_rx_msg = p_buf;
98 p_lcb->p_rx_msg->offset += p_lcb->p_rx_msg->len;
101 p_lcb->p_rx_msg->len -= 1;
109 if (p_lcb->p_rx_msg == NULL)
118 buf_len = GKI_get_buf_size(p_lcb->p_rx_msg) - sizeof(BT_HDR);
125 if ((p_lcb->p_rx_msg->offset + p_buf->len) > buf_len)
128 GKI_freebuf(p_lcb->p_rx_msg);
129 p_lcb->p_rx_msg = NULL;
137 memcpy((UINT8 *)(p_lcb->p_rx_msg + 1) + p_lcb->p_rx_msg->offset,
142 p_lcb->p_rx_msg->offset -= p_lcb->p_rx_msg->len;
143 p_lcb->p_rx_msg->len += p_buf->len;
144 p_ret = p_lcb->p_rx_msg;
145 p_lcb->p_rx_msg = NULL;
149 p_lcb->p_rx_msg->offset += p_buf->len;
150 p_lcb->p_rx_msg->len += p_buf->len;
171 void avct_lcb_chnl_open(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
176 BTM_SetOutService(p_lcb->peer_addr, BTM_SEC_SERVICE_AVCTP, 0);
178 p_lcb->ch_state = AVCT_CH_CONN;
179 if ((p_lcb->ch_lcid = L2CA_ConnectReq(AVCT_PSM, p_lcb->peer_addr)) == 0)
182 avct_lcb_event(p_lcb, AVCT_LCB_LL_CLOSE_EVT, (tAVCT_LCB_EVT *) &result);
196 void avct_lcb_unbind_disc(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
198 UNUSED(p_lcb);
216 void avct_lcb_open_ind(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
228 if (p_ccb->p_lcb == p_lcb)
231 L2CA_SetTxPriority(p_lcb->ch_lcid, L2CAP_CHNL_PRIORITY_HIGH);
233 0, p_lcb->peer_addr);
236 else if ((p_ccb->p_lcb == NULL) && (p_ccb->cc.role == AVCT_ACP) &&
237 (avct_lcb_has_pid(p_lcb, p_ccb->cc.pid) == NULL))
241 p_ccb->p_lcb = p_lcb;
242 L2CA_SetTxPriority(p_lcb->ch_lcid, L2CAP_CHNL_PRIORITY_HIGH);
244 0, p_lcb->peer_addr);
252 avct_lcb_event(p_lcb, AVCT_LCB_INT_CLOSE_EVT, p_data);
267 void avct_lcb_open_fail(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
274 if (p_ccb->allocated && (p_ccb->p_lcb == p_lcb))
277 p_data->result, p_lcb->peer_addr);
293 void avct_lcb_close_ind(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
301 if (p_ccb->allocated && (p_ccb->p_lcb == p_lcb))
306 0, p_lcb->peer_addr);
310 p_ccb->p_lcb = NULL;
312 0, p_lcb->peer_addr);
329 void avct_lcb_close_cfm(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
337 if (p_ccb->allocated && (p_ccb->p_lcb == p_lcb))
352 avct_ccb_dealloc(p_ccb, event, p_data->result, p_lcb->peer_addr);
356 p_ccb->p_lcb = NULL;
358 p_data->result, p_lcb->peer_addr);
374 void avct_lcb_bind_conn(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
376 p_data->p_ccb->p_lcb = p_lcb;
378 AVCT_CONNECT_CFM_EVT, 0, p_lcb->peer_addr);
393 void avct_lcb_chk_disc(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
397 avct_close_bcb(p_lcb, p_data);
399 if (avct_lcb_last_ccb(p_lcb, p_data->p_ccb))
403 avct_lcb_event(p_lcb, AVCT_LCB_INT_CLOSE_EVT, p_data);
408 avct_lcb_unbind_disc(p_lcb, p_data);
422 void avct_lcb_chnl_disc(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
426 L2CA_DisconnectReq(p_lcb->ch_lcid);
440 void avct_lcb_bind_fail(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
442 UNUSED(p_lcb);
457 void avct_lcb_cong_ind(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
466 p_lcb->cong = p_data->cong;
467 if (p_lcb->cong == FALSE && GKI_getfirst(&p_lcb->tx_q))
469 while ( !p_lcb->cong && (p_buf = (BT_HDR *)GKI_dequeue(&p_lcb->tx_q)) != NULL)
471 if (L2CA_DataWrite(p_lcb->ch_lcid, p_buf) == L2CAP_DW_CONGESTED)
473 p_lcb->cong = TRUE;
481 if (p_ccb->allocated && (p_ccb->p_lcb == p_lcb))
483 (*p_ccb->cc.p_ctrl_cback)(avct_ccb_to_idx(p_ccb), event, 0, p_lcb->peer_addr);
498 void avct_lcb_discard_msg(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
500 UNUSED(p_lcb);
517 void avct_lcb_send_msg(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
526 UINT16 buf_size = p_lcb->peer_mtu + L2CAP_MIN_OFFSET + BT_HDR_SIZE;
533 if (curr_msg_len <= (p_lcb->peer_mtu - AVCT_HDR_LEN_SINGLE))
540 temp = (curr_msg_len + AVCT_HDR_LEN_START - p_lcb->peer_mtu);
541 nosp = temp / (p_lcb->peer_mtu - 1) + 1;
542 if ( (temp % (p_lcb->peer_mtu - 1)) != 0)
553 if (p_data->ul_msg.p_buf->len > (p_lcb->peer_mtu - hdr_len))
566 p_buf->len = p_lcb->peer_mtu - hdr_len;
597 if (p_lcb->cong == TRUE)
599 GKI_enqueue (&p_lcb->tx_q, p_buf);
605 if (L2CA_DataWrite(p_lcb->ch_lcid, p_buf) == L2CAP_DW_CONGESTED)
607 p_lcb->cong = TRUE;
612 if (curr_msg_len > (p_lcb->peer_mtu - AVCT_HDR_LEN_END))
621 AVCT_TRACE_DEBUG ("avct_lcb_send_msg tx_q_count:%d", p_lcb->tx_q.count);
635 void avct_lcb_free_msg_ind(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
637 UNUSED(p_lcb);
654 void avct_lcb_msg_ind(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
668 if ((p_data->p_buf = avct_lcb_msg_asmbl(p_lcb, p_data->p_buf)) == NULL)
688 if ((p_ccb = avct_lcb_has_pid(p_lcb, pid)) != NULL)
711 L2CA_DataWrite(p_lcb->ch_lcid, p_buf);