Lines Matching refs:p_ccb
127 tL2C_CCB* p_ccb; in L2CA_Deregister() local
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()
143 if ((p_ccb->in_use) && in L2CA_Deregister()
144 ((p_ccb->chnl_state == CST_W4_L2CAP_DISCONNECT_RSP) || in L2CA_Deregister()
145 (p_ccb->chnl_state == CST_W4_L2CA_DISCONNECT_RSP))) { in L2CA_Deregister()
149 if (p_ccb->p_rcb == p_rcb) { in L2CA_Deregister()
150 l2c_csm_execute(p_ccb, L2CEVT_L2CA_DISCONNECT_REQ, NULL); in L2CA_Deregister()
335 tL2C_CCB* p_ccb = l2cu_allocate_ccb(p_lcb, 0); in L2CA_ErtmConnectReq() local
336 if (p_ccb == nullptr) { in L2CA_ErtmConnectReq()
342 p_ccb->p_rcb = p_rcb; in L2CA_ErtmConnectReq()
345 p_ccb->ertm_info = *p_ertm_info; in L2CA_ErtmConnectReq()
348 if (p_ccb->ertm_info.fcr_rx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE) in L2CA_ErtmConnectReq()
349 p_ccb->ertm_info.fcr_rx_buf_size = L2CAP_FCR_RX_BUF_SIZE; in L2CA_ErtmConnectReq()
351 if (p_ccb->ertm_info.fcr_tx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE) in L2CA_ErtmConnectReq()
352 p_ccb->ertm_info.fcr_tx_buf_size = L2CAP_FCR_TX_BUF_SIZE; in L2CA_ErtmConnectReq()
354 if (p_ccb->ertm_info.user_rx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE) in L2CA_ErtmConnectReq()
355 p_ccb->ertm_info.user_rx_buf_size = L2CAP_USER_RX_BUF_SIZE; in L2CA_ErtmConnectReq()
357 if (p_ccb->ertm_info.user_tx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE) in L2CA_ErtmConnectReq()
358 p_ccb->ertm_info.user_tx_buf_size = L2CAP_USER_TX_BUF_SIZE; in L2CA_ErtmConnectReq()
360 p_ccb->max_rx_mtu = in L2CA_ErtmConnectReq()
367 l2c_csm_execute(p_ccb, L2CEVT_L2CA_CONNECT_REQ, nullptr); in L2CA_ErtmConnectReq()
378 p_lcb->p_pending_ccb = p_ccb; in L2CA_ErtmConnectReq()
382 psm, p_ccb->local_cid); in L2CA_ErtmConnectReq()
385 return p_ccb->local_cid; in L2CA_ErtmConnectReq()
480 tL2C_CCB* p_ccb = p_lcb->ccb_queue.p_first_ccb; in L2CA_DeregisterLECoc() local
481 if ((p_ccb == NULL) || (p_lcb->link_state == LST_DISCONNECTING)) continue; in L2CA_DeregisterLECoc()
483 if (p_ccb->in_use && (p_ccb->chnl_state == CST_W4_L2CAP_DISCONNECT_RSP || in L2CA_DeregisterLECoc()
484 p_ccb->chnl_state == CST_W4_L2CA_DISCONNECT_RSP)) in L2CA_DeregisterLECoc()
487 if (p_ccb->p_rcb == p_rcb) in L2CA_DeregisterLECoc()
488 l2c_csm_execute(p_ccb, L2CEVT_L2CA_DISCONNECT_REQ, NULL); in L2CA_DeregisterLECoc()
544 tL2C_CCB* p_ccb = l2cu_allocate_ccb(p_lcb, 0); in L2CA_ConnectLECocReq() local
545 if (p_ccb == NULL) { in L2CA_ConnectLECocReq()
551 p_ccb->p_rcb = p_rcb; in L2CA_ConnectLECocReq()
555 memcpy(&p_ccb->local_conn_cfg, p_cfg, sizeof(tL2CAP_LE_CFG_INFO)); in L2CA_ConnectLECocReq()
556 p_ccb->remote_credit_count = p_cfg->credits; in L2CA_ConnectLECocReq()
561 if (p_ccb->p_lcb->transport == BT_TRANSPORT_LE) { in L2CA_ConnectLECocReq()
563 l2c_csm_execute(p_ccb, L2CEVT_L2CA_CONNECT_REQ, NULL); in L2CA_ConnectLECocReq()
577 p_lcb->p_pending_ccb = p_ccb; in L2CA_ConnectLECocReq()
581 p_ccb->local_cid); in L2CA_ConnectLECocReq()
584 return p_ccb->local_cid; in L2CA_ConnectLECocReq()
614 tL2C_CCB* p_ccb = l2cu_find_ccb_by_cid(p_lcb, lcid); in L2CA_ConnectLECocRsp() local
615 if (p_ccb == NULL) { in L2CA_ConnectLECocRsp()
621 if (p_ccb->remote_id != id) { in L2CA_ConnectLECocRsp()
623 p_ccb->remote_id, id); in L2CA_ConnectLECocRsp()
628 memcpy(&p_ccb->local_conn_cfg, p_cfg, sizeof(tL2CAP_LE_CFG_INFO)); in L2CA_ConnectLECocRsp()
629 p_ccb->remote_credit_count = p_cfg->credits; in L2CA_ConnectLECocRsp()
633 l2c_csm_execute(p_ccb, L2CEVT_L2CA_CONNECT_RSP, NULL); in L2CA_ConnectLECocRsp()
639 l2c_csm_execute(p_ccb, L2CEVT_L2CA_CONNECT_RSP_NEG, &conn_info); in L2CA_ConnectLECocRsp()
661 tL2C_CCB* p_ccb = l2cu_find_ccb_by_cid(NULL, lcid); in L2CA_GetPeerLECocConfig() local
662 if (p_ccb == NULL) { in L2CA_GetPeerLECocConfig()
668 memcpy(peer_cfg, &p_ccb->peer_conn_cfg, sizeof(tL2CAP_LE_CFG_INFO)); in L2CA_GetPeerLECocConfig()
742 tL2C_CCB* p_ccb; in L2CA_ErtmConnectRsp() local
757 p_ccb = l2cu_find_ccb_by_cid(p_lcb, lcid); in L2CA_ErtmConnectRsp()
758 if (p_ccb == NULL) { in L2CA_ErtmConnectRsp()
764 if (p_ccb->remote_id != id) { in L2CA_ErtmConnectRsp()
766 p_ccb->remote_id, id); in L2CA_ErtmConnectRsp()
771 p_ccb->ertm_info = *p_ertm_info; in L2CA_ErtmConnectRsp()
774 if (p_ccb->ertm_info.fcr_rx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE) in L2CA_ErtmConnectRsp()
775 p_ccb->ertm_info.fcr_rx_buf_size = L2CAP_FCR_RX_BUF_SIZE; in L2CA_ErtmConnectRsp()
777 if (p_ccb->ertm_info.fcr_tx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE) in L2CA_ErtmConnectRsp()
778 p_ccb->ertm_info.fcr_tx_buf_size = L2CAP_FCR_TX_BUF_SIZE; in L2CA_ErtmConnectRsp()
780 if (p_ccb->ertm_info.user_rx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE) in L2CA_ErtmConnectRsp()
781 p_ccb->ertm_info.user_rx_buf_size = L2CAP_USER_RX_BUF_SIZE; in L2CA_ErtmConnectRsp()
783 if (p_ccb->ertm_info.user_tx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE) in L2CA_ErtmConnectRsp()
784 p_ccb->ertm_info.user_tx_buf_size = L2CAP_USER_TX_BUF_SIZE; in L2CA_ErtmConnectRsp()
786 p_ccb->max_rx_mtu = in L2CA_ErtmConnectRsp()
792 l2c_csm_execute(p_ccb, L2CEVT_L2CA_CONNECT_RSP, NULL); in L2CA_ErtmConnectRsp()
800 l2c_csm_execute(p_ccb, L2CEVT_L2CA_CONNECT_RSP, &conn_info); in L2CA_ErtmConnectRsp()
802 l2c_csm_execute(p_ccb, L2CEVT_L2CA_CONNECT_RSP_NEG, &conn_info); in L2CA_ErtmConnectRsp()
820 tL2C_CCB* p_ccb; in L2CA_ConfigReq() local
828 p_ccb = l2cu_find_ccb_by_cid(NULL, cid); in L2CA_ConfigReq()
829 if (p_ccb == NULL) { in L2CA_ConfigReq()
835 if (!l2c_fcr_adj_our_req_options(p_ccb, p_cfg)) return (false); in L2CA_ConfigReq()
851 p_ccb->our_cfg = *p_cfg; in L2CA_ConfigReq()
853 l2c_csm_execute(p_ccb, L2CEVT_L2CA_CONFIG_REQ, p_cfg); in L2CA_ConfigReq()
869 tL2C_CCB* p_ccb; in L2CA_ConfigRsp() local
878 p_ccb = l2cu_find_ccb_by_cid(NULL, cid); in L2CA_ConfigRsp()
879 if (p_ccb == NULL) { in L2CA_ConfigRsp()
885 l2c_csm_execute(p_ccb, L2CEVT_L2CA_CONFIG_RSP, p_cfg); in L2CA_ConfigRsp()
892 if (p_cfg->mtu_present) p_ccb->peer_cfg.mtu_present = false; in L2CA_ConfigRsp()
893 if (p_cfg->flush_to_present) p_ccb->peer_cfg.flush_to_present = false; in L2CA_ConfigRsp()
894 if (p_cfg->qos_present) p_ccb->peer_cfg.qos_present = false; in L2CA_ConfigRsp()
896 l2c_csm_execute(p_ccb, L2CEVT_L2CA_CONFIG_RSP_NEG, p_cfg); in L2CA_ConfigRsp()
912 tL2C_CCB* p_ccb; in L2CA_DisconnectReq() local
917 p_ccb = l2cu_find_ccb_by_cid(NULL, cid); in L2CA_DisconnectReq()
918 if (p_ccb == NULL) { in L2CA_DisconnectReq()
923 l2c_csm_execute(p_ccb, L2CEVT_L2CA_DISCONNECT_REQ, NULL); in L2CA_DisconnectReq()
939 tL2C_CCB* p_ccb; in L2CA_DisconnectRsp() local
944 p_ccb = l2cu_find_ccb_by_cid(NULL, cid); in L2CA_DisconnectRsp()
945 if (p_ccb == NULL) { in L2CA_DisconnectRsp()
950 l2c_csm_execute(p_ccb, L2CEVT_L2CA_DISCONNECT_RSP, NULL); in L2CA_DisconnectRsp()
1097 tL2C_CCB* p_ccb; in L2CA_SetIdleTimeout() local
1104 p_ccb = l2cu_find_ccb_by_cid(NULL, cid); in L2CA_SetIdleTimeout()
1105 if (p_ccb == NULL) { in L2CA_SetIdleTimeout()
1111 p_lcb = p_ccb->p_lcb; in L2CA_SetIdleTimeout()
1234 tL2C_CCB* p_ccb; in L2CA_LocalLoopbackReq() local
1263 p_ccb = l2cu_allocate_ccb(p_lcb, 0); in L2CA_LocalLoopbackReq()
1264 if (p_ccb == NULL) { in L2CA_LocalLoopbackReq()
1270 p_ccb->p_rcb = p_rcb; in L2CA_LocalLoopbackReq()
1271 p_ccb->chnl_state = CST_OPEN; in L2CA_LocalLoopbackReq()
1272 p_ccb->remote_cid = p_ccb->local_cid; in L2CA_LocalLoopbackReq()
1273 p_ccb->config_done = CFG_DONE_MASK; in L2CA_LocalLoopbackReq()
1276 return (p_ccb->local_cid); in L2CA_LocalLoopbackReq()
1308 tL2C_CCB* p_ccb; in L2CA_FlowControl() local
1314 p_ccb = l2cu_find_ccb_by_cid(NULL, cid); in L2CA_FlowControl()
1315 if (p_ccb == NULL) { in L2CA_FlowControl()
1322 if (p_ccb->peer_cfg.fcr.mode != L2CAP_FCR_ERTM_MODE) { in L2CA_FlowControl()
1324 p_ccb->peer_cfg.fcr.mode); in L2CA_FlowControl()
1327 if (p_ccb->fcrb.local_busy != on_off) { in L2CA_FlowControl()
1328 p_ccb->fcrb.local_busy = on_off; in L2CA_FlowControl()
1330 if ((p_ccb->chnl_state == CST_OPEN) && (!p_ccb->fcrb.wait_ack)) { in L2CA_FlowControl()
1332 l2c_fcr_send_S_frame(p_ccb, L2CAP_FCR_SUP_RNR, 0); in L2CA_FlowControl()
1334 l2c_fcr_send_S_frame(p_ccb, L2CAP_FCR_SUP_RR, L2CAP_FCR_P_BIT); in L2CA_FlowControl()
1351 tL2C_CCB* p_ccb; in L2CA_SendTestSFrame() local
1358 p_ccb = l2cu_find_ccb_by_cid(NULL, cid); in L2CA_SendTestSFrame()
1359 if (p_ccb == NULL) { in L2CA_SendTestSFrame()
1364 if ((p_ccb->chnl_state != CST_OPEN) || in L2CA_SendTestSFrame()
1365 (p_ccb->peer_cfg.fcr.mode != L2CAP_FCR_ERTM_MODE)) in L2CA_SendTestSFrame()
1368 p_ccb->fcrb.next_seq_expected -= back_track; in L2CA_SendTestSFrame()
1371 p_ccb, (uint16_t)(sup_type & 3), in L2CA_SendTestSFrame()
1387 tL2C_CCB* p_ccb; in L2CA_SetTxPriority() local
1393 p_ccb = l2cu_find_ccb_by_cid(NULL, cid); in L2CA_SetTxPriority()
1394 if (p_ccb == NULL) { in L2CA_SetTxPriority()
1401 l2cu_change_pri_ccb(p_ccb, priority); in L2CA_SetTxPriority()
1417 tL2C_CCB* p_ccb; in L2CA_SetChnlDataRate() local
1423 p_ccb = l2cu_find_ccb_by_cid(NULL, cid); in L2CA_SetChnlDataRate()
1424 if (p_ccb == NULL) { in L2CA_SetChnlDataRate()
1430 p_ccb->tx_data_rate = tx; in L2CA_SetChnlDataRate()
1431 p_ccb->rx_data_rate = rx; in L2CA_SetChnlDataRate()
1605 tL2C_CCB* p_ccb = l2cu_find_ccb_by_cid(NULL, lcid); in L2CA_GetChnlFcrMode() local
1607 if (p_ccb) { in L2CA_GetChnlFcrMode()
1609 p_ccb->peer_cfg.fcr.mode); in L2CA_GetChnlFcrMode()
1610 return (p_ccb->peer_cfg.fcr.mode); in L2CA_GetChnlFcrMode()
1889 tL2C_CCB* p_ccb; in L2CA_RemoveFixedChnl() local
1919 p_ccb = p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]; in L2CA_RemoveFixedChnl()
1933 l2cu_release_ccb(p_ccb); in L2CA_RemoveFixedChnl()
2002 tL2C_CCB* p_ccb; in L2CA_GetCurrentConfig() local
2006 p_ccb = l2cu_find_ccb_by_cid(NULL, lcid); in L2CA_GetCurrentConfig()
2008 if (p_ccb) { in L2CA_GetCurrentConfig()
2009 *pp_our_cfg = &(p_ccb->our_cfg); in L2CA_GetCurrentConfig()
2013 if (p_ccb->our_cfg.mtu_present) *p_our_cfg_bits |= L2CAP_CH_CFG_MASK_MTU; in L2CA_GetCurrentConfig()
2014 if (p_ccb->our_cfg.qos_present) *p_our_cfg_bits |= L2CAP_CH_CFG_MASK_QOS; in L2CA_GetCurrentConfig()
2015 if (p_ccb->our_cfg.flush_to_present) in L2CA_GetCurrentConfig()
2017 if (p_ccb->our_cfg.fcr_present) *p_our_cfg_bits |= L2CAP_CH_CFG_MASK_FCR; in L2CA_GetCurrentConfig()
2018 if (p_ccb->our_cfg.fcs_present) *p_our_cfg_bits |= L2CAP_CH_CFG_MASK_FCS; in L2CA_GetCurrentConfig()
2019 if (p_ccb->our_cfg.ext_flow_spec_present) in L2CA_GetCurrentConfig()
2022 *pp_peer_cfg = &(p_ccb->peer_cfg); in L2CA_GetCurrentConfig()
2023 *p_peer_cfg_bits = p_ccb->peer_cfg_bits; in L2CA_GetCurrentConfig()
2044 tL2C_CCB* p_ccb = l2cu_find_ccb_by_cid(NULL, lcid); in L2CA_GetConnectionConfig() local
2049 if (p_ccb) { in L2CA_GetConnectionConfig()
2051 if (p_ccb->our_cfg.mtu_present) *mtu = p_ccb->our_cfg.mtu; in L2CA_GetConnectionConfig()
2053 *rcid = p_ccb->remote_cid; in L2CA_GetConnectionConfig()
2054 *handle = p_ccb->p_lcb->handle; in L2CA_GetConnectionConfig()
2118 tL2C_CCB* p_ccb; in L2CA_SetChnlFlushability() local
2121 p_ccb = l2cu_find_ccb_by_cid(NULL, cid); in L2CA_SetChnlFlushability()
2122 if (p_ccb == NULL) { in L2CA_SetChnlFlushability()
2128 p_ccb->is_flushable = is_flushable; in L2CA_SetChnlFlushability()
2175 tL2C_CCB* p_ccb; in L2CA_FlushChannel() local
2179 p_ccb = l2cu_find_ccb_by_cid(NULL, lcid); in L2CA_FlushChannel()
2181 if (!p_ccb || (p_ccb->p_lcb == NULL)) { in L2CA_FlushChannel()
2186 p_lcb = p_ccb->p_lcb; in L2CA_FlushChannel()
2192 lcid, num_to_flush, fixed_queue_length(p_ccb->xmit_hold_q), in L2CA_FlushChannel()
2193 fixed_queue_try_peek_first(p_ccb->xmit_hold_q)); in L2CA_FlushChannel()
2199 if (p_ccb->peer_cfg.fcr.mode != L2CAP_FCR_ERTM_MODE) { in L2CA_FlushChannel()
2233 while ((num_to_flush != 0) && (!fixed_queue_is_empty(p_ccb->xmit_hold_q))) { in L2CA_FlushChannel()
2234 BT_HDR* p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_ccb->xmit_hold_q); in L2CA_FlushChannel()
2241 if ((p_ccb->p_rcb) && (p_ccb->p_rcb->api.pL2CA_TxComplete_Cb) && in L2CA_FlushChannel()
2243 (*p_ccb->p_rcb->api.pL2CA_TxComplete_Cb)(p_ccb->local_cid, num_flushed2); in L2CA_FlushChannel()
2253 num_left += fixed_queue_length(p_ccb->xmit_hold_q); in L2CA_FlushChannel()
2260 l2cu_check_channel_congestion(p_ccb); in L2CA_FlushChannel()