• Home
  • Raw
  • Download

Lines Matching refs:linux_cb

157 static tLINUX_CB linux_cb;  /* case of multipel port support use array : [MAX_SERIAL_PORT] */  variable
338 clock_gettime(CLOCK_MONOTONIC, &linux_cb.write_time); in setWriteDelay()
341 linux_cb.write_time.tv_sec += delay / 1000; in setWriteDelay()
345 linux_cb.write_time.tv_nsec += write_delay; in setWriteDelay()
346 if (linux_cb.write_time.tv_nsec > 1000*1000*1000) in setWriteDelay()
348 linux_cb.write_time.tv_nsec -= 1000*1000*1000; in setWriteDelay()
349 linux_cb.write_time.tv_sec++; in setWriteDelay()
373 if (now.tv_sec > linux_cb.write_time.tv_sec) in doWriteDelay()
375 else if (now.tv_sec == linux_cb.write_time.tv_sec) in doWriteDelay()
377 if (now.tv_nsec > linux_cb.write_time.tv_nsec) in doWriteDelay()
379 delay = (linux_cb.write_time.tv_nsec - now.tv_nsec) / 1000000; in doWriteDelay()
382 …delay = (linux_cb.write_time.tv_sec - now.tv_sec) * 1000 + linux_cb.write_time.tv_nsec / 1000000 -… in doWriteDelay()
541 memset(&linux_cb, 0, sizeof(linux_cb)); in USERIAL_Init()
542 linux_cb.sock = -1; in USERIAL_Init()
543 linux_cb.ser_cb = NULL; in USERIAL_Init()
544 linux_cb.sock_power_control = -1; in USERIAL_Init()
545 linux_cb.client_device_address = 0; in USERIAL_Init()
716 for (;linux_cb.sock > 0;) in userial_read_thread()
727 rx_length = my_read(linux_cb.sock, current_packet, READ_LIMIT); in userial_read_thread()
750 if (linux_cb.ser_cb != NULL) in userial_read_thread()
751 (*linux_cb.ser_cb)(linux_cb.port, USERIAL_RX_READY_EVT, (tUSERIAL_EVT_DATA *)p_buf); in userial_read_thread()
774 if (linux_cb.ser_cb != NULL) in userial_read_thread()
775 … (*linux_cb.ser_cb)(linux_cb.port, USERIAL_ERR_EVT, (tUSERIAL_EVT_DATA *)p_buf); in userial_read_thread()
994 if ((linux_cb.sock = open((char*)device_name, O_RDWR | O_NOCTTY )) == -1) in USERIAL_Open()
1000 ALOGD( "sock = %d\n", linux_cb.sock); in USERIAL_Open()
1005 linux_cb.sock_power_control = linux_cb.sock; in USERIAL_Open()
1008 … if ((linux_cb.sock_power_control = open((char*)power_control_dev, O_RDWR | O_NOCTTY )) == -1) in USERIAL_Open()
1018 linux_cb.ser_cb = p_cback; in USERIAL_Open()
1019 linux_cb.port = port; in USERIAL_Open()
1020 memcpy(&linux_cb.open_cfg, p_cfg, sizeof(tUSERIAL_OPEN_CFG)); in USERIAL_Open()
1166 ret = write(linux_cb.sock, p_data + total, len); in USERIAL_Write()
1203 tcflush(linux_cb.sock, TCIOFLUSH); in userial_change_rate()
1205 tcgetattr(linux_cb.sock, &termios); in userial_change_rate()
1213 tcsetattr(linux_cb.sock, TCSANOW, &termios); in userial_change_rate()
1214 tcflush(linux_cb.sock, TCIOFLUSH); in userial_change_rate()
1220 USERIAL_Close(linux_cb.port); in userial_change_rate()
1225 linux_cb.open_cfg.baud = baud; in userial_change_rate()
1230 USERIAL_Open(linux_cb.port, &linux_cb.open_cfg, linux_cb.ser_cb); in userial_change_rate()
1235 linux_cb.open_cfg.baud = baud; in userial_change_rate()
1236 if (!userial_to_tcio_baud(linux_cb.open_cfg.baud, &tcio_baud)) in userial_change_rate()
1239 tcflush(linux_cb.sock, TCIOFLUSH); in userial_change_rate()
1242 tcgetattr(linux_cb.sock, &termios); in userial_change_rate()
1247 tcsetattr(linux_cb.sock, TCSANOW, &termios); in userial_change_rate()
1249 tcflush(linux_cb.sock, TCIOFLUSH); in userial_change_rate()
1265 USERIAL_Close(linux_cb.port); in userial_close_port()
1299 linux_cb.port = port; in USERIAL_Ioctl()
1365 ALOGD( "%s: closing transport (%d)\n", __FUNCTION__, linux_cb.sock); in userial_close_thread()
1369 if (linux_cb.sock <= 0) in userial_close_thread()
1371 ALOGD( "%s: already closed (%d)\n", __FUNCTION__, linux_cb.sock); in userial_close_thread()
1383 if (linux_cb.sock_power_control > 0) in userial_close_thread()
1385 result = ioctl(linux_cb.sock_power_control, BCMNFC_WAKE_CTL, sleep_state()); in userial_close_thread()
1388 result = ioctl(linux_cb.sock_power_control, BCMNFC_POWER_CTL, 0); in userial_close_thread()
1392 result = close(linux_cb.sock); in userial_close_thread()
1396 if (linux_cb.sock_power_control > 0 && linux_cb.sock_power_control != linux_cb.sock) in userial_close_thread()
1397 result = close(linux_cb.sock_power_control); in userial_close_thread()
1401 linux_cb.sock_power_control = -1; in userial_close_thread()
1402 linux_cb.sock = -1; in userial_close_thread()
1494 if (linux_cb.sock_power_control > 0) in UPIO_Set()
1497 ret = ioctl(linux_cb.sock_power_control, BCMNFC_WAKE_CTL, new_state); in UPIO_Set()
1532 ret = ioctl(linux_cb.sock, BCMNFC_READ_FULL_PACKET, len); in setReadPacketSize()
1538 return (linux_cb.sock == -1) ? TRUE : FALSE; in USERIAL_IsClosed()
1553 ioctl(linux_cb.sock, BCMNFC_READ_MULTI_PACKETS, bcmi2cnfc_read_multi_packets); in USERIAL_PowerupDevice()
1559 if (linux_cb.sock_power_control > 0) in USERIAL_PowerupDevice()
1561 ioctl(linux_cb.sock_power_control, BCMNFC_POWER_CTL, 0); in USERIAL_PowerupDevice()
1563 ioctl(linux_cb.sock_power_control, BCMNFC_POWER_CTL, 1); in USERIAL_PowerupDevice()
1565 ret = ioctl(linux_cb.sock_power_control, BCMNFC_WAKE_CTL, current_nfc_wake_state); in USERIAL_PowerupDevice()
1585 ret = ioctl(linux_cb.sock, BCMNFC_CHANGE_ADDR, bcmi2cnfc_client_addr); in USERIAL_PowerupDevice()
1588 linux_cb.client_device_address = bcmi2cnfc_client_addr; in USERIAL_PowerupDevice()