[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Kernel Extensions and Device Support Programming Concepts

Required IDE Adapter Driver ioctl Commands

Various ioctl operations must be performed for proper operation of the IDE adapter driver. The ioctl operations described here are the minimum set of commands the IDE adapter driver must implement to support IDE device drivers. Other operations might be required in the IDE adapter driver to support, for example, system management facilities. IDE device driver writers also need to understand these ioctl operations.

Every IDE adapter 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 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.

ioctl Commands

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 driver to allocate and initialize internal resources. The IDEIORESET operation is provided for clearing device hard errors.

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:

IDEIOSTART
This operation allocates and initializes IDE device-dependent information local to the IDE adapter 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.

For more information, see IDEIOSTART (Start IDE) IDE Adapter Device Driver ioctl Operation in AIX 5L Version 5.2 Technical Reference: Kernel and Subsystems Volume 1.

 
IDEIOSTOP
This operation deallocates resources local to the IDE adapter 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.

For more information, see IDEIOSTOP (Stop) IDE Adapter Device Driver ioctl Operation in AIX 5L Version 5.2 Technical Reference: Kernel and Subsystems Volume 1.

IDEIORESET
This operation causes the IDE adapter driver to send an ATAPI device reset to the specified IDE device ID.

The IDE device driver should use this command only when directed to do a forced open. This occurs in for the situation when the device needs to be reset to clear an error condition.

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.
IDEIOINQU
This operation allows the caller to issue an IDE device inquiry command to a selected device.

For more information, see IDEIOINQU (Inquiry) IDE Adapter Device Driver ioctl Operation in AIX 5L Version 5.2 Technical Reference: Kernel and Subsystems Volume 1.

IDEIOSTUNIT
This operation allows the caller to issue an IDE Start Unit command to a selected IDE device. For the IDEIOSTUNIT operation, the arg parameter operation is the address of an ide_startunit structure. This structure is defined in the /usr/include/sys/ide.h file.

For more information, see IDEIOSTUNIT (Start Unit) IDE Adapter Device Driver ioctl Operation in AIX 5L Version 5.2 Technical Reference: Kernel and Subsystems Volume 1.

IDEIOTUR
This operation allows the caller to issue an IDE Test Unit Ready command to a selected IDE device.

For more information, see IDEIOTUR (Test Unit Ready) IDE Adapter Device Driver ioctl Operation in AIX 5L Version 5.2 Technical Reference: Kernel and Subsystems Volume 1.

IDEIOREAD
This operation allows the caller to issue an IDE device read command to a selected device.

For more information, see IDEIOREAD (Read) IDE Adapter Device Driver ioctl Operation in AIX 5L Version 5.2 Technical Reference: Kernel and Subsystems Volume 1.

IDEIOIDENT
This operation allows the caller to issue an IDE identify device command to a selected device.

For more information, see IDEIOIDENT (Identify Device) IDE Adapter Device Driver ioctl Operation in AIX 5L Version 5.2 Technical Reference: Kernel and Subsystems Volume 1.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]