STRUCTURE DEFINITION OFFSET DATA TYPE LENGTH FIELD DESCRIPTION 00 UNSIGNED CHAR 1 driver command byte (see below) 01 UNSIGNED CHAR 1 device/lun 02 UNSIGNED CHAR 12 command descriptor block 14 UNSIGNED CHAR 1 driver return code 15 UNSIGNED CHAR 1 target status 16 UNSIGNED INT 2 data offset 18 UNSIGNED INT 2 data segment 20 UNSIGNED INT 2 data length 22 UNSIGNED INT 2 sense offset 24 UNSIGNED INT 2 sense segment 26 UNSIGNED CHAR 2 sense length 28 UNSIGNED INT 2 next command block offset 30 UNSIGNED INT 2 next command block segment STRUCTURE DEFINITION driver command byte - consists of two fields: command code and control bits. bits 4-7 = command code field. values are as follows: 0 = perform generic SCSI command (CDB fully specified). 1 = initiate SCSI ABORT message. 2 = initiate SCSI Bus Device Reset. 3 = SCSI Bus Reset (NOT recommended!) 4 = return Host adapter SCSI ID. 5 = get device table information. 6-F = RESERVED. bits 0-3 = control bits as follows: 0 = disconnect flag - When set to one, this bit causes the driver to set bit 6 in the SCSI IDENTIFY message to one. Bit 6 in the SCSI IDENTIFY message indicates that the initiator has the ability to accommodate disconnection and reconnection. 1 = direction flag - This bit is an indicator that tells the generic driver the direction of data movement during the data transfer phase. A value of zero (0) indicates a "read" operation (data from target to initiator). A value of one (1) indicates a "write" operation (data from initiator to target). 2 = sense data flag - When set to one, this bit causes the driver to retrieve sense data on a check condition in the target completion status byte. When the check condition occurs, the driver constructs a 6-byte SCSI CDB with the "Request Sense" command to send to the same target. The location and amount of the sense data is as specified in the command block. On return, the driver return code field contains the status of the original command. The target status contains the target completion status of the original command. (This feature should be mandatory!!!) 3 = polling flag - When set to one, this bit causes the driver to return to the caller as soon as the command block has been "registered" with the driver. This will allow the calling software to "poll" the driver return code field to determine when the command is completed. A non-zero value will indicate completion or termination. When this bit is reset (0), the driver will suspend the caller until the command is completed. STRUCTURE DEFINITION device/lun - This field contains the SCSI ID and Logical Unit Number (LUN) of the target for this command. Bits 5, 6, and 7 contain the SCSI ID and bits 0-2 contain the LUN. Bits 3 and 4 are unused and set to zero. command descriptor block - This 12-byte field will contain the CDB for the command that is to be performed. target status - This field is the status byte returned by the target after the command is completed. data offset and data segment - These fields make up a double word (32 bit) pointer to the data buffer set up in memory by the caller for data transfers between the target and system memory. data length - This field contains the length (in bytes) of the data buffer. A value of FFFF(hex) indicates 64K bytes in the data buffer. sense offset and sense segment - These fields make up a double word (32 bit) pointer to the data buffer for the "request sense" data. This buffer (and pointer) will only be used if the sense data control bit is set and an error occurs while performing the specified command. sense length - This field contains the length (in bytes) of the request sense data buffer. next command block offset and segment - These fields make up a double word (32 bit) pointer to the next command block in a chain of command blocks. A value of zero (0) in this field indicates the last command block on the chain. This field allows for linked commands. STRUCTURE DEFINITION driver return code - This field contains the driver's return status code. The values returned have the following meanings: 00 = NOT USED. 01 = NO ERRORS - normal completion status. 02 = BUFFER OVERFLOW ERROR - Either the target asked for more than 12 bytes of command, or the target tried to send or receive more bytes of data than the buffer can hold. 03-7F = RESERVED. 80 = COMMAND TIMEOUT - the specified command did not complete within the timer value specified. 81 = SCSI BUS BUSY - The driver failed to win arbitration for the SCSI Bus during several different bus free phases. 82 = TARGET SELECTION TIMEOUT - The target failed to respond to selection. 83 = SCSI BUS RESET SENT/RECEIVED - The SCSI operation was terminated at some point because the SCSI bus was reset. 84 = UNEXPECTED DISCONNECTION/INVALID BUS PHASE - The target terminates a SCSI operation prematurely by releasing the SCSI bus. The target does this by dropping the BSY signal prior to sending a "Command Complete" or "Disconnect" message. 85 = TRANSFER INCOMPLETE - This code indicates that the SCSI operation ended normally, but the total number of bytes transferred successfully was less than the initial number of bytes to be transferred. 86 = UNCORRECTABLE PARITY ERROR DETECTED - This code indicates that an uncorrectable SCSI bus parity error was detected. When this occurs, the driver sends the ABORT message to the target. STRUCTURE DEFINITION 87 = SENSE DATA OPERATION FAILED - The driver attempted to obtain sense data and failed. 88 = MESSAGE REJECT RECEIVED - This code is returned when the driver receives the MESSAGE REJECT message. 89 = BAD COMMAND - This code is returned when an invalid command code is specified. 8A-FF = RESERVED.