4 /*----------------------------------------------------------------------------*
6 * NetWare 386 Developer's Asynchronous I/O (AIO) Runtime library *
8 * This include file defines the constants and prototypes required *
9 * to use the AIO application interface. *
11 * (c) Copyright. 1991 Novell, Inc. All rights reserved. *
13 *----------------------------------------------------------------------------*/
15 typedef unsigned long DWORD
;
18 /*----------------------------------------------------------------------------*
20 * Predefined hardware types for use with the AIOAcquirePort function. *
22 *----------------------------------------------------------------------------*/
24 #define AIO_COMX_TYPE (1)
25 #define AIO_ARTIC_TYPE (2)
26 #define AIO_WNIM_TYPE (3)
29 /*----------------------------------------------------------------------------*
31 * Function completion code status values. *
33 * Note that all error statuses are negative values. *
35 *----------------------------------------------------------------------------*/
37 #define AIO_SUCCESS (0)
38 #define AIO_BAD_HANDLE (-1)
39 #define AIO_FAILURE (-2)
40 #define AIO_FUNC_NOT_SUPPORTED (-3)
41 #define AIO_INVALID_PARAMETER (-5)
42 #define AIO_PORT_NOT_AVAILABLE (-6)
43 #define AIO_QUALIFIED_SUCCESS (-7)
44 #define AIO_NO_MORE_PORTS (-8)
45 #define AIO_TYPE_NUMBER_INVALID (-10)
46 #define AIO_BOARD_NUMBER_INVALID (-11)
47 #define AIO_PORT_NUMBER_INVALID (-12)
48 #define AIO_RESOURCE_TAG_INVALID (-13)
49 #define AIO_DATA_PRESENT (-14)
50 #define AIO_BAD_REQUEST_TYPE (-15)
51 #define AIO_PORT_GONE (-20)
52 #define AIO_RTAG_INVALID (-21)
55 /* This is only for non-CLIB application */
57 #define ASYNCIOSignature 0x4E595341 /* 'NYSA' */
59 /*----------------------------------------------------------------------------*
61 * Definitions for use with the AIOSetExternalControl function. *
63 *----------------------------------------------------------------------------*/
65 #define AIO_EXTERNAL_CONTROL (1)
66 #define AIO_EXTCTRL_DTR (1)
67 #define AIO_EXTCTRL_RTS (2)
70 #define AIO_BREAK_CONTROL (2)
71 #define AIO_SET_BREAK_OFF (0)
72 #define AIO_SET_BREAK_ON (1)
75 #define AIO_FLOW_CONTROL (3)
76 #define AIO_SOFTWARE_FLOW_CONTROL_OFF (0)
77 #define AIO_SOFTWARE_FLOW_CONTROL_ON (1)
78 #define AIO_HARDWARE_FLOW_CONTROL_OFF (0)
79 #define AIO_HARDWARE_FLOW_CONTROL_ON (2)
82 #define AIO_FLOW_CONTROL_CHARACTERS (4)
84 #define AIO_SET_DEADMAN_TIMER (5)
86 /*----------------------------------------------------------------------------*
88 * Definitions for use with the AIOGetExternalStatus function. *
90 *----------------------------------------------------------------------------*/
92 #define AIO_EXTSTA_RI (0x00000001)
93 #define AIO_EXTSTA_DCD (0x00000008)
94 #define AIO_EXTSTA_DSR (0x00000010)
95 #define AIO_EXTSTA_CTS (0x00000020)
96 #define AIO_EXTSTA_BREAK (0x00000080)
99 /*----------------------------------------------------------------------------*
101 * Definitions for use with the AIOFlushBuffers function. *
103 *----------------------------------------------------------------------------*/
105 #define AIO_FLUSH_WRITE_BUFFER (0x0001)
106 #define AIO_FLUSH_READ_BUFFER (0x0002)
109 /*----------------------------------------------------------------------------*
111 * Definitions for use with the AIOReadStatus function. *
113 *----------------------------------------------------------------------------*/
115 #define AIO_RECEIVE_ACTIVE (0)
116 #define AIO_RECEIVE_FULL (1)
118 /*----------------------------------------------------------------------------*
120 * Definitions for use with the AIOWriteStatus function. *
122 *----------------------------------------------------------------------------*/
124 #define AIO_TRANSMIT_IDLE (0)
125 #define AIO_TRANSMIT_ACTIVE (1)
126 #define AIO_TRANSMIT_XOFFED (2)
128 /*----------------------------------------------------------------------------*
130 * Definitions for use with the AIOAcquirePort function. *
132 *----------------------------------------------------------------------------*/
134 #define AIO_HARDWARE_TYPE_WILDCARD (-1)
135 #define AIO_BOARD_NUMBER_WILDCARD (-1)
136 #define AIO_PORT_NUMBER_WILDCARD (-1)
138 /*----------------------------------------------------------------------------*
140 * Definitions for use with the AIOConfigurePort function. *
142 *----------------------------------------------------------------------------*/
146 #define AIO_BAUD_50 (0)
147 #define AIO_BAUD_75 (1)
148 #define AIO_BAUD_110 (2)
149 #define AIO_BAUD_134p5 (3)
150 #define AIO_BAUD_150 (4)
151 #define AIO_BAUD_300 (5)
152 #define AIO_BAUD_600 (6)
153 #define AIO_BAUD_1200 (7)
154 #define AIO_BAUD_1800 (8)
155 #define AIO_BAUD_2000 (9)
156 #define AIO_BAUD_2400 (10)
157 #define AIO_BAUD_3600 (11)
158 #define AIO_BAUD_4800 (12)
159 #define AIO_BAUD_7200 (13)
160 #define AIO_BAUD_9600 (14)
161 #define AIO_BAUD_19200 (15)
162 #define AIO_BAUD_38400 (16)
163 #define AIO_BAUD_57600 (17)
164 #define AIO_BAUD_115200 (18)
168 #define AIO_DATA_BITS_5 (0)
169 #define AIO_DATA_BITS_6 (1)
170 #define AIO_DATA_BITS_7 (2)
171 #define AIO_DATA_BITS_8 (3)
175 #define AIO_STOP_BITS_1 (0)
176 #define AIO_STOP_BITS_1p5 (1)
177 #define AIO_STOP_BITS_2 (2)
181 #define AIO_PARITY_NONE (0)
182 #define AIO_PARITY_ODD (1)
183 #define AIO_PARITY_EVEN (2)
184 #define AIO_PARITY_MARK (3)
185 #define AIO_PARITY_SPACE (4)
189 #define AIO_SOFTWARE_FLOWCONTROL_OFF (0)
190 #define AIO_SOFTWARE_FLOWCONTROL_ON (1)
191 #define AIO_HARDWARE_FLOWCONTROL_OFF (0)
192 #define AIO_HARDWARE_FLOWCONTROL_ON (2)
194 #define AIO_DROPOUT_VALUE (0xFF)
196 /*----------------------------------------------------------------------------*
198 * Definitions for use with AIOPORTCAPABILITIES structure. *
200 *----------------------------------------------------------------------------*/
204 WORD returnLength
; /* byte length of capabilities data */
207 LONG notSupportedMask
;
208 BYTE minBitRate
; /* minimum bit rate index supported */
209 BYTE maxBitRate
; /* maximum bit rate index supported */
210 BYTE minDataBits
; /* minimum data bits per char index supported */
211 BYTE maxDataBits
; /* maximum data bits per char index supported */
212 BYTE minStopBits
; /* minimum stop bits per char index supported */
213 BYTE maxStopBits
; /* maximum stop bits per char index supported */
214 BYTE minParityMode
; /* minimum parity mode index supported */
215 BYTE maxParityMode
; /* maximum parity mode index supported */
216 BYTE minFlowCtrlMode
; /* minimum flow control mode index supported */
217 BYTE maxFlowCtrlMode
; /* maximum flow control mode index supported */
218 LONG miscCapabilities
; /* miscellaneous capability flags */
219 LONG minReadBufferSize
; /* minimum length of receive buffer */
220 LONG maxReadBufferSize
; /* maximum length of receive buffer */
221 LONG minWriteBufferSize
; /* minimum length of transmit buffer */
222 LONG maxWriteBufferSize
; /* maximum length of transmit buffer */
223 WORD minDeadmanTime
; /* minimum deadman time (seconds) */
224 WORD maxDeadmanTime
; /* maximum deadman time (seconds) */
225 } AIOPORTCAPABILITIES
;
227 #define AIO_PORT_NS_MINBITRATE (0x80000000)
228 #define AIO_PORT_NS_MAXBITRATE (0x40000000)
229 #define AIO_PORT_NS_MINDATABITS (0x20000000)
230 #define AIO_PORT_NS_MAXDATABITS (0x10000000)
231 #define AIO_PORT_NS_MINSTOPBITS (0x08000000)
232 #define AIO_PORT_NS_MAXSTOPBITS (0x04000000)
233 #define AIO_PORT_NS_MINPARITYMODE (0x02000000)
234 #define AIO_PORT_NS_MAXPARITYMODE (0x01000000)
235 #define AIO_PORT_NS_MINFLOWCTRLMODE (0x00800000)
236 #define AIO_PORT_NS_MAXFLOWCTRLMODE (0x00400000)
237 #define AIO_PORT_NS_MISCCAPABILITIES (0x00200000)
238 #define AIO_PORT_NS_MINREADBUFFERSIZE (0x00100000)
239 #define AIO_PORT_NS_MAXREADBUFFERSIZE (0x00080000)
240 #define AIO_PORT_NS_MINWRITEBUFFERSIZE (0x00040000)
241 #define AIO_PORT_NS_MAXWRITEBUFFERSIZE (0x00020000)
242 #define AIO_PORT_NS_MINDEADMANTIME (0x00010000)
243 #define AIO_PORT_NS_MAXDEADMANTIME (0x00008000)
245 #define AIO_PORT_CAPS_NOT_SUPPORTED (0x00007FFF)
246 #define AIO_PORT_CAPS_MAJOR_VERSION (1)
247 #define AIO_PORT_CAPS_MINOR_VERSION (0)
249 #define AIO_CAP_OUTPUT_BREAK (0x00000002)
250 #define AIO_CAP_FLOWCTRLCHARS (0x00000004)
251 #define AIO_CAP_PROGRAMMABLE (0x00000008)
252 #define AIO_CAP_INPUT (0x00000010)
253 #define AIO_CAP_OUTPUT (0x00000020)
258 WORD returnLength
; /* byte length of driver capabilities structure */
260 } AIODVRCAPABILITIES
;
262 #define AIO_NO_STRUCT_DATA_RETURNED (2)
264 /*----------------------------------------------------------------------------*
266 * Definitions for use with the AIOGetPortsRollCall function. *
268 *----------------------------------------------------------------------------*/
272 WORD returnLength
; /* byte length of port info data */
275 LONG notSupportedMask
;
276 int hardwareType
; /* value used with AIOAcquirePort */
277 int boardNumber
; /* " */
278 int portNumber
; /* " */
279 WORD availability
; /* availability of port for acquire */
280 LONG externalStatus
; /* current external status value for port */
281 LONG chgdExternalStatus
; /* changed external status value for port */
284 #define AIO_INFO_NS_HARDWARETYPE (0x80000000)
285 #define AIO_INFO_NS_BOARDNUMBER (0x40000000)
286 #define AIO_INFO_NS_PORTNUMBER (0x20000000)
287 #define AIO_INFO_NS_AVAILABILITY (0x10000000)
288 #define AIO_INFO_NS_EXTERNALSTATUS (0x08000000)
289 #define AIO_INFO_NS_CHGDEXTERNALSTATUS (0x04000000)
291 #define AIO_PORT_INFO_NOT_SUPPORTED (0x03FFFFFF)
292 #define AIO_PORT_INFO_MAJOR_VERSION (1)
293 #define AIO_PORT_INFO_MINOR_VERSION (0)
295 #define AIO_AVAILABLE_FOR_ACQUIRE (0)
296 #define AIO_ALREADY_ACQUIRED (1)
297 #define AIO_UNAVAILABLE (0xFF)
299 #define AIO_INITIAL (0)
300 #define AIO_SUCCESSOR (1)
303 /*----------------------------------------------------------------------------*
305 * Definitions for use with the AIOGetPortConfiguration function. *
307 *----------------------------------------------------------------------------*/
311 WORD returnLength
; /* byte length of port configuration data */
314 LONG notSupportedMask
;
315 int hardwareType
; /* value used with AIOAcquirePort */
316 int boardNumber
; /* " */
317 int portNumber
; /* " */
318 BYTE bitRate
; /* Bits per second index */
319 BYTE dataBits
; /* Bits per character index */
320 BYTE stopBits
; /* Stop bits per char index */
321 BYTE parityMode
; /* Generated parity index */
322 BYTE flowCtrlMode
; /* Flow control mode */
323 BYTE breakMode
; /* Break control mode */
324 LONG readSize
; /* Receive buffer size */
325 LONG writeSize
; /* Transmit buffer size */
330 WORD externalControl
; /* set with AIO_EXTERNAL_CONTROL */
334 #define AIO_CONFIG_NS_HARDWARETYPE (0x80000000)
335 #define AIO_CONFIG_NS_BOARDNUMBER (0x40000000)
336 #define AIO_CONFIG_NS_PORTNUMBER (0x20000000)
337 #define AIO_CONFIG_NS_BITRATE (0x10000000)
338 #define AIO_CONFIG_NS_DATABITS (0x08000000)
339 #define AIO_CONFIG_NS_STOPBITS (0x04000000)
340 #define AIO_CONFIG_NS_PARITYMODE (0x02000000)
341 #define AIO_CONFIG_NS_FLOWCTRLMODE (0x01000000)
342 #define AIO_CONFIG_NS_BREAKMODE (0x00800000)
343 #define AIO_CONFIG_NS_READSIZE (0x00400000)
344 #define AIO_CONFIG_NS_WRITESIZE (0x00200000)
345 #define AIO_CONFIG_NS_TRANSMITXON (0x00100000)
346 #define AIO_CONFIG_NS_TRANSMITXOFF (0x00080000)
347 #define AIO_CONFIG_NS_RECEIVEXON (0x00040000)
348 #define AIO_CONFIG_NS_RECEIVEXOFF (0x00020000)
349 #define AIO_CONFIG_NS_EXTERNALCONTROL (0x00010000)
351 #define AIO_PORT_CONFIG_NOT_SUPPORTED (0x0007FFFF)
352 #define AIO_PORT_CONFIG_MAJOR_VERSION (1)
353 #define AIO_PORT_CONFIG_MINOR_VERSION (0)
355 #define AIO_EXTCTRL_DTR_ENABLE (1)
356 #define AIO_EXTCTRL_DTR_DISABLE (0)
357 #define AIO_EXTCTRL_RTS_ENABLE (2)
358 #define AIO_EXTCTRL_RTS_DISABLE (0)
360 #define AIO_BREAK_MODE_OFF (0)
361 #define AIO_BREAK_MODE_ON (1)
365 WORD returnLength
; /* byte length of driver config structure */
369 /*----------------------------------------------------------------------------*
371 * Definitions for use with the AIOGetStatistics function. *
373 *----------------------------------------------------------------------------*/
377 WORD returnLength
; /* byte length of port statistics structure */
380 LONG notSupportedMask
;
381 LONG receiveBytes
; /* total number of bytes received on port */
382 LONG transmitBytes
; /* total number of bytes transmitted from port */
383 LONG parityErrors
; /* number of receive parity errors */
384 LONG framingErrors
; /* number of receive framing errors */
385 LONG overrunSoftware
; /* number of software overruns (occurrences) */
386 LONG overrunHardware
; /* number of hardware overruns (occurrences) */
389 #define AIO_STATS_NS_RECEIVEBYTES (0x80000000)
390 #define AIO_STATS_NS_TRANSMITBYTES (0x40000000)
391 #define AIO_STATS_NS_PARITYERRORS (0x20000000)
392 #define AIO_STATS_NS_FRAMINGERRORS (0x10000000)
393 #define AIO_STATS_NS_OVERRUNSOFTWARE (0x08000000)
394 #define AIO_STATS_NS_OVERRUNHARDWARE (0x04000000)
396 #define AIO_PORT_STATS_NOT_SUPPORTED (0x03FFFFFF)
397 #define AIO_PORT_STATS_MAJOR_VERSION (1)
398 #define AIO_PORT_STATS_MINOR_VERSION (0)
402 WORD returnLength
; /* byte length of driver statistics structure */
406 /*----------------------------------------------------------------------------*
408 * Definitions for use with AIOGetDriverList function. *
410 *----------------------------------------------------------------------------*/
417 } AIODRIVERLISTENTRY
;
422 AIODRIVERLISTENTRY driver
[1];
425 #define AIO_DRIVER_LIST_GET_FIRST (-1)
428 /*----------------------------------------------------------------------------*
430 * Definitions for use with AIOGetBoardList function. *
432 *----------------------------------------------------------------------------*/
444 AIOBOARDLISTENTRY board
[1];
447 #define AIO_BOARD_LIST_GET_FIRST (-1)
449 /*----------------------------------------------------------------------------*
451 * Definitions for use with AIOSetControlData function. *
453 *----------------------------------------------------------------------------*/
457 WORD returnLength
; /* byte length of control data structure */
461 /*----------------------------------------------------------------------------*
463 * Definitions for use with AIOGetFirstPortInfo and AIOGetNextPortInfo *
465 *----------------------------------------------------------------------------*/
475 /* reserved index values */
477 #define SEARCH_TYPE_INDEX 0
478 #define SEARCH_BOARD_INDEX 1
479 #define SEARCH_PORT_INDEX 2
482 /*----------------------------------------------------------------------------*
484 * Definition of AIO functions. *
486 *----------------------------------------------------------------------------*/
488 extern int AIOAcquirePort ( int *hardwareType
,
494 extern int AIOAcquirePortWithRTag ( int *hardwareType
,
501 extern int AIOConfigurePort ( int portHandle
,
509 extern int AIOFlushBuffers ( int portHandle
,
513 extern int AIOGetBoardList( int hardwareType
,
515 AIOBOARDLIST
*pBoardList
);
517 extern int AIOGetDriverList ( int lastHardwareType
,
518 AIODRIVERLIST
*pDriverList
521 extern int AIOGetExternalStatus ( int portHandle
,
526 extern int AIOGetFirstPortInfo ( int hardwareType
,
529 AIOPORTSEARCH
*portSearchP
,
530 AIOPORTINFO
*portInfoP
,
531 AIOPORTCAPABILITIES
*capabilitiesP
,
532 AIODVRCAPABILITIES
*dvrCapabilitiesP
,
533 char *NLMModuleNameP
);
535 extern int AIOGetNextPortInfo ( AIOPORTSEARCH
*portSearchP
,
536 AIOPORTINFO
*portInfoP
,
537 AIOPORTCAPABILITIES
*capabilitiesP
,
538 AIODVRCAPABILITIES
*dvrCapabilitiesP
,
539 char *NLMModuleNameP
);
541 extern int AIOGetPortCapability ( int portHandle
,
542 AIOPORTCAPABILITIES
*pCapabilities
,
543 AIODVRCAPABILITIES
*pDvrCapabilities
546 extern int AIOGetPortConfiguration ( int portHandle
,
547 AIOPORTCONFIG
*pPortConfig
,
548 AIODVRCONFIG
*pDvrConfig
551 extern int AIOGetPortStatus ( int portHandle
,
560 extern int AIOGetReadBufferSize ( int portHandle
,
564 extern int AIOGetPortStatistics ( int portHandle
,
565 AIOPORTSTATISTICS
*pPortStatistics
,
566 AIODVRSTATISTICS
*pDvrStatistics
569 extern int AIOGetFirstPortStatistics( int hardwareType
,
572 AIOPORTSEARCH
*portSearchP
,
573 AIOPORTSTATISTICS
*pPortStatistics
,
574 AIODVRSTATISTICS
*pDvrStatistics
577 extern int AIOGetNextPortStatistics ( AIOPORTSEARCH
*portSearchP
,
578 AIOPORTSTATISTICS
*pPortStatistics
,
579 AIODVRSTATISTICS
*pDvrStatistics
582 extern int AIOGetWriteBufferSize ( int portHandle
,
586 extern int AIOReadData ( int portHandle
,
589 LONG
*numberBytesRead
592 extern int AIOReadStatus ( int portHandle
,
597 extern int AIOReleasePort ( int portHandle
);
599 extern int AIOSetControlData ( int portHandle
,
601 AIOCONTROLDATA
*requestStructValue
604 extern int AIOSetExternalControl ( int portHandle
,
609 extern int AIOSetFlowControl ( int portHandle
,
613 extern int AIOSetFlowControlCharacters( int portHandle
,
620 extern int AIOSetReadBufferSize ( int portHandle
,
624 extern int AIOSetWriteBufferSize ( int portHandle
,
628 extern int AIOWriteData ( int portHandle
,
631 LONG
*numberBytesWritten
634 extern int AIOWriteStatus ( int portHandle
,