Lines Matching refs:p_scb
2274 btif_hl_soc_cb_t *p_scb = p_dcb->p_scb; in btif_hl_send_disconnecting_cb() local
2276 int app_id = (int) btif_hl_get_app_id(p_scb->channel_id); in btif_hl_send_disconnecting_cb()
2278 btif_hl_copy_bda(&bd_addr, p_scb->bd_addr); in btif_hl_send_disconnecting_cb()
2281 …"call channel state callback channel_id=0x%08x mdep_cfg_idx=%d, state=%d fd=%d",p_scb->channel_id, in btif_hl_send_disconnecting_cb()
2282 p_scb->mdep_cfg_idx, BTHL_CONN_STATE_DISCONNECTING, p_scb->socket_id[0]); in btif_hl_send_disconnecting_cb()
2285 &bd_addr, p_scb->mdep_cfg_idx, in btif_hl_send_disconnecting_cb()
2286 p_scb->channel_id, BTHL_CONN_STATE_DISCONNECTING, p_scb->socket_id[0] ); in btif_hl_send_disconnecting_cb()
4579 btif_hl_soc_cb_t *p_scb = NULL; in btif_hl_update_maxfd() local
4587 p_scb = (btif_hl_soc_cb_t *)GKI_getfirst((void *)&soc_queue); in btif_hl_update_maxfd()
4588 if (maxfd < p_scb->max_s) in btif_hl_update_maxfd()
4590 maxfd = p_scb->max_s; in btif_hl_update_maxfd()
4593 while (p_scb != NULL) in btif_hl_update_maxfd()
4595 if (maxfd < p_scb->max_s) in btif_hl_update_maxfd()
4597 maxfd = p_scb->max_s; in btif_hl_update_maxfd()
4600 p_scb = (btif_hl_soc_cb_t *)GKI_getnext((void *)p_scb ); in btif_hl_update_maxfd()
4616 btif_hl_soc_state_t btif_hl_get_socket_state(btif_hl_soc_cb_t *p_scb){ in btif_hl_get_socket_state() argument
4617 BTIF_TRACE_DEBUG1("btif_hl_get_socket_state state=%d", p_scb->state); in btif_hl_get_socket_state()
4618 return p_scb->state; in btif_hl_get_socket_state()
4629 void btif_hl_set_socket_state(btif_hl_soc_cb_t *p_scb, btif_hl_soc_state_t new_state){ in btif_hl_set_socket_state() argument
4630 BTIF_TRACE_DEBUG2("btif_hl_set_socket_state %d---->%d", p_scb->state, new_state); in btif_hl_set_socket_state()
4631 p_scb->state = new_state; in btif_hl_set_socket_state()
4643 btif_hl_soc_cb_t *p_scb = NULL; in btif_hl_release_mcl_sockets() local
4651 if (p_dcb && p_dcb->in_use && p_dcb->p_scb) in btif_hl_release_mcl_sockets()
4654 btif_hl_set_socket_state (p_dcb->p_scb, BTIF_HL_SOC_STATE_W4_REL); in btif_hl_release_mcl_sockets()
4655 p_dcb->p_scb = NULL; in btif_hl_release_mcl_sockets()
4672 btif_hl_soc_cb_t *p_scb = NULL; in btif_hl_release_socket() local
4678 if (p_dcb && p_dcb->p_scb) in btif_hl_release_socket()
4680 p_scb = p_dcb->p_scb; in btif_hl_release_socket()
4681 btif_hl_set_socket_state(p_scb, BTIF_HL_SOC_STATE_W4_REL); in btif_hl_release_socket()
4682 p_dcb->p_scb = NULL; in btif_hl_release_socket()
4698 btif_hl_soc_cb_t *p_scb = NULL; in btif_hl_create_socket() local
4704 if (p_dcb && ((p_scb = (btif_hl_soc_cb_t *)GKI_getbuf((UINT16)sizeof(btif_hl_soc_cb_t)))!=NULL)) in btif_hl_create_socket()
4706 if (socketpair(AF_UNIX, SOCK_STREAM, 0, p_scb->socket_id) >= 0) in btif_hl_create_socket()
4708 BTIF_TRACE_DEBUG2("socket id[0]=%d id[1]=%d",p_scb->socket_id[0], p_scb->socket_id[1] ); in btif_hl_create_socket()
4709 p_dcb->p_scb = p_scb; in btif_hl_create_socket()
4710 p_scb->app_idx = app_idx; in btif_hl_create_socket()
4711 p_scb->mcl_idx = mcl_idx; in btif_hl_create_socket()
4712 p_scb->mdl_idx = mdl_idx; in btif_hl_create_socket()
4713 p_scb->channel_id = p_dcb->channel_id; in btif_hl_create_socket()
4714 p_scb->mdep_cfg_idx = p_dcb->local_mdep_cfg_idx; in btif_hl_create_socket()
4715 memcpy(p_scb->bd_addr, p_mcb->bd_addr,sizeof(BD_ADDR)); in btif_hl_create_socket()
4716 btif_hl_set_socket_state(p_scb, BTIF_HL_SOC_STATE_W4_ADD); in btif_hl_create_socket()
4717 p_scb->max_s = p_scb->socket_id[1]; in btif_hl_create_socket()
4718 GKI_enqueue(&soc_queue, (void *) p_scb); in btif_hl_create_socket()
4725 btif_hl_free_buf((void **)&p_scb); in btif_hl_create_socket()
4742 btif_hl_soc_cb_t *p_scb = NULL; in btif_hl_add_socket_to_set() local
4753 p_scb = (btif_hl_soc_cb_t *)GKI_getfirst((void *)&soc_queue); in btif_hl_add_socket_to_set()
4754 BTIF_TRACE_DEBUG1("btif_hl_add_socket_to_set first p_scb=0x%x", p_scb); in btif_hl_add_socket_to_set()
4755 while (p_scb != NULL) in btif_hl_add_socket_to_set()
4757 if (btif_hl_get_socket_state(p_scb) == BTIF_HL_SOC_STATE_W4_ADD) in btif_hl_add_socket_to_set()
4759 btif_hl_set_socket_state(p_scb, BTIF_HL_SOC_STATE_W4_READ); in btif_hl_add_socket_to_set()
4760 FD_SET(p_scb->socket_id[1], p_org_set); in btif_hl_add_socket_to_set()
4761 …BTIF_TRACE_DEBUG2("found and set socket_id=%d is_set=%d", p_scb->socket_id[1], FD_ISSET(p_scb->soc… in btif_hl_add_socket_to_set()
4762 p_mcb = BTIF_HL_GET_MCL_CB_PTR(p_scb->app_idx, p_scb->mcl_idx); in btif_hl_add_socket_to_set()
4763 p_dcb = BTIF_HL_GET_MDL_CB_PTR(p_scb->app_idx, p_scb->mcl_idx, p_scb->mdl_idx); in btif_hl_add_socket_to_set()
4766 btif_hl_stop_cch_timer(p_scb->app_idx, p_scb->mcl_idx); in btif_hl_add_socket_to_set()
4770 evt_param.chan_cb.fd = p_scb->socket_id[0]; in btif_hl_add_socket_to_set()
4779 p_scb = (btif_hl_soc_cb_t *)GKI_getnext((void *)p_scb ); in btif_hl_add_socket_to_set()
4780 BTIF_TRACE_DEBUG1("next p_scb=0x%x", p_scb); in btif_hl_add_socket_to_set()
4796 btif_hl_soc_cb_t *p_scb = NULL; in btif_hl_close_socket() local
4806 p_scb = (btif_hl_soc_cb_t *)GKI_getfirst((void *)&soc_queue); in btif_hl_close_socket()
4807 while (p_scb != NULL) in btif_hl_close_socket()
4809 if (btif_hl_get_socket_state(p_scb) == BTIF_HL_SOC_STATE_W4_REL) in btif_hl_close_socket()
4812 p_scb->app_idx, p_scb->mcl_idx, p_scb->mdl_idx); in btif_hl_close_socket()
4813 btif_hl_set_socket_state(p_scb, BTIF_HL_SOC_STATE_IDLE); in btif_hl_close_socket()
4814 if (p_scb->socket_id[1] != -1) in btif_hl_close_socket()
4816 FD_CLR(p_scb->socket_id[1] , p_org_set); in btif_hl_close_socket()
4817 shutdown(p_scb->socket_id[1], SHUT_RDWR); in btif_hl_close_socket()
4818 close(p_scb->socket_id[1]); in btif_hl_close_socket()
4820 evt_param.chan_cb.app_id = (int) btif_hl_get_app_id(p_scb->channel_id); in btif_hl_close_socket()
4821 memcpy(evt_param.chan_cb.bd_addr, p_scb->bd_addr, sizeof(BD_ADDR)); in btif_hl_close_socket()
4822 evt_param.chan_cb.channel_id = p_scb->channel_id; in btif_hl_close_socket()
4823 evt_param.chan_cb.fd = p_scb->socket_id[0]; in btif_hl_close_socket()
4824 evt_param.chan_cb.mdep_cfg_index = (int ) p_scb->mdep_cfg_idx; in btif_hl_close_socket()
4835 p_scb = (btif_hl_soc_cb_t *)GKI_getnext((void *)p_scb ); in btif_hl_close_socket()
4836 BTIF_TRACE_DEBUG1("while loop next p_scb=0x%x", p_scb); in btif_hl_close_socket()
4839 p_scb = (btif_hl_soc_cb_t *)GKI_getfirst((void *)&soc_queue); in btif_hl_close_socket()
4840 while (p_scb != NULL) in btif_hl_close_socket()
4842 if (btif_hl_get_socket_state(p_scb) == BTIF_HL_SOC_STATE_IDLE) in btif_hl_close_socket()
4844 p_dcb = BTIF_HL_GET_MDL_CB_PTR(p_scb->app_idx, p_scb->mcl_idx, p_scb->mdl_idx); in btif_hl_close_socket()
4846 p_scb->app_idx, p_scb->mcl_idx, p_scb->mdl_idx, p_dcb->in_use); in btif_hl_close_socket()
4847 GKI_remove_from_queue((void *)&soc_queue, p_scb); in btif_hl_close_socket()
4848 btif_hl_free_buf((void **)&p_scb); in btif_hl_close_socket()
4849 p_dcb->p_scb = NULL; in btif_hl_close_socket()
4852 BTIF_TRACE_DEBUG2("element_removed=%d p_scb=0x%x", element_removed, p_scb); in btif_hl_close_socket()
4856 p_scb = (btif_hl_soc_cb_t *)GKI_getfirst((void *)&soc_queue); in btif_hl_close_socket()
4859 p_scb = (btif_hl_soc_cb_t *)GKI_getnext((void *)p_scb ); in btif_hl_close_socket()
4861 BTIF_TRACE_DEBUG1("while loop p_scb=0x%x", p_scb); in btif_hl_close_socket()
4900 btif_hl_soc_cb_t *p_scb = NULL; in btif_hl_select_monitor_callback() local
4908 p_scb = (btif_hl_soc_cb_t *)GKI_getfirst((void *)&soc_queue); in btif_hl_select_monitor_callback()
4910 while (p_scb != NULL) in btif_hl_select_monitor_callback()
4912 if (btif_hl_get_socket_state(p_scb) == BTIF_HL_SOC_STATE_W4_READ) in btif_hl_select_monitor_callback()
4914 if (FD_ISSET(p_scb->socket_id[1], p_cur_set)) in btif_hl_select_monitor_callback()
4918 p_dcb = BTIF_HL_GET_MDL_CB_PTR(p_scb->app_idx, p_scb->mcl_idx, p_scb->mdl_idx); in btif_hl_select_monitor_callback()
4932 … if ((r = (int)recv(p_scb->socket_id[1], p_dcb->p_tx_pkt, p_dcb->mtu , MSG_DONTWAIT)) > 0) in btif_hl_select_monitor_callback()
4948 p_scb = (btif_hl_soc_cb_t *)GKI_getnext((void *)p_scb ); in btif_hl_select_monitor_callback()