|
|
1.1 ! root 1: /*++ BUILD Version: 0001 // Increment this if a change has global effects ! 2: ! 3: Copyright (c) 1990-1993 Microsoft Corporation ! 4: ! 5: Module Name: ! 6: ! 7: ntddser.h ! 8: ! 9: Abstract: ! 10: ! 11: This is the include file that defines all constants and types for ! 12: accessing the Serial device. ! 13: ! 14: Author: ! 15: ! 16: Steve Wood (stevewo) 27-May-1990 ! 17: ! 18: Revision History: ! 19: ! 20: --*/ ! 21: ! 22: ! 23: // ! 24: // NtDeviceIoControlFile IoControlCode values for this device. ! 25: // ! 26: ! 27: #define IOCTL_SERIAL_SET_BAUD_RATE CTL_CODE(FILE_DEVICE_SERIAL_PORT, 1,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 28: #define IOCTL_SERIAL_SET_QUEUE_SIZE CTL_CODE(FILE_DEVICE_SERIAL_PORT, 2,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 29: #define IOCTL_SERIAL_SET_LINE_CONTROL CTL_CODE(FILE_DEVICE_SERIAL_PORT, 3,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 30: #define IOCTL_SERIAL_SET_BREAK_ON CTL_CODE(FILE_DEVICE_SERIAL_PORT, 4,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 31: #define IOCTL_SERIAL_SET_BREAK_OFF CTL_CODE(FILE_DEVICE_SERIAL_PORT, 5,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 32: #define IOCTL_SERIAL_IMMEDIATE_CHAR CTL_CODE(FILE_DEVICE_SERIAL_PORT, 6,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 33: #define IOCTL_SERIAL_SET_TIMEOUTS CTL_CODE(FILE_DEVICE_SERIAL_PORT, 7,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 34: #define IOCTL_SERIAL_GET_TIMEOUTS CTL_CODE(FILE_DEVICE_SERIAL_PORT, 8,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 35: #define IOCTL_SERIAL_SET_DTR CTL_CODE(FILE_DEVICE_SERIAL_PORT, 9,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 36: #define IOCTL_SERIAL_CLR_DTR CTL_CODE(FILE_DEVICE_SERIAL_PORT,10,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 37: #define IOCTL_SERIAL_RESET_DEVICE CTL_CODE(FILE_DEVICE_SERIAL_PORT,11,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 38: #define IOCTL_SERIAL_SET_RTS CTL_CODE(FILE_DEVICE_SERIAL_PORT,12,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 39: #define IOCTL_SERIAL_CLR_RTS CTL_CODE(FILE_DEVICE_SERIAL_PORT,13,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 40: #define IOCTL_SERIAL_SET_XOFF CTL_CODE(FILE_DEVICE_SERIAL_PORT,14,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 41: #define IOCTL_SERIAL_SET_XON CTL_CODE(FILE_DEVICE_SERIAL_PORT,15,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 42: #define IOCTL_SERIAL_GET_WAIT_MASK CTL_CODE(FILE_DEVICE_SERIAL_PORT,16,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 43: #define IOCTL_SERIAL_SET_WAIT_MASK CTL_CODE(FILE_DEVICE_SERIAL_PORT,17,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 44: #define IOCTL_SERIAL_WAIT_ON_MASK CTL_CODE(FILE_DEVICE_SERIAL_PORT,18,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 45: #define IOCTL_SERIAL_PURGE CTL_CODE(FILE_DEVICE_SERIAL_PORT,19,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 46: #define IOCTL_SERIAL_GET_BAUD_RATE CTL_CODE(FILE_DEVICE_SERIAL_PORT,20,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 47: #define IOCTL_SERIAL_GET_LINE_CONTROL CTL_CODE(FILE_DEVICE_SERIAL_PORT,21,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 48: #define IOCTL_SERIAL_GET_CHARS CTL_CODE(FILE_DEVICE_SERIAL_PORT,22,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 49: #define IOCTL_SERIAL_SET_CHARS CTL_CODE(FILE_DEVICE_SERIAL_PORT,23,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 50: #define IOCTL_SERIAL_GET_HANDFLOW CTL_CODE(FILE_DEVICE_SERIAL_PORT,24,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 51: #define IOCTL_SERIAL_SET_HANDFLOW CTL_CODE(FILE_DEVICE_SERIAL_PORT,25,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 52: #define IOCTL_SERIAL_GET_MODEMSTATUS CTL_CODE(FILE_DEVICE_SERIAL_PORT,26,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 53: #define IOCTL_SERIAL_GET_COMMSTATUS CTL_CODE(FILE_DEVICE_SERIAL_PORT,27,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 54: #define IOCTL_SERIAL_XOFF_COUNTER CTL_CODE(FILE_DEVICE_SERIAL_PORT,28,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 55: #define IOCTL_SERIAL_GET_PROPERTIES CTL_CODE(FILE_DEVICE_SERIAL_PORT,29,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 56: #define IOCTL_SERIAL_GET_DTRRTS CTL_CODE(FILE_DEVICE_SERIAL_PORT,30,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 57: ! 58: ! 59: // begin_winioctl ! 60: ! 61: #define IOCTL_SERIAL_LSRMST_INSERT CTL_CODE(FILE_DEVICE_SERIAL_PORT,31,METHOD_BUFFERED,FILE_ANY_ACCESS) ! 62: ! 63: // end_winioctl ! 64: ! 65: // ! 66: // NtDeviceIoControlFile InputBuffer/OutputBuffer record structures for ! 67: // this device. ! 68: // ! 69: ! 70: // ! 71: // This structure used to set line parameters. ! 72: // ! 73: ! 74: typedef struct _SERIAL_LINE_CONTROL { ! 75: UCHAR StopBits; ! 76: UCHAR Parity; ! 77: UCHAR WordLength; ! 78: } SERIAL_LINE_CONTROL,*PSERIAL_LINE_CONTROL; ! 79: ! 80: typedef struct _SERIAL_TIMEOUTS { ! 81: ULONG ReadIntervalTimeout; ! 82: ULONG ReadTotalTimeoutMultiplier; ! 83: ULONG ReadTotalTimeoutConstant; ! 84: ULONG WriteTotalTimeoutMultiplier; ! 85: ULONG WriteTotalTimeoutConstant; ! 86: } SERIAL_TIMEOUTS,*PSERIAL_TIMEOUTS; ! 87: ! 88: // ! 89: // This structure used to resize the input/output buffers. ! 90: // An error code will be returned if the size exceeds the ! 91: // drivers capacity. The driver reserves the right to ! 92: // allocate a larger buffer. ! 93: // ! 94: ! 95: typedef struct _SERIAL_QUEUE_SIZE { ! 96: ULONG InSize; ! 97: ULONG OutSize; ! 98: } SERIAL_QUEUE_SIZE,*PSERIAL_QUEUE_SIZE; ! 99: ! 100: ! 101: // ! 102: // This structure used by set baud rate ! 103: // ! 104: ! 105: typedef struct _SERIAL_BAUD_RATE { ! 106: ULONG BaudRate; ! 107: } SERIAL_BAUD_RATE,*PSERIAL_BAUD_RATE; ! 108: ! 109: // ! 110: // Defines the bitmask that the driver can used to notify ! 111: // app of various changes in the state of the UART. ! 112: // ! 113: ! 114: #define SERIAL_EV_RXCHAR 0x0001 // Any Character received ! 115: #define SERIAL_EV_RXFLAG 0x0002 // Received certain character ! 116: #define SERIAL_EV_TXEMPTY 0x0004 // Transmitt Queue Empty ! 117: #define SERIAL_EV_CTS 0x0008 // CTS changed state ! 118: #define SERIAL_EV_DSR 0x0010 // DSR changed state ! 119: #define SERIAL_EV_RLSD 0x0020 // RLSD changed state ! 120: #define SERIAL_EV_BREAK 0x0040 // BREAK received ! 121: #define SERIAL_EV_ERR 0x0080 // Line status error occurred ! 122: #define SERIAL_EV_RING 0x0100 // Ring signal detected ! 123: #define SERIAL_EV_PERR 0x0200 // Printer error occured ! 124: #define SERIAL_EV_RX80FULL 0x0400 // Receive buffer is 80 percent full ! 125: #define SERIAL_EV_EVENT1 0x0800 // Provider specific event 1 ! 126: #define SERIAL_EV_EVENT2 0x1000 // Provider specific event 2 ! 127: ! 128: // ! 129: // A longword is used to send down a mask that ! 130: // instructs the driver what to purge. ! 131: // ! 132: // SERIAL_PURGE_TXABORT - Implies the current and all pending writes. ! 133: // SERIAL_PURGE_RXABORT - Implies the current and all pending reads. ! 134: // SERIAL_PURGE_TXCLEAR - Implies the transmit buffer if exists ! 135: // SERIAL_PURGE_RXCLEAR - Implies the receive buffer if exists. ! 136: // ! 137: ! 138: #define SERIAL_PURGE_TXABORT 0x00000001 ! 139: #define SERIAL_PURGE_RXABORT 0x00000002 ! 140: #define SERIAL_PURGE_TXCLEAR 0x00000004 ! 141: #define SERIAL_PURGE_RXCLEAR 0x00000008 ! 142: ! 143: // ! 144: // Communication defines ! 145: // ! 146: ! 147: #define STOP_BIT_1 0 ! 148: #define STOP_BITS_1_5 1 ! 149: #define STOP_BITS_2 2 ! 150: ! 151: #define NO_PARITY 0 ! 152: #define ODD_PARITY 1 ! 153: #define EVEN_PARITY 2 ! 154: #define MARK_PARITY 3 ! 155: #define SPACE_PARITY 4 ! 156: ! 157: ! 158: // ! 159: // This structure is used to set and retrieve the special characters ! 160: // used by the nt serial driver. ! 161: // ! 162: // Note that the driver will return an error if xonchar == xoffchar. ! 163: // ! 164: ! 165: typedef struct _SERIAL_CHARS { ! 166: UCHAR EofChar; ! 167: UCHAR ErrorChar; ! 168: UCHAR BreakChar; ! 169: UCHAR EventChar; ! 170: UCHAR XonChar; ! 171: UCHAR XoffChar; ! 172: } SERIAL_CHARS,*PSERIAL_CHARS; ! 173: ! 174: // ! 175: // This structure is used to contain the flow control ! 176: // and handshaking setup. ! 177: // ! 178: // A reasonably precise explaination of how they all ! 179: // work can be found in the OS/2 tech references. ! 180: // ! 181: // For Xon/Xofflimit: ! 182: // ! 183: // When there are more characters then ! 184: // ! 185: // (typeaheadbuffersize - xofflimit) ! 186: // ! 187: // in the typeahead buffer then the driver will perform all flow ! 188: // control that the app has enabled so that the sender will (hopefully) ! 189: // stop sending characters. ! 190: // ! 191: // When there are less than xonlimit number of characters in the ! 192: // typeahead buffer the driver will perform all flow control that ! 193: // the app has enabled so that the sender will hopefully start sending ! 194: // characters again. ! 195: // ! 196: // It should be noted that if Xoff character is sent then the ! 197: // driver will also stop transmitting any more characters. This is to ! 198: // provide support for those systems that take any character that ! 199: // follows an Xoff as an implied Xon. ! 200: // ! 201: ! 202: typedef struct _SERIAL_HANDFLOW { ! 203: ULONG ControlHandShake; ! 204: ULONG FlowReplace; ! 205: LONG XonLimit; ! 206: LONG XoffLimit; ! 207: } SERIAL_HANDFLOW,*PSERIAL_HANDFLOW; ! 208: ! 209: #define SERIAL_DTR_MASK ((ULONG)0x03) ! 210: #define SERIAL_DTR_CONTROL ((ULONG)0x01) ! 211: #define SERIAL_DTR_HANDSHAKE ((ULONG)0x02) ! 212: #define SERIAL_CTS_HANDSHAKE ((ULONG)0x08) ! 213: #define SERIAL_DSR_HANDSHAKE ((ULONG)0x10) ! 214: #define SERIAL_DCD_HANDSHAKE ((ULONG)0x20) ! 215: #define SERIAL_OUT_HANDSHAKEMASK ((ULONG)0x38) ! 216: #define SERIAL_DSR_SENSITIVITY ((ULONG)0x40) ! 217: #define SERIAL_ERROR_ABORT ((ULONG)0x80000000) ! 218: #define SERIAL_CONTROL_INVALID ((ULONG)0x7fffff84) ! 219: #define SERIAL_AUTO_TRANSMIT ((ULONG)0x01) ! 220: #define SERIAL_AUTO_RECEIVE ((ULONG)0x02) ! 221: #define SERIAL_ERROR_CHAR ((ULONG)0x04) ! 222: #define SERIAL_NULL_STRIPPING ((ULONG)0x08) ! 223: #define SERIAL_BREAK_CHAR ((ULONG)0x10) ! 224: #define SERIAL_RTS_MASK ((ULONG)0xc0) ! 225: #define SERIAL_RTS_CONTROL ((ULONG)0x40) ! 226: #define SERIAL_RTS_HANDSHAKE ((ULONG)0x80) ! 227: #define SERIAL_TRANSMIT_TOGGLE ((ULONG)0xc0) ! 228: #define SERIAL_XOFF_CONTINUE ((ULONG)0x80000000) ! 229: #define SERIAL_FLOW_INVALID ((ULONG)0x7fffff20) ! 230: ! 231: // ! 232: // These are the following reasons that the device could be holding. ! 233: // ! 234: #define SERIAL_TX_WAITING_FOR_CTS ((ULONG)0x00000001) ! 235: #define SERIAL_TX_WAITING_FOR_DSR ((ULONG)0x00000002) ! 236: #define SERIAL_TX_WAITING_FOR_DCD ((ULONG)0x00000004) ! 237: #define SERIAL_TX_WAITING_FOR_XON ((ULONG)0x00000008) ! 238: #define SERIAL_TX_WAITING_XOFF_SENT ((ULONG)0x00000010) ! 239: #define SERIAL_TX_WAITING_ON_BREAK ((ULONG)0x00000020) ! 240: #define SERIAL_RX_WAITING_FOR_DSR ((ULONG)0x00000040) ! 241: ! 242: // ! 243: // These are the error values that can be returned by the ! 244: // driver. ! 245: // ! 246: #define SERIAL_ERROR_BREAK ((ULONG)0x00000001) ! 247: #define SERIAL_ERROR_FRAMING ((ULONG)0x00000002) ! 248: #define SERIAL_ERROR_OVERRUN ((ULONG)0x00000004) ! 249: #define SERIAL_ERROR_QUEUEOVERRUN ((ULONG)0x00000008) ! 250: #define SERIAL_ERROR_PARITY ((ULONG)0x00000010) ! 251: ! 252: ! 253: // ! 254: // This structure is used to get the current error and ! 255: // general status of the driver. ! 256: // ! 257: ! 258: typedef struct _SERIAL_STATUS { ! 259: ULONG Errors; ! 260: ULONG HoldReasons; ! 261: ULONG AmountInInQueue; ! 262: ULONG AmountInOutQueue; ! 263: BOOLEAN EofReceived; ! 264: BOOLEAN WaitForImmediate; ! 265: } SERIAL_STATUS,*PSERIAL_STATUS; ! 266: ! 267: // ! 268: // This structure is used for XOFF counter ioctl. The xoff ioctl ! 269: // is used to support those subsystems that feel the need to emulate ! 270: // the serial chip in software. ! 271: // ! 272: // It has the following semantics: ! 273: // ! 274: // This io request is placed into the normal device write ! 275: // queue. That is, it will be queued behind any writes ! 276: // already given to the driver. ! 277: // ! 278: // When this request becomes the current request, the character ! 279: // specified in the field XoffChar will be sent, subject to ! 280: // all other flow control already defined. ! 281: // ! 282: // Immediately upon sending the character the driver will ! 283: // perform the following actions. ! 284: // ! 285: // A timer will be initiated that will expire after the ! 286: // number of milliseconds in the Timeout field of the ! 287: // SERIAL_XOFF_COUNTER structure. ! 288: // ! 289: // The driver will initialize a counter to the value specified ! 290: // in the Counter field of the SERIAL_XOFF_RECORD. The driver ! 291: // will decrement this counter whenever a character is received. ! 292: // ! 293: // This request will then be held by the driver. It will ! 294: // actually complete under the following circumstances: ! 295: // ! 296: // 1) If there is another "write" request behind it in the queue. ! 297: // The "xoff" request will be completed with the informational status ! 298: // STATUS_SERIAL_MORE_WRITES. The Information field of the ! 299: // IOSTATUS block will be set to 0. ! 300: // ! 301: // Note: By write request we mean another SERIAL_XOFF_COUNTER ! 302: // request, or a simple write request. If the only subsequent ! 303: // request is a flush request, the driver WILL NOT automatically ! 304: // complete the SERIAL_XOFF_COUNTER request. NOTE: Transmit ! 305: // immediate requests DO NOT count as a normal write, and therefore ! 306: // would not cause a counter request to complete. ! 307: // ! 308: // 2) The timer expires. The driver will complete the request ! 309: // with the informational status STATUS_SERIAL_COUNTER_TIMEOUT. ! 310: // The Information field of the IOSTATUS of the request will be set to 0. ! 311: // ! 312: // 3) The driver maintained counter goes to zero. (By implication, ! 313: // at least "Counter" number of characters have been received.) ! 314: // The request will be completed with a successful status ! 315: // of STATUS_SUCCESS. The Information field of the ! 316: // IOSTATUS of the request will be set to 0. ! 317: // ! 318: // 4) This is really a degenerate case of "1" above. The request ! 319: // is started and no request follow it on the queue. However ! 320: // at some point, before "2" or "3" above occur, another "write" ! 321: // request is started. This will cause the completion actions ! 322: // stated in "1" to occur. ! 323: // ! 324: // NOTE: This request being issued WILL NOT cause the normal flow ! 325: // control code of the driver to be invoked. ! 326: // ! 327: // NOTE: This request has no interaction with the IOCTL_SERIAL_WAIT_ON_MASK ! 328: // request. An application CAN NOT wait via the above ^^^^^^ ioctl ! 329: // on the counter going to zero. The application must synchronize ! 330: // with the particular IOCTL_SERIAL_XOFF_COUNTER request. ! 331: // ! 332: // NOTE: The Timeout value equal to zero would cause the counter ! 333: // to NEVER timeout. The only way that such a request could ! 334: // be killed at that point would be issue another write, or ! 335: // to purge the WRITE queue. ! 336: // ! 337: ! 338: typedef struct _SERIAL_XOFF_COUNTER { ! 339: ULONG Timeout; // Zero based. In milliseconds ! 340: LONG Counter; // Must be greater than zero. ! 341: UCHAR XoffChar; ! 342: } SERIAL_XOFF_COUNTER,*PSERIAL_XOFF_COUNTER; ! 343: ! 344: // ! 345: // The following structure (and defines) are passed back by ! 346: // the serial driver in response to the get properties ioctl. ! 347: // ! 348: ! 349: #define SERIAL_SP_SERIALCOMM ((ULONG)0x00000001) ! 350: ! 351: // ! 352: // Provider subtypes ! 353: // ! 354: #define SERIAL_SP_UNSPECIFIED ((ULONG)0x00000000) ! 355: #define SERIAL_SP_RS232 ((ULONG)0x00000001) ! 356: #define SERIAL_SP_PARALLEL ((ULONG)0x00000002) ! 357: #define SERIAL_SP_RS422 ((ULONG)0x00000003) ! 358: #define SERIAL_SP_RS423 ((ULONG)0x00000004) ! 359: #define SERIAL_SP_RS449 ((ULONG)0x00000005) ! 360: #define SERIAL_SP_FAX ((ULONG)0x00000021) ! 361: #define SERIAL_SP_SCANNER ((ULONG)0x00000022) ! 362: #define SERIAL_SP_BRIDGE ((ULONG)0x00000100) ! 363: #define SERIAL_SP_LAT ((ULONG)0x00000101) ! 364: #define SERIAL_SP_TELNET ((ULONG)0x00000102) ! 365: #define SERIAL_SP_X25 ((ULONG)0x00000103) ! 366: ! 367: // ! 368: // Provider capabilities flags. ! 369: // ! 370: ! 371: #define SERIAL_PCF_DTRDSR ((ULONG)0x0001) ! 372: #define SERIAL_PCF_RTSCTS ((ULONG)0x0002) ! 373: #define SERIAL_PCF_CD ((ULONG)0x0004) ! 374: #define SERIAL_PCF_PARITY_CHECK ((ULONG)0x0008) ! 375: #define SERIAL_PCF_XONXOFF ((ULONG)0x0010) ! 376: #define SERIAL_PCF_SETXCHAR ((ULONG)0x0020) ! 377: #define SERIAL_PCF_TOTALTIMEOUTS ((ULONG)0x0040) ! 378: #define SERIAL_PCF_INTTIMEOUTS ((ULONG)0x0080) ! 379: #define SERIAL_PCF_SPECIALCHARS ((ULONG)0x0100) ! 380: #define SERIAL_PCF_16BITMODE ((ULONG)0x0200) ! 381: ! 382: // ! 383: // Comm provider settable parameters. ! 384: // ! 385: ! 386: #define SERIAL_SP_PARITY ((ULONG)0x0001) ! 387: #define SERIAL_SP_BAUD ((ULONG)0x0002) ! 388: #define SERIAL_SP_DATABITS ((ULONG)0x0004) ! 389: #define SERIAL_SP_STOPBITS ((ULONG)0x0008) ! 390: #define SERIAL_SP_HANDSHAKING ((ULONG)0x0010) ! 391: #define SERIAL_SP_PARITY_CHECK ((ULONG)0x0020) ! 392: #define SERIAL_SP_CARRIER_DETECT ((ULONG)0x0040) ! 393: ! 394: // ! 395: // Settable baud rates in the provider. ! 396: // ! 397: ! 398: #define SERIAL_BAUD_075 ((ULONG)0x00000001) ! 399: #define SERIAL_BAUD_110 ((ULONG)0x00000002) ! 400: #define SERIAL_BAUD_134_5 ((ULONG)0x00000004) ! 401: #define SERIAL_BAUD_150 ((ULONG)0x00000008) ! 402: #define SERIAL_BAUD_300 ((ULONG)0x00000010) ! 403: #define SERIAL_BAUD_600 ((ULONG)0x00000020) ! 404: #define SERIAL_BAUD_1200 ((ULONG)0x00000040) ! 405: #define SERIAL_BAUD_1800 ((ULONG)0x00000080) ! 406: #define SERIAL_BAUD_2400 ((ULONG)0x00000100) ! 407: #define SERIAL_BAUD_4800 ((ULONG)0x00000200) ! 408: #define SERIAL_BAUD_7200 ((ULONG)0x00000400) ! 409: #define SERIAL_BAUD_9600 ((ULONG)0x00000800) ! 410: #define SERIAL_BAUD_14400 ((ULONG)0x00001000) ! 411: #define SERIAL_BAUD_19200 ((ULONG)0x00002000) ! 412: #define SERIAL_BAUD_38400 ((ULONG)0x00004000) ! 413: #define SERIAL_BAUD_56K ((ULONG)0x00008000) ! 414: #define SERIAL_BAUD_128K ((ULONG)0x00010000) ! 415: #define SERIAL_BAUD_115200 ((ULONG)0x00020000) ! 416: #define SERIAL_BAUD_57600 ((ULONG)0x00040000) ! 417: #define SERIAL_BAUD_USER ((ULONG)0x10000000) ! 418: ! 419: // ! 420: // Settable Data Bits ! 421: // ! 422: ! 423: #define SERIAL_DATABITS_5 ((USHORT)0x0001) ! 424: #define SERIAL_DATABITS_6 ((USHORT)0x0002) ! 425: #define SERIAL_DATABITS_7 ((USHORT)0x0004) ! 426: #define SERIAL_DATABITS_8 ((USHORT)0x0008) ! 427: #define SERIAL_DATABITS_16 ((USHORT)0x0010) ! 428: #define SERIAL_DATABITS_16X ((USHORT)0x0020) ! 429: ! 430: // ! 431: // Settable Stop and Parity bits. ! 432: // ! 433: ! 434: #define SERIAL_STOPBITS_10 ((USHORT)0x0001) ! 435: #define SERIAL_STOPBITS_15 ((USHORT)0x0002) ! 436: #define SERIAL_STOPBITS_20 ((USHORT)0x0004) ! 437: #define SERIAL_PARITY_NONE ((USHORT)0x0100) ! 438: #define SERIAL_PARITY_ODD ((USHORT)0x0200) ! 439: #define SERIAL_PARITY_EVEN ((USHORT)0x0400) ! 440: #define SERIAL_PARITY_MARK ((USHORT)0x0800) ! 441: #define SERIAL_PARITY_SPACE ((USHORT)0x1000) ! 442: ! 443: typedef struct _SERIAL_COMMPROP { ! 444: USHORT PacketLength; ! 445: USHORT PacketVersion; ! 446: ULONG ServiceMask; ! 447: ULONG Reserved1; ! 448: ULONG MaxTxQueue; ! 449: ULONG MaxRxQueue; ! 450: ULONG MaxBaud; ! 451: ULONG ProvSubType; ! 452: ULONG ProvCapabilities; ! 453: ULONG SettableParams; ! 454: ULONG SettableBaud; ! 455: USHORT SettableData; ! 456: USHORT SettableStopParity; ! 457: ULONG CurrentTxQueue; ! 458: ULONG CurrentRxQueue; ! 459: ULONG ProvSpec1; ! 460: ULONG ProvSpec2; ! 461: WCHAR ProvChar[1]; ! 462: } SERIAL_COMMPROP,*PSERIAL_COMMPROP; ! 463: ! 464: // ! 465: // Define masks for the rs-232 input and output. ! 466: // ! 467: ! 468: #define SERIAL_DTR_STATE ((ULONG)0x00000001) ! 469: #define SERIAL_RTS_STATE ((ULONG)0x00000002) ! 470: #define SERIAL_CTS_STATE ((ULONG)0x00000010) ! 471: #define SERIAL_DSR_STATE ((ULONG)0x00000020) ! 472: #define SERIAL_RI_STATE ((ULONG)0x00000040) ! 473: #define SERIAL_DCD_STATE ((ULONG)0x00000080) ! 474: ! 475: ! 476: // begin_winioctl ! 477: ! 478: // ! 479: // The following values follow the escape designator in the ! 480: // data stream if the LSRMST_INSERT mode has been turned on. ! 481: // ! 482: #define SERIAL_LSRMST_ESCAPE ((UCHAR)0x00) ! 483: ! 484: // ! 485: // Following this value is the contents of the line status ! 486: // register, and then the character in the RX hardware when ! 487: // the line status register was encountered. ! 488: // ! 489: #define SERIAL_LSRMST_LSR_DATA ((UCHAR)0x01) ! 490: ! 491: // ! 492: // Following this value is the contents of the line status ! 493: // register. No error character follows ! 494: // ! 495: #define SERIAL_LSRMST_LSR_NODATA ((UCHAR)0x02) ! 496: ! 497: // ! 498: // Following this value is the contents of the modem status ! 499: // register. ! 500: // ! 501: #define SERIAL_LSRMST_MST ((UCHAR)0x03) ! 502: ! 503: // end_winioctl
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.