Lines Matching defs:p_bcb
125 tBNEP_CONN *p_bcb = bnepu_find_bcb_by_bd_addr (bd_addr);
130 if (!(bnep_cb.profile_registered) || (p_bcb)
131 || ((p_bcb = bnepu_allocate_bcb(bd_addr)) == NULL))
138 p_bcb->con_state = BNEP_STATE_CFG_SETUP;
141 p_bcb->l2cap_cid = l2cap_cid;
150 alarm_set_on_queue(p_bcb->conn_timer, BNEP_CONN_TIMEOUT_MS,
151 bnep_conn_timer_timeout, p_bcb,
154 BNEP_TRACE_EVENT("BNEP - Rcvd L2CAP conn ind, CID: 0x%x", p_bcb->l2cap_cid);
172 tBNEP_CONN *p_bcb;
175 if ((p_bcb = bnepu_find_bcb_by_cid (l2cap_cid)) == NULL)
183 if ((result == L2CAP_CONN_OK) && (p_bcb->con_state == BNEP_STATE_CONN_START))
185 p_bcb->con_state = BNEP_STATE_CFG_SETUP;
191 alarm_set_on_queue(p_bcb->conn_timer, BNEP_CONN_TIMEOUT_MS,
192 bnep_conn_timer_timeout, p_bcb,
195 BNEP_TRACE_EVENT ("BNEP - got conn cnf, sent cfg req, CID: 0x%x", p_bcb->l2cap_cid);
199 BNEP_TRACE_WARNING ("BNEP - Rcvd conn cnf with error: 0x%x CID 0x%x", result, p_bcb->l2cap_cid);
203 p_bcb->con_flags & BNEP_FLAGS_IS_ORIG)
205 (*bnep_cb.p_conn_state_cb) (p_bcb->handle, p_bcb->rem_bda, BNEP_CONN_FAILED, FALSE);
208 bnepu_release_bcb (p_bcb);
224 tBNEP_CONN *p_bcb;
228 if ((p_bcb = bnepu_find_bcb_by_cid (l2cap_cid)) == NULL)
248 p_bcb->rem_mtu_size = BNEP_MTU_SIZE;
250 p_bcb->rem_mtu_size = p_cfg->mtu;
266 p_bcb->con_flags |= BNEP_FLAGS_HIS_CFG_DONE;
268 if (p_bcb->con_flags & BNEP_FLAGS_MY_CFG_DONE)
270 p_bcb->con_state = BNEP_STATE_SEC_CHECKING;
273 alarm_set_on_queue(p_bcb->conn_timer, BNEP_HOST_TIMEOUT_MS,
274 bnep_conn_timer_timeout, p_bcb,
277 if (p_bcb->con_flags & BNEP_FLAGS_IS_ORIG)
279 btm_sec_mx_access_request (p_bcb->rem_bda, BT_PSM_BNEP, TRUE,
281 bnep_get_uuid32(&(p_bcb->src_uuid)),
282 &bnep_sec_check_complete, p_bcb);
300 tBNEP_CONN *p_bcb;
305 if ((p_bcb = bnepu_find_bcb_by_cid (l2cap_cid)) == NULL)
314 p_bcb->con_flags |= BNEP_FLAGS_MY_CFG_DONE;
316 if (p_bcb->con_flags & BNEP_FLAGS_HIS_CFG_DONE)
318 p_bcb->con_state = BNEP_STATE_SEC_CHECKING;
321 alarm_set_on_queue(p_bcb->conn_timer, BNEP_HOST_TIMEOUT_MS,
322 bnep_conn_timer_timeout, p_bcb,
325 if (p_bcb->con_flags & BNEP_FLAGS_IS_ORIG)
327 btm_sec_mx_access_request (p_bcb->rem_bda, BT_PSM_BNEP, TRUE,
329 bnep_get_uuid32(&(p_bcb->src_uuid)),
330 &bnep_sec_check_complete, p_bcb);
337 if ((p_bcb->con_flags & BNEP_FLAGS_IS_ORIG) && (bnep_cb.p_conn_state_cb))
339 (*bnep_cb.p_conn_state_cb) (p_bcb->handle, p_bcb->rem_bda, BNEP_CONN_FAILED_CFG, FALSE);
342 L2CA_DisconnectReq (p_bcb->l2cap_cid);
344 bnepu_release_bcb (p_bcb);
361 tBNEP_CONN *p_bcb;
367 if ((p_bcb = bnepu_find_bcb_by_cid (l2cap_cid)) == NULL)
376 if (p_bcb->con_state == BNEP_STATE_CONNECTED)
379 (*bnep_cb.p_conn_state_cb)(p_bcb->handle, p_bcb->rem_bda, BNEP_CONN_DISCONNECTED, FALSE);
383 if ((bnep_cb.p_conn_state_cb) && ((p_bcb->con_flags & BNEP_FLAGS_IS_ORIG) ||
384 (p_bcb->con_flags & BNEP_FLAGS_CONN_COMPLETED)))
385 (*bnep_cb.p_conn_state_cb) (p_bcb->handle, p_bcb->rem_bda, BNEP_CONN_FAILED, FALSE);
388 bnepu_release_bcb (p_bcb);
419 tBNEP_CONN *p_bcb;
422 if ((p_bcb = bnepu_find_bcb_by_cid (l2cap_cid)) == NULL)
430 p_bcb->con_flags |= BNEP_FLAGS_L2CAP_CONGESTED;
433 bnep_cb.p_tx_data_flow_cb(p_bcb->handle, BNEP_TX_FLOW_OFF);
438 p_bcb->con_flags &= ~BNEP_FLAGS_L2CAP_CONGESTED;
442 bnep_cb.p_tx_data_flow_cb(p_bcb->handle, BNEP_TX_FLOW_ON);
446 while (!(p_bcb->con_flags & BNEP_FLAGS_L2CAP_CONGESTED))
448 BT_HDR *p_buf = (BT_HDR *)fixed_queue_try_dequeue(p_bcb->xmit_q);
477 tBNEP_CONN *p_bcb;
487 if ((p_bcb = bnepu_find_bcb_by_cid (l2cap_cid)) == NULL)
507 if ((p_bcb->con_state != BNEP_STATE_CONNECTED) &&
508 (!(p_bcb->con_flags & BNEP_FLAGS_CONN_COMPLETED)) &&
512 p_bcb->con_state, l2cap_cid);
533 bnep_send_command_not_understood (p_bcb, *p);
572 p = bnep_process_control_packet (p_bcb, p, &rem_len, FALSE);
575 p_bcb->con_state != BNEP_STATE_CONNECTED &&
578 p_bcb->p_pending_data = (BT_HDR *)osi_malloc(rem_len);
579 memcpy((UINT8 *)(p_bcb->p_pending_data + 1), p, rem_len);
580 p_bcb->p_pending_data->len = rem_len;
581 p_bcb->p_pending_data->offset = 0;
595 p = bnep_process_control_packet (p_bcb, p, &rem_len, TRUE);
637 p = bnep_process_control_packet (p_bcb, p, &rem_len, TRUE);
645 p_src_addr = (UINT8 *) p_bcb->rem_bda;
658 (*bnep_cb.p_data_buf_cb)(p_bcb->handle, p_src_addr, p_dst_addr, protocol, p_buf, fw_ext_present);
662 (*bnep_cb.p_data_ind_cb)(p_bcb->handle, p_src_addr, p_dst_addr, protocol, p, rem_len, fw_ext_present);
682 tBNEP_CONN *p_bcb = (tBNEP_CONN *)data;
685 p_bcb->con_state, p_bcb->l2cap_cid, p_bcb->con_flags, p_bcb->re_transmits);
687 if (p_bcb->con_state == BNEP_STATE_CONN_SETUP)
690 p_bcb->con_state, p_bcb->l2cap_cid);
692 if (!(p_bcb->con_flags & BNEP_FLAGS_IS_ORIG))
694 L2CA_DisconnectReq (p_bcb->l2cap_cid);
696 bnepu_release_bcb (p_bcb);
700 if (p_bcb->re_transmits++ != BNEP_MAX_RETRANSMITS)
702 bnep_send_conn_req (p_bcb);
703 alarm_set_on_queue(p_bcb->conn_timer, BNEP_CONN_TIMEOUT_MS,
704 bnep_conn_timer_timeout, p_bcb,
709 L2CA_DisconnectReq (p_bcb->l2cap_cid);
711 if ((p_bcb->con_flags & BNEP_FLAGS_IS_ORIG) && (bnep_cb.p_conn_state_cb))
712 (*bnep_cb.p_conn_state_cb) (p_bcb->handle, p_bcb->rem_bda, BNEP_CONN_FAILED, FALSE);
714 bnepu_release_bcb (p_bcb);
718 else if (p_bcb->con_state != BNEP_STATE_CONNECTED)
721 p_bcb->con_state, p_bcb->l2cap_cid);
723 L2CA_DisconnectReq (p_bcb->l2cap_cid);
726 if ((p_bcb->con_flags & BNEP_FLAGS_IS_ORIG) && (bnep_cb.p_conn_state_cb))
727 (*bnep_cb.p_conn_state_cb) (p_bcb->handle, p_bcb->rem_bda, BNEP_CONN_FAILED, FALSE);
729 bnepu_release_bcb (p_bcb);
731 else if (p_bcb->con_flags & BNEP_FLAGS_FILTER_RESP_PEND)
733 if (p_bcb->re_transmits++ != BNEP_MAX_RETRANSMITS)
735 bnepu_send_peer_our_filters (p_bcb);
736 alarm_set_on_queue(p_bcb->conn_timer, BNEP_FILTER_SET_TIMEOUT_MS,
737 bnep_conn_timer_timeout, p_bcb,
742 L2CA_DisconnectReq (p_bcb->l2cap_cid);
746 (*bnep_cb.p_conn_state_cb) (p_bcb->handle, p_bcb->rem_bda, BNEP_SET_FILTER_FAIL, FALSE);
748 bnepu_release_bcb (p_bcb);
752 else if (p_bcb->con_flags & BNEP_FLAGS_MULTI_RESP_PEND)
754 if (p_bcb->re_transmits++ != BNEP_MAX_RETRANSMITS)
756 bnepu_send_peer_our_multi_filters (p_bcb);
757 alarm_set_on_queue(p_bcb->conn_timer, BNEP_FILTER_SET_TIMEOUT_MS,
758 bnep_conn_timer_timeout, p_bcb,
763 L2CA_DisconnectReq (p_bcb->l2cap_cid);
767 (*bnep_cb.p_conn_state_cb) (p_bcb->handle, p_bcb->rem_bda, BNEP_SET_FILTER_FAIL, FALSE);
769 bnepu_release_bcb (p_bcb);
786 void bnep_connected (tBNEP_CONN *p_bcb)
790 if (p_bcb->con_flags & BNEP_FLAGS_CONN_COMPLETED)
795 p_bcb->con_state = BNEP_STATE_CONNECTED;
796 p_bcb->con_flags |= BNEP_FLAGS_CONN_COMPLETED;
797 p_bcb->con_flags &= (~BNEP_FLAGS_SETUP_RCVD);
800 alarm_cancel(p_bcb->conn_timer);
801 p_bcb->re_transmits = 0;
805 (*bnep_cb.p_conn_state_cb) (p_bcb->handle, p_bcb->rem_bda, BNEP_SUCCESS, is_role_change);