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

Kernel Extensions and Device Support Programming Concepts

Other IDE Design Considerations

The following topics cover design considerations of IDE device and adapter 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 driver, it must ensure that all transactions are complete. When the IDE adapter 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 driver's ddstrategy routine.

IDE Error Processing

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

Device Driver and Adapter Driver Interfaces

The IDE device drivers can have both character (raw) and block special files in the /dev directory. The IDE adapter 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 driver by calling the IDE adapter 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 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 kernel services as fp_opendev, fp_close, fp_ioctl, devdump, and devstrat.

Performing IDE Dumps

An IDE adapter 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 driver writers should be aware that system services providing interrupt and timer services are unavailable for use while executing the dump routine. Kernel DMA services are assumed to be available for use by the dump routine. The IDE adapter driver should be designed to ignore extra DUMPINIT and DUMPSTART commands to the dddump entry point while processing the dump routine.

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 driver.

Calls to the IDE adapter 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 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 because 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.

Note
No error recovery techniques are used during the DUMPWRITE option because any error occurring during DUMPWRITE is a real problem as the system is already unstable. 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 driver at completion of the DUMPWRITE command. Error logging is, of necessity, not supported during the dump.

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