Lines Matching refs:linux_cb
188 static tLINUX_CB linux_cb; /* case of multipel port support use array : [MAX_SERIAL_PORT] */ variable
370 clock_gettime(CLOCK_MONOTONIC, &linux_cb.write_time); in setWriteDelay()
373 linux_cb.write_time.tv_sec += delay / 1000; in setWriteDelay()
377 linux_cb.write_time.tv_nsec += write_delay; in setWriteDelay()
378 if (linux_cb.write_time.tv_nsec > 1000*1000*1000) in setWriteDelay()
380 linux_cb.write_time.tv_nsec -= 1000*1000*1000; in setWriteDelay()
381 linux_cb.write_time.tv_sec++; in setWriteDelay()
405 if (now.tv_sec > linux_cb.write_time.tv_sec) in doWriteDelay()
407 else if (now.tv_sec == linux_cb.write_time.tv_sec) in doWriteDelay()
409 if (now.tv_nsec > linux_cb.write_time.tv_nsec) in doWriteDelay()
411 delay = (linux_cb.write_time.tv_nsec - now.tv_nsec) / 1000000; in doWriteDelay()
414 …delay = (linux_cb.write_time.tv_sec - now.tv_sec) * 1000 + linux_cb.write_time.tv_nsec / 1000000 -… in doWriteDelay()
594 memset(&linux_cb, 0, sizeof(linux_cb)); in USERIAL_Init()
595 linux_cb.sock = -1; in USERIAL_Init()
596 linux_cb.ser_cb = NULL; in USERIAL_Init()
597 linux_cb.sock_power_control = -1; in USERIAL_Init()
598 linux_cb.client_device_address = 0; in USERIAL_Init()
773 for (;linux_cb.sock > 0;) in userial_read_thread()
784 rx_length = my_read(linux_cb.sock, current_packet, READ_LIMIT); in userial_read_thread()
807 if (linux_cb.ser_cb != NULL) in userial_read_thread()
808 (*linux_cb.ser_cb)(linux_cb.port, USERIAL_RX_READY_EVT, (tUSERIAL_EVT_DATA *)p_buf); in userial_read_thread()
831 if (linux_cb.ser_cb != NULL) in userial_read_thread()
832 … (*linux_cb.ser_cb)(linux_cb.port, USERIAL_ERR_EVT, (tUSERIAL_EVT_DATA *)p_buf); in userial_read_thread()
1052 if ((linux_cb.sock = open((char*)device_name, O_RDWR | O_NOCTTY )) == -1) in USERIAL_Open()
1058 ALOGD( "%s sock = %d\n", __FUNCTION__, linux_cb.sock); in USERIAL_Open()
1063 linux_cb.sock_power_control = linux_cb.sock; in USERIAL_Open()
1066 … if ((linux_cb.sock_power_control = open((char*)power_control_dev, O_RDWR | O_NOCTTY )) == -1) in USERIAL_Open()
1074 tcflush(linux_cb.sock, TCIOFLUSH); in USERIAL_Open()
1075 tcgetattr(linux_cb.sock, &termios); in USERIAL_Open()
1092 tcsetattr(linux_cb.sock, TCSANOW, &termios); in USERIAL_Open()
1094 tcflush(linux_cb.sock, TCIOFLUSH); in USERIAL_Open()
1097 userial_io_init_bt_wake( linux_cb.sock, &linux_cb.bt_wake_state ); in USERIAL_Open()
1107 linux_cb.ser_cb = p_cback; in USERIAL_Open()
1108 linux_cb.port = port; in USERIAL_Open()
1109 memcpy(&linux_cb.open_cfg, p_cfg, sizeof(tUSERIAL_OPEN_CFG)); in USERIAL_Open()
1255 while (len != 0 && linux_cb.sock != -1) in USERIAL_Write()
1257 ret = TEMP_FAILURE_RETRY(write(linux_cb.sock, p_data + total, len)); in USERIAL_Write()
1302 tcflush(linux_cb.sock, TCIOFLUSH); in userial_change_rate()
1304 tcgetattr(linux_cb.sock, &termios); in userial_change_rate()
1312 tcsetattr(linux_cb.sock, TCSANOW, &termios); in userial_change_rate()
1313 tcflush(linux_cb.sock, TCIOFLUSH); in userial_change_rate()
1319 USERIAL_Close(linux_cb.port); in userial_change_rate()
1324 linux_cb.open_cfg.baud = baud; in userial_change_rate()
1329 USERIAL_Open(linux_cb.port, &linux_cb.open_cfg, linux_cb.ser_cb); in userial_change_rate()
1334 linux_cb.open_cfg.baud = baud; in userial_change_rate()
1335 if (!userial_to_tcio_baud(linux_cb.open_cfg.baud, &tcio_baud)) in userial_change_rate()
1338 tcflush(linux_cb.sock, TCIOFLUSH); in userial_change_rate()
1341 tcgetattr(linux_cb.sock, &termios); in userial_change_rate()
1346 tcsetattr(linux_cb.sock, TCSANOW, &termios); in userial_change_rate()
1348 tcflush(linux_cb.sock, TCIOFLUSH); in userial_change_rate()
1364 USERIAL_Close(linux_cb.port); in userial_close_port()
1398 linux_cb.port = port; in USERIAL_Ioctl()
1504 ALOGD( "%s: closing transport (%d)\n", __FUNCTION__, linux_cb.sock); in userial_close_thread()
1508 if (linux_cb.sock <= 0) in userial_close_thread()
1510 ALOGD( "%s: already closed (%d)\n", __FUNCTION__, linux_cb.sock); in userial_close_thread()
1522 if (linux_cb.sock_power_control > 0) in userial_close_thread()
1524 result = ioctl(linux_cb.sock_power_control, BCMNFC_WAKE_CTL, sleep_state()); in userial_close_thread()
1527 result = ioctl(linux_cb.sock_power_control, BCMNFC_POWER_CTL, 0); in userial_close_thread()
1531 result = close(linux_cb.sock); in userial_close_thread()
1535 if (linux_cb.sock_power_control > 0 && linux_cb.sock_power_control != linux_cb.sock) in userial_close_thread()
1536 result = close(linux_cb.sock_power_control); in userial_close_thread()
1540 linux_cb.sock_power_control = -1; in userial_close_thread()
1541 linux_cb.sock = -1; in userial_close_thread()
1633 if (linux_cb.sock_power_control > 0) in UPIO_Set()
1636 ret = ioctl(linux_cb.sock_power_control, BCMNFC_WAKE_CTL, new_state); in UPIO_Set()
1671 ret = ioctl(linux_cb.sock, BCMNFC_READ_FULL_PACKET, len); in setReadPacketSize()
1677 return (linux_cb.sock == -1) ? TRUE : FALSE; in USERIAL_IsClosed()
1694 ioctl(linux_cb.sock, BCMNFC_READ_MULTI_PACKETS, bcmi2cnfc_read_multi_packets); in USERIAL_PowerupDevice()
1700 if (linux_cb.sock_power_control > 0) in USERIAL_PowerupDevice()
1703 ioctl(linux_cb.sock_power_control, BCMNFC_WAKE_CTL, NFC_WAKE_ASSERTED_ON_POR); in USERIAL_PowerupDevice()
1704 ioctl(linux_cb.sock_power_control, BCMNFC_POWER_CTL, 0); in USERIAL_PowerupDevice()
1706 ret = ioctl(linux_cb.sock_power_control, BCMNFC_POWER_CTL, 1); in USERIAL_PowerupDevice()
1730 linux_cb.client_device_address = bcmi2cnfc_client_addr; in USERIAL_PowerupDevice()
1769 ioctl(linux_cb.sock, BCMNFC_SET_CLIENT_ADDR, DEFAULT_CLIENT_ADDRESS); in change_client_addr()
1771 ret = TEMP_FAILURE_RETRY(write(linux_cb.sock, &addr_data[1], size)); in change_client_addr()
1779 ret = ioctl(linux_cb.sock, BCMNFC_CHANGE_ADDR, addr); in change_client_addr()
1790 ret = ioctl(linux_cb.sock, BCMNFC_SET_CLIENT_ADDR, addr); in change_client_addr()