Lines Matching refs:ch

192   memset(&uipc.ch, 0, sizeof(uipc.ch));  in uipc_main_init()
203 tUIPC_CHAN* p = &uipc.ch[i]; in uipc_main_init()
230 if (uipc.ch[i].task_evt_flags & UIPC_TASK_FLAG_DISCONNECT_CHAN) { in uipc_check_task_flags_locked()
231 uipc.ch[i].task_evt_flags &= ~UIPC_TASK_FLAG_DISCONNECT_CHAN; in uipc_check_task_flags_locked()
245 if (SAFE_FD_ISSET(uipc.ch[ch_id].srvfd, &uipc.read_set)) { in uipc_check_fd_locked()
249 if (uipc.ch[ch_id].fd != UIPC_DISCONNECTED) { in uipc_check_fd_locked()
250 BTIF_TRACE_EVENT("CLOSE CONNECTION (FD %d)", uipc.ch[ch_id].fd); in uipc_check_fd_locked()
251 close(uipc.ch[ch_id].fd); in uipc_check_fd_locked()
252 FD_CLR(uipc.ch[ch_id].fd, &uipc.active_set); in uipc_check_fd_locked()
253 uipc.ch[ch_id].fd = UIPC_DISCONNECTED; in uipc_check_fd_locked()
256 uipc.ch[ch_id].fd = accept_server_socket(uipc.ch[ch_id].srvfd); in uipc_check_fd_locked()
258 BTIF_TRACE_EVENT("NEW FD %d", uipc.ch[ch_id].fd); in uipc_check_fd_locked()
260 if ((uipc.ch[ch_id].fd >= 0) && uipc.ch[ch_id].cback) { in uipc_check_fd_locked()
263 BTIF_TRACE_EVENT("ADD FD %d TO ACTIVE SET", uipc.ch[ch_id].fd); in uipc_check_fd_locked()
264 FD_SET(uipc.ch[ch_id].fd, &uipc.active_set); in uipc_check_fd_locked()
265 uipc.max_fd = MAX(uipc.max_fd, uipc.ch[ch_id].fd); in uipc_check_fd_locked()
268 if (uipc.ch[ch_id].fd < 0) { in uipc_check_fd_locked()
273 if (uipc.ch[ch_id].cback) uipc.ch[ch_id].cback(ch_id, UIPC_OPEN_EVT); in uipc_check_fd_locked()
278 if (SAFE_FD_ISSET(uipc.ch[ch_id].fd, &uipc.read_set)) { in uipc_check_fd_locked()
281 if (uipc.ch[ch_id].cback) in uipc_check_fd_locked()
282 uipc.ch[ch_id].cback(ch_id, UIPC_RX_DATA_READY_EVT); in uipc_check_fd_locked()
323 uipc.ch[ch_id].srvfd = fd; in uipc_setup_server_locked()
324 uipc.ch[ch_id].cback = cback; in uipc_setup_server_locked()
325 uipc.ch[ch_id].read_poll_tmo_ms = DEFAULT_READ_POLL_TMO_MS; in uipc_setup_server_locked()
338 pfd.fd = uipc.ch[ch_id].fd; in uipc_flush_ch_locked()
340 if (uipc.ch[ch_id].fd == UIPC_DISCONNECTED) { in uipc_flush_ch_locked()
393 if (uipc.ch[ch_id].srvfd != UIPC_DISCONNECTED) { in uipc_close_ch_locked()
394 BTIF_TRACE_EVENT("CLOSE SERVER (FD %d)", uipc.ch[ch_id].srvfd); in uipc_close_ch_locked()
395 close(uipc.ch[ch_id].srvfd); in uipc_close_ch_locked()
396 FD_CLR(uipc.ch[ch_id].srvfd, &uipc.active_set); in uipc_close_ch_locked()
397 uipc.ch[ch_id].srvfd = UIPC_DISCONNECTED; in uipc_close_ch_locked()
401 if (uipc.ch[ch_id].fd != UIPC_DISCONNECTED) { in uipc_close_ch_locked()
402 BTIF_TRACE_EVENT("CLOSE CONNECTION (FD %d)", uipc.ch[ch_id].fd); in uipc_close_ch_locked()
403 close(uipc.ch[ch_id].fd); in uipc_close_ch_locked()
404 FD_CLR(uipc.ch[ch_id].fd, &uipc.active_set); in uipc_close_ch_locked()
405 uipc.ch[ch_id].fd = UIPC_DISCONNECTED; in uipc_close_ch_locked()
410 if (uipc.ch[ch_id].cback) uipc.ch[ch_id].cback(ch_id, UIPC_CLOSE_EVT); in uipc_close_ch_locked()
419 if (uipc.ch[ch_id].srvfd == UIPC_DISCONNECTED) { in uipc_close_locked()
425 uipc.ch[ch_id].task_evt_flags |= UIPC_TASK_FLAG_DISCONNECT_CHAN; in uipc_close_locked()
552 if (uipc.ch[ch_id].srvfd != UIPC_DISCONNECTED) { in UIPC_Open()
603 OSI_NO_INTR(ret = write(uipc.ch[ch_id].fd, p_buf, msglen)); in UIPC_Send()
630 int fd = uipc.ch[ch_id].fd; in UIPC_Read()
646 OSI_NO_INTR(poll_ret = poll(&pfd, 1, uipc.ch[ch_id].read_poll_tmo_ms)); in UIPC_Read()
649 uipc.ch[ch_id].read_poll_tmo_ms); in UIPC_Read()
714 uipc.ch[ch_id].cback = (tUIPC_RCV_CBACK*)param; in UIPC_Ioctl()
719 if (uipc.ch[ch_id].fd != UIPC_DISCONNECTED) { in UIPC_Ioctl()
721 FD_CLR(uipc.ch[ch_id].fd, &uipc.active_set); in UIPC_Ioctl()
729 uipc.ch[ch_id].read_poll_tmo_ms = (intptr_t)param; in UIPC_Ioctl()
731 uipc.ch[ch_id].read_poll_tmo_ms); in UIPC_Ioctl()