Lines Matching refs:linux_cb

187 static tLINUX_CB linux_cb;  /* case of multipel port support use array : [MAX_SERIAL_PORT] */  variable
369 clock_gettime(CLOCK_MONOTONIC, &linux_cb.write_time); in setWriteDelay()
372 linux_cb.write_time.tv_sec += delay / 1000; in setWriteDelay()
376 linux_cb.write_time.tv_nsec += write_delay; in setWriteDelay()
377 if (linux_cb.write_time.tv_nsec > 1000*1000*1000) in setWriteDelay()
379 linux_cb.write_time.tv_nsec -= 1000*1000*1000; in setWriteDelay()
380 linux_cb.write_time.tv_sec++; in setWriteDelay()
404 if (now.tv_sec > linux_cb.write_time.tv_sec) in doWriteDelay()
406 else if (now.tv_sec == linux_cb.write_time.tv_sec) in doWriteDelay()
408 if (now.tv_nsec > linux_cb.write_time.tv_nsec) in doWriteDelay()
410 delay = (linux_cb.write_time.tv_nsec - now.tv_nsec) / 1000000; in doWriteDelay()
413 …delay = (linux_cb.write_time.tv_sec - now.tv_sec) * 1000 + linux_cb.write_time.tv_nsec / 1000000 -… in doWriteDelay()
593 memset(&linux_cb, 0, sizeof(linux_cb)); in USERIAL_Init()
594 linux_cb.sock = -1; in USERIAL_Init()
595 linux_cb.ser_cb = NULL; in USERIAL_Init()
596 linux_cb.sock_power_control = -1; in USERIAL_Init()
597 linux_cb.client_device_address = 0; in USERIAL_Init()
772 for (;linux_cb.sock > 0;) in userial_read_thread()
783 rx_length = my_read(linux_cb.sock, current_packet, READ_LIMIT); in userial_read_thread()
806 if (linux_cb.ser_cb != NULL) in userial_read_thread()
807 (*linux_cb.ser_cb)(linux_cb.port, USERIAL_RX_READY_EVT, (tUSERIAL_EVT_DATA *)p_buf); in userial_read_thread()
830 if (linux_cb.ser_cb != NULL) in userial_read_thread()
831 … (*linux_cb.ser_cb)(linux_cb.port, USERIAL_ERR_EVT, (tUSERIAL_EVT_DATA *)p_buf); in userial_read_thread()
1051 if ((linux_cb.sock = open((char*)device_name, O_RDWR | O_NOCTTY )) == -1) in USERIAL_Open()
1057 ALOGD( "%s sock = %d\n", __FUNCTION__, linux_cb.sock); in USERIAL_Open()
1062 linux_cb.sock_power_control = linux_cb.sock; in USERIAL_Open()
1065 … if ((linux_cb.sock_power_control = open((char*)power_control_dev, O_RDWR | O_NOCTTY )) == -1) in USERIAL_Open()
1073 tcflush(linux_cb.sock, TCIOFLUSH); in USERIAL_Open()
1074 tcgetattr(linux_cb.sock, &termios); in USERIAL_Open()
1091 tcsetattr(linux_cb.sock, TCSANOW, &termios); in USERIAL_Open()
1093 tcflush(linux_cb.sock, TCIOFLUSH); in USERIAL_Open()
1096 userial_io_init_bt_wake( linux_cb.sock, &linux_cb.bt_wake_state ); in USERIAL_Open()
1106 linux_cb.ser_cb = p_cback; in USERIAL_Open()
1107 linux_cb.port = port; in USERIAL_Open()
1108 memcpy(&linux_cb.open_cfg, p_cfg, sizeof(tUSERIAL_OPEN_CFG)); in USERIAL_Open()
1254 while (len != 0 && linux_cb.sock != -1) in USERIAL_Write()
1256 ret = write(linux_cb.sock, p_data + total, len); in USERIAL_Write()
1301 tcflush(linux_cb.sock, TCIOFLUSH); in userial_change_rate()
1303 tcgetattr(linux_cb.sock, &termios); in userial_change_rate()
1311 tcsetattr(linux_cb.sock, TCSANOW, &termios); in userial_change_rate()
1312 tcflush(linux_cb.sock, TCIOFLUSH); in userial_change_rate()
1318 USERIAL_Close(linux_cb.port); in userial_change_rate()
1323 linux_cb.open_cfg.baud = baud; in userial_change_rate()
1328 USERIAL_Open(linux_cb.port, &linux_cb.open_cfg, linux_cb.ser_cb); in userial_change_rate()
1333 linux_cb.open_cfg.baud = baud; in userial_change_rate()
1334 if (!userial_to_tcio_baud(linux_cb.open_cfg.baud, &tcio_baud)) in userial_change_rate()
1337 tcflush(linux_cb.sock, TCIOFLUSH); in userial_change_rate()
1340 tcgetattr(linux_cb.sock, &termios); in userial_change_rate()
1345 tcsetattr(linux_cb.sock, TCSANOW, &termios); in userial_change_rate()
1347 tcflush(linux_cb.sock, TCIOFLUSH); in userial_change_rate()
1363 USERIAL_Close(linux_cb.port); in userial_close_port()
1397 linux_cb.port = port; in USERIAL_Ioctl()
1503 ALOGD( "%s: closing transport (%d)\n", __FUNCTION__, linux_cb.sock); in userial_close_thread()
1507 if (linux_cb.sock <= 0) in userial_close_thread()
1509 ALOGD( "%s: already closed (%d)\n", __FUNCTION__, linux_cb.sock); in userial_close_thread()
1521 if (linux_cb.sock_power_control > 0) in userial_close_thread()
1523 result = ioctl(linux_cb.sock_power_control, BCMNFC_WAKE_CTL, sleep_state()); in userial_close_thread()
1526 result = ioctl(linux_cb.sock_power_control, BCMNFC_POWER_CTL, 0); in userial_close_thread()
1530 result = close(linux_cb.sock); in userial_close_thread()
1534 if (linux_cb.sock_power_control > 0 && linux_cb.sock_power_control != linux_cb.sock) in userial_close_thread()
1535 result = close(linux_cb.sock_power_control); in userial_close_thread()
1539 linux_cb.sock_power_control = -1; in userial_close_thread()
1540 linux_cb.sock = -1; in userial_close_thread()
1632 if (linux_cb.sock_power_control > 0) in UPIO_Set()
1635 ret = ioctl(linux_cb.sock_power_control, BCMNFC_WAKE_CTL, new_state); in UPIO_Set()
1670 ret = ioctl(linux_cb.sock, BCMNFC_READ_FULL_PACKET, len); in setReadPacketSize()
1676 return (linux_cb.sock == -1) ? TRUE : FALSE; in USERIAL_IsClosed()
1693 ioctl(linux_cb.sock, BCMNFC_READ_MULTI_PACKETS, bcmi2cnfc_read_multi_packets); in USERIAL_PowerupDevice()
1699 if (linux_cb.sock_power_control > 0) in USERIAL_PowerupDevice()
1702 ioctl(linux_cb.sock_power_control, BCMNFC_WAKE_CTL, NFC_WAKE_ASSERTED_ON_POR); in USERIAL_PowerupDevice()
1703 ioctl(linux_cb.sock_power_control, BCMNFC_POWER_CTL, 0); in USERIAL_PowerupDevice()
1705 ret = ioctl(linux_cb.sock_power_control, BCMNFC_POWER_CTL, 1); in USERIAL_PowerupDevice()
1729 linux_cb.client_device_address = bcmi2cnfc_client_addr; in USERIAL_PowerupDevice()
1768 ioctl(linux_cb.sock, BCMNFC_SET_CLIENT_ADDR, DEFAULT_CLIENT_ADDRESS); in change_client_addr()
1770 ret = write(linux_cb.sock, &addr_data[1], size); in change_client_addr()
1778 ret = ioctl(linux_cb.sock, BCMNFC_CHANGE_ADDR, addr); in change_client_addr()
1789 ret = ioctl(linux_cb.sock, BCMNFC_SET_CLIENT_ADDR, addr); in change_client_addr()