1 /* This contains defs for the stubs defined in alpha-patch.c. Many of these
2 defs are ripped off of other files. */
4 #include "altdebug.h" /* Get StackFrame structure */
6 /* -=-=-= aio.h -=-=-= */
8 /*----------------------------------------------------------------------------*
10 * NetWare 386 Developer's Asynchronous I/O (AIO) Runtime library *
12 * This include file defines the constants and prototypes required *
13 * to use the AIO application interface. *
15 * (c) Copyright. 1991 Novell, Inc. All rights reserved. *
17 *----------------------------------------------------------------------------*/
19 typedef unsigned long DWORD
;
22 /*----------------------------------------------------------------------------*
24 * Predefined hardware types for use with the AIOAcquirePort function. *
26 *----------------------------------------------------------------------------*/
28 #define AIO_COMX_TYPE (1)
29 #define AIO_ARTIC_TYPE (2)
30 #define AIO_WNIM_TYPE (3)
33 /*----------------------------------------------------------------------------*
35 * Function completion code status values. *
37 * Note that all error statuses are negative values. *
39 *----------------------------------------------------------------------------*/
41 #define AIO_SUCCESS (0)
42 #define AIO_BAD_HANDLE (-1)
43 #define AIO_FAILURE (-2)
44 #define AIO_FUNC_NOT_SUPPORTED (-3)
45 #define AIO_INVALID_PARAMETER (-5)
46 #define AIO_PORT_NOT_AVAILABLE (-6)
47 #define AIO_QUALIFIED_SUCCESS (-7)
48 #define AIO_NO_MORE_PORTS (-8)
49 #define AIO_TYPE_NUMBER_INVALID (-10)
50 #define AIO_BOARD_NUMBER_INVALID (-11)
51 #define AIO_PORT_NUMBER_INVALID (-12)
52 #define AIO_RESOURCE_TAG_INVALID (-13)
53 #define AIO_DATA_PRESENT (-14)
54 #define AIO_BAD_REQUEST_TYPE (-15)
55 #define AIO_PORT_GONE (-20)
56 #define AIO_RTAG_INVALID (-21)
59 /* This is only for non-CLIB application */
61 #define ASYNCIOSignature 0x4E595341 /* 'NYSA' */
63 /*----------------------------------------------------------------------------*
65 * Definitions for use with the AIOSetExternalControl function. *
67 *----------------------------------------------------------------------------*/
69 #define AIO_EXTERNAL_CONTROL (1)
70 #define AIO_EXTCTRL_DTR (1)
71 #define AIO_EXTCTRL_RTS (2)
74 #define AIO_BREAK_CONTROL (2)
75 #define AIO_SET_BREAK_OFF (0)
76 #define AIO_SET_BREAK_ON (1)
79 #define AIO_FLOW_CONTROL (3)
80 #define AIO_SOFTWARE_FLOW_CONTROL_OFF (0)
81 #define AIO_SOFTWARE_FLOW_CONTROL_ON (1)
82 #define AIO_HARDWARE_FLOW_CONTROL_OFF (0)
83 #define AIO_HARDWARE_FLOW_CONTROL_ON (2)
86 #define AIO_FLOW_CONTROL_CHARACTERS (4)
88 #define AIO_SET_DEADMAN_TIMER (5)
90 /*----------------------------------------------------------------------------*
92 * Definitions for use with the AIOGetExternalStatus function. *
94 *----------------------------------------------------------------------------*/
96 #define AIO_EXTSTA_RI (0x00000001)
97 #define AIO_EXTSTA_DCD (0x00000008)
98 #define AIO_EXTSTA_DSR (0x00000010)
99 #define AIO_EXTSTA_CTS (0x00000020)
100 #define AIO_EXTSTA_BREAK (0x00000080)
103 /*----------------------------------------------------------------------------*
105 * Definitions for use with the AIOFlushBuffers function. *
107 *----------------------------------------------------------------------------*/
109 #define AIO_FLUSH_WRITE_BUFFER (0x0001)
110 #define AIO_FLUSH_READ_BUFFER (0x0002)
113 /*----------------------------------------------------------------------------*
115 * Definitions for use with the AIOReadStatus function. *
117 *----------------------------------------------------------------------------*/
119 #define AIO_RECEIVE_ACTIVE (0)
120 #define AIO_RECEIVE_FULL (1)
122 /*----------------------------------------------------------------------------*
124 * Definitions for use with the AIOWriteStatus function. *
126 *----------------------------------------------------------------------------*/
128 #define AIO_TRANSMIT_IDLE (0)
129 #define AIO_TRANSMIT_ACTIVE (1)
130 #define AIO_TRANSMIT_XOFFED (2)
132 /*----------------------------------------------------------------------------*
134 * Definitions for use with the AIOAcquirePort function. *
136 *----------------------------------------------------------------------------*/
138 #define AIO_HARDWARE_TYPE_WILDCARD (-1)
139 #define AIO_BOARD_NUMBER_WILDCARD (-1)
140 #define AIO_PORT_NUMBER_WILDCARD (-1)
142 /*----------------------------------------------------------------------------*
144 * Definitions for use with the AIOConfigurePort function. *
146 *----------------------------------------------------------------------------*/
150 #define AIO_BAUD_50 (0)
151 #define AIO_BAUD_75 (1)
152 #define AIO_BAUD_110 (2)
153 #define AIO_BAUD_134p5 (3)
154 #define AIO_BAUD_150 (4)
155 #define AIO_BAUD_300 (5)
156 #define AIO_BAUD_600 (6)
157 #define AIO_BAUD_1200 (7)
158 #define AIO_BAUD_1800 (8)
159 #define AIO_BAUD_2000 (9)
160 #define AIO_BAUD_2400 (10)
161 #define AIO_BAUD_3600 (11)
162 #define AIO_BAUD_4800 (12)
163 #define AIO_BAUD_7200 (13)
164 #define AIO_BAUD_9600 (14)
165 #define AIO_BAUD_19200 (15)
166 #define AIO_BAUD_38400 (16)
167 #define AIO_BAUD_57600 (17)
168 #define AIO_BAUD_115200 (18)
172 #define AIO_DATA_BITS_5 (0)
173 #define AIO_DATA_BITS_6 (1)
174 #define AIO_DATA_BITS_7 (2)
175 #define AIO_DATA_BITS_8 (3)
179 #define AIO_STOP_BITS_1 (0)
180 #define AIO_STOP_BITS_1p5 (1)
181 #define AIO_STOP_BITS_2 (2)
185 #define AIO_PARITY_NONE (0)
186 #define AIO_PARITY_ODD (1)
187 #define AIO_PARITY_EVEN (2)
188 #define AIO_PARITY_MARK (3)
189 #define AIO_PARITY_SPACE (4)
193 #define AIO_SOFTWARE_FLOWCONTROL_OFF (0)
194 #define AIO_SOFTWARE_FLOWCONTROL_ON (1)
195 #define AIO_HARDWARE_FLOWCONTROL_OFF (0)
196 #define AIO_HARDWARE_FLOWCONTROL_ON (2)
198 #define AIO_DROPOUT_VALUE (0xFF)
200 /*----------------------------------------------------------------------------*
202 * Definitions for use with AIOPORTCAPABILITIES structure. *
204 *----------------------------------------------------------------------------*/
208 WORD returnLength
; /* byte length of capabilities data */
211 LONG notSupportedMask
;
212 BYTE minBitRate
; /* minimum bit rate index supported */
213 BYTE maxBitRate
; /* maximum bit rate index supported */
214 BYTE minDataBits
; /* minimum data bits per char index supported */
215 BYTE maxDataBits
; /* maximum data bits per char index supported */
216 BYTE minStopBits
; /* minimum stop bits per char index supported */
217 BYTE maxStopBits
; /* maximum stop bits per char index supported */
218 BYTE minParityMode
; /* minimum parity mode index supported */
219 BYTE maxParityMode
; /* maximum parity mode index supported */
220 BYTE minFlowCtrlMode
; /* minimum flow control mode index supported */
221 BYTE maxFlowCtrlMode
; /* maximum flow control mode index supported */
222 LONG miscCapabilities
; /* miscellaneous capability flags */
223 LONG minReadBufferSize
; /* minimum length of receive buffer */
224 LONG maxReadBufferSize
; /* maximum length of receive buffer */
225 LONG minWriteBufferSize
; /* minimum length of transmit buffer */
226 LONG maxWriteBufferSize
; /* maximum length of transmit buffer */
227 WORD minDeadmanTime
; /* minimum deadman time (seconds) */
228 WORD maxDeadmanTime
; /* maximum deadman time (seconds) */
229 } AIOPORTCAPABILITIES
;
231 #define AIO_PORT_NS_MINBITRATE (0x80000000)
232 #define AIO_PORT_NS_MAXBITRATE (0x40000000)
233 #define AIO_PORT_NS_MINDATABITS (0x20000000)
234 #define AIO_PORT_NS_MAXDATABITS (0x10000000)
235 #define AIO_PORT_NS_MINSTOPBITS (0x08000000)
236 #define AIO_PORT_NS_MAXSTOPBITS (0x04000000)
237 #define AIO_PORT_NS_MINPARITYMODE (0x02000000)
238 #define AIO_PORT_NS_MAXPARITYMODE (0x01000000)
239 #define AIO_PORT_NS_MINFLOWCTRLMODE (0x00800000)
240 #define AIO_PORT_NS_MAXFLOWCTRLMODE (0x00400000)
241 #define AIO_PORT_NS_MISCCAPABILITIES (0x00200000)
242 #define AIO_PORT_NS_MINREADBUFFERSIZE (0x00100000)
243 #define AIO_PORT_NS_MAXREADBUFFERSIZE (0x00080000)
244 #define AIO_PORT_NS_MINWRITEBUFFERSIZE (0x00040000)
245 #define AIO_PORT_NS_MAXWRITEBUFFERSIZE (0x00020000)
246 #define AIO_PORT_NS_MINDEADMANTIME (0x00010000)
247 #define AIO_PORT_NS_MAXDEADMANTIME (0x00008000)
249 #define AIO_PORT_CAPS_NOT_SUPPORTED (0x00007FFF)
250 #define AIO_PORT_CAPS_MAJOR_VERSION (1)
251 #define AIO_PORT_CAPS_MINOR_VERSION (0)
253 #define AIO_CAP_OUTPUT_BREAK (0x00000002)
254 #define AIO_CAP_FLOWCTRLCHARS (0x00000004)
255 #define AIO_CAP_PROGRAMMABLE (0x00000008)
256 #define AIO_CAP_INPUT (0x00000010)
257 #define AIO_CAP_OUTPUT (0x00000020)
262 WORD returnLength
; /* byte length of driver capabilities structure */
264 } AIODVRCAPABILITIES
;
266 #define AIO_NO_STRUCT_DATA_RETURNED (2)
268 /*----------------------------------------------------------------------------*
270 * Definitions for use with the AIOGetPortsRollCall function. *
272 *----------------------------------------------------------------------------*/
276 WORD returnLength
; /* byte length of port info data */
279 LONG notSupportedMask
;
280 int hardwareType
; /* value used with AIOAcquirePort */
281 int boardNumber
; /* " */
282 int portNumber
; /* " */
283 WORD availability
; /* availability of port for acquire */
284 LONG externalStatus
; /* current external status value for port */
285 LONG chgdExternalStatus
; /* changed external status value for port */
288 #define AIO_INFO_NS_HARDWARETYPE (0x80000000)
289 #define AIO_INFO_NS_BOARDNUMBER (0x40000000)
290 #define AIO_INFO_NS_PORTNUMBER (0x20000000)
291 #define AIO_INFO_NS_AVAILABILITY (0x10000000)
292 #define AIO_INFO_NS_EXTERNALSTATUS (0x08000000)
293 #define AIO_INFO_NS_CHGDEXTERNALSTATUS (0x04000000)
295 #define AIO_PORT_INFO_NOT_SUPPORTED (0x03FFFFFF)
296 #define AIO_PORT_INFO_MAJOR_VERSION (1)
297 #define AIO_PORT_INFO_MINOR_VERSION (0)
299 #define AIO_AVAILABLE_FOR_ACQUIRE (0)
300 #define AIO_ALREADY_ACQUIRED (1)
301 #define AIO_UNAVAILABLE (0xFF)
303 #define AIO_INITIAL (0)
304 #define AIO_SUCCESSOR (1)
307 /*----------------------------------------------------------------------------*
309 * Definitions for use with the AIOGetPortConfiguration function. *
311 *----------------------------------------------------------------------------*/
315 WORD returnLength
; /* byte length of port configuration data */
318 LONG notSupportedMask
;
319 int hardwareType
; /* value used with AIOAcquirePort */
320 int boardNumber
; /* " */
321 int portNumber
; /* " */
322 BYTE bitRate
; /* Bits per second index */
323 BYTE dataBits
; /* Bits per character index */
324 BYTE stopBits
; /* Stop bits per char index */
325 BYTE parityMode
; /* Generated parity index */
326 BYTE flowCtrlMode
; /* Flow control mode */
327 BYTE breakMode
; /* Break control mode */
328 LONG readSize
; /* Receive buffer size */
329 LONG writeSize
; /* Transmit buffer size */
334 WORD externalControl
; /* set with AIO_EXTERNAL_CONTROL */
338 #define AIO_CONFIG_NS_HARDWARETYPE (0x80000000)
339 #define AIO_CONFIG_NS_BOARDNUMBER (0x40000000)
340 #define AIO_CONFIG_NS_PORTNUMBER (0x20000000)
341 #define AIO_CONFIG_NS_BITRATE (0x10000000)
342 #define AIO_CONFIG_NS_DATABITS (0x08000000)
343 #define AIO_CONFIG_NS_STOPBITS (0x04000000)
344 #define AIO_CONFIG_NS_PARITYMODE (0x02000000)
345 #define AIO_CONFIG_NS_FLOWCTRLMODE (0x01000000)
346 #define AIO_CONFIG_NS_BREAKMODE (0x00800000)
347 #define AIO_CONFIG_NS_READSIZE (0x00400000)
348 #define AIO_CONFIG_NS_WRITESIZE (0x00200000)
349 #define AIO_CONFIG_NS_TRANSMITXON (0x00100000)
350 #define AIO_CONFIG_NS_TRANSMITXOFF (0x00080000)
351 #define AIO_CONFIG_NS_RECEIVEXON (0x00040000)
352 #define AIO_CONFIG_NS_RECEIVEXOFF (0x00020000)
353 #define AIO_CONFIG_NS_EXTERNALCONTROL (0x00010000)
355 #define AIO_PORT_CONFIG_NOT_SUPPORTED (0x0007FFFF)
356 #define AIO_PORT_CONFIG_MAJOR_VERSION (1)
357 #define AIO_PORT_CONFIG_MINOR_VERSION (0)
359 #define AIO_EXTCTRL_DTR_ENABLE (1)
360 #define AIO_EXTCTRL_DTR_DISABLE (0)
361 #define AIO_EXTCTRL_RTS_ENABLE (2)
362 #define AIO_EXTCTRL_RTS_DISABLE (0)
364 #define AIO_BREAK_MODE_OFF (0)
365 #define AIO_BREAK_MODE_ON (1)
369 WORD returnLength
; /* byte length of driver config structure */
373 /*----------------------------------------------------------------------------*
375 * Definitions for use with the AIOGetStatistics function. *
377 *----------------------------------------------------------------------------*/
381 WORD returnLength
; /* byte length of port statistics structure */
384 LONG notSupportedMask
;
385 LONG receiveBytes
; /* total number of bytes received on port */
386 LONG transmitBytes
; /* total number of bytes transmitted from port */
387 LONG parityErrors
; /* number of receive parity errors */
388 LONG framingErrors
; /* number of receive framing errors */
389 LONG overrunSoftware
; /* number of software overruns (occurrences) */
390 LONG overrunHardware
; /* number of hardware overruns (occurrences) */
393 #define AIO_STATS_NS_RECEIVEBYTES (0x80000000)
394 #define AIO_STATS_NS_TRANSMITBYTES (0x40000000)
395 #define AIO_STATS_NS_PARITYERRORS (0x20000000)
396 #define AIO_STATS_NS_FRAMINGERRORS (0x10000000)
397 #define AIO_STATS_NS_OVERRUNSOFTWARE (0x08000000)
398 #define AIO_STATS_NS_OVERRUNHARDWARE (0x04000000)
400 #define AIO_PORT_STATS_NOT_SUPPORTED (0x03FFFFFF)
401 #define AIO_PORT_STATS_MAJOR_VERSION (1)
402 #define AIO_PORT_STATS_MINOR_VERSION (0)
406 WORD returnLength
; /* byte length of driver statistics structure */
410 /*----------------------------------------------------------------------------*
412 * Definitions for use with AIOGetDriverList function. *
414 *----------------------------------------------------------------------------*/
421 } AIODRIVERLISTENTRY
;
426 AIODRIVERLISTENTRY driver
[1];
429 #define AIO_DRIVER_LIST_GET_FIRST (-1)
432 /*----------------------------------------------------------------------------*
434 * Definitions for use with AIOGetBoardList function. *
436 *----------------------------------------------------------------------------*/
448 AIOBOARDLISTENTRY board
[1];
451 #define AIO_BOARD_LIST_GET_FIRST (-1)
453 /*----------------------------------------------------------------------------*
455 * Definitions for use with AIOSetControlData function. *
457 *----------------------------------------------------------------------------*/
461 WORD returnLength
; /* byte length of control data structure */
465 /*----------------------------------------------------------------------------*
467 * Definitions for use with AIOGetFirstPortInfo and AIOGetNextPortInfo *
469 *----------------------------------------------------------------------------*/
479 /* reserved index values */
481 #define SEARCH_TYPE_INDEX 0
482 #define SEARCH_BOARD_INDEX 1
483 #define SEARCH_PORT_INDEX 2
486 /*----------------------------------------------------------------------------*
488 * Definition of AIO functions. *
490 *----------------------------------------------------------------------------*/
492 extern int AIOAcquirePort ( int *hardwareType
,
498 extern int AIOAcquirePortWithRTag ( int *hardwareType
,
505 extern int AIOConfigurePort ( int portHandle
,
513 extern int AIOFlushBuffers ( int portHandle
,
517 extern int AIOGetBoardList( int hardwareType
,
519 AIOBOARDLIST
*pBoardList
);
521 extern int AIOGetDriverList ( int lastHardwareType
,
522 AIODRIVERLIST
*pDriverList
525 extern int AIOGetExternalStatus ( int portHandle
,
530 extern int AIOGetFirstPortInfo ( int hardwareType
,
533 AIOPORTSEARCH
*portSearchP
,
534 AIOPORTINFO
*portInfoP
,
535 AIOPORTCAPABILITIES
*capabilitiesP
,
536 AIODVRCAPABILITIES
*dvrCapabilitiesP
,
537 char *NLMModuleNameP
);
539 extern int AIOGetNextPortInfo ( AIOPORTSEARCH
*portSearchP
,
540 AIOPORTINFO
*portInfoP
,
541 AIOPORTCAPABILITIES
*capabilitiesP
,
542 AIODVRCAPABILITIES
*dvrCapabilitiesP
,
543 char *NLMModuleNameP
);
545 extern int AIOGetPortCapability ( int portHandle
,
546 AIOPORTCAPABILITIES
*pCapabilities
,
547 AIODVRCAPABILITIES
*pDvrCapabilities
550 extern int AIOGetPortConfiguration ( int portHandle
,
551 AIOPORTCONFIG
*pPortConfig
,
552 AIODVRCONFIG
*pDvrConfig
555 extern int AIOGetPortStatus ( int portHandle
,
564 extern int AIOGetReadBufferSize ( int portHandle
,
568 extern int AIOGetPortStatistics ( int portHandle
,
569 AIOPORTSTATISTICS
*pPortStatistics
,
570 AIODVRSTATISTICS
*pDvrStatistics
573 extern int AIOGetFirstPortStatistics( int hardwareType
,
576 AIOPORTSEARCH
*portSearchP
,
577 AIOPORTSTATISTICS
*pPortStatistics
,
578 AIODVRSTATISTICS
*pDvrStatistics
581 extern int AIOGetNextPortStatistics ( AIOPORTSEARCH
*portSearchP
,
582 AIOPORTSTATISTICS
*pPortStatistics
,
583 AIODVRSTATISTICS
*pDvrStatistics
586 extern int AIOGetWriteBufferSize ( int portHandle
,
590 extern int AIOReadData ( int portHandle
,
593 LONG
*numberBytesRead
596 extern int AIOReadStatus ( int portHandle
,
601 extern int AIOReleasePort ( int portHandle
);
603 extern int AIOSetControlData ( int portHandle
,
605 AIOCONTROLDATA
*requestStructValue
608 extern int AIOSetExternalControl ( int portHandle
,
613 extern int AIOSetFlowControl ( int portHandle
,
617 extern int AIOSetFlowControlCharacters( int portHandle
,
624 extern int AIOSetReadBufferSize ( int portHandle
,
628 extern int AIOSetWriteBufferSize ( int portHandle
,
632 extern int AIOWriteData ( int portHandle
,
635 LONG
*numberBytesWritten
638 extern int AIOWriteStatus ( int portHandle
,
643 /* -=-=-= Random stuff -=-=-=-= */
645 #define isspace(C) (C == '\n' || C == '\r' || C == ' ' || C == '\t')
646 int Breakpoint (int __arg
);
648 #define ULONG unsigned long