Lines Matching defs:p_ccb

267     tL2C_CCB    *p_ccb;
297 p_ccb = l2cb.ccb_pool;
300 if (( p_ccb->in_use )
301 &&( p_ccb->local_cid == L2CAP_CONNECTIONLESS_CID ))
303 l2cu_release_ccb (p_ccb);
305 p_ccb++;
329 tL2C_CCB *p_ccb;
347 ||((p_ccb = l2cu_find_ccb_by_cid (p_lcb, L2CAP_CONNECTIONLESS_CID)) == NULL))
366 if (!p_ccb)
368 p_ccb = l2cu_find_ccb_by_cid (p_lcb, L2CAP_CONNECTIONLESS_CID);
370 l2c_ucd_check_pending_info_req(p_ccb);
395 tL2C_CCB *p_ccb;
415 ||((p_ccb = l2cu_find_ccb_by_cid (p_lcb, L2CAP_CONNECTIONLESS_CID)) == NULL))
425 || ((p_ccb = l2cu_find_ccb_by_cid (p_lcb, L2CAP_CONNECTIONLESS_CID)) == NULL))
448 if (p_ccb->cong_sent)
452 (p_ccb->xmit_hold_q.count + p_lcb->ucd_out_sec_pending_q.count),
453 p_ccb->buff_quota);
462 l2c_csm_execute (p_ccb, L2CEVT_L2CA_DATA_WRITE, p_buf);
464 if (p_ccb->cong_sent)
485 tL2C_CCB *p_ccb;
494 ||((p_ccb = l2cu_find_ccb_by_cid (p_lcb, L2CAP_CONNECTIONLESS_CID)) == NULL))
501 p_ccb->fixed_chnl_idle_tout = timeout;
518 tL2C_CCB *p_ccb;
531 if ((p_ccb = l2cu_find_ccb_by_cid (p_lcb, L2CAP_CONNECTIONLESS_CID)) == NULL)
538 l2cu_change_pri_ccb (p_ccb, priority);
557 tL2C_CCB *p_ccb;
592 if ((p_ccb = l2cu_find_ccb_by_cid (p_lcb, L2CAP_CONNECTIONLESS_CID)) == NULL)
595 if ((p_ccb = l2cu_allocate_ccb (p_lcb, 0)) == NULL)
603 p_ccb->local_cid = L2CAP_CONNECTIONLESS_CID;
604 p_ccb->remote_cid = L2CAP_CONNECTIONLESS_CID;
607 p_ccb->fixed_chnl_idle_tout = L2CAP_UCD_IDLE_TIMEOUT;
610 l2cu_change_pri_ccb (p_ccb, L2CAP_UCD_CH_PRIORITY);
618 p_ccb->p_rcb = p_rcb;
623 p_ccb->chnl_state = CST_OPEN;
659 BOOLEAN l2c_ucd_check_pending_info_req(tL2C_CCB *p_ccb)
665 if (p_ccb == NULL)
667 L2CAP_TRACE_ERROR ("L2CAP - NULL p_ccb in l2c_ucd_check_pending_info_req");
679 if ( p_ccb->p_lcb->info_rx_bits & (1 << L2CAP_EXTENDED_FEATURES_INFO_TYPE) )
681 if (!(p_ccb->p_lcb->peer_ext_fea & L2CAP_EXTFEA_UCD_RECEPTION))
685 l2c_ucd_delete_sec_pending_q(p_ccb->p_lcb);
686 l2cu_release_ccb (p_ccb);
689 p_ccb->p_rcb->ucd.cb_info.pL2CA_UCD_Discover_Cb (p_ccb->p_lcb->remote_bd_addr,
691 p_ccb->p_lcb->peer_ext_fea & L2CAP_EXTFEA_UCD_RECEPTION);
696 if (p_ccb->p_lcb->w4_info_rsp == FALSE)
698 l2cu_send_peer_info_req (p_ccb->p_lcb, L2CAP_EXTENDED_FEATURES_INFO_TYPE);
707 if ( p_ccb->p_lcb->info_rx_bits & (1 << L2CAP_CONNLESS_MTU_INFO_TYPE))
709 p_ccb->p_rcb->ucd.cb_info.pL2CA_UCD_Discover_Cb (p_ccb->p_lcb->remote_bd_addr,
711 p_ccb->p_lcb->ucd_mtu);
716 if (p_ccb->p_lcb->w4_info_rsp == FALSE)
718 l2cu_send_peer_info_req (p_ccb->p_lcb, L2CAP_CONNLESS_MTU_INFO_TYPE);
737 void l2c_ucd_enqueue_pending_out_sec_q(tL2C_CCB *p_ccb, void *p_data)
739 GKI_enqueue (&p_ccb->p_lcb->ucd_out_sec_pending_q, p_data);
740 l2cu_check_channel_congestion (p_ccb);
752 BOOLEAN l2c_ucd_check_pending_out_sec_q(tL2C_CCB *p_ccb)
758 if ( p_ccb->p_lcb->ucd_out_sec_pending_q.count )
760 p_buf = (BT_HDR*)(p_ccb->p_lcb->ucd_out_sec_pending_q.p_first);
764 p_ccb->chnl_state = CST_ORIG_W4_SEC_COMP;
765 btm_sec_l2cap_access_req (p_ccb->p_lcb->remote_bd_addr, psm,
766 p_ccb->p_lcb->handle, CONNLESS_ORIG, &l2c_link_sec_comp, p_ccb);
783 void l2c_ucd_send_pending_out_sec_q(tL2C_CCB *p_ccb)
787 if ( p_ccb->p_lcb->ucd_out_sec_pending_q.count )
789 p_buf = (BT_HDR*)GKI_dequeue (&p_ccb->p_lcb->ucd_out_sec_pending_q);
791 l2c_enqueue_peer_data (p_ccb, (BT_HDR *)p_buf);
792 l2c_link_check_send_pkts (p_ccb->p_lcb, NULL, NULL);
806 void l2c_ucd_discard_pending_out_sec_q(tL2C_CCB *p_ccb)
810 p_buf = (BT_HDR*)GKI_dequeue (&p_ccb->p_lcb->ucd_out_sec_pending_q);
829 BOOLEAN l2c_ucd_check_pending_in_sec_q(tL2C_CCB *p_ccb)
835 if ( p_ccb->p_lcb->ucd_in_sec_pending_q.count )
837 p_buf = (BT_HDR*)(p_ccb->p_lcb->ucd_in_sec_pending_q.p_first);
841 p_ccb->chnl_state = CST_TERM_W4_SEC_COMP;
842 btm_sec_l2cap_access_req (p_ccb->p_lcb->remote_bd_addr, psm,
843 p_ccb->p_lcb->handle, CONNLESS_TERM, &l2c_link_sec_comp, p_ccb);
860 void l2c_ucd_send_pending_in_sec_q(tL2C_CCB *p_ccb)
864 if ( p_ccb->p_lcb->ucd_in_sec_pending_q.count )
866 p_buf = (BT_HDR*)GKI_dequeue (&p_ccb->p_lcb->ucd_in_sec_pending_q);
868 p_ccb->p_rcb->ucd.cb_info.pL2CA_UCD_Data_Cb(p_ccb->p_lcb->remote_bd_addr, (BT_HDR *)p_buf);
882 void l2c_ucd_discard_pending_in_sec_q(tL2C_CCB *p_ccb)
886 p_buf = (BT_HDR*)GKI_dequeue (&p_ccb->p_lcb->ucd_in_sec_pending_q);
906 tL2C_CCB *p_ccb;
909 if (((p_ccb = l2cu_find_ccb_by_cid (p_lcb, L2CAP_CONNECTIONLESS_CID)) != NULL)
912 if (p_ccb == NULL)
915 if ((p_ccb = l2cu_allocate_ccb (p_lcb, 0)) == NULL)
924 p_ccb->local_cid = L2CAP_CONNECTIONLESS_CID;
925 p_ccb->remote_cid = L2CAP_CONNECTIONLESS_CID;
928 p_ccb->fixed_chnl_idle_tout = L2CAP_UCD_IDLE_TIMEOUT;
931 l2cu_change_pri_ccb (p_ccb, L2CAP_UCD_CH_PRIORITY);
934 p_ccb->p_rcb = p_rcb;
936 p_ccb->chnl_state = CST_OPEN;
939 l2c_csm_execute(p_ccb, L2CEVT_L2CAP_DATA, p_msg);
957 BOOLEAN l2c_ucd_process_event(tL2C_CCB *p_ccb, UINT16 event, void *p_data)
962 switch (p_ccb->chnl_state)
969 if (!l2c_ucd_check_pending_info_req (p_ccb))
972 if (!l2c_ucd_check_pending_out_sec_q(p_ccb))
974 p_ccb->chnl_state = CST_OPEN;
980 GKI_enqueue (&p_ccb->p_lcb->ucd_in_sec_pending_q, p_data);
984 l2c_ucd_enqueue_pending_out_sec_q(p_ccb, p_data);
989 if (!l2c_ucd_check_pending_info_req (p_ccb))
992 if (!l2c_ucd_check_pending_out_sec_q(p_ccb))
994 p_ccb->chnl_state = CST_OPEN;
1010 if (!l2c_ucd_check_pending_out_sec_q(p_ccb))
1012 p_ccb->chnl_state = CST_OPEN;
1017 p_ccb->chnl_state = CST_OPEN;
1018 l2c_ucd_send_pending_out_sec_q(p_ccb);
1020 if ( p_ccb->p_lcb->ucd_out_sec_pending_q.count )
1024 btu_start_timer (&p_ccb->timer_entry, BTU_TTYPE_L2CAP_CHNL, 0);
1029 btu_start_timer (&p_ccb->timer_entry, BTU_TTYPE_L2CAP_CHNL, p_ccb->fixed_chnl_idle_tout);
1034 p_ccb->chnl_state = CST_OPEN;
1035 l2c_ucd_discard_pending_out_sec_q(p_ccb);
1038 btu_start_timer (&p_ccb->timer_entry, BTU_TTYPE_L2CAP_CHNL, p_ccb->fixed_chnl_idle_tout);
1042 l2c_ucd_enqueue_pending_out_sec_q(p_ccb, p_data);
1046 GKI_enqueue (&p_ccb->p_lcb->ucd_in_sec_pending_q, p_data);
1051 l2c_ucd_check_pending_info_req (p_ccb);
1065 p_ccb->chnl_state = CST_OPEN;
1066 l2c_ucd_send_pending_in_sec_q (p_ccb);
1068 if ( p_ccb->p_lcb->ucd_in_sec_pending_q.count )
1072 btu_start_timer (&p_ccb->timer_entry, BTU_TTYPE_L2CAP_CHNL, 0);
1077 btu_start_timer (&p_ccb->timer_entry, BTU_TTYPE_L2CAP_CHNL, p_ccb->fixed_chnl_idle_tout);
1087 p_ccb->chnl_state = CST_OPEN;
1088 l2c_ucd_discard_pending_in_sec_q (p_ccb);
1091 btu_start_timer (&p_ccb->timer_entry, BTU_TTYPE_L2CAP_CHNL, p_ccb->fixed_chnl_idle_tout);
1095 l2c_ucd_enqueue_pending_out_sec_q(p_ccb, p_data);
1099 GKI_enqueue (&p_ccb->p_lcb->ucd_in_sec_pending_q, p_data);
1104 if (!l2c_ucd_check_pending_in_sec_q(p_ccb))
1106 p_ccb->chnl_state = CST_OPEN;
1112 l2c_ucd_check_pending_info_req (p_ccb);
1126 btu_stop_timer (&p_ccb->timer_entry);
1128 GKI_enqueue (&p_ccb->p_lcb->ucd_in_sec_pending_q, p_data);
1129 l2c_ucd_check_pending_in_sec_q (p_ccb);
1134 btu_stop_timer (&p_ccb->timer_entry);
1136 l2c_ucd_enqueue_pending_out_sec_q(p_ccb, p_data);
1140 l2c_ucd_check_pending_out_sec_q (p_ccb);
1145 if ((!l2c_ucd_check_pending_in_sec_q(p_ccb))
1146 &&(!l2c_ucd_check_pending_out_sec_q(p_ccb)))
1148 l2cu_release_ccb (p_ccb);
1154 l2c_ucd_check_pending_info_req (p_ccb);