A.3.2 Supplying Required and Optional Miniclass Routines

A tape miniclass driver must have the following routines:

·DriverEntry initializes the miniclass driver.

This routine must be named DriverEntry for the OS to load the miniclass driver automatically.

The miniclass DriverEntry routine sets driver-specific constants and entry points in the TAPE_INIT_DATA structure and calls TapeClassInitialize in the tape class driver.

·TapeMiniVerifyInquiry determines whether the miniclass driver supports a particular tape device.

·TapeMiniProcessCommand routines, such as TapeMiniGetPosition, implement device-specific processing for tape device control requests.

These routines set up the SRBs with CDBs for each device control request. There is typically one routine for each command. The TapeMiniProcessCommand routines are called by the tape class driver. They return the SRBs and CDBs to the tape class driver and the tape class driver sends them to the tape device.

A tape miniclass driver can have the following optional routines:

·TapeMiniExtensionInit initializes the optional device extension.

See Section A.3.3 for information on device extensions.

·TapeMiniTapeError supplements the error handling of the tape class driver.

For most devices, the tape class driver returns an appropriate status value to the application when an error occurs. For some devices, returning the appropriate status requires device-specific information from the tape miniclass driver. For example, the miniclass driver for 4mm DAT tape drives can determine that, in certain situations, a TAPE_STATUS_BUS_ERROR status is actually due to no media in the drive. The 4mm DAT miniclass driver's TapeMiniTapeError routine identifies these situations and changes the status that is returned to the application to TAPE_ERROR_NO_MEDIA.

The DriverEntry routine must use that name exactly. The other TapeMiniXxx routines can be named as the driver writer chooses, as long as the addresses of the routines are loaded into the appropriate members of the TAPE_INIT_DATA structure. To aid in debugging, a miniclass driver should prefix the TapeMiniXxx routines with some characters that identify its driver and should ensure the rest of the characters in the name reflect what the routine does.

See also the description of tape miniclass routines in the Kernel-Mode Driver Reference.