
*----------------------------------------------------------------
*
*   IO Request Structures
*
*----------------------------------------------------------------

*------ Required portion of IO request:

; STRUCTURE  IO,MN_SIZE	EQU	20
IO_DEVICE   EQU	20                * device node pointer
IO_DEVICEint
IO_UNIT     EQU	24                * unit (driver private)
IO_UNITint
IO_COMMAND  EQU	28                * device command
IO_COMMANDshort
IO_FLAGS    EQU	30                * special flags
IO_FLAGSchar
IO_ERROR    EQU	31                * error or warning code
IO_ERRORchar
IO_SIZE	SET	32


*------ Standard IO request extension:

IO_ACTUAL	EQU	32                   * actual # of bytes transfered
IO_ACTUALint
IO_LENGTH 	EQU	36                * requested # of bytes transfered
IO_LENGTHint
IO_DATA		EQU	40                     * pointer to data area
IO_DATAint
IO_OFFSET	EQU	44                   * offset for seeking devices
IO_OFFSETint
IOSTD_SIZE	SET	48


*------ IO_FLAGS bit definitions:

    BITDEF  IO,QUICK,0                  * complete IO quickly


*----------------------------------------------------------------
*
*   Standard Device Library Functions
*
*----------------------------------------------------------------

 

DEV_BEGINIO	EQU	-30         * process IO request
DEV_ABORTIO	EQU	-36         * abort IO request


*----------------------------------------------------------------
*
*   IO Function Macros
*
*----------------------------------------------------------------

BEGINIO     MACRO
            LINKLIB DEV_BEGINIO,IO_DEVICE(A1)
            ENDM

ABORTIO     MACRO
            LINKLIB DEV_ABORTIO,IO_DEVICE(A1)
            ENDM


*----------------------------------------------------------------
*
*   Standard Device Command Definitions
*
*----------------------------------------------------------------

*------ Command definition macro:
DEVINIT     MACRO   * [baseOffset]
            IFC     '\1',''
CMD_COUNT   SET     CMD_NONSTD
            ENDC
            IFNC    '\1',''
CMD_COUNT   SET     \1
            ENDC
            ENDM

DEVCMD      MACRO   * cmdname
\1          EQU     CMD_COUNT
CMD_COUNT   SET     CMD_COUNT+1
            ENDM


*------ Standard device commands:


CMD_INVALID	 	EQU	0        * invalid command
CMD_RESET		EQU	1           * reset as if just inited
CMD_READ		EQU	2            * standard read
CMD_WRITE		EQU	3           * standard write
CMD_UPDATE		EQU	4          * write out all buffers
CMD_CLEAR		EQU	5           * clear all buffers
CMD_STOP		EQU	6            * hold current and queued
CMD_START		EQU	7           * restart after stop
CMD_FLUSH		EQU	8           * abort entire queue


*------ First non-standard device command value:

CMD_NONSTD		SET	9


