IOR


#include <ior.h>

typedef struct _IOR { 
    ULONG  IOR_next;            // client link; see below
    USHORT IOR_func;            // function; see below
    USHORT IOR_status;          // request status; see below
    ULONG  IOR_flags;           // request flags; see below
    CMDCPLT IOR_callback;       // address of callback; see below
    ULONG  IOR_start_addr[2];   // starting address; see below
    ULONG  IOR_xfer_count;      // # of sectors/bytes; see below
    ULONG  IOR_buffer_ptr;      // client buffer; see below
    ULONG  IOR_private_client;  // BlockDev/IOS client reserved
    ULONG  IOR_private_IOS;     // reserved space for IOS
    ULONG  IOR_private_port;    // private area for port driver
    union  urequestor_usage _ureq;  // requestor usage; see below
    ULONG  IOR_req_req_handle;  // request handle; see below
    ULONG  IOR_req_vol_handle;  // media handle; see below
    ULONG  IOR_sgd_lin_phys;    // first physical SGD; see below
    UCHAR  IOR_num_sgds;        // number of physical SGDs
    UCHAR  IOR_vol_designtr;    // drive letter; see below
    USHORT IOR_ios_private_1;   // reserved by IOS to force alignment
    ULONG  IOR_reserved_2[2];   // reserved for internal use
} IOR, *PIOR;

Contains information about an I/O request.

IOR_next

Client link for BCBs. Must be zero if IOR_flags is set to IORF_VERSION_002.

IOR_func

I/O request function. Can be one of these values:

IOR_READ

Reads the number of sectors/bytes as specified in IOR_xfer_count.

IOR_WRITE

Writes the number of sectors/bytes as specified in IOR_xfer_count.

IOR_VERIFY

Verifies the number of sectors/bytes as specified in IOR_xfer_count.

IOR_CANCEL

NOT SUPPORTED. Cancels the specified IOR.

IOR_WRITEV

Writes and verifies the number of sectors/bytes as specified in IOR_xfer_count. Some hardware (IDE, for example) does not support this function.

IOR_MEDIA_CHECK

Obsolete. Use IOR_MEDIA_CHECK_RESET instead. (Checks to see if media has changed, and returns status in IOR_status.)

IOR_MEDIA_CHECK_RESET

Checks to see if media has changed, and returns status in IOR_status.

IOR_LOAD_MEDIA

Performs a LOAD MEDIA operation on removable drives.

IOR_EJECT_MEDIA

Performs an EJECT MEDIA operation on removable drives. For disk and CD-ROM devices, applications are queried before eject, and the lock count is checked for zero. If one of these checks fails, the user is queried to see if he wants to proceed.

IOR_LOCK_MEDIA

Performs a LOCK MEDIA operation on removable drives. LOCK and UNLOCK MEDIA calls must be synchronized, as a depth counter is maintained by the IOS.

IOR_UNLOCK_MEDIA

Performs an UNLOCK MEDIA operation on removable drives. LOCK and UNLOCK MEDIA calls must be synchronized, as a depth counter is maintained by IOS. UNLOCK MEDIA is delayed by about 5 seconds.

IOR_REQUEST_SENSE

Performs REQUEST SENSE operation on removable drives. Currently supported for SCSI devices only.

IOR_COMPUTE_GEOM

Results in a reexamination of volume and device characteristics. When this command is received, each IOS layer assumes the device has changed, and performs whatever initialization required. For example, the disk TSD will reexamine the partitions of a device.

IOR_GEN_IOCTL

Function permits device-specific IOCTLs to be issued to IOS drivers. Standard 16-bit, MS-DOS IOCTLs (INT 21h Function 44xx) are supported, but 32-bit IOCTLs are not yet defined. For 16-bit IOCTLs, IOR_flags is set to IORF_16BIT_IOCTL and members of sdeffsd_req_usage structure in _ureq member are defined below. Note that macros are defined that provide an alias reference to these members. The macro names are equivalent to the member names listed below, with the leading underscore omitted. For example, _ureq.sdeffsd_req_usage._IOR_ioctl_drive can be referenced with the macro IOR_ioctl_drive.


_IOR_ioctl_drive

Input. 1-based drive number or device handle (from BX register)

_IOR_ioctl_function

Input. Function number (from AX register)

_IOR_ioctl_control_param

Input. Function parameter zero-extended to 32 bits (from CX register)

_IOR_ioctl_buffer_ptr

Input. Address of buffer, mapped to flat address (from DS:DX register)

_IOR_ioctl_client_params

Input. Address of additional parameters passed in from the caller. The IORF_16BIT_IOCTL flag must be used to determine the structure type. If it is a 16-bit IOCTL, the pointer will be to the CLIENT_REGS structure.

_IOR_ioctl_return

Output. Return value to be mapped to the IOCTL caller upon exit.

_IOR_ioctl_buffer_length

Output. Size of buffer pointed to by _IOR_ioctl_buffer_ptr. Not used by INT 21h Function 440Dh IOCTL calls.


IOR_FORMAT

Allows issuance of a low level format packet as defined in the INT 13h specification. The IOR_format_address_field (same as IOR_sgd_lin_phys) member contains the low level sector map. See the IOP_format_* members of the IOP structure for additional information.

IOR_SCSI_PASS_THROUGH

Each layer passes this request down with modification to the SCSI port driver. The IOR must contain a pointer to a valid SRB. Also, the EBX register must point to the BDD portion of the DCB when IOS_SendCommand is called with a passthrough request.

IOR_CLEAR_QUEUE

Callback of request; indicates all requests issued prior to this request have been completed.

IOR_DOS_RESET

Issued in response to an INT 13h reset by the INT 13h VxD. Currently used only by and for the IOS floppy driver.

IOR_SCSI_REQUEST

A generic function that indicates the request is for SCSI. The SRB member in the IOR must be valid. Normally used by IOS layers to send internal requests to SCSI devices.

IOR_SET_WRITE_STATUS

Results in the correct setting of DCB_DEV_WRITABLE flag in the DCB if SUCCESS status is returned. Currently only supported by the IOS floppy driver.

IOR_RESTART_QUEUE

A placeholder function that results in restarting of the queue provided by the IOS queuing services. Has no other effect. Should be sent after the DCB_QUEUE_FREEZE field has been decremented to zero.

IOR_ABORT_QUEUE

Causes each layer to call back each queued request with status of IORS_CANCELED.

IOR_SPIN_DOWN

Causes the specified drive to be spun down.

IOR_SPIN_UP

Causes the specified drive to be spun up.

IOR_FLUSH_DRIVE

Causes layer drivers to flush out dirty data. This is a synchronous function and should not be called at event/interrupt time.

IOR_FLUSH_DRIVE_AND_DISCARD

Causes layer drivers to flush out dirty data and then discard cached data. This is a synchronous function and should not be called at event/interrupt time.

IOR_FSD_EXT

Sends private command from an IOS client to the FSD extension layer (DRP_FSD_EXT_1 or DRP_FSD_EXT_2) such as a Compressed Volume Manager (CVM). This call is similar in intent and usage to IOR_GEN_IOCTL; however, it can be used in the swapper path, so, in general, the handling driver should not touch pageable code or data.


Not all drivers support all functions.

IOR_status

Status value. The function sets this member to IORS_SUCCESS (0) if it is successful. Otherwise, it sets the member to one of these values:

IORS_BIG_IO_BREAKUP_FAILED

Attempt to split big I/O failed.

IORS_BUSY

Device is busy.

IORS_CANCELED

Command was canceled.

IORS_CMD_IN_PROGRESS

Command is in progress, and can't be canceled.

IORS_DEVICE_ERROR

Error on recalib. drive, etc.

IORS_ERROR_DESIGNTR

Error occurred.

IORS_HW_FAILURE

General hardware failure.

IORS_ILLEGAL_ACCESS_MODE

CD-ROM read on audio or attempt play on data.

IORS_INVALID_CMD_PTR

Cancel of an invalid command.

IORS_INVALID_COMMAND

Command not supported or invalid.

IORS_INVALID_PARM

Invalid parameter.

IORS_INVALID_SECTOR

Old blockdev error code for requests on an invalid sector number.

IORS_LOCK_COUNT_EXCEEDED

Volume lock count exceeded.

IORS_LOCK_VIOLATION

Illegal access to locked device.

IORS_MEDIA_ERROR

Media failure.

IORS_MEMORY_ERROR

Error allocating DMA buffer space for I/O.

IORS_NO_DEVICE

Physical or logical device nonexistant.

IORS_NO_MEDIA

Media removed from device.

IORS_NOT_READY

Device not ready.

IORS_OUT_OF_SPACE

No space on media.

IORS_SUCCESS_WITH_ECC

Successful, but with ECC.

IORS_SUCCESS_WITH_RETRY

Successful, but retries required.

IORS_TIME_OUT

Device timed out.

IORS_UNCERTAIN_MEDIA

Media may have changed.

IORS_UNFORMATTED_MEDIA

Unformatted media.

IORS_UNREC_ERROR

Unrecoverable error.

IORS_VALID_EJECT_FAILED

Eject command was not accepted.

IORS_VOL_IN_USE

Volume is in use ; used for eject.

IORS_VOL_LOCKED

Eject received with drive locked.

IORS_VOL_NOT_LOCKED

Volume received unlock without lock.

IORS_VOL_NOT_REMOVABLE

Removable request to non-removeable drive.

IORS_WRITE_PROTECT

Write protect error.

IORS_WRONG_MEDIA

Wrong media in drive.


IOR_flags

Flags. Can be a combination of these values:

IORF_16BIT_IOCTL

If set, 16-bit IOCTL; 32-bit otherwise.

IORF_AUDIO_DATA_READ

Indicates an audio data read.

IORF_BLOCKDEV_EMULATE

Request started as a BCB

IORF_BYPASS_A_B

Indicates that VOLTRK should bypass AB check.

IORF_BYPASS_QUEUE

Request should bypass IOS queuing (internal IOS driver use only).

IORF_BYPASS_VOLTRK

Request will not be volume tracked.

IORF_CHAR_COMMAND

Indicates transfer counts and scatter/gather buffer sizes are byte values.

IORF_CHAR_DEVICE

Indicates character device.

IORF_DATA_IN

Indicates a data read operation.

IORF_DATA_OUT

Indicates a data write operation.

IORF_DIRECT_IO

Such as INT 25h or INT 26h.

IORF_DONT_CACHE

Indicates that the BDCB data should not be cached.

IORF_DOUBLE_BUFFER

Indicates that the request is to be completed using double buffering. Client must ensure that both the SGD buffer pointers and IOR_sgd_lin_phys are virtual pointers.

IORF_HIGH_PRIORITY

Binary priority indication.

IORF_IDE_RESERVED

Indicates I/O is for a physical device.

IORF_INHIBIT_GEOM_RECOMPUTE

Force inhibit of device geometry recomputation.

IORF_IO_TOO_BIG

Indicates I/O is too big for single pass (set by IOS criteria code).

IORF_LOGICAL_START_SECTOR

IOR_start_addr is logical.

IORF_NO_COMPRESS

Do not compress data.

IORF_PARTITION_BIAS_ADDED

Set by TSD only to indicate that it has added in the bias, as requiredd by IORF_LOGICAL_START_SECTOR.

IORF_PHYS_CMD

Indicates I/O is for a physical device.

IORF_PHYS_SGDS

Indicates IOR_sgd_lin_phys valid.

IORF_POSTPONED_VOL_OPS

IORF_QUIET_VOLTRK

Indicates that volume tracking just return error when wrong media in drive (no dialog box).

IORF_SCATTER_GATHER

Indicates BDCB physical SGD list present.

IORF_SRB_VALID

Indicates that IOP_srb points to a valid SRB.

IORF_SWAPPER_IO

Request is from the swapper.

IORF_SYNC_CMD_DONE

Set by IOS only to indicate completion of synchronous command.

IORF_SYNC_COMMAND

Indicates synchronous command (complete before return from IOS).

IORF_VERSION_002

Indicates use of extended BCB (IOR) format for request.

IORF_VOL_RETRY

Indicates volume tracking retried request (internal use only).

IORF_WIN32

Indicates I/O is from 32 bit API.


IOR_callback

Address of the callback routine for asynchronous requests. The callback receives control after the request completes. This member is ignored if IOR_flags is set to IORF_SYNC_COMMAND.

IOR_start_addr

Volume-relative start address if IOR_flags is set to IORF_LOGICAL_START_SECTOR; otherwise, this member is a physical address. IOR_start_addr[0] contains the low order 32 bits and IOR_start_addr[1] contains the high order 32 bits.

IOR_xfer_count

Number of bytes to transfer if IOR_flags is set to IORF_CHAR_COMMAND; otherwise, number of sectors to transfer. Must be set to zero if the requested function does not involve a data transfer.

IOR_buffer_ptr

Address of the BlockDev client buffer. Contains the address of the data buffer or of a null-terminated list of SGD structures, depending on whether IOR_flags is set to IORF_SCATTER_GATHER. This member is ignored if the requested function does not involve a data transfer.

_ureq

Usage area for requestor. Is used for storing parameters and return values for IOCTLs.

IOR_req_req_handle

Request handle, a 32-bit value that is passed on the stack to the callback routine specified by the IOR_callback member. Any 32 bit value may be used, but this member often contains the address of this IOR or of the IOP which contains this IOR.

IOR_req_vol_handle

Requestor-provided media handle designating the media on which to carry out the requested function (VRP).

IOR_sgd_lin_phys

Address of the first physical scatter/gather descripter (SGD). (Contrast with IOR_buffer_ptr, which points to the logical SGDs.) This is either a linear or physical address, depending on the drivers as indicated by the DCB demand bits.

IOR_num_sgds

Number of physical SGDs pointed to by the IOR_sgd_lin_phys member.

IOR_vol_designtr

Numeric representation of the drive letter designating the volume to perform the function on. A is 0, B is 1, C is 2, and so on.

See also IOP, SGD, urequestor_usage