Lines Matching refs:p_scb
58 static void bta_pan_pm_conn_busy(tBTA_PAN_SCB* p_scb) { in bta_pan_pm_conn_busy() argument
59 if ((p_scb != NULL) && (p_scb->state != BTA_PAN_IDLE_ST)) in bta_pan_pm_conn_busy()
60 bta_sys_busy(BTA_ID_PAN, p_scb->app_id, p_scb->bd_addr); in bta_pan_pm_conn_busy()
74 static void bta_pan_pm_conn_idle(tBTA_PAN_SCB* p_scb) { in bta_pan_pm_conn_idle() argument
75 if ((p_scb != NULL) && (p_scb->state != BTA_PAN_IDLE_ST)) in bta_pan_pm_conn_idle()
76 bta_sys_idle(BTA_ID_PAN, p_scb->app_id, p_scb->bd_addr); in bta_pan_pm_conn_idle()
92 tBTA_PAN_SCB* p_scb; in bta_pan_conn_state_cback() local
97 p_scb = bta_pan_scb_by_handle(handle); in bta_pan_conn_state_cback()
98 if (p_scb == NULL) { in bta_pan_conn_state_cback()
100 p_scb = bta_pan_scb_alloc(); in bta_pan_conn_state_cback()
103 if (!p_scb) { in bta_pan_conn_state_cback()
108 p_scb->handle = handle; in bta_pan_conn_state_cback()
109 p_scb->local_role = src_role; in bta_pan_conn_state_cback()
110 p_scb->peer_role = dst_role; in bta_pan_conn_state_cback()
111 p_scb->pan_flow_enable = true; in bta_pan_conn_state_cback()
112 p_scb->bd_addr = bd_addr; in bta_pan_conn_state_cback()
113 p_scb->data_queue = fixed_queue_new(SIZE_MAX); in bta_pan_conn_state_cback()
116 p_scb->app_id = bta_pan_cb.app_id[0]; in bta_pan_conn_state_cback()
118 p_scb->app_id = bta_pan_cb.app_id[2]; in bta_pan_conn_state_cback()
142 tBTA_PAN_SCB* p_scb; in bta_pan_data_flow_cb() local
144 p_scb = bta_pan_scb_by_handle(handle); in bta_pan_data_flow_cb()
145 if (p_scb == NULL) return; in bta_pan_data_flow_cb()
152 bta_pan_co_rx_flow(handle, p_scb->app_id, true); in bta_pan_data_flow_cb()
154 p_scb->pan_flow_enable = false; in bta_pan_data_flow_cb()
155 bta_pan_co_rx_flow(handle, p_scb->app_id, false); in bta_pan_data_flow_cb()
172 tBTA_PAN_SCB* p_scb = bta_pan_scb_by_handle(handle); in bta_pan_data_buf_ind_cback() local
173 if (p_scb == NULL) { in bta_pan_data_buf_ind_cback()
198 fixed_queue_enqueue(p_scb->data_queue, p_new_buf); in bta_pan_data_buf_ind_cback()
257 tBTA_PAN_SCB* p_scb = NULL; in bta_pan_has_multiple_connections() local
262 p_scb = &bta_pan_cb.scb[index]; in bta_pan_has_multiple_connections()
263 if (p_scb->in_use && app_id == p_scb->app_id) { in bta_pan_has_multiple_connections()
265 bd_addr = p_scb->bd_addr; in bta_pan_has_multiple_connections()
278 p_scb = &bta_pan_cb.scb[index]; in bta_pan_has_multiple_connections()
279 if (p_scb->in_use && p_scb->app_id != bta_pan_cb.app_id[0] && in bta_pan_has_multiple_connections()
280 bd_addr != p_scb->bd_addr) { in bta_pan_has_multiple_connections()
376 tBTA_PAN_SCB* p_scb = &bta_pan_cb.scb[0]; in bta_pan_disable() local
388 for (i = 0; i < BTA_PAN_NUM_CONN; i++, p_scb++) { in bta_pan_disable()
389 if (p_scb->in_use) { in bta_pan_disable()
390 while ((p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_scb->data_queue)) != in bta_pan_disable()
394 bta_pan_co_close(p_scb->handle, p_scb->app_id); in bta_pan_disable()
410 void bta_pan_open(tBTA_PAN_SCB* p_scb, tBTA_PAN_DATA* p_data) { in bta_pan_open() argument
415 p_data->api_open.peer_role, &p_scb->handle); in bta_pan_open()
419 p_scb->bd_addr = p_data->api_open.bd_addr; in bta_pan_open()
420 p_scb->local_role = p_data->api_open.local_role; in bta_pan_open()
421 p_scb->peer_role = p_data->api_open.peer_role; in bta_pan_open()
423 bta_pan.opening.handle = p_scb->handle; in bta_pan_open()
427 bta_pan_scb_dealloc(p_scb); in bta_pan_open()
447 void bta_pan_api_close(tBTA_PAN_SCB* p_scb, UNUSED_ATTR tBTA_PAN_DATA* p_data) { in bta_pan_api_close() argument
450 PAN_Disconnect(p_scb->handle); in bta_pan_api_close()
457 p_buf->hdr.layer_specific = p_scb->handle; in bta_pan_api_close()
471 void bta_pan_conn_open(tBTA_PAN_SCB* p_scb, tBTA_PAN_DATA* p_data) { in bta_pan_conn_open() argument
477 bta_pan.open.bd_addr = p_scb->bd_addr; in bta_pan_conn_open()
478 bta_pan.open.handle = p_scb->handle; in bta_pan_conn_open()
479 bta_pan.open.local_role = p_scb->local_role; in bta_pan_conn_open()
480 bta_pan.open.peer_role = p_scb->peer_role; in bta_pan_conn_open()
484 p_scb->pan_flow_enable = true; in bta_pan_conn_open()
485 p_scb->app_flow_enable = true; in bta_pan_conn_open()
486 bta_sys_conn_open(BTA_ID_PAN, p_scb->app_id, p_scb->bd_addr); in bta_pan_conn_open()
488 bta_pan_scb_dealloc(p_scb); in bta_pan_conn_open()
492 p_scb->pan_flow_enable = true; in bta_pan_conn_open()
493 p_scb->app_flow_enable = true; in bta_pan_conn_open()
498 if (p_scb->app_id == bta_pan_cb.app_id[2] && in bta_pan_conn_open()
499 bta_pan_has_multiple_connections(p_scb->app_id)) { in bta_pan_conn_open()
500 p_scb->app_id = BTA_APP_ID_PAN_MULTI; in bta_pan_conn_open()
503 bta_sys_conn_open(BTA_ID_PAN, p_scb->app_id, p_scb->bd_addr); in bta_pan_conn_open()
518 void bta_pan_conn_close(tBTA_PAN_SCB* p_scb, tBTA_PAN_DATA* p_data) { in bta_pan_conn_close() argument
524 bta_sys_conn_close(BTA_ID_PAN, p_scb->app_id, p_scb->bd_addr); in bta_pan_conn_close()
527 while ((p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_scb->data_queue)) != NULL) in bta_pan_conn_close()
530 bta_pan_scb_dealloc(p_scb); in bta_pan_conn_close()
546 void bta_pan_rx_path(tBTA_PAN_SCB* p_scb, UNUSED_ATTR tBTA_PAN_DATA* p_data) { in bta_pan_rx_path() argument
550 if (p_scb->pan_flow_enable) { in bta_pan_rx_path()
552 bta_pan_co_rx_path(p_scb->handle, p_scb->app_id); in bta_pan_rx_path()
570 void bta_pan_tx_path(tBTA_PAN_SCB* p_scb, UNUSED_ATTR tBTA_PAN_DATA* p_data) { in bta_pan_tx_path() argument
571 bta_pan_pm_conn_busy(p_scb); in bta_pan_tx_path()
573 bta_pan_co_tx_path(p_scb->handle, p_scb->app_id); in bta_pan_tx_path()
576 while (fixed_queue_length(p_scb->data_queue) > bta_pan_cb.q_level) { in bta_pan_tx_path()
577 BT_HDR* p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_scb->data_queue); in bta_pan_tx_path()
583 bta_pan_pm_conn_idle(p_scb); in bta_pan_tx_path()
596 void bta_pan_tx_flow(tBTA_PAN_SCB* p_scb, tBTA_PAN_DATA* p_data) { in bta_pan_tx_flow() argument
597 p_scb->app_flow_enable = p_data->ci_tx_flow.enable; in bta_pan_tx_flow()
610 void bta_pan_write_buf(tBTA_PAN_SCB* p_scb, tBTA_PAN_DATA* p_data) { in bta_pan_write_buf() argument
612 bta_pan_pm_conn_busy(p_scb); in bta_pan_write_buf()
614 PAN_WriteBuf(p_scb->handle, ((tBTA_PAN_DATA_PARAMS*)p_data)->dst, in bta_pan_write_buf()
618 bta_pan_pm_conn_idle(p_scb); in bta_pan_write_buf()
632 void bta_pan_free_buf(UNUSED_ATTR tBTA_PAN_SCB* p_scb, tBTA_PAN_DATA* p_data) { in bta_pan_free_buf() argument