Various ioctl operations must be performed for proper operation of the IDE adapter device driver. The ioctl operations described here are the minimum set of commands the IDE adapter device driver must implement to support IDE device drivers. Other operations may be required in the IDE adapter device driver to support, for example, system management facilities. IDE device driver writers also need to understand these ioctl operations.
Every IDE adapter device driver must support the IOCINFO ioctl operation. The structure to be returned to the caller is the devinfo structure, including the ide union definition for the IDE adapter found in the /usr/include/sys/devinfo.h file. The IDE device driver should request the IOCINFO ioctl operation (probably during its open routine) to get the maximum transfer size of the adapter.
Note: The IDE adapter device driver ioctl operations can only be called from the process level. They cannot be executed from a call on any more favored priority levels. Attempting to call them from a more favored priority level can result in a system crash.
The following IDEIOSTART and IDEIOSTOP operations must be sent by the IDE device driver (for the open and close routines, respectively) for each device. They cause the IDE adapter device driver to allocate and initialize internal resources. The IDEIORESET operation is provided for clearing device hard errors. The IDEIOGTHW operation is supported by IDE adapter device drivers that support gathered write commands to target devices.
Except where noted otherwise, the arg parameter for each of the ioctl operations described here must contain a long integer. In this field, the least significant byte is the IDE device ID value. (The upper three bytes are reserved and should be set to 0.) This provides the information required to allocate or deallocate resources and perform IDE bus operations for the ioctl operation requested.
The following information is provided on the various ioctl operations:
| This operation allocates and initializes IDE
device-dependent information local to the IDE adapter device driver. Run
this operation only on the first open of a device. Subsequent
IDEIOSTART commands to the same device fail unless an intervening
IDEIOSTOP command is issued.
| This operation deallocates resources local to the IDE
adapter device driver for this IDE device. This should be run on the last
close of an IDE device. If an IDEIOSTART operation has not been
previously issued, this command is unsuccessful.
| This operation causes the IDE adapter device driver to send
an ATAPI device reset to the specified IDE device ID.
Note: In normal system operation, this command should not be issued, as it would reset all devices connected to the controller. If an IDEIOSTART operation has not been previously issued, this command is unsuccessful.
| This operation is only supported by IDE adapter device
drivers that support gathered write commands. The purpose of the operation
is to indicate support for gathered writes to IDE device drivers that intend
to use this facility. If the IDE adapter device driver does not support
gathered write commands, it must fail the operation. The IDE device driver
should call this operation from its open routine for a particular device
instance. If the operation is unsuccessful, the IDE device driver should not
attempt to run a gathered write command.
IDE Adapter Device Driver, idecdrom IDE Device Driver, idedisk IDE Device Driver, IDEIOIDENT (Identify Device) IDE Adapter Device Driver ioctl Operation, IDEIOINQU (Inquiry) IDE Adapter Device Driver ioctl Operation, IDEIOREAD (Read) IDE Adapter Device Driver ioctl Operation, IDEIOSTART (Start IDE) Adapter Device Driver ioctl Operation, IDEIOSTOP (Stop) Device IDE Adapter Device Driver ioctl Operation, IDEIOSTUNIT (Start Unit) IDE Adapter Device Driver ioctl Operation, and IDEIOTUR (Test Unit Ready) IDE Adapter Device Driver ioctl Operation in AIX Version 4.3 Technical Reference: Kernel and Subsystems Volume 2.
Execution of I/O Requests.
IDE Error Recovery.