Lines Matching refs:p_bcb
68 static BT_HDR* avct_bcb_msg_asmbl(UNUSED_ATTR tAVCT_BCB* p_bcb, BT_HDR* p_buf) { in avct_bcb_msg_asmbl() argument
101 void avct_bcb_chnl_open(tAVCT_BCB* p_bcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) { in avct_bcb_chnl_open() argument
103 tAVCT_LCB* p_lcb = avct_lcb_by_bcb(p_bcb); in avct_bcb_chnl_open()
117 p_bcb->ch_state = AVCT_CH_CONN; in avct_bcb_chnl_open()
118 p_bcb->ch_lcid = in avct_bcb_chnl_open()
120 if (p_bcb->ch_lcid == 0) { in avct_bcb_chnl_open()
124 avct_bcb_event(p_bcb, AVCT_LCB_LL_CLOSE_EVT, &avct_lcb_evt); in avct_bcb_chnl_open()
138 void avct_bcb_unbind_disc(UNUSED_ATTR tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) { in avct_bcb_unbind_disc() argument
139 p_data->p_ccb->p_bcb = NULL; in avct_bcb_unbind_disc()
158 void avct_bcb_open_ind(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) { in avct_bcb_open_ind() argument
168 if (p_ccb->p_bcb == p_bcb) { in avct_bcb_open_ind()
176 else if ((p_ccb->p_bcb == NULL) && (p_ccb->cc.role == AVCT_ACP) && in avct_bcb_open_ind()
178 p_bcb->peer_addr == p_ccb->p_lcb->peer_addr) { in avct_bcb_open_ind()
182 p_ccb->p_bcb = p_bcb; in avct_bcb_open_ind()
191 avct_bcb_event(p_bcb, AVCT_LCB_INT_CLOSE_EVT, p_data); in avct_bcb_open_ind()
195 if (!p_bcb->p_tx_msg || !p_ccb_bind) { in avct_bcb_open_ind()
199 ul_msg.p_buf = p_bcb->p_tx_msg; in avct_bcb_open_ind()
201 ul_msg.label = (uint8_t)(p_bcb->p_tx_msg->layer_specific & 0xFF); in avct_bcb_open_ind()
202 ul_msg.cr = (uint8_t)((p_bcb->p_tx_msg->layer_specific & 0xFF00) >> 8); in avct_bcb_open_ind()
203 p_bcb->p_tx_msg->layer_specific = AVCT_DATA_BROWSE; in avct_bcb_open_ind()
204 p_bcb->p_tx_msg = NULL; in avct_bcb_open_ind()
209 avct_bcb_event(p_bcb, AVCT_LCB_UL_MSG_EVT, &avct_lcb_evt); in avct_bcb_open_ind()
223 void avct_bcb_open_fail(tAVCT_BCB* p_bcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) { in avct_bcb_open_fail() argument
227 if (p_ccb->allocated && (p_ccb->p_bcb == p_bcb)) { in avct_bcb_open_fail()
228 p_ccb->p_bcb = NULL; in avct_bcb_open_fail()
244 void avct_bcb_close_ind(tAVCT_BCB* p_bcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) { in avct_bcb_close_ind() argument
246 tAVCT_LCB* p_lcb = avct_lcb_by_bcb(p_bcb); in avct_bcb_close_ind()
249 if (p_ccb->allocated && (p_ccb->p_bcb == p_bcb)) { in avct_bcb_close_ind()
258 p_ccb->p_bcb = NULL; in avct_bcb_close_ind()
274 void avct_bcb_close_cfm(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) { in avct_bcb_close_cfm() argument
278 bool ch_close = p_bcb->ch_close; in avct_bcb_close_cfm()
281 p_bcb->ch_close = false; in avct_bcb_close_cfm()
282 p_bcb->allocated = 0; in avct_bcb_close_cfm()
284 if (p_ccb->allocated && (p_ccb->p_bcb == p_bcb)) { in avct_bcb_close_cfm()
293 p_ccb->p_bcb = NULL; in avct_bcb_close_cfm()
296 &p_bcb->peer_addr); in avct_bcb_close_cfm()
311 void avct_bcb_bind_conn(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) { in avct_bcb_bind_conn() argument
312 tAVCT_LCB* p_lcb = avct_lcb_by_bcb(p_bcb); in avct_bcb_bind_conn()
313 p_data->p_ccb->p_bcb = p_bcb; in avct_bcb_bind_conn()
331 void avct_bcb_chk_disc(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) { in avct_bcb_chk_disc() argument
332 p_bcb->ch_close = avct_bcb_get_last_ccb_index(p_bcb, p_data->p_ccb); in avct_bcb_chk_disc()
333 if (p_bcb->ch_close) { in avct_bcb_chk_disc()
334 avct_bcb_event(p_bcb, AVCT_LCB_INT_CLOSE_EVT, p_data); in avct_bcb_chk_disc()
338 avct_bcb_unbind_disc(p_bcb, p_data); in avct_bcb_chk_disc()
351 void avct_bcb_chnl_disc(tAVCT_BCB* p_bcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) { in avct_bcb_chnl_disc() argument
352 L2CA_DisconnectReq(p_bcb->ch_lcid); in avct_bcb_chnl_disc()
366 void avct_bcb_bind_fail(UNUSED_ATTR tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) { in avct_bcb_bind_fail() argument
367 p_data->p_ccb->p_bcb = NULL; in avct_bcb_bind_fail()
383 void avct_bcb_cong_ind(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) { in avct_bcb_cong_ind() argument
386 tAVCT_LCB* p_lcb = avct_lcb_by_bcb(p_bcb); in avct_bcb_cong_ind()
394 if (p_ccb->allocated && (p_ccb->p_bcb == p_bcb)) { in avct_bcb_cong_ind()
411 void avct_bcb_discard_msg(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) { in avct_bcb_discard_msg() argument
412 osi_free_and_reset((void**)&p_bcb->p_tx_msg); in avct_bcb_discard_msg()
419 p_bcb->p_tx_msg = p_data->ul_msg.p_buf; in avct_bcb_discard_msg()
421 if (p_bcb->p_tx_msg) { in avct_bcb_discard_msg()
422 p_bcb->p_tx_msg->layer_specific = in avct_bcb_discard_msg()
426 AVCT_TRACE_DEBUG("ch_state: %d, allocated:%d->%d", p_bcb->ch_state, in avct_bcb_discard_msg()
427 p_bcb->allocated, p_data->ul_msg.p_ccb->p_lcb->allocated); in avct_bcb_discard_msg()
428 p_bcb->allocated = p_data->ul_msg.p_ccb->p_lcb->allocated; in avct_bcb_discard_msg()
429 avct_bcb_event(p_bcb, AVCT_LCB_UL_BIND_EVT, in avct_bcb_discard_msg()
444 void avct_bcb_send_msg(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) { in avct_bcb_send_msg() argument
455 if (curr_msg_len > (p_bcb->peer_mtu - AVCT_HDR_LEN_SINGLE)) { in avct_bcb_send_msg()
457 curr_msg_len, p_bcb->peer_mtu, AVCT_HDR_LEN_SINGLE); in avct_bcb_send_msg()
478 L2CA_DataWrite(p_bcb->ch_lcid, p_buf); in avct_bcb_send_msg()
491 void avct_bcb_free_msg_ind(UNUSED_ATTR tAVCT_BCB* p_bcb, in avct_bcb_free_msg_ind() argument
506 void avct_bcb_msg_ind(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) { in avct_bcb_msg_ind() argument
511 tAVCT_LCB* p_lcb = avct_lcb_by_bcb(p_bcb); in avct_bcb_msg_ind()
525 p_data->p_buf = avct_bcb_msg_asmbl(p_bcb, p_data->p_buf); in avct_bcb_msg_ind()
575 L2CA_DataWrite(p_bcb->ch_lcid, p_buf); in avct_bcb_msg_ind()
589 void avct_bcb_dealloc(tAVCT_BCB* p_bcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) { in avct_bcb_dealloc() argument
592 AVCT_TRACE_DEBUG("%s %d", __func__, p_bcb->allocated); in avct_bcb_dealloc()
596 if ((p_ccb->allocated) && (p_ccb->p_bcb == p_bcb)) { in avct_bcb_dealloc()
597 p_ccb->p_bcb = NULL; in avct_bcb_dealloc()
604 osi_free_and_reset((void**)&p_bcb->p_tx_msg); in avct_bcb_dealloc()
605 memset(p_bcb, 0, sizeof(tAVCT_BCB)); in avct_bcb_dealloc()
619 tAVCT_BCB* p_bcb = avct_bcb_by_lcb(p_lcb); in avct_close_bcb() local
620 if (p_bcb->allocated) { in avct_close_bcb()
621 avct_bcb_event(p_bcb, AVCT_LCB_UL_UNBIND_EVT, p_data); in avct_close_bcb()
634 tAVCT_LCB* avct_lcb_by_bcb(tAVCT_BCB* p_bcb) { in avct_lcb_by_bcb() argument
635 return &avct_cb.lcb[p_bcb->allocated - 1]; in avct_lcb_by_bcb()
661 uint8_t avct_bcb_get_last_ccb_index(tAVCT_BCB* p_bcb, tAVCT_CCB* p_ccb_last) { in avct_bcb_get_last_ccb_index() argument
666 if (p_ccb->allocated && (p_ccb->p_bcb == p_bcb)) { in avct_bcb_get_last_ccb_index()
685 tAVCT_BCB* p_bcb = &avct_cb.bcb[0]; in avct_bcb_by_lcid() local
688 for (idx = 0; idx < AVCT_NUM_LINKS; idx++, p_bcb++) { in avct_bcb_by_lcid()
689 if (p_bcb->allocated && (p_bcb->ch_lcid == lcid)) { in avct_bcb_by_lcid()
690 return p_bcb; in avct_bcb_by_lcid()