The IOCC_FORMAT CommandCode consists of all CommandModifiers responsible for unit format requests. The following table describes the IOCC_FORMAT CommandModifiers:
┌────────────────────────┬────────────────────────────────────┐ │CommandModifier │Description │ ├────────────────────────┼────────────────────────────────────┤ │IOCM_FORMAT_MEDIA │Formats the entire media in the │ │ │unit. Support of this command is │ │ │mandatory for SCSI devices that │ │ │require low-level formatting. │ ├────────────────────────┼────────────────────────────────────┤ │IOCM_FORMAT_TRACK │Formats the specified track on the │ │ │unit. Support of this command is │ │ │mandatory for standard diskette │ │ │media. │ ├────────────────────────┼────────────────────────────────────┤ │IOCM_FORMAT_PROGRESS │Reports the progress of the │ │ │formatting. Support of this command │ │ │is mandatory for standard diskette │ │ │media. │ └────────────────────────┴────────────────────────────────────┘
Remarks
Support:
Format of IORB
IORB_FORMAT Description:
This section defines the IORB_FORMAT control block. (See the following table.)
┌─────────────────┬─────────────────┬─────────┬─────────────────┐│Field Name │C Type │Length │Description │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │iorbh │IORBH │DB(68) │IORB header │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │cSGLIST │USHORT │DW │Number of │ │ │ │ │elements │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │pSGLIST │PSCATGATENTRY │DD │Far pointer to │ │ │ │ │s/g list │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │ppSGLIST │ULONG │DD │Physical address │ │ │ │ │of s/g list │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │FormatCmdLen │USHORT │DW │Length of Format │ │ │ │ │command │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │pFormatCmd │PBYTE │DD │Pointer to Format│ │ │ │ │command │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │Reserved_1 │UCHAR │DB(8) │Reserved. │ └─────────────────┴─────────────────┴─────────┴─────────────────┘
On entry to the driver:
iorbh
See IORB General Format.
cSGList
contains the number of scatter/gather elements in the scatter/gather list
(pSGLIST).
pSGLIST
contains a far pointer to the scatter/gather list supplied by the caller.
The scatter/gather list consists of an array of cSGList elements,
each pointing to a physically contiguous area of real memory in a format
defined by the SCATGATENTRY structure. (See the following table.)
┌─────────────────┬─────────────────┬─────────┬─────────────────┐ │Field Name │C Type │Length │Description │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │ppXferBuf │ULONG │DD │Physical pointer │ │ │ │ │to buffer │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │XferBufLen │ULONG │DD │Length of buffer │ └─────────────────┴─────────────────┴─────────┴─────────────────┘
ppSGLIST
contains a 32-bit physical address of the scatter/gather list.
Note: For IOCM_FORMAT_MEDIA, the s/g pointers will point to a Format Unit Parameter List as defined by the SCSI-2 specification.
If the SCSI Format Unit CDB does not require a parameter list and other command modifiers, the s/g pointers must be 0.
FormatCmdLen
contains the length of the format command (pFormatCmd), in bytes.
pFormatCmd
contains a pointer to device-specific formatting information. For diskette
controllers, this points to the FORMAT_CMD_TRACK structure (see the table
below). For SCSI devices, this points to a SCSI Format Unit CDB.
┌─────────────────┬─────────────────┬─────────┬─────────────────┐ │Field Name │C Type │Length │Description │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │Flags │USHORT │DW │Flags │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │RBA │ULONG │DD │Starting RBA │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │cTrackEntries │USHORT │DW │Number of track │ │ │ │ │entries │ └─────────────────┴─────────────────┴─────────┴─────────────────┘
On entry to the driver:
Flags
contains flags to define the request, as shown in the following table.
┌───────────────┬─────────────────────────────────────────────┐ │Flag │Description │ ├───────────────┼─────────────────────────────────────────────┤ │FF_VERIFY │Verify after format. If set, this flag │ │ │indicates that the driver should verify the │ │ │sectors after formatting. │ └───────────────┴─────────────────────────────────────────────┘
RBA
contains the starting relative block address for an IOCM_FORMAT_TRACK request.
For IOCM_FORMAT_MEDIA and IOCM_FORMAT_PROGRESS requests, this field equals
0. If the IORB_CHS_ADDRESSING flag is set in the IORBH->RequestControl
field, then the format of the RBA field is defined by the CHS_ADDRstructure
,showninthefollowingtable .
┌─────────────────┬─────────────────┬─────────┬─────────────────┐ │Field Name │C Type │Length │Description │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │Cylinder │USHORT │DW │Starting cylinder│ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │Head │UCHAR │DB │Starting head │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │Sector │UCHAR │DB │Starting sector │ └─────────────────┴─────────────────┴─────────┴─────────────────┘
Note: The scatter/gather list-related fields (cSGLIST, pSGLIST, and ppSGLIST) are at the same offset as its equivalent pointers in the IOCC_EXECUTE_IO and IOCC_ADAPTER_PASSTHRU CommandCodes.
On exit, the driver sets the Status and ErrorCode fields of the IORBH to reflect the results of the IOCC_FORMAT request.
Return Codes
Following is a list of the IOCC_FORMAT error codes:
IOERR_CMD_NOT_SUPPORTED
IOERR_CMD_SYNTAX
IOERR_CMD_SW_RESOURCE
IOERR_CMD_ABORTED
IOERR_UNIT_NOT_ALLOCATED
IOERR_UNIT_NOT_READY
IOERR_UNIT_PWR_OFF
IOERR_RBA_ADDRESSING_ERROR
IOERR_RBA_LIMIT
IOERR_RBA_CRC_ERROR
IOERR_MEDIA_NOT_SUPPORTED
IOERR_MEDIA_WRITE_PROTECT
IOERR_MEDIA_CHANGED
IOERR_MEDIA_NOT_PRESENT
IOERR_ADAPTER_HOSTBUSCHECK
IOERR_ADAPTER_DEVICEBUSCHECK
IOERR_ADAPTER_OVERRUN
IOERR_ADAPTER_UNDERRUN
IOERR_ADAPTER_DIAGFAIL
IOERR_ADAPTER_TIMEOUT
IOERR_ADAPTER_DEVICE_TIMEOUT
IOERR_ADAPTER_REQ_NOT_SUPPORTED
IOERR_ADAPTER_REFER_TO_STATUS
IOERR_DEVICE_DEVICEBUSCHECK
IOERR_DEVICE_REQ_NOT_SUPPORTED
IOERR_DEVICE_DIAGFAIL
IOERR_DEVICE_BUSY
IOERR_DEVICE_OVERRUN
IOERR_DEVICE_UNDERRUN
For a detailed description of all the return codes, see Error Handling.