Lines Matching refs:p_lcb
131 tL2C_LCB *p_lcb; in L2CA_Deregister() local
138 p_lcb = &l2cb.lcb_pool[0]; in L2CA_Deregister()
139 for (ii = 0; ii < MAX_L2CAP_LINKS; ii++, p_lcb++) in L2CA_Deregister()
141 if (p_lcb->in_use) in L2CA_Deregister()
143 if (((p_ccb = p_lcb->ccb_queue.p_first_ccb) == NULL) in L2CA_Deregister()
144 || (p_lcb->link_state == LST_DISCONNECTING)) in L2CA_Deregister()
241 tL2C_LCB *p_lcb; in L2CA_ErtmConnectReq() local
267 if ((p_lcb = l2cu_find_lcb_by_bd_addr (p_bd_addr, BT_TRANSPORT_BR_EDR)) == NULL) in L2CA_ErtmConnectReq()
270 if ( ((p_lcb = l2cu_allocate_lcb (p_bd_addr, FALSE, BT_TRANSPORT_BR_EDR)) == NULL) in L2CA_ErtmConnectReq()
272 || (l2cu_create_conn(p_lcb, BT_TRANSPORT_BR_EDR) == FALSE) ) in L2CA_ErtmConnectReq()
274 … L2CAP_TRACE_WARNING ("L2CAP - conn not started for PSM: 0x%04x p_lcb: 0x%08x", psm, p_lcb); in L2CA_ErtmConnectReq()
280 if ((p_ccb = l2cu_allocate_ccb (p_lcb, 0)) == NULL) in L2CA_ErtmConnectReq()
311 if (p_lcb->link_state == LST_CONNECTED) in L2CA_ErtmConnectReq()
322 else if (p_lcb->link_state == LST_DISCONNECTING) in L2CA_ErtmConnectReq()
327 p_lcb->p_pending_ccb = p_ccb; in L2CA_ErtmConnectReq()
407 tL2C_LCB *p_lcb; in L2CA_ErtmConnectRsp() local
417 if ((p_lcb = l2cu_find_lcb_by_bd_addr (p_bd_addr, BT_TRANSPORT_BR_EDR)) == NULL) in L2CA_ErtmConnectRsp()
425 if ((p_ccb = l2cu_find_ccb_by_cid (p_lcb, lcid)) == NULL) in L2CA_ErtmConnectRsp()
646 tL2C_LCB *p_lcb; in L2CA_Ping() local
656 if ((p_lcb = l2cu_find_lcb_by_bd_addr (p_bd_addr, BT_TRANSPORT_BR_EDR)) == NULL) in L2CA_Ping()
659 if ((p_lcb = l2cu_allocate_lcb (p_bd_addr, FALSE, BT_TRANSPORT_BR_EDR)) == NULL) in L2CA_Ping()
664 if (l2cu_create_conn(p_lcb, BT_TRANSPORT_BR_EDR) == FALSE) in L2CA_Ping()
669 p_lcb->p_echo_rsp_cb = p_callback; in L2CA_Ping()
675 if (p_lcb->p_echo_rsp_cb != NULL) in L2CA_Ping()
682 if (p_lcb->link_state == LST_DISCONNECTING) in L2CA_Ping()
689 p_lcb->p_echo_rsp_cb = p_callback; in L2CA_Ping()
691 if (p_lcb->link_state == LST_CONNECTED) in L2CA_Ping()
693 l2cu_adj_id(p_lcb, L2CAP_ADJ_BRCM_ID); /* Make sure not using Broadcom ID */ in L2CA_Ping()
694 l2cu_send_peer_echo_req (p_lcb, NULL, 0); in L2CA_Ping()
695 btu_start_timer (&p_lcb->timer_entry, BTU_TTYPE_L2CAP_LINK, L2CAP_ECHO_RSP_TOUT); in L2CA_Ping()
713 tL2C_LCB *p_lcb; in L2CA_Echo() local
732 if ((p_lcb = l2cu_find_lcb_by_bd_addr (p_bd_addr, BT_TRANSPORT_BR_EDR)) == NULL) in L2CA_Echo()
738 if (p_lcb->link_state != LST_CONNECTED) in L2CA_Echo()
749 l2cu_adj_id(p_lcb, L2CAP_ADJ_BRCM_ID); /* Make sure not using Broadcom ID */ in L2CA_Echo()
750 l2cu_send_peer_echo_req (p_lcb, pp, p_data->len); in L2CA_Echo()
764 *handle = control_block->p_lcb->handle; in L2CA_GetIdentifiers()
791 tL2C_LCB *p_lcb; in L2CA_SetIdleTimeout() local
806 p_lcb = p_ccb->p_lcb; in L2CA_SetIdleTimeout()
808 if ((p_lcb) && (p_lcb->in_use) && (p_lcb->link_state == LST_CONNECTED)) in L2CA_SetIdleTimeout()
809 p_lcb->idle_timeout = timeout; in L2CA_SetIdleTimeout()
838 tL2C_LCB *p_lcb; in L2CA_SetIdleTimeoutByBdAddr() local
842 p_lcb = l2cu_find_lcb_by_bd_addr( bd_addr, transport); in L2CA_SetIdleTimeoutByBdAddr()
843 if ((p_lcb) && (p_lcb->in_use) && (p_lcb->link_state == LST_CONNECTED)) in L2CA_SetIdleTimeoutByBdAddr()
845 p_lcb->idle_timeout = timeout; in L2CA_SetIdleTimeoutByBdAddr()
847 if (!p_lcb->ccb_queue.p_first_ccb) in L2CA_SetIdleTimeoutByBdAddr()
848 l2cu_no_dynamic_ccbs (p_lcb); in L2CA_SetIdleTimeoutByBdAddr()
856 tL2C_LCB *p_lcb = &l2cb.lcb_pool[0]; in L2CA_SetIdleTimeoutByBdAddr() local
858 for (xx = 0; xx < MAX_L2CAP_LINKS; xx++, p_lcb++) in L2CA_SetIdleTimeoutByBdAddr()
860 if ((p_lcb->in_use) && (p_lcb->link_state == LST_CONNECTED)) in L2CA_SetIdleTimeoutByBdAddr()
862 p_lcb->idle_timeout = timeout; in L2CA_SetIdleTimeoutByBdAddr()
864 if (!p_lcb->ccb_queue.p_first_ccb) in L2CA_SetIdleTimeoutByBdAddr()
865 l2cu_no_dynamic_ccbs (p_lcb); in L2CA_SetIdleTimeoutByBdAddr()
943 tL2C_LCB *p_lcb; in L2CA_LocalLoopbackReq() local
963 if ((p_lcb = l2cu_allocate_lcb (p_bd_addr, FALSE, BT_TRANSPORT_BR_EDR)) == NULL) in L2CA_LocalLoopbackReq()
969 p_lcb->link_state = LST_CONNECTED; in L2CA_LocalLoopbackReq()
970 p_lcb->handle = handle; in L2CA_LocalLoopbackReq()
973 if ((p_ccb = l2cu_allocate_ccb (p_lcb, 0)) == NULL) in L2CA_LocalLoopbackReq()
1170 tL2C_LCB *p_lcb; in L2CA_SetFlushTimeout() local
1212 p_lcb = l2cu_find_lcb_by_bd_addr (bd_addr, BT_TRANSPORT_BR_EDR); in L2CA_SetFlushTimeout()
1214 if ((p_lcb) && (p_lcb->in_use) && (p_lcb->link_state == LST_CONNECTED)) in L2CA_SetFlushTimeout()
1216 if (p_lcb->link_flush_tout != flush_tout) in L2CA_SetFlushTimeout()
1218 p_lcb->link_flush_tout = flush_tout; in L2CA_SetFlushTimeout()
1223 if (!btsnd_hcic_write_auto_flush_tout (p_lcb->handle, hci_flush_to)) in L2CA_SetFlushTimeout()
1237 p_lcb = &l2cb.lcb_pool[0]; in L2CA_SetFlushTimeout()
1239 for (xx = 0; xx < MAX_L2CAP_LINKS; xx++, p_lcb++) in L2CA_SetFlushTimeout()
1241 if ((p_lcb->in_use) && (p_lcb->link_state == LST_CONNECTED)) in L2CA_SetFlushTimeout()
1243 if (p_lcb->link_flush_tout != flush_tout) in L2CA_SetFlushTimeout()
1245 p_lcb->link_flush_tout = flush_tout; in L2CA_SetFlushTimeout()
1248 flush_tout, p_lcb->remote_bd_addr[3], in L2CA_SetFlushTimeout()
1249 p_lcb->remote_bd_addr[4], p_lcb->remote_bd_addr[5]); in L2CA_SetFlushTimeout()
1251 if (!btsnd_hcic_write_auto_flush_tout(p_lcb->handle, hci_flush_to)) in L2CA_SetFlushTimeout()
1275 tL2C_LCB *p_lcb; in L2CA_GetPeerFeatures() local
1278 if ((p_lcb = l2cu_find_lcb_by_bd_addr (bd_addr, BT_TRANSPORT_BR_EDR)) == NULL) in L2CA_GetPeerFeatures()
1288 (bd_addr[4]<<8)+bd_addr[5], p_lcb->peer_ext_fea, p_lcb->peer_chnl_mask[0]); in L2CA_GetPeerFeatures()
1290 *p_ext_feat = p_lcb->peer_ext_fea; in L2CA_GetPeerFeatures()
1292 memcpy (p_chnl_mask, p_lcb->peer_chnl_mask, L2CAP_FIXED_CHNL_ARRAY_SIZE); in L2CA_GetPeerFeatures()
1311 tL2C_LCB *p_lcb = NULL; in L2CA_GetBDAddrbyHandle() local
1314 p_lcb = l2cu_find_lcb_by_handle (handle); in L2CA_GetBDAddrbyHandle()
1315 if (p_lcb) in L2CA_GetBDAddrbyHandle()
1318 memcpy (bd_addr, p_lcb->remote_bd_addr, BD_ADDR_LEN); in L2CA_GetBDAddrbyHandle()
1389 tL2C_LCB *p_lcb; in L2CA_ConnectFixedChnl() local
1418 if ((p_lcb = l2cu_find_lcb_by_bd_addr (rem_bda, transport)) != NULL) in L2CA_ConnectFixedChnl()
1428 peer_channel_mask = p_lcb->peer_chnl_mask[0]; in L2CA_ConnectFixedChnl()
1440 if (!l2cu_initialize_fixed_ccb (p_lcb, fixed_cid, in L2CA_ConnectFixedChnl()
1448 if (p_lcb->link_state == LST_DISCONNECTING) in L2CA_ConnectFixedChnl()
1452 p_lcb->p_pending_ccb = p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]; in L2CA_ConnectFixedChnl()
1458 (fixed_cid,p_lcb->remote_bd_addr, TRUE, 0, p_lcb->transport); in L2CA_ConnectFixedChnl()
1461 (fixed_cid, p_lcb->remote_bd_addr, TRUE, 0, BT_TRANSPORT_BR_EDR); in L2CA_ConnectFixedChnl()
1467 if ((p_lcb = l2cu_allocate_lcb (rem_bda, FALSE, transport)) == NULL) in L2CA_ConnectFixedChnl()
1474 if (!l2cu_initialize_fixed_ccb (p_lcb, fixed_cid, in L2CA_ConnectFixedChnl()
1477 p_lcb->disc_reason = L2CAP_CONN_NO_RESOURCES; in L2CA_ConnectFixedChnl()
1479 l2cu_release_lcb (p_lcb); in L2CA_ConnectFixedChnl()
1483 if (!l2cu_create_conn(p_lcb, transport)) in L2CA_ConnectFixedChnl()
1486 l2cu_release_lcb (p_lcb); in L2CA_ConnectFixedChnl()
1508 tL2C_LCB *p_lcb; in L2CA_SendFixedChnlData() local
1537 if ((p_lcb = l2cu_find_lcb_by_bd_addr (rem_bda, transport)) == NULL || in L2CA_SendFixedChnlData()
1539 p_lcb->link_state == LST_DISCONNECTING) in L2CA_SendFixedChnlData()
1554 peer_channel_mask = p_lcb->peer_chnl_mask[0]; in L2CA_SendFixedChnlData()
1566 if (!p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]) in L2CA_SendFixedChnlData()
1568 …if (!l2cu_initialize_fixed_ccb (p_lcb, fixed_cid, &l2cb.fixed_reg[fixed_cid - L2CAP_FIRST_FIXED_CH… in L2CA_SendFixedChnlData()
1577 if (p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->cong_sent) in L2CA_SendFixedChnlData()
1581 GKI_queue_length(&p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->xmit_hold_q), in L2CA_SendFixedChnlData()
1582 p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->buff_quota); in L2CA_SendFixedChnlData()
1587 l2c_enqueue_peer_data (p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL], p_buf); in L2CA_SendFixedChnlData()
1589 l2c_link_check_send_pkts (p_lcb, NULL, NULL); in L2CA_SendFixedChnlData()
1592 if (p_lcb->in_use && p_lcb->link_state == LST_CONNECTED && !p_lcb->ccb_queue.p_first_ccb) in L2CA_SendFixedChnlData()
1594 l2cu_no_dynamic_ccbs (p_lcb); in L2CA_SendFixedChnlData()
1597 if (p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->cong_sent) in L2CA_SendFixedChnlData()
1618 tL2C_LCB *p_lcb; in L2CA_RemoveFixedChnl() local
1636 p_lcb = l2cu_find_lcb_by_bd_addr (rem_bda, transport); in L2CA_RemoveFixedChnl()
1638 if ( ((p_lcb) == NULL) || (!p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]) ) in L2CA_RemoveFixedChnl()
1649 p_ccb = p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]; in L2CA_RemoveFixedChnl()
1651 p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL] = NULL; in L2CA_RemoveFixedChnl()
1652 p_lcb->disc_reason = HCI_ERR_CONN_CAUSE_LOCAL_HOST; in L2CA_RemoveFixedChnl()
1661 if ((fixed_cid == L2CAP_ATT_CID ) && !p_lcb->ccb_queue.p_first_ccb) in L2CA_RemoveFixedChnl()
1662 p_lcb->idle_timeout = 0; in L2CA_RemoveFixedChnl()
1689 tL2C_LCB *p_lcb; in L2CA_SetFixedChannelTout() local
1698 p_lcb = l2cu_find_lcb_by_bd_addr (rem_bda, transport); in L2CA_SetFixedChannelTout()
1699 if ( ((p_lcb) == NULL) || (!p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]) ) in L2CA_SetFixedChannelTout()
1706 p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->fixed_chnl_idle_tout = idle_tout; in L2CA_SetFixedChannelTout()
1708 if (p_lcb->in_use && p_lcb->link_state == LST_CONNECTED && !p_lcb->ccb_queue.p_first_ccb) in L2CA_SetFixedChannelTout()
1711 l2cu_no_dynamic_ccbs (p_lcb); in L2CA_SetFixedChannelTout()
1787 tL2C_LCB *p_lcb; in L2CA_RegForNoCPEvt() local
1790 p_lcb = l2cu_find_lcb_by_bd_addr (p_bda, BT_TRANSPORT_BR_EDR); in L2CA_RegForNoCPEvt()
1793 if (!p_lcb) in L2CA_RegForNoCPEvt()
1796 p_lcb->p_nocp_cb = p_cb; in L2CA_RegForNoCPEvt()
1889 tL2C_LCB *p_lcb; in L2CA_FlushChannel() local
1896 if ( !p_ccb || ((p_lcb = p_ccb->p_lcb) == NULL) ) in L2CA_FlushChannel()
1927 btsnd_hcic_enhanced_flush (p_lcb->handle, 0); in L2CA_FlushChannel()
1935 for (const list_node_t *node = list_begin(p_lcb->link_xmit_data_q); in L2CA_FlushChannel()
1936 (num_to_flush > 0) && node != list_end(p_lcb->link_xmit_data_q);) { in L2CA_FlushChannel()
1943 list_remove(p_lcb->link_xmit_data_q, p_buf); in L2CA_FlushChannel()
1964 for (const list_node_t *node = list_begin(p_lcb->link_xmit_data_q); in L2CA_FlushChannel()
1965 node != list_end(p_lcb->link_xmit_data_q); in L2CA_FlushChannel()