Lines Matching refs:p_ccb
170 tCONN_CB* p_ccb; in sdp_connect_ind() local
173 p_ccb = sdpu_allocate_ccb(); in sdp_connect_ind()
174 if (p_ccb == NULL) return; in sdp_connect_ind()
177 p_ccb->con_state = SDP_STATE_CFG_SETUP; in sdp_connect_ind()
180 p_ccb->device_address = bd_addr; in sdp_connect_ind()
181 p_ccb->connection_id = l2cap_cid; in sdp_connect_ind()
206 p_ccb->connection_id); in sdp_connect_ind()
225 tCONN_CB* p_ccb; in sdp_connect_cfm() local
229 p_ccb = sdpu_find_ccb_by_cid(l2cap_cid); in sdp_connect_cfm()
230 if (p_ccb == NULL) { in sdp_connect_cfm()
237 if ((result == L2CAP_CONN_OK) && (p_ccb->con_state == SDP_STATE_CONN_SETUP)) { in sdp_connect_cfm()
238 p_ccb->con_state = SDP_STATE_CFG_SETUP; in sdp_connect_cfm()
259 p_ccb->connection_id); in sdp_connect_cfm()
262 p_ccb->connection_id); in sdp_connect_cfm()
265 if (p_ccb->p_cb || p_ccb->p_cb2) { in sdp_connect_cfm()
277 if (p_ccb->p_cb) in sdp_connect_cfm()
278 (*p_ccb->p_cb)(err); in sdp_connect_cfm()
279 else if (p_ccb->p_cb2) in sdp_connect_cfm()
280 (*p_ccb->p_cb2)(err, p_ccb->user_data); in sdp_connect_cfm()
282 sdpu_release_ccb(p_ccb); in sdp_connect_cfm()
297 tCONN_CB* p_ccb; in sdp_config_ind() local
300 p_ccb = sdpu_find_ccb_by_cid(l2cap_cid); in sdp_config_ind()
301 if (p_ccb == NULL) { in sdp_config_ind()
309 p_ccb->rem_mtu_size = in sdp_config_ind()
313 p_ccb->rem_mtu_size = SDP_MTU_SIZE; in sdp_config_ind()
315 p_ccb->rem_mtu_size = p_cfg->mtu; in sdp_config_ind()
362 p_ccb->con_flags |= SDP_FLAGS_HIS_CFG_DONE; in sdp_config_ind()
364 if (p_ccb->con_flags & SDP_FLAGS_MY_CFG_DONE) { in sdp_config_ind()
365 p_ccb->con_state = SDP_STATE_CONNECTED; in sdp_config_ind()
367 if (p_ccb->con_flags & SDP_FLAGS_IS_ORIG) { in sdp_config_ind()
368 sdp_disc_connected(p_ccb); in sdp_config_ind()
371 alarm_set_on_mloop(p_ccb->sdp_conn_timer, SDP_INACT_TIMEOUT_MS, in sdp_config_ind()
372 sdp_conn_timer_timeout, p_ccb); in sdp_config_ind()
388 tCONN_CB* p_ccb; in sdp_config_cfm() local
394 p_ccb = sdpu_find_ccb_by_cid(l2cap_cid); in sdp_config_cfm()
395 if (p_ccb == NULL) { in sdp_config_cfm()
402 p_ccb->con_flags |= SDP_FLAGS_MY_CFG_DONE; in sdp_config_cfm()
404 if (p_ccb->con_flags & SDP_FLAGS_HIS_CFG_DONE) { in sdp_config_cfm()
405 p_ccb->con_state = SDP_STATE_CONNECTED; in sdp_config_cfm()
407 if (p_ccb->con_flags & SDP_FLAGS_IS_ORIG) { in sdp_config_cfm()
408 sdp_disc_connected(p_ccb); in sdp_config_cfm()
411 alarm_set_on_mloop(p_ccb->sdp_conn_timer, SDP_INACT_TIMEOUT_MS, in sdp_config_cfm()
412 sdp_conn_timer_timeout, p_ccb); in sdp_config_cfm()
426 sdp_disconnect(p_ccb, SDP_CFG_FAILED); in sdp_config_cfm()
441 tCONN_CB* p_ccb; in sdp_disconnect_ind() local
444 p_ccb = sdpu_find_ccb_by_cid(l2cap_cid); in sdp_disconnect_ind()
445 if (p_ccb == NULL) { in sdp_disconnect_ind()
454 if (p_ccb->p_cb) in sdp_disconnect_ind()
455 (*p_ccb->p_cb)((uint16_t)((p_ccb->con_state == SDP_STATE_CONNECTED) in sdp_disconnect_ind()
458 else if (p_ccb->p_cb2) in sdp_disconnect_ind()
459 (*p_ccb->p_cb2)( in sdp_disconnect_ind()
460 (uint16_t)((p_ccb->con_state == SDP_STATE_CONNECTED) ? SDP_SUCCESS in sdp_disconnect_ind()
462 p_ccb->user_data); in sdp_disconnect_ind()
464 sdpu_release_ccb(p_ccb); in sdp_disconnect_ind()
483 tCONN_CB* p_ccb; in sdp_data_ind() local
486 p_ccb = sdpu_find_ccb_by_cid(l2cap_cid); in sdp_data_ind()
487 if (p_ccb != NULL) { in sdp_data_ind()
488 if (p_ccb->con_state == SDP_STATE_CONNECTED) { in sdp_data_ind()
489 if (p_ccb->con_flags & SDP_FLAGS_IS_ORIG) in sdp_data_ind()
490 sdp_disc_server_rsp(p_ccb, p_msg); in sdp_data_ind()
492 sdp_server_handle_client_req(p_ccb, p_msg); in sdp_data_ind()
496 p_ccb->con_state, l2cap_cid); in sdp_data_ind()
516 tCONN_CB* p_ccb; in sdp_conn_originate() local
520 p_ccb = sdpu_allocate_ccb(); in sdp_conn_originate()
521 if (p_ccb == NULL) { in sdp_conn_originate()
531 p_ccb->con_flags |= SDP_FLAGS_IS_ORIG; in sdp_conn_originate()
534 p_ccb->device_address = p_bd_addr; in sdp_conn_originate()
538 p_ccb->con_state = SDP_STATE_CONN_SETUP; in sdp_conn_originate()
546 sdpu_release_ccb(p_ccb); in sdp_conn_originate()
549 p_ccb->connection_id = cid; in sdp_conn_originate()
550 return (p_ccb); in sdp_conn_originate()
562 void sdp_disconnect(tCONN_CB* p_ccb, uint16_t reason) { in sdp_disconnect() argument
566 if ((p_ccb->con_state == SDP_STATE_CONNECTED) && in sdp_disconnect()
567 (p_ccb->con_flags & SDP_FLAGS_IS_ORIG) && in sdp_disconnect()
570 if ((p_ccb->cur_uuid_idx == 0) && (p_ccb->p_db->p_first_rec)) in sdp_disconnect()
571 p_ccb->cur_uuid_idx = p_ccb->p_db->num_uuid_filters; in sdp_disconnect()
573 while (++p_ccb->cur_uuid_idx < p_ccb->p_db->num_uuid_filters) { in sdp_disconnect()
575 if ((p_ccb->p_db->uuid_filters[p_ccb->cur_uuid_idx].len == 2) && in sdp_disconnect()
577 p_ccb->p_db, in sdp_disconnect()
578 p_ccb->p_db->uuid_filters[p_ccb->cur_uuid_idx].uu.uuid16, NULL))) in sdp_disconnect()
581 if ((p_ccb->p_db->uuid_filters[p_ccb->cur_uuid_idx].len > 2) && in sdp_disconnect()
583 p_ccb->p_db, &p_ccb->p_db->uuid_filters[p_ccb->cur_uuid_idx], in sdp_disconnect()
587 p_ccb->cur_handle = 0; in sdp_disconnect()
590 p_ccb->connection_id); in sdp_disconnect()
592 sdp_disc_connected(p_ccb); in sdp_disconnect()
597 if ((reason == SDP_NO_RECS_MATCH) && (p_ccb->p_db->p_first_rec)) in sdp_disconnect()
602 SDP_TRACE_EVENT("SDP - disconnect CID: 0x%x", p_ccb->connection_id); in sdp_disconnect()
605 if (p_ccb->connection_id != 0) { in sdp_disconnect()
606 L2CA_DisconnectReq(p_ccb->connection_id); in sdp_disconnect()
607 p_ccb->disconnect_reason = reason; in sdp_disconnect()
612 if (p_ccb->con_state == SDP_STATE_CONN_SETUP) { in sdp_disconnect()
614 if (p_ccb->p_cb) in sdp_disconnect()
615 (*p_ccb->p_cb)(reason); in sdp_disconnect()
616 else if (p_ccb->p_cb2) in sdp_disconnect()
617 (*p_ccb->p_cb2)(reason, p_ccb->user_data); in sdp_disconnect()
619 sdpu_release_ccb(p_ccb); in sdp_disconnect()
634 tCONN_CB* p_ccb; in sdp_disconnect_cfm() local
637 p_ccb = sdpu_find_ccb_by_cid(l2cap_cid); in sdp_disconnect_cfm()
638 if (p_ccb == NULL) { in sdp_disconnect_cfm()
647 if (p_ccb->p_cb) in sdp_disconnect_cfm()
648 (*p_ccb->p_cb)(p_ccb->disconnect_reason); in sdp_disconnect_cfm()
649 else if (p_ccb->p_cb2) in sdp_disconnect_cfm()
650 (*p_ccb->p_cb2)(p_ccb->disconnect_reason, p_ccb->user_data); in sdp_disconnect_cfm()
652 sdpu_release_ccb(p_ccb); in sdp_disconnect_cfm()
667 tCONN_CB* p_ccb = (tCONN_CB*)data; in sdp_conn_timer_timeout() local
669 SDP_TRACE_EVENT("SDP - CCB timeout in state: %d CID: 0x%x", p_ccb->con_state, in sdp_conn_timer_timeout()
670 p_ccb->connection_id); in sdp_conn_timer_timeout()
672 L2CA_DisconnectReq(p_ccb->connection_id); in sdp_conn_timer_timeout()
674 if (p_ccb->p_cb) in sdp_conn_timer_timeout()
675 (*p_ccb->p_cb)(SDP_CONN_FAILED); in sdp_conn_timer_timeout()
676 else if (p_ccb->p_cb2) in sdp_conn_timer_timeout()
677 (*p_ccb->p_cb2)(SDP_CONN_FAILED, p_ccb->user_data); in sdp_conn_timer_timeout()
678 sdpu_release_ccb(p_ccb); in sdp_conn_timer_timeout()