Lines Matching refs:p_ccb
270 tL2C_CCB *p_ccb;
300 p_ccb = l2cb.ccb_pool;
303 if (( p_ccb->in_use )
304 &&( p_ccb->local_cid == L2CAP_CONNECTIONLESS_CID ))
306 l2cu_release_ccb (p_ccb);
308 p_ccb++;
332 tL2C_CCB *p_ccb;
350 ||((p_ccb = l2cu_find_ccb_by_cid (p_lcb, L2CAP_CONNECTIONLESS_CID)) == NULL))
369 if (!p_ccb)
371 p_ccb = l2cu_find_ccb_by_cid (p_lcb, L2CAP_CONNECTIONLESS_CID);
373 l2c_ucd_check_pending_info_req(p_ccb);
398 tL2C_CCB *p_ccb;
418 ||((p_ccb = l2cu_find_ccb_by_cid (p_lcb, L2CAP_CONNECTIONLESS_CID)) == NULL))
428 || ((p_ccb = l2cu_find_ccb_by_cid (p_lcb, L2CAP_CONNECTIONLESS_CID)) == NULL))
451 if (p_ccb->cong_sent)
455 (fixed_queue_length(p_ccb->xmit_hold_q) +
457 p_ccb->buff_quota);
466 l2c_csm_execute (p_ccb, L2CEVT_L2CA_DATA_WRITE, p_buf);
468 if (p_ccb->cong_sent)
489 tL2C_CCB *p_ccb;
498 ||((p_ccb = l2cu_find_ccb_by_cid (p_lcb, L2CAP_CONNECTIONLESS_CID)) == NULL))
505 p_ccb->fixed_chnl_idle_tout = timeout;
522 tL2C_CCB *p_ccb;
535 if ((p_ccb = l2cu_find_ccb_by_cid (p_lcb, L2CAP_CONNECTIONLESS_CID)) == NULL)
542 l2cu_change_pri_ccb (p_ccb, priority);
561 tL2C_CCB *p_ccb;
596 if ((p_ccb = l2cu_find_ccb_by_cid (p_lcb, L2CAP_CONNECTIONLESS_CID)) == NULL)
599 if ((p_ccb = l2cu_allocate_ccb (p_lcb, 0)) == NULL)
607 p_ccb->local_cid = L2CAP_CONNECTIONLESS_CID;
608 p_ccb->remote_cid = L2CAP_CONNECTIONLESS_CID;
611 p_ccb->fixed_chnl_idle_tout = L2CAP_UCD_IDLE_TIMEOUT;
614 l2cu_change_pri_ccb (p_ccb, L2CAP_UCD_CH_PRIORITY);
622 p_ccb->p_rcb = p_rcb;
627 p_ccb->chnl_state = CST_OPEN;
667 BOOLEAN l2c_ucd_check_pending_info_req(tL2C_CCB *p_ccb)
673 if (p_ccb == NULL)
675 L2CAP_TRACE_ERROR ("L2CAP - NULL p_ccb in l2c_ucd_check_pending_info_req");
687 if ( p_ccb->p_lcb->info_rx_bits & (1 << L2CAP_EXTENDED_FEATURES_INFO_TYPE) )
689 if (!(p_ccb->p_lcb->peer_ext_fea & L2CAP_EXTFEA_UCD_RECEPTION))
693 l2c_ucd_delete_sec_pending_q(p_ccb->p_lcb);
694 l2cu_release_ccb (p_ccb);
697 p_ccb->p_rcb->ucd.cb_info.pL2CA_UCD_Discover_Cb (p_ccb->p_lcb->remote_bd_addr,
699 p_ccb->p_lcb->peer_ext_fea & L2CAP_EXTFEA_UCD_RECEPTION);
704 if (p_ccb->p_lcb->w4_info_rsp == FALSE)
706 l2cu_send_peer_info_req (p_ccb->p_lcb, L2CAP_EXTENDED_FEATURES_INFO_TYPE);
715 if ( p_ccb->p_lcb->info_rx_bits & (1 << L2CAP_CONNLESS_MTU_INFO_TYPE))
717 p_ccb->p_rcb->ucd.cb_info.pL2CA_UCD_Discover_Cb (p_ccb->p_lcb->remote_bd_addr,
719 p_ccb->p_lcb->ucd_mtu);
724 if (p_ccb->p_lcb->w4_info_rsp == FALSE)
726 l2cu_send_peer_info_req (p_ccb->p_lcb, L2CAP_CONNLESS_MTU_INFO_TYPE);
745 void l2c_ucd_enqueue_pending_out_sec_q(tL2C_CCB *p_ccb, void *p_data)
747 fixed_queue_enqueue(p_ccb->p_lcb->ucd_out_sec_pending_q, p_data);
748 l2cu_check_channel_congestion (p_ccb);
760 BOOLEAN l2c_ucd_check_pending_out_sec_q(tL2C_CCB *p_ccb)
762 BT_HDR *p_buf = (BT_HDR*)fixed_queue_try_peek_first(p_ccb->p_lcb->ucd_out_sec_pending_q);
771 p_ccb->chnl_state = CST_ORIG_W4_SEC_COMP;
772 btm_sec_l2cap_access_req (p_ccb->p_lcb->remote_bd_addr, psm,
773 p_ccb->p_lcb->handle, CONNLESS_ORIG, &l2c_link_sec_comp, p_ccb);
790 void l2c_ucd_send_pending_out_sec_q(tL2C_CCB *p_ccb)
792 BT_HDR *p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_ccb->p_lcb->ucd_out_sec_pending_q);
796 l2c_enqueue_peer_data (p_ccb, (BT_HDR *)p_buf);
797 l2c_link_check_send_pkts (p_ccb->p_lcb, NULL, NULL);
811 void l2c_ucd_discard_pending_out_sec_q(tL2C_CCB *p_ccb)
813 BT_HDR *p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_ccb->p_lcb->ucd_out_sec_pending_q);
828 BOOLEAN l2c_ucd_check_pending_in_sec_q(tL2C_CCB *p_ccb)
830 BT_HDR *p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_ccb->p_lcb->ucd_in_sec_pending_q);
838 p_ccb->chnl_state = CST_TERM_W4_SEC_COMP;
839 btm_sec_l2cap_access_req (p_ccb->p_lcb->remote_bd_addr, psm,
840 p_ccb->p_lcb->handle, CONNLESS_TERM, &l2c_link_sec_comp, p_ccb);
857 void l2c_ucd_send_pending_in_sec_q(tL2C_CCB *p_ccb)
859 BT_HDR *p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_ccb->p_lcb->ucd_in_sec_pending_q)
863 p_ccb->p_rcb->ucd.cb_info.pL2CA_UCD_Data_Cb(p_ccb->p_lcb->remote_bd_addr, (BT_HDR *)p_buf);
877 void l2c_ucd_discard_pending_in_sec_q(tL2C_CCB *p_ccb)
879 BT_HDR *p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_ccb->p_lcb->ucd_in_sec_pending_q);
895 tL2C_CCB *p_ccb;
898 if (((p_ccb = l2cu_find_ccb_by_cid (p_lcb, L2CAP_CONNECTIONLESS_CID)) != NULL)
901 if (p_ccb == NULL)
904 if ((p_ccb = l2cu_allocate_ccb (p_lcb, 0)) == NULL)
913 p_ccb->local_cid = L2CAP_CONNECTIONLESS_CID;
914 p_ccb->remote_cid = L2CAP_CONNECTIONLESS_CID;
917 p_ccb->fixed_chnl_idle_tout = L2CAP_UCD_IDLE_TIMEOUT;
920 l2cu_change_pri_ccb (p_ccb, L2CAP_UCD_CH_PRIORITY);
923 p_ccb->p_rcb = p_rcb;
925 p_ccb->chnl_state = CST_OPEN;
928 l2c_csm_execute(p_ccb, L2CEVT_L2CAP_DATA, p_msg);
946 BOOLEAN l2c_ucd_process_event(tL2C_CCB *p_ccb, UINT16 event, void *p_data)
951 switch (p_ccb->chnl_state)
958 if (!l2c_ucd_check_pending_info_req (p_ccb))
961 if (!l2c_ucd_check_pending_out_sec_q(p_ccb))
963 p_ccb->chnl_state = CST_OPEN;
969 fixed_queue_enqueue(p_ccb->p_lcb->ucd_in_sec_pending_q, p_data);
973 l2c_ucd_enqueue_pending_out_sec_q(p_ccb, p_data);
978 if (!l2c_ucd_check_pending_info_req (p_ccb))
981 if (!l2c_ucd_check_pending_out_sec_q(p_ccb))
983 p_ccb->chnl_state = CST_OPEN;
999 if (!l2c_ucd_check_pending_out_sec_q(p_ccb))
1001 p_ccb->chnl_state = CST_OPEN;
1006 p_ccb->chnl_state = CST_OPEN;
1007 l2c_ucd_send_pending_out_sec_q(p_ccb);
1009 if (! fixed_queue_is_empty(p_ccb->p_lcb->ucd_out_sec_pending_q))
1013 alarm_set_on_queue(p_ccb->l2c_ccb_timer, 0,
1014 l2c_ccb_timer_timeout, p_ccb,
1020 period_ms_t timeout_ms = p_ccb->fixed_chnl_idle_tout * 1000;
1021 alarm_set_on_queue(p_ccb->l2c_ccb_timer, timeout_ms,
1022 l2c_ccb_timer_timeout, p_ccb,
1028 p_ccb->chnl_state = CST_OPEN;
1029 l2c_ucd_discard_pending_out_sec_q(p_ccb);
1032 period_ms_t timeout_ms = p_ccb->fixed_chnl_idle_tout * 1000;
1033 alarm_set_on_queue(p_ccb->l2c_ccb_timer, timeout_ms,
1034 l2c_ccb_timer_timeout, p_ccb,
1039 l2c_ucd_enqueue_pending_out_sec_q(p_ccb, p_data);
1043 fixed_queue_enqueue(p_ccb->p_lcb->ucd_in_sec_pending_q, p_data);
1048 l2c_ucd_check_pending_info_req (p_ccb);
1062 p_ccb->chnl_state = CST_OPEN;
1063 l2c_ucd_send_pending_in_sec_q (p_ccb);
1065 if (! fixed_queue_is_empty(p_ccb->p_lcb->ucd_in_sec_pending_q))
1069 alarm_set_on_queue(p_ccb->l2c_ccb_timer, 0,
1070 l2c_ccb_timer_timeout, p_ccb,
1076 period_ms_t timeout_ms = p_ccb->fixed_chnl_idle_tout * 1000;
1077 alarm_set_on_queue(p_ccb->l2c_ccb_timer, timeout_ms,
1078 l2c_ccb_timer_timeout, p_ccb,
1089 p_ccb->chnl_state = CST_OPEN;
1090 l2c_ucd_discard_pending_in_sec_q (p_ccb);
1093 period_ms_t timeout_ms = p_ccb->fixed_chnl_idle_tout * 1000;
1094 alarm_set_on_queue(p_ccb->l2c_ccb_timer, timeout_ms,
1095 l2c_ccb_timer_timeout, p_ccb,
1100 l2c_ucd_enqueue_pending_out_sec_q(p_ccb, p_data);
1104 fixed_queue_enqueue(p_ccb->p_lcb->ucd_in_sec_pending_q, p_data);
1109 if (!l2c_ucd_check_pending_in_sec_q(p_ccb))
1111 p_ccb->chnl_state = CST_OPEN;
1117 l2c_ucd_check_pending_info_req (p_ccb);
1131 alarm_cancel(p_ccb->l2c_ccb_timer);
1133 fixed_queue_enqueue(p_ccb->p_lcb->ucd_in_sec_pending_q, p_data);
1134 l2c_ucd_check_pending_in_sec_q (p_ccb);
1139 alarm_cancel(p_ccb->l2c_ccb_timer);
1141 l2c_ucd_enqueue_pending_out_sec_q(p_ccb, p_data);
1145 l2c_ucd_check_pending_out_sec_q (p_ccb);
1150 if ((!l2c_ucd_check_pending_in_sec_q(p_ccb))
1151 &&(!l2c_ucd_check_pending_out_sec_q(p_ccb)))
1153 l2cu_release_ccb (p_ccb);
1159 l2c_ucd_check_pending_info_req (p_ccb);