18#define COMMPROP_INITIALIZED 0xE73CF52E
100#define SERIAL_TAG 'lreS'
102#define INFINITE MAXULONG
105#define BAUD_CLOCK 1843200
106#define CLOCKS_PER_BIT 16
109#define SER_RBR(x) ((PUCHAR)(x)+0)
110#define SER_THR(x) ((PUCHAR)(x)+0)
111#define SER_DLL(x) ((PUCHAR)(x)+0)
112#define SER_IER(x) ((PUCHAR)(x)+1)
113#define SR_IER_DATA_RECEIVED 0x01
114#define SR_IER_THR_EMPTY 0x02
115#define SR_IER_LSR_CHANGE 0x04
116#define SR_IER_MSR_CHANGE 0x08
117#define SR_IER_SLEEP_MODE 0x10
118#define SR_IER_LOW_POWER 0x20
119#define SER_DLM(x) ((PUCHAR)(x)+1)
120#define SER_IIR(x) ((PUCHAR)(x)+2)
121#define SR_IIR_SELF 0x00
122#define SR_IIR_ID_MASK 0x07
123#define SR_IIR_MSR_CHANGE SR_IIR_SELF
124#define SR_IIR_THR_EMPTY (SR_IIR_SELF | 2)
125#define SR_IIR_DATA_RECEIVED (SR_IIR_SELF | 4)
126#define SR_IIR_ERROR (SR_IIR_SELF | 6)
127#define SER_FCR(x) ((PUCHAR)(x)+2)
128#define SR_FCR_ENABLE_FIFO 0x01
129#define SR_FCR_CLEAR_RCVR (0x02 | SR_FCR_ENABLE_FIFO)
130#define SR_FCR_CLEAR_XMIT (0x04 | SR_FCR_ENABLE_FIFO)
131#define SR_FCR_1_BYTE (0x00 | SR_FCR_ENABLE_FIFO)
132#define SR_FCR_4_BYTES (0x40 | SR_FCR_ENABLE_FIFO)
133#define SR_FCR_8_BYTES (0x80 | SR_FCR_ENABLE_FIFO)
134#define SR_FCR_14_BYTES (0xC0 | SR_FCR_ENABLE_FIFO)
135#define SER_LCR(x) ((PUCHAR)(x)+3)
136#define SR_LCR_CS5 0x00
137#define SR_LCR_CS6 0x01
138#define SR_LCR_CS7 0x02
139#define SR_LCR_CS8 0x03
140#define SR_LCR_ST1 0x00
141#define SR_LCR_ST2 0x04
142#define SR_LCR_PNO 0x00
143#define SR_LCR_POD 0x08
144#define SR_LCR_PEV 0x18
145#define SR_LCR_PMK 0x28
146#define SR_LCR_PSP 0x38
147#define SR_LCR_BRK 0x40
148#define SR_LCR_DLAB 0x80
149#define SER_MCR(x) ((PUCHAR)(x)+4)
150#define SR_MCR_DTR SERIAL_DTR_STATE
151#define SR_MCR_RTS SERIAL_RTS_STATE
152#define SER_LSR(x) ((PUCHAR)(x)+5)
153#define SR_LSR_DATA_RECEIVED 0x01
154#define SR_LSR_OVERRUN_ERROR 0x02
155#define SR_LSR_PARITY_ERROR 0x04
156#define SR_LSR_FRAMING_ERROR 0x08
157#define SR_LSR_BREAK_INT 0x10
158#define SR_LSR_THR_EMPTY 0x20
159#define SR_LSR_TSR_EMPTY 0x40
160#define SR_LSR_ERROR_IN_FIFO 0x80
161#define SER_MSR(x) ((PUCHAR)(x)+6)
162#define SR_MSR_CTS_CHANGED 0x01
163#define SR_MSR_DSR_CHANGED 0x02
164#define SR_MSR_RI_CHANGED 0x04
165#define SR_MSR_DCD_CHANGED 0x08
166#define SR_MSR_CTS SERIAL_CTS_STATE
167#define SR_MSR_DSR SERIAL_DSR_STATE
168#define SI_MSR_RI SERIAL_RI_STATE
169#define SR_MSR_DCD SERIAL_DCD_STATE
170#define SER_SCR(x) ((PUCHAR)(x)+7)
DRIVER_DISPATCH SerialDeviceControl
NTSTATUS NTAPI SerialPnpStartDevice(IN PDEVICE_OBJECT DeviceObject, IN PCM_RESOURCE_LIST ResourceList, IN PCM_RESOURCE_LIST ResourceListTranslated)
VOID NTAPI SerialReceiveByte(IN PKDPC Dpc, IN PVOID pDeviceExtension, IN PVOID Unused1, IN PVOID Unused2)
NTSTATUS PushCircularBufferEntry(IN PCIRCULAR_BUFFER pBuffer, IN UCHAR Entry)
struct _SERIAL_DEVICE_EXTENSION SERIAL_DEVICE_EXTENSION
VOID NTAPI SerialSendByte(IN PKDPC Dpc, IN PVOID pDeviceExtension, IN PVOID Unused1, IN PVOID Unused2)
DRIVER_DISPATCH SerialCleanup
BOOLEAN IsCircularBufferEmpty(IN PCIRCULAR_BUFFER pBuffer)
NTSTATUS NTAPI SerialAddDeviceInternal(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT Pdo, IN UART_TYPE UartType, IN PULONG pComPortNumber OPTIONAL, OUT PDEVICE_OBJECT *pFdo OPTIONAL)
DRIVER_DISPATCH SerialClose
DRIVER_DISPATCH SerialPnp
NTSTATUS InitializeCircularBuffer(IN PCIRCULAR_BUFFER pBuffer, IN ULONG BufferSize)
struct _SERIAL_DEVICE_EXTENSION * PSERIAL_DEVICE_EXTENSION
DRIVER_DISPATCH SerialCreate
VOID NTAPI SerialCompleteIrp(IN PKDPC Dpc, IN PVOID pDeviceExtension, IN PVOID pIrp, IN PVOID Unused)
DRIVER_ADD_DEVICE SerialAddDevice
DRIVER_DISPATCH SerialPower
struct _WORKITEM_DATA * PWORKITEM_DATA
UART_TYPE SerialDetectUartType(IN PUCHAR ComPortBase)
NTSTATUS PopCircularBufferEntry(IN PCIRCULAR_BUFFER pBuffer, OUT PUCHAR Entry)
DRIVER_DISPATCH ForwardIrpAndForget
DRIVER_DISPATCH SerialRead
NTSTATUS NTAPI SerialSetBaudRate(IN PSERIAL_DEVICE_EXTENSION DeviceExtension, IN ULONG NewBaudRate)
struct _CIRCULAR_BUFFER * PCIRCULAR_BUFFER
NTSTATUS FreeCircularBuffer(IN PCIRCULAR_BUFFER pBuffer)
NTSTATUS IncreaseCircularBufferSize(IN PCIRCULAR_BUFFER pBuffer, IN ULONG NewBufferSize)
struct _WORKITEM_DATA WORKITEM_DATA
DRIVER_DISPATCH SerialWrite
NTSTATUS NTAPI SerialSetLineControl(IN PSERIAL_DEVICE_EXTENSION DeviceExtension, IN PSERIAL_LINE_CONTROL NewSettings)
ULONG GetNumberOfElementsInCircularBuffer(IN PCIRCULAR_BUFFER pBuffer)
struct _CIRCULAR_BUFFER CIRCULAR_BUFFER
DRIVER_DISPATCH SerialQueryInformation
KSERVICE_ROUTINE SerialInterruptService
DRIVER_DISPATCH(nfs41_FsdDispatch)
PULONG MinorVersion OPTIONAL
base of all file and directory entries
SERIAL_LINE_CONTROL SerialLineControl
PDEVICE_OBJECT LowerDevice
KSPIN_LOCK OutputBufferLock
KSPIN_LOCK InputBufferLock
IO_REMOVE_LOCK RemoveLock
KEVENT InputBufferNotEmpty
ULONG BreakInterruptErrorCount
UNICODE_STRING SerialInterfaceName
CIRCULAR_BUFFER InputBuffer
SERIAL_DEVICE_STATE PnpState
CIRCULAR_BUFFER OutputBuffer
SERIALPERF_STATS SerialPerfStats
SERIAL_TIMEOUTS SerialTimeOuts
LARGE_INTEGER TotalTimeoutTime
LARGE_INTEGER IntervalTimeout
BOOLEAN ReadAtLeastOneByte
BOOLEAN UseIntervalTimeout
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
WDF_EXTERN_C_START typedef _Must_inspect_result_ _In_ WDFDRIVER _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT Pdo
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList