[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel Extensions and Device Support Programming Concepts

Other IDE Design Considerations

The following topics cover design considerations of IDE device and adapter device drivers:

IDE Device Driver Tasks

IDE device drivers are responsible for the following actions:

Closing the IDE Device

When an IDE device driver is preparing to close a device through the IDE adapter device driver, it must ensure that all transactions are complete. When the IDE adapter device driver receives an IDEIOSTOP ioctl operation and there are pending I/O requests, the ioctl operation does not return until all have completed. New requests received during this time are rejected from the adapter device driver's ddstrategy routine.

IDE Error Processing

It is the responsibility of the IDE device driver to process IDE check conditions and other returned errors properly. The IDE adapter device driver only passes IDE commands without otherwise processing them and is not responsible for device error recovery.

Device Driver and Adapter Device Driver Interfaces

The IDE device drivers can have both character (raw) and block special files in the /dev directory. The IDE adapter device driver has only character (raw) special files in the /dev directory and has only the ddconfig, ddopen, ddclose, dddump, and ddioctl entry points available to operating system programs. The ddread and ddwrite entry points are not implemented.

Internally, the devsw table has entry points for the ddconfig, ddopen, ddclose, dddump, ddioctl, and ddstrategy routines. The IDE device drivers pass their IDE commands to the IDE adapter device driver by calling the IDE adapter device driver ddstrategy routine. (This routine is unavailable to other operating system programs due to the lack of a block-device special file.)

Access to the IDE adapter device driver's ddconfig, ddopen, ddclose, dddump, ddioctl, and ddstrategy entry points by the IDE device drivers is performed through the kernel services provided. These include such services as fp_opendev, fp_close, fp_ioctl, devdump, and devstrat.

Performing IDE Dumps

An IDE adapter device driver must have a dddump entry point if it is used to access a system dump device. An IDE device driver must have a dddump entry point if it drives a dump device. Examples of dump devices are disks and tapes.

Note: IDE adapter device driver writers should be aware that system services providing interrupt and timer services are unavailable for use in the dump routine. Kernel DMA services are assumed to be available for use by the dump routine. The IDE adapter device driver should be designed to ignore extra DUMPINIT and DUMPSTART commands to the dddump entry point.

The DUMPQUERY option should return a minimum transfer size of 0 bytes, and a maximum transfer size equal to the maximum transfer size supported by the IDE adapter device driver.

Calls to the IDE adapter device driver DUMPWRITE option should use the arg parameter as a pointer to the ataide_buf structure to be processed. Using this interface, an IDE write command can be executed on a previously started (opened) target device. The uiop parameter is ignored by the IDE adapter device driver during the DUMPWRITE command. Spanned or consolidated commands are not supported using the DUMPWRITE option. Gathered write commands are also not supported using the DUMPWRITE option. No queuing of ataide_buf structures is supported during dump processing since the dump routine runs essentially as a subroutine call from the caller's dump routine. Control is returned when the entire ataide_buf structure has been processed.

Attention: Both adapter device driver and device driver writers should be aware that any error occurring during the DUMPWRITE option is considered unsuccessful. Therefore, no error recovery is employed during the DUMPWRITE. Return values from the call to the dddump routine indicate the specific nature of the failure.

Successful completion of the selected operation is indicated by a 0 return value to the subroutine. Unsuccessful completion is indicated by a return code set to one of the following values for the errno global variable. The various ataide_buf status fields, including the b_error field, are not set by the IDE adapter device driver at completion of the DUMPWRITE command. Error logging is, of necessity, not supported during the dump.


[ Previous | Next | Contents | Home | Search ]