21 #ifndef WINPR_COMM_PRIVATE_H
22 #define WINPR_COMM_PRIVATE_H
24 #if defined(__linux__)
25 #define WINPR_HAVE_COMM_COUNTERS
26 #include <linux/serial.h>
29 #include <winpr/comm.h>
31 #include "../handle/handle.h"
32 #include <winpr/config.h>
34 #if defined(WINPR_HAVE_SYS_EVENTFD_H)
35 #include <sys/eventfd.h>
66 SERIAL_DRIVER_ID serverSerialDriverId;
72 #if defined(WINPR_HAVE_COMM_COUNTERS)
73 struct serial_icounter_struct counters;
84 #define SERIAL_EV_RXCHAR 0x0001
85 #define SERIAL_EV_RXFLAG 0x0002
86 #define SERIAL_EV_TXEMPTY 0x0004
87 #define SERIAL_EV_CTS 0x0008
88 #define SERIAL_EV_DSR 0x0010
89 #define SERIAL_EV_RLSD 0x0020
90 #define SERIAL_EV_BREAK 0x0040
91 #define SERIAL_EV_ERR 0x0080
92 #define SERIAL_EV_RING 0x0100
93 #define SERIAL_EV_PERR 0x0200
94 #define SERIAL_EV_RX80FULL 0x0400
95 #define SERIAL_EV_EVENT1 0x0800
96 #define SERIAL_EV_EVENT2 0x1000
97 #define SERIAL_EV_WINPR_WAITING 0x4000
98 #define SERIAL_EV_WINPR_STOP 0x8000
100 #define WINPR_PURGE_TXABORT 0x00000001
101 #define WINPR_PURGE_RXABORT 0x00000002
103 void CommLog_Print(DWORD wlog_level, ...);
105 BOOL CommIsHandled(HANDLE handle);
106 BOOL CommIsHandleValid(HANDLE handle);
107 BOOL CommCloseHandle(HANDLE handle);
110 #if defined(WINPR_HAVE_SYS_EVENTFD_H)
111 #ifndef WITH_EVENTFD_READ_WRITE
112 int eventfd_read(
int fd, eventfd_t* value);
113 int eventfd_write(
int fd, eventfd_t value);