TapeMiniWriteMarks

TAPE_STATUS
    TapeMiniWriteMarks(

        IN OUT PVOID  MinitapeExtension,            /* optional */
        IN OUT PVOID  CommandExtension,            /* optional */
       
IN OUT PVOID  CommandParameters,
        IN OUT PSCSI_REQUEST_BLOCK Srb,
        IN ULONG  CallNumber,
        IN TAPE_STATUS  StatusOfLastCommand,        /* optional */
        IN OUT PULONG  RetryFlags                /* optional */
        );

TapeMiniWriteMarks handles the device-specific aspects of an IOCTL_TAPE_WRITE_MARKS request. It is one of the TapeMiniProcessCommand routines in a miniclass driver and is called by the tape class driver. This routine is required.

Parameters

MinitapeExtension
Points to the driver-specific minitape extension. The pointer is NULL if the miniclass driver did not specify a minitape extension.
CommandExtension
Points to the command extension. The pointer is NULL if the miniclass driver did not specify a command extension.
CommandParameters
Points to a buffer containing the parameters for the command. The structure for each I/O command (IOCTL) is defined in minitape.h.
Srb
Points to the partially filled SRB. TapeMiniWriteMarks must fill in the CDB in the SRB. TapeMiniWriteMarks might fill in other SRB members, depending on the requirements of its device(s).
CallNumber
Specifies the number of times the routine has been called to process a given tape command. CallNumber is zero the first time this routine is called for a given command and is incremented until the command request is complete.
StatusOfLastCommand
Specifies the status of the last command. The tape miniclass driver can set RETURN_ERRORS in RetryFlags to have the tape class driver return errors to the miniclass driver rather than directly to the application. Zero if RETURN_ERRORS was not set.
RetryFlags
Points to a value that specifies what action the tape class driver should take when a tape device reports an error.

The low-order word specifies the number of retries to perform in the event of a SCSI command failure. The default is zero (no retries).

The high-order word contains flags:

  • By default, the RETURN_ERRORS and IGNORE_ERRORS flags are clear and the tape class driver returns a failure status to the requesting application if an error occurs.

  • If RETURN_ERRORS is set, the tape class driver returns a failure status, but returns control to the TapeMiniProcessCommand routine rather than to the application.

  • If IGNORE_ERRORS is set, the tape class driver converts a failure status to a success status, and returns control to the TapeMiniProcessCommand routine rather than the application.

Return Value

TAPE_STATUS_SEND_SRB_AND_CALLBACK
Indicates to the tape class driver that the SRB has been filled in and is ready to be given to the device. By default, the tape miniclass driver’s TapeMiniProcessCommand routine is called back if the SRB is successfully completed by the tape class driver. A miniclass driver can modify the default behavior using RetryFlags.

TAPE_STATUS_CALLBACK
Directs the tape class driver to increment CallNumber and call back to the TapeMiniProcessCommand routine, without sending an SRB to the tape device.

TAPE_STATUS_CHECK_TEST_UNIT_READY
Directs the tape class driver to fill in an SRB for the TEST UNIT READY command and send the SRB to the device.

TAPE_STATUS_XXX
Any other return code indicates to the tape class driver that the command is complete and indicates success, failure, or warning. Possible completion return values for this routine include, but are not limited to:
TAPE_STATUS_SUCCESS
TAPE_STATUS_NOT_IMPLEMENTED

Comments

TapeMiniWriteMarks builds SRBs with CDBs to write marks to a tape. It can take one or more SRBs to complete the request. TapeMiniWriteMarks returns each SRB to the tape class driver which sends it along to the device.

TapeMiniWriteMarks must fill in the following members in the SRB before returning to the tape class driver:

TapeMiniWriteMarks can optionally fill in the following members in the SRB:

See Also

TapeClassZeroMemory