Lines Matching refs:fd
63 int fd; /* fd to Bluetooth device */ member
138 void userial_ioctl_init_bt_wake(int fd) in userial_ioctl_init_bt_wake() argument
146 if (ioctl(vnd_userial.fd, TIOCSETD, &ldisc) < 0) in userial_ioctl_init_bt_wake()
149 fd, errno, ldisc); in userial_ioctl_init_bt_wake()
156 ioctl(fd, USERIAL_IOCTL_BT_WAKE_ASSERT, NULL); in userial_ioctl_init_bt_wake()
157 ioctl(fd, USERIAL_IOCTL_BT_WAKE_GET_ST, &bt_wake_state); in userial_ioctl_init_bt_wake()
179 vnd_userial.fd = -1; in userial_vendor_init()
200 vnd_userial.fd = -1; in userial_vendor_open()
245 if ((vnd_userial.fd = open(vnd_userial.port_name, O_RDWR)) == -1) in userial_vendor_open()
251 tcflush(vnd_userial.fd, TCIOFLUSH); in userial_vendor_open()
253 tcgetattr(vnd_userial.fd, &vnd_userial.termios); in userial_vendor_open()
256 tcsetattr(vnd_userial.fd, TCSANOW, &vnd_userial.termios); in userial_vendor_open()
257 tcflush(vnd_userial.fd, TCIOFLUSH); in userial_vendor_open()
259 tcsetattr(vnd_userial.fd, TCSANOW, &vnd_userial.termios); in userial_vendor_open()
260 tcflush(vnd_userial.fd, TCIOFLUSH); in userial_vendor_open()
261 tcflush(vnd_userial.fd, TCIOFLUSH); in userial_vendor_open()
266 tcsetattr(vnd_userial.fd, TCSANOW, &vnd_userial.termios); in userial_vendor_open()
269 userial_ioctl_init_bt_wake(vnd_userial.fd); in userial_vendor_open()
272 ALOGI("device fd = %d open", vnd_userial.fd); in userial_vendor_open()
274 return vnd_userial.fd; in userial_vendor_open()
290 if (vnd_userial.fd == -1) in userial_vendor_close()
295 ioctl(vnd_userial.fd, USERIAL_IOCTL_BT_WAKE_DEASSERT, NULL); in userial_vendor_close()
298 ALOGI("device fd = %d close", vnd_userial.fd); in userial_vendor_close()
300 tcflush(vnd_userial.fd, TCIOFLUSH); in userial_vendor_close()
301 if ((result = close(vnd_userial.fd)) < 0) in userial_vendor_close()
302 ALOGE( "close(fd:%d) FAILED result:%d", vnd_userial.fd, result); in userial_vendor_close()
304 vnd_userial.fd = -1; in userial_vendor_close()
324 tcsetattr(vnd_userial.fd, TCSANOW, &vnd_userial.termios); in userial_vendor_set_baud()
343 ioctl(vnd_userial.fd, USERIAL_IOCTL_BT_WAKE_ASSERT, NULL); in userial_vendor_ioctl()
348 ioctl(vnd_userial.fd, USERIAL_IOCTL_BT_WAKE_DEASSERT, NULL); in userial_vendor_ioctl()
352 ioctl(vnd_userial.fd, USERIAL_IOCTL_BT_WAKE_GET_ST, p_data); in userial_vendor_ioctl()