Lines Matching refs:p_lcb
128 tL2C_LCB* p_lcb; in L2CA_Deregister() local
135 p_lcb = &l2cb.lcb_pool[0]; in L2CA_Deregister()
136 for (ii = 0; ii < MAX_L2CAP_LINKS; ii++, p_lcb++) { in L2CA_Deregister()
137 if (p_lcb->in_use) { in L2CA_Deregister()
138 p_ccb = p_lcb->ccb_queue.p_first_ccb; in L2CA_Deregister()
139 if ((p_ccb == NULL) || (p_lcb->link_state == LST_DISCONNECTING)) { in L2CA_Deregister()
321 tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(p_bd_addr, BT_TRANSPORT_BR_EDR); in L2CA_ErtmConnectReq() local
322 if (p_lcb == nullptr) { in L2CA_ErtmConnectReq()
324 p_lcb = l2cu_allocate_lcb(p_bd_addr, false, BT_TRANSPORT_BR_EDR); in L2CA_ErtmConnectReq()
326 if ((p_lcb == nullptr) || (!l2cu_create_conn_br_edr(p_lcb))) { in L2CA_ErtmConnectReq()
329 << ", p_lcb=" << p_lcb; in L2CA_ErtmConnectReq()
335 tL2C_CCB* p_ccb = l2cu_allocate_ccb(p_lcb, 0); in L2CA_ErtmConnectReq()
366 if (p_lcb->link_state == LST_CONNECTED) { in L2CA_ErtmConnectReq()
368 } else if (p_lcb->link_state == LST_DISCONNECTING) { in L2CA_ErtmConnectReq()
378 p_lcb->p_pending_ccb = p_ccb; in L2CA_ErtmConnectReq()
476 tL2C_LCB* p_lcb = &l2cb.lcb_pool[0]; in L2CA_DeregisterLECoc() local
477 for (int i = 0; i < MAX_L2CAP_LINKS; i++, p_lcb++) { in L2CA_DeregisterLECoc()
478 if (!p_lcb->in_use || p_lcb->transport != BT_TRANSPORT_LE) continue; in L2CA_DeregisterLECoc()
480 tL2C_CCB* p_ccb = p_lcb->ccb_queue.p_first_ccb; in L2CA_DeregisterLECoc()
481 if ((p_ccb == NULL) || (p_lcb->link_state == LST_DISCONNECTING)) continue; in L2CA_DeregisterLECoc()
530 tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(p_bd_addr, BT_TRANSPORT_LE); in L2CA_ConnectLECocReq() local
531 if (p_lcb == NULL) { in L2CA_ConnectLECocReq()
533 p_lcb = l2cu_allocate_lcb(p_bd_addr, false, BT_TRANSPORT_LE); in L2CA_ConnectLECocReq()
534 if ((p_lcb == NULL) in L2CA_ConnectLECocReq()
536 || (!l2cu_create_conn_le(p_lcb))) { in L2CA_ConnectLECocReq()
538 __func__, psm, p_lcb); in L2CA_ConnectLECocReq()
544 tL2C_CCB* p_ccb = l2cu_allocate_ccb(p_lcb, 0); in L2CA_ConnectLECocReq()
560 if (p_lcb->link_state == LST_CONNECTED) { in L2CA_ConnectLECocReq()
561 if (p_ccb->p_lcb->transport == BT_TRANSPORT_LE) { in L2CA_ConnectLECocReq()
573 else if (p_lcb->link_state == LST_DISCONNECTING) { in L2CA_ConnectLECocReq()
577 p_lcb->p_pending_ccb = p_ccb; in L2CA_ConnectLECocReq()
606 tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(p_bd_addr, BT_TRANSPORT_LE); in L2CA_ConnectLECocRsp() local
607 if (p_lcb == NULL) { in L2CA_ConnectLECocRsp()
614 tL2C_CCB* p_ccb = l2cu_find_ccb_by_cid(p_lcb, lcid); in L2CA_ConnectLECocRsp()
741 tL2C_LCB* p_lcb; in L2CA_ErtmConnectRsp() local
749 p_lcb = l2cu_find_lcb_by_bd_addr(p_bd_addr, BT_TRANSPORT_BR_EDR); in L2CA_ErtmConnectRsp()
750 if (p_lcb == NULL) { in L2CA_ErtmConnectRsp()
757 p_ccb = l2cu_find_ccb_by_cid(p_lcb, lcid); in L2CA_ErtmConnectRsp()
965 tL2C_LCB* p_lcb; in L2CA_Ping() local
973 p_lcb = l2cu_find_lcb_by_bd_addr(p_bd_addr, BT_TRANSPORT_BR_EDR); in L2CA_Ping()
974 if (p_lcb == NULL) { in L2CA_Ping()
976 p_lcb = l2cu_allocate_lcb(p_bd_addr, false, BT_TRANSPORT_BR_EDR); in L2CA_Ping()
977 if (p_lcb == NULL) { in L2CA_Ping()
981 if (!l2cu_create_conn_br_edr(p_lcb)) { in L2CA_Ping()
985 p_lcb->p_echo_rsp_cb = p_callback; in L2CA_Ping()
991 if (p_lcb->p_echo_rsp_cb != NULL) { in L2CA_Ping()
998 if (p_lcb->link_state == LST_DISCONNECTING) { in L2CA_Ping()
1004 p_lcb->p_echo_rsp_cb = p_callback; in L2CA_Ping()
1006 if (p_lcb->link_state == LST_CONNECTED) { in L2CA_Ping()
1007 l2cu_adj_id(p_lcb, L2CAP_ADJ_BRCM_ID); /* Make sure not using Broadcom ID */ in L2CA_Ping()
1008 l2cu_send_peer_echo_req(p_lcb, NULL, 0); in L2CA_Ping()
1009 alarm_set_on_mloop(p_lcb->l2c_lcb_timer, L2CAP_ECHO_RSP_TIMEOUT_MS, in L2CA_Ping()
1010 l2c_lcb_timer_timeout, p_lcb); in L2CA_Ping()
1028 tL2C_LCB* p_lcb; in L2CA_Echo() local
1045 p_lcb = l2cu_find_lcb_by_bd_addr(p_bd_addr, BT_TRANSPORT_BR_EDR); in L2CA_Echo()
1046 if (p_lcb == NULL) { in L2CA_Echo()
1051 if (p_lcb->link_state != LST_CONNECTED) { in L2CA_Echo()
1061 l2cu_adj_id(p_lcb, L2CAP_ADJ_BRCM_ID); /* Make sure not using Broadcom ID */ in L2CA_Echo()
1062 l2cu_send_peer_echo_req(p_lcb, pp, p_data->len); in L2CA_Echo()
1072 if (handle) *handle = control_block->p_lcb->handle; in L2CA_GetIdentifiers()
1098 tL2C_LCB* p_lcb; in L2CA_SetIdleTimeout() local
1111 p_lcb = p_ccb->p_lcb; in L2CA_SetIdleTimeout()
1113 if ((p_lcb) && (p_lcb->in_use) && (p_lcb->link_state == LST_CONNECTED)) in L2CA_SetIdleTimeout()
1114 p_lcb->idle_timeout = timeout; in L2CA_SetIdleTimeout()
1143 tL2C_LCB* p_lcb; in L2CA_SetIdleTimeoutByBdAddr() local
1146 p_lcb = l2cu_find_lcb_by_bd_addr(bd_addr, transport); in L2CA_SetIdleTimeoutByBdAddr()
1147 if ((p_lcb) && (p_lcb->in_use) && (p_lcb->link_state == LST_CONNECTED)) { in L2CA_SetIdleTimeoutByBdAddr()
1148 p_lcb->idle_timeout = timeout; in L2CA_SetIdleTimeoutByBdAddr()
1150 if (!p_lcb->ccb_queue.p_first_ccb) l2cu_no_dynamic_ccbs(p_lcb); in L2CA_SetIdleTimeoutByBdAddr()
1155 tL2C_LCB* p_lcb = &l2cb.lcb_pool[0]; in L2CA_SetIdleTimeoutByBdAddr() local
1157 for (xx = 0; xx < MAX_L2CAP_LINKS; xx++, p_lcb++) { in L2CA_SetIdleTimeoutByBdAddr()
1158 if ((p_lcb->in_use) && (p_lcb->link_state == LST_CONNECTED)) { in L2CA_SetIdleTimeoutByBdAddr()
1159 p_lcb->idle_timeout = timeout; in L2CA_SetIdleTimeoutByBdAddr()
1161 if (!p_lcb->ccb_queue.p_first_ccb) l2cu_no_dynamic_ccbs(p_lcb); in L2CA_SetIdleTimeoutByBdAddr()
1233 tL2C_LCB* p_lcb; in L2CA_LocalLoopbackReq() local
1253 p_lcb = l2cu_allocate_lcb(p_bd_addr, false, BT_TRANSPORT_BR_EDR); in L2CA_LocalLoopbackReq()
1254 if (p_lcb == NULL) { in L2CA_LocalLoopbackReq()
1259 p_lcb->link_state = LST_CONNECTED; in L2CA_LocalLoopbackReq()
1260 p_lcb->handle = handle; in L2CA_LocalLoopbackReq()
1263 p_ccb = l2cu_allocate_ccb(p_lcb, 0); in L2CA_LocalLoopbackReq()
1464 tL2C_LCB* p_lcb; in L2CA_SetFlushTimeout() local
1499 p_lcb = l2cu_find_lcb_by_bd_addr(bd_addr, BT_TRANSPORT_BR_EDR); in L2CA_SetFlushTimeout()
1501 if ((p_lcb) && (p_lcb->in_use) && (p_lcb->link_state == LST_CONNECTED)) { in L2CA_SetFlushTimeout()
1502 if (p_lcb->link_flush_tout != flush_tout) { in L2CA_SetFlushTimeout()
1503 p_lcb->link_flush_tout = flush_tout; in L2CA_SetFlushTimeout()
1507 btsnd_hcic_write_auto_flush_tout(p_lcb->handle, hci_flush_to); in L2CA_SetFlushTimeout()
1515 p_lcb = &l2cb.lcb_pool[0]; in L2CA_SetFlushTimeout()
1517 for (xx = 0; xx < MAX_L2CAP_LINKS; xx++, p_lcb++) { in L2CA_SetFlushTimeout()
1518 if ((p_lcb->in_use) && (p_lcb->link_state == LST_CONNECTED)) { in L2CA_SetFlushTimeout()
1519 if (p_lcb->link_flush_tout != flush_tout) { in L2CA_SetFlushTimeout()
1520 p_lcb->link_flush_tout = flush_tout; in L2CA_SetFlushTimeout()
1522 VLOG(1) << __func__ << " BDA: " << p_lcb->remote_bd_addr << " " in L2CA_SetFlushTimeout()
1525 btsnd_hcic_write_auto_flush_tout(p_lcb->handle, hci_flush_to); in L2CA_SetFlushTimeout()
1548 tL2C_LCB* p_lcb; in L2CA_GetPeerFeatures() local
1551 p_lcb = l2cu_find_lcb_by_bd_addr(bd_addr, BT_TRANSPORT_BR_EDR); in L2CA_GetPeerFeatures()
1552 if (p_lcb == NULL) { in L2CA_GetPeerFeatures()
1559 p_lcb->peer_ext_fea, p_lcb->peer_chnl_mask[0]); in L2CA_GetPeerFeatures()
1561 *p_ext_feat = p_lcb->peer_ext_fea; in L2CA_GetPeerFeatures()
1563 memcpy(p_chnl_mask, p_lcb->peer_chnl_mask, L2CAP_FIXED_CHNL_ARRAY_SIZE); in L2CA_GetPeerFeatures()
1581 tL2C_LCB* p_lcb = NULL; in L2CA_GetBDAddrbyHandle() local
1584 p_lcb = l2cu_find_lcb_by_handle(handle); in L2CA_GetBDAddrbyHandle()
1585 if (p_lcb) { in L2CA_GetBDAddrbyHandle()
1587 bd_addr = p_lcb->remote_bd_addr; in L2CA_GetBDAddrbyHandle()
1663 tL2C_LCB* p_lcb; in L2CA_ConnectFixedChnl() local
1690 p_lcb = l2cu_find_lcb_by_bd_addr(rem_bda, transport); in L2CA_ConnectFixedChnl()
1691 if (p_lcb != NULL) { in L2CA_ConnectFixedChnl()
1698 peer_channel_mask = p_lcb->peer_chnl_mask[0]; in L2CA_ConnectFixedChnl()
1709 p_lcb, fixed_cid, in L2CA_ConnectFixedChnl()
1717 if (p_lcb->link_state == LST_DISCONNECTING) { in L2CA_ConnectFixedChnl()
1720 p_lcb->p_pending_ccb = in L2CA_ConnectFixedChnl()
1721 p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]; in L2CA_ConnectFixedChnl()
1726 fixed_cid, p_lcb->remote_bd_addr, true, 0, p_lcb->transport); in L2CA_ConnectFixedChnl()
1731 p_lcb = l2cu_allocate_lcb(rem_bda, false, transport); in L2CA_ConnectFixedChnl()
1732 if (p_lcb == NULL) { in L2CA_ConnectFixedChnl()
1739 p_lcb, fixed_cid, &l2cb.fixed_reg[fixed_cid - L2CAP_FIRST_FIXED_CHNL] in L2CA_ConnectFixedChnl()
1741 p_lcb->disc_reason = L2CAP_CONN_NO_RESOURCES; in L2CA_ConnectFixedChnl()
1743 l2cu_release_lcb(p_lcb); in L2CA_ConnectFixedChnl()
1748 ? l2cu_create_conn_le(p_lcb, initiating_phys) in L2CA_ConnectFixedChnl()
1749 : l2cu_create_conn_br_edr(p_lcb)); in L2CA_ConnectFixedChnl()
1753 l2cu_release_lcb(p_lcb); in L2CA_ConnectFixedChnl()
1775 tL2C_LCB* p_lcb; in L2CA_SendFixedChnlData() local
1804 p_lcb = l2cu_find_lcb_by_bd_addr(rem_bda, transport); in L2CA_SendFixedChnlData()
1805 if (p_lcb == NULL || p_lcb->link_state == LST_DISCONNECTING) { in L2CA_SendFixedChnlData()
1818 peer_channel_mask = p_lcb->peer_chnl_mask[0]; in L2CA_SendFixedChnlData()
1831 if (!p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]) { in L2CA_SendFixedChnlData()
1833 p_lcb, fixed_cid, in L2CA_SendFixedChnlData()
1844 if (p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->cong_sent) { in L2CA_SendFixedChnlData()
1849 p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL] in L2CA_SendFixedChnlData()
1851 p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->buff_quota); in L2CA_SendFixedChnlData()
1856 l2c_enqueue_peer_data(p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL], in L2CA_SendFixedChnlData()
1859 l2c_link_check_send_pkts(p_lcb, NULL, NULL); in L2CA_SendFixedChnlData()
1863 if (p_lcb->in_use && p_lcb->link_state == LST_CONNECTED && in L2CA_SendFixedChnlData()
1864 !p_lcb->ccb_queue.p_first_ccb) { in L2CA_SendFixedChnlData()
1865 l2cu_no_dynamic_ccbs(p_lcb); in L2CA_SendFixedChnlData()
1868 if (p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->cong_sent) in L2CA_SendFixedChnlData()
1888 tL2C_LCB* p_lcb; in L2CA_RemoveFixedChnl() local
1905 p_lcb = l2cu_find_lcb_by_bd_addr(rem_bda, transport); in L2CA_RemoveFixedChnl()
1907 if (((p_lcb) == NULL) || in L2CA_RemoveFixedChnl()
1908 (!p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL])) { in L2CA_RemoveFixedChnl()
1919 p_ccb = p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]; in L2CA_RemoveFixedChnl()
1921 p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL] = NULL; in L2CA_RemoveFixedChnl()
1922 p_lcb->disc_reason = HCI_ERR_CONN_CAUSE_LOCAL_HOST; in L2CA_RemoveFixedChnl()
1930 if ((fixed_cid == L2CAP_ATT_CID) && !p_lcb->ccb_queue.p_first_ccb) in L2CA_RemoveFixedChnl()
1931 p_lcb->idle_timeout = 0; in L2CA_RemoveFixedChnl()
1955 tL2C_LCB* p_lcb; in L2CA_SetFixedChannelTout() local
1962 p_lcb = l2cu_find_lcb_by_bd_addr(rem_bda, transport); in L2CA_SetFixedChannelTout()
1963 if (((p_lcb) == NULL) || in L2CA_SetFixedChannelTout()
1964 (!p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL])) { in L2CA_SetFixedChannelTout()
1970 p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL] in L2CA_SetFixedChannelTout()
1973 if (p_lcb->in_use && p_lcb->link_state == LST_CONNECTED && in L2CA_SetFixedChannelTout()
1974 !p_lcb->ccb_queue.p_first_ccb) { in L2CA_SetFixedChannelTout()
1977 l2cu_no_dynamic_ccbs(p_lcb); in L2CA_SetFixedChannelTout()
2054 *handle = p_ccb->p_lcb->handle; in L2CA_GetConnectionConfig()
2075 tL2C_LCB* p_lcb; in L2CA_RegForNoCPEvt() local
2078 p_lcb = l2cu_find_lcb_by_bd_addr(p_bda, BT_TRANSPORT_BR_EDR); in L2CA_RegForNoCPEvt()
2081 if (!p_lcb) return false; in L2CA_RegForNoCPEvt()
2083 p_lcb->p_nocp_cb = p_cb; in L2CA_RegForNoCPEvt()
2176 tL2C_LCB* p_lcb; in L2CA_FlushChannel() local
2181 if (!p_ccb || (p_ccb->p_lcb == NULL)) { in L2CA_FlushChannel()
2186 p_lcb = p_ccb->p_lcb; in L2CA_FlushChannel()
2210 btsnd_hcic_enhanced_flush(p_lcb->handle, 0); in L2CA_FlushChannel()
2218 for (const list_node_t* node = list_begin(p_lcb->link_xmit_data_q); in L2CA_FlushChannel()
2219 (num_to_flush > 0) && node != list_end(p_lcb->link_xmit_data_q);) { in L2CA_FlushChannel()
2226 list_remove(p_lcb->link_xmit_data_q, p_buf); in L2CA_FlushChannel()
2246 for (const list_node_t* node = list_begin(p_lcb->link_xmit_data_q); in L2CA_FlushChannel()
2247 node != list_end(p_lcb->link_xmit_data_q); node = list_next(node)) { in L2CA_FlushChannel()