Lines Matching refs:p_scb
189 tBTA_AV_SCB* p_scb = NULL; in bta_av_addr_to_scb() local
193 if (bta_av_cb.p_scb[xx]) { in bta_av_addr_to_scb()
194 if (bd_addr == bta_av_cb.p_scb[xx]->PeerAddress()) { in bta_av_addr_to_scb()
195 p_scb = bta_av_cb.p_scb[xx]; in bta_av_addr_to_scb()
200 return p_scb; in bta_av_addr_to_scb()
205 tBTA_AV_SCB* p_scb = bta_av_addr_to_scb(peer_address); in BTA_AvObtainPeerChannelIndex() local
206 if (p_scb != nullptr) { in BTA_AvObtainPeerChannelIndex()
207 return p_scb->hdi; in BTA_AvObtainPeerChannelIndex()
212 tBTA_AV_SCB* p_scb = bta_av_cb.p_scb[index]; in BTA_AvObtainPeerChannelIndex() local
213 if (p_scb == nullptr) { in BTA_AvObtainPeerChannelIndex()
216 if (p_scb->PeerAddress().IsEmpty()) { in BTA_AvObtainPeerChannelIndex()
217 return p_scb->hdi; in BTA_AvObtainPeerChannelIndex()
235 tBTA_AV_SCB* p_scb = NULL; in bta_av_hndl_to_scb() local
239 p_scb = bta_av_cb.p_scb[idx - 1]; in bta_av_hndl_to_scb()
241 return p_scb; in bta_av_hndl_to_scb()
262 if (bta_av_cb.p_scb[xx] != nullptr) continue; in bta_av_alloc_scb()
273 bta_av_cb.p_scb[xx] = p_ret; in bta_av_alloc_scb()
280 void bta_av_free_scb(tBTA_AV_SCB* p_scb) { in bta_av_free_scb() argument
281 if (p_scb == nullptr) return; in bta_av_free_scb()
282 uint8_t scb_index = p_scb->hdi; in bta_av_free_scb()
285 CHECK(p_scb == bta_av_cb.p_scb[scb_index]); in bta_av_free_scb()
286 bta_av_cb.p_scb[scb_index] = nullptr; in bta_av_free_scb()
287 alarm_free(p_scb->avrc_ct_timer); in bta_av_free_scb()
290 osi_free(p_scb); in bta_av_free_scb()
330 tBTA_AV_SCB* p_scb = NULL; in bta_av_conn_cback() local
337 p_scb = bta_av_addr_to_scb(bd_addr); in bta_av_conn_cback()
350 if (p_scb) { in bta_av_conn_cback()
351 APPL_TRACE_DEBUG("%s: bta_handle x%x, role x%x", __func__, p_scb->hndl, in bta_av_conn_cback()
352 p_scb->role); in bta_av_conn_cback()
389 tBTA_AV_SCB* p_scb; /* stream control block */ in bta_av_api_register() local
439 p_scb = bta_av_alloc_scb(registr.chnl); in bta_av_api_register()
440 if (p_scb == NULL) { in bta_av_api_register()
445 registr.hndl = p_scb->hndl; in bta_av_api_register()
446 p_scb->app_id = registr.app_id; in bta_av_api_register()
457 reg.scb_index = p_scb->hdi; in bta_av_api_register()
521 p_scb->suspend_sup = true; in bta_av_api_register()
522 p_scb->recfg_sup = true; in bta_av_api_register()
524 avdtp_stream_config.scb_index = p_scb->hdi; in bta_av_api_register()
528 p_scb->p_cos = &bta_av_a2dp_cos; in bta_av_api_register()
529 p_scb->media_type = AVDT_MEDIA_TYPE_AUDIO; in bta_av_api_register()
556 p_scb->seps[xx].av_handle = 0; in bta_av_api_register()
560 p_scb->cfg = avdtp_stream_config.cfg; in bta_av_api_register()
570 if (AVDT_CreateStream(p_scb->app_id, &p_scb->seps[codec_index].av_handle, in bta_av_api_register()
574 __func__, p_scb->hndl, p_scb->app_id, codec_index); in bta_av_api_register()
578 memcpy(p_scb->seps[codec_index].codec_info, in bta_av_api_register()
580 p_scb->seps[codec_index].tsep = avdtp_stream_config.tsep; in bta_av_api_register()
582 p_scb->seps[codec_index].p_app_sink_data_cback = in bta_av_api_register()
588 p_scb->seps[codec_index].p_app_sink_data_cback = NULL; in bta_av_api_register()
640 bta_av_cb.reg_audio |= BTA_AV_HNDL_TO_MSK(p_scb->hdi); in bta_av_api_register()
661 tBTA_AV_SCB* p_scb = bta_av_hndl_to_scb(p_data->hdr.layer_specific); in bta_av_api_deregister() local
663 if (p_scb) { in bta_av_api_deregister()
664 p_scb->deregistering = true; in bta_av_api_deregister()
665 bta_av_ssm_execute(p_scb, BTA_AV_API_CLOSE_EVT, p_data); in bta_av_api_deregister()
683 tBTA_AV_SCB* p_scb; in bta_av_ci_data() local
688 p_scb = bta_av_cb.p_scb[i]; in bta_av_ci_data()
690 if (p_scb && p_scb->chnl == chnl) { in bta_av_ci_data()
691 bta_av_ssm_execute(p_scb, BTA_AV_SRC_DATA_READY_EVT, p_data); in bta_av_ci_data()
721 tBTA_AV_SCB* p_scb = bta_av_hndl_to_scb(handle); in bta_av_api_to_ssm() local
723 if (p_scb != nullptr) { in bta_av_api_to_ssm()
724 bta_av_ssm_execute(p_scb, event, p_data); in bta_av_api_to_ssm()
740 bool bta_av_chk_start(tBTA_AV_SCB* p_scb) { in bta_av_chk_start() argument
743 if ((p_scb->chnl == BTA_AV_CHNL_AUDIO) && (bta_av_cb.audio_open_cnt >= 2) && in bta_av_chk_start()
744 (((p_scb->role & BTA_AV_ROLE_AD_ACP) == 0) || // Outgoing connection or in bta_av_chk_start()
750 tBTA_AV_SCB* p_scbi = bta_av_cb.p_scb[i]; in bta_av_chk_start()
764 __func__, p_scb->PeerAddress().ToString().c_str(), p_scb->chnl, in bta_av_chk_start()
765 bta_av_cb.audio_open_cnt, p_scb->role, bta_av_cb.features, in bta_av_chk_start()
789 if (p_cb->p_scb[i]) { in bta_av_restore_switch()
790 BTM_unblock_role_switch_for(p_cb->p_scb[i]->PeerAddress()); in bta_av_restore_switch()
810 tBTA_AV_SCB* p_scb = NULL; in bta_av_sys_rs_cback() local
822 p_scb = bta_av_cb.p_scb[i]; in bta_av_sys_rs_cback()
823 if (p_scb && p_scb->PeerAddress() == peer_addr) { in bta_av_sys_rs_cback()
828 __func__, peer_addr.ToString().c_str(), id, app_id, p_scb->hndl); in bta_av_sys_rs_cback()
830 p_buf->hdr.layer_specific = p_scb->hndl; in bta_av_sys_rs_cback()
835 peer_idx = p_scb->hdi + 1; /* Handle index for the peer_addr */ in bta_av_sys_rs_cback()
851 p_scb = bta_av_cb.p_scb[bta_av_cb.rs_idx - 1]; in bta_av_sys_rs_cback()
853 if (p_scb && p_scb->q_tag == BTA_AV_Q_TAG_OPEN) { in bta_av_sys_rs_cback()
855 __func__, p_scb->PeerAddress().ToString().c_str(), in bta_av_sys_rs_cback()
856 bta_av_cb.rs_idx, p_scb->hndl, p_scb->q_tag); in bta_av_sys_rs_cback()
859 p_scb->q_info.open.switch_res = BTA_AV_RS_OK; in bta_av_sys_rs_cback()
865 p_scb->PeerAddress().ToString().c_str(), id, app_id); in bta_av_sys_rs_cback()
866 p_scb->q_info.open.switch_res = BTA_AV_RS_FAIL; in bta_av_sys_rs_cback()
870 bta_av_do_disc_a2dp(p_scb, (tBTA_AV_DATA*)&(p_scb->q_info.open)); in bta_av_sys_rs_cback()
891 tBTA_AV_SCB* p_scb; in bta_av_sco_chg_cback() local
908 p_scb = bta_av_cb.p_scb[i]; in bta_av_sco_chg_cback()
910 if (p_scb && p_scb->co_started && (!p_scb->sco_suspend)) { in bta_av_sco_chg_cback()
913 p_scb->sco_suspend = true; in bta_av_sco_chg_cback()
917 bta_av_ssm_execute(p_scb, BTA_AV_AP_STOP_EVT, (tBTA_AV_DATA*)&stop); in bta_av_sco_chg_cback()
930 p_scb = bta_av_cb.p_scb[i]; in bta_av_sco_chg_cback()
932 if (p_scb && p_scb->sco_suspend) /* scb is used and suspended for SCO */ in bta_av_sco_chg_cback()
935 bta_av_ssm_execute(p_scb, BTA_AV_AP_START_EVT, NULL); in bta_av_sco_chg_cback()
952 bool bta_av_switch_if_needed(tBTA_AV_SCB* p_scb) { in bta_av_switch_if_needed() argument
965 p_scbi = bta_av_cb.p_scb[i]; in bta_av_switch_if_needed()
966 if (p_scbi && (p_scb->hdi != i) && /* not the original channel */ in bta_av_switch_if_needed()
980 bta_sys_start_timer(p_scb->avrc_ct_timer, BTA_AV_RS_TIME_VAL, in bta_av_switch_if_needed()
981 BTA_AV_AVRC_TIMER_EVT, p_scb->hndl); in bta_av_switch_if_needed()
985 bta_av_cb.rs_idx = p_scb->hdi + 1; in bta_av_switch_if_needed()
1004 bool bta_av_link_role_ok(tBTA_AV_SCB* p_scb, uint8_t bits) { in bta_av_link_role_ok() argument
1006 if (BTM_GetRole(p_scb->PeerAddress(), &role) != BTM_SUCCESS) { in bta_av_link_role_ok()
1008 PRIVATE_ADDRESS(p_scb->PeerAddress())); in bta_av_link_role_ok()
1016 PRIVATE_ADDRESS(p_scb->PeerAddress()), p_scb->hndl, in bta_av_link_role_ok()
1018 const tBTM_STATUS status = BTM_SwitchRoleToCentral(p_scb->PeerAddress()); in bta_av_link_role_ok()
1028 PRIVATE_ADDRESS(p_scb->PeerAddress())); in bta_av_link_role_ok()
1032 p_scb->wait |= BTA_AV_WAIT_ROLE_SW_RES_START; in bta_av_link_role_ok()
1034 PRIVATE_ADDRESS(p_scb->PeerAddress()), in bta_av_link_role_ok()
1052 void bta_av_dup_audio_buf(tBTA_AV_SCB* p_scb, BT_HDR* p_buf) { in bta_av_dup_audio_buf() argument
1058 tBTA_AV_SCB* p_scbi = bta_av_cb.p_scb[i]; in bta_av_dup_audio_buf()
1060 if (i == p_scb->hdi) continue; /* Ignore the original channel */ in bta_av_dup_audio_buf()
1421 const tBTA_AV_SCB* p_scb = bta_av_cb.p_scb[i]; in bta_debug_av_dump() local
1422 if (p_scb == nullptr) { in bta_debug_av_dump()
1425 if (p_scb->PeerAddress().IsEmpty()) { in bta_debug_av_dump()
1429 p_scb->PeerAddress().ToString().c_str()); in bta_debug_av_dump()
1431 p_scb->sdp_discovery_started ? "true" : "false"); in bta_debug_av_dump()
1433 const tBTA_AV_SEP& sep = p_scb->seps[j]; in bta_debug_av_dump()
1442 dprintf(fd, " BTA info tag: %d\n", p_scb->q_tag); in bta_debug_av_dump()
1444 p_scb->q_info.open.bd_addr.ToString().c_str()); in bta_debug_av_dump()
1446 p_scb->q_info.open.use_rc ? "true" : "false"); in bta_debug_av_dump()
1447 dprintf(fd, " Switch result: %d\n", p_scb->q_info.open.switch_res); in bta_debug_av_dump()
1448 dprintf(fd, " Initiator UUID: 0x%x\n", p_scb->q_info.open.uuid); in bta_debug_av_dump()
1450 p_scb->open_api.bd_addr.ToString().c_str()); in bta_debug_av_dump()
1452 p_scb->open_api.use_rc ? "true" : "false"); in bta_debug_av_dump()
1453 dprintf(fd, " Switch result: %d\n", p_scb->open_api.switch_res); in bta_debug_av_dump()
1454 dprintf(fd, " Initiator UUID: 0x%x\n", p_scb->open_api.uuid); in bta_debug_av_dump()
1456 alarm_is_scheduled(p_scb->link_signalling_timer) ? "Scheduled" in bta_debug_av_dump()
1459 alarm_is_scheduled(p_scb->accept_signalling_timer) in bta_debug_av_dump()
1463 dprintf(fd, " L2CAP Channel ID: %d\n", p_scb->l2c_cid); in bta_debug_av_dump()
1464 dprintf(fd, " Stream MTU: %d\n", p_scb->stream_mtu); in bta_debug_av_dump()
1465 dprintf(fd, " AVDTP version: 0x%x\n", p_scb->AvdtpVersion()); in bta_debug_av_dump()
1466 dprintf(fd, " Media type: %d\n", p_scb->media_type); in bta_debug_av_dump()
1467 dprintf(fd, " Congested: %s\n", p_scb->cong ? "true" : "false"); in bta_debug_av_dump()
1468 dprintf(fd, " Open status: %d\n", p_scb->open_status); in bta_debug_av_dump()
1469 dprintf(fd, " Channel: %d\n", p_scb->chnl); in bta_debug_av_dump()
1470 dprintf(fd, " BTA handle: 0x%x\n", p_scb->hndl); in bta_debug_av_dump()
1472 p_scb->cur_psc_mask); in bta_debug_av_dump()
1473 dprintf(fd, " AVDTP handle: %d\n", p_scb->avdt_handle); in bta_debug_av_dump()
1474 dprintf(fd, " Stream control block index: %d\n", p_scb->hdi); in bta_debug_av_dump()
1476 bta_av_sst_code(p_scb->state), p_scb->state); in bta_debug_av_dump()
1477 dprintf(fd, " AVDTP label: 0x%x\n", p_scb->avdt_label); in bta_debug_av_dump()
1478 dprintf(fd, " Application ID: %d\n", p_scb->app_id); in bta_debug_av_dump()
1479 dprintf(fd, " Role: 0x%x\n", p_scb->role); in bta_debug_av_dump()
1480 dprintf(fd, " Queued L2CAP buffers: %d\n", p_scb->l2c_bufs); in bta_debug_av_dump()
1481 dprintf(fd, " AVRCP allowed: %s\n", p_scb->use_rc ? "true" : "false"); in bta_debug_av_dump()
1482 dprintf(fd, " Stream started: %s\n", p_scb->started ? "true" : "false"); in bta_debug_av_dump()
1483 dprintf(fd, " Stream call-out started: %d\n", p_scb->co_started); in bta_debug_av_dump()
1485 p_scb->recfg_sup ? "true" : "false"); in bta_debug_av_dump()
1487 p_scb->suspend_sup ? "true" : "false"); in bta_debug_av_dump()
1489 p_scb->deregistering ? "true" : "false"); in bta_debug_av_dump()
1491 p_scb->sco_suspend ? "true" : "false"); in bta_debug_av_dump()
1493 p_scb->coll_mask); in bta_debug_av_dump()
1494 dprintf(fd, " Wait mask: 0x%x\n", p_scb->wait); in bta_debug_av_dump()
1496 p_scb->no_rtp_header ? "true" : "false"); in bta_debug_av_dump()
1498 p_scb->uuid_int); in bta_debug_av_dump()