Lines Matching refs:btpan_cb

93 btpan_cb_t btpan_cb;  variable
129 btpan_cb.enabled); in btif_pan_init()
132 if (jni_initialized && !btpan_cb.enabled) { in btif_pan_init()
134 memset(&btpan_cb, 0, sizeof(btpan_cb)); in btif_pan_init()
135 btpan_cb.tap_fd = INVALID_FD; in btif_pan_init()
136 btpan_cb.flow = 1; in btif_pan_init()
138 btpan_cleanup_conn(&btpan_cb.conns[i]); in btif_pan_init()
140 btpan_cb.enabled = 1; in btif_pan_init()
146 if (btpan_cb.enabled) { in pan_disable()
147 btpan_cb.enabled = 0; in pan_disable()
149 if (btpan_cb.tap_fd != INVALID_FD) { in pan_disable()
150 btpan_tap_close(btpan_cb.tap_fd); in pan_disable()
151 btpan_cb.tap_fd = INVALID_FD; in pan_disable()
161 btpan_cleanup_conn(&btpan_cb.conns[i]); in btif_pan_cleanup()
170 stack_initialized, btpan_cb.enabled); in btpan_jni_init()
173 if (stack_initialized && !btpan_cb.enabled) btif_pan_init(); in btpan_jni_init()
367 if (btpan_cb.tap_fd == -1) return; in btpan_set_flow_control()
369 btpan_cb.flow = enable; in btpan_set_flow_control()
371 btsock_thread_add_fd(pan_pth, btpan_cb.tap_fd, 0, SOCK_THREAD_FD_RD, 0); in btpan_set_flow_control()
373 base::Bind(btu_exec_tap_fd_read, btpan_cb.tap_fd)); in btpan_set_flow_control()
445 if (btpan_cb.conns[i].handle == handle) return &btpan_cb.conns[i]; in btpan_find_conn_handle()
452 if (btpan_cb.conns[i].peer == addr) return &btpan_cb.conns[i]; in btpan_find_conn_addr()
470 btpan_cb.tap_fd, btpan_cb.open_count, conn->handle, p_data->open.handle, in btpan_open_conn()
473 btpan_cb.open_count++; in btpan_open_conn()
475 if (btpan_cb.tap_fd < 0) { in btpan_open_conn()
476 btpan_cb.tap_fd = btpan_tap_open(); in btpan_open_conn()
477 if (btpan_cb.tap_fd >= 0) create_tap_read_thread(btpan_cb.tap_fd); in btpan_open_conn()
480 if (btpan_cb.tap_fd >= 0) { in btpan_open_conn()
481 btpan_cb.flow = 1; in btpan_open_conn()
494 btpan_cb.open_count--; in btpan_close_conn()
496 if (btpan_cb.open_count == 0) { in btpan_close_conn()
498 if (btpan_cb.tap_fd != INVALID_FD) { in btpan_close_conn()
499 btpan_tap_close(btpan_cb.tap_fd); in btpan_close_conn()
500 btpan_cb.tap_fd = INVALID_FD; in btpan_close_conn()
519 BTIF_TRACE_DEBUG("conns[%d]:%d", i, btpan_cb.conns[i].handle); in btpan_new_conn()
520 if (btpan_cb.conns[i].handle == -1) { in btpan_new_conn()
524 btpan_cb.conns[i].handle = handle; in btpan_new_conn()
525 btpan_cb.conns[i].peer = addr; in btpan_new_conn()
526 btpan_cb.conns[i].local_role = local_role; in btpan_new_conn()
527 btpan_cb.conns[i].remote_role = remote_role; in btpan_new_conn()
528 return &btpan_cb.conns[i]; in btpan_new_conn()
557 uint16_t handle = btpan_cb.conns[i].handle; in forward_bnep()
559 (broadcast || btpan_cb.conns[i].eth_addr == eth_hdr->h_dest || in forward_bnep()
560 btpan_cb.conns[i].peer == eth_hdr->h_dest)) { in forward_bnep()
671 if (fd == INVALID_FD || fd != btpan_cb.tap_fd) return; in btu_exec_tap_fd_read()
676 for (int i = 0; i < PAN_BUF_MAX && btif_is_enabled() && btpan_cb.flow; i++) { in btu_exec_tap_fd_read()
688 if (!btpan_cb.congest_packet_size) { in btu_exec_tap_fd_read()
690 OSI_NO_INTR(ret = read(fd, btpan_cb.congest_packet, in btu_exec_tap_fd_read()
691 sizeof(btpan_cb.congest_packet))); in btu_exec_tap_fd_read()
707 btpan_cb.congest_packet_size = ret; in btu_exec_tap_fd_read()
712 memcpy(packet, btpan_cb.congest_packet, in btu_exec_tap_fd_read()
713 MIN(btpan_cb.congest_packet_size, buffer->len)); in btu_exec_tap_fd_read()
714 buffer->len = MIN(btpan_cb.congest_packet_size, buffer->len); in btu_exec_tap_fd_read()
728 btpan_cb.congest_packet_size = 0; in btu_exec_tap_fd_read()
732 btpan_cb.congest_packet_size = 0; in btu_exec_tap_fd_read()
746 if (btpan_cb.flow) { in btu_exec_tap_fd_read()
756 if (btpan_cb.conns[i].handle != -1) BTA_PanClose(btpan_cb.conns[i].handle); in btif_pan_close_all_conns()
762 CHECK(btpan_cb.tap_fd == INVALID_FD || btpan_cb.tap_fd == fd); in btpan_tap_fd_signaled()
764 if (btpan_cb.tap_fd != fd) { in btpan_tap_fd_signaled()
766 __func__, btpan_cb.tap_fd, fd); in btpan_tap_fd_signaled()
771 btpan_cb.tap_fd = INVALID_FD; in btpan_tap_fd_signaled()