• No results found

Selection Data Structure

The Target Selection Data Structure is used by the adapter to give the Host driver information about the transaction requested of the adapter by a SCSI initiator.

The address of the area reserved by the Host to accommodate the Target Selection Data Structure, is passed to the RF3880 in the Target Mode Enable command (described in Chapter 7). The structure has the following format:

To buffer Host operations from Target Mode operations, information destined for the Target Selection Data Structure is queued by the RF3880, as initiator selections occur on the SCSI bus. Information from about sixty selections from initiators can be queued at a time. See Chapter 8 for more information about the Selection Queue.

Command Identifier

The Command Identifier that labels the Target Mode Enable command is copied by the adapter into the Target Selection Data Structure when a selection occurs. The Host driver may use this for verification of the source of the selection data.

Address Offset

Byte Memory Address

Offset + 0 Offset + 1 Offset + 2 Offset + 3

00H Command Identifier

04H SCSI flags Reserved Error Flags

08H Msg Byte Rcd CDB Length Init ID ID Msg Received 0CH Queue Tag Msg Queue Tag ID Reserved

10H SCSI CDB Received

14H SCSI CDB Received

18H SCSI CDB Received

1CH Reserved Semaphore

Target Selection Data Structure Page 6 - 11

Flags Field

This field contains flags that report the status of the selection process. The format of this field is as follows:

TME Target Mode Enabled - This bit indicates the current status of Target Mode.

0 ⇒ Target Mode has been terminated. This Target Selection Data Structure was not due to an initiator selecting the adapter. (Either Target Mode was disabled by a SCSI Reset, or by the Target Mode Disable command.) 1 ⇒ Target Mode is enabled. This Target Selection Data Structure was sent due to an initiator selecting the adapter.

RTY Retry - Indicates whether a selection process required retries to complete. 0 ⇒ No retries were required.

1 ⇒ Retries were required to complete.

ERR Error Status - Identifies when a selection process completes with an error. Used in conjunction with the Error field, indicates if error was

recoverable.

0 ⇒ No error occurred, or if non-zero value exists in the Error field, error was recoverable.

1 ⇒ An error occurred. Also set if Target Mode was terminated due to a SCSI Reset.

CC Command Complete - Indicates whether a selection process has finished.

0 ⇒ Command not complete. 1 ⇒ Command complete. Error

When the adapter detects an error, this byte contains an error code to describe the condition. There are special Target Mode error codes that indicate Target Mode error conditions. These codes are listed along with the other adapter error codes in Appendix A.

BITS

7 6 5 4 3 2 1 0

CC ERR RTY 0 0 0 0 TME

Page 6 - 12 Target Selection Data Structure

SCSI Flags

This byte indicates the status of the current command, and of the SCSI bus. You must use it to check for certain conditions that may have occurred and need specific action. The format is as follows:

DIS Disconnect - The bit indicates whether the adapter has disconnected from the SCSI bus while processing this command.

0 ⇒ The adapter has not disconnected.

1 ⇒ The adapter has disconnected to process this command.

CHK Check Condition - Because of an error condition, the RF3880 may attempt to send a Check Condition status followed by a Command Complete message to the initiator.

0 ⇒ No Check Condition status was sent.

1 ⇒ A Check Condition status and Command Compete message to the initiator were attempted.

MSG Message - The adapter (as Target) may receive a Message from the initiator. This bit indicates whether a Message was received and can be found in the Message Byte Received Field.

0 ⇒ No Message Byte was received.

1 ⇒ The Message Byte Received field contains a valid Message from the initiator.

CMD Command Bytes Received - This bit indicates whether the adapter has placed SCSI Command Bytes into the CDB Received area of the Target Selection Data Structure.

0 ⇒ No SCSI commands were received.

1 ⇒ A SCSI command was received. The CDB Received area is valid, and CDB Length field is valid.

BITS

7 6 5 4 3 2 1 0

Error Sequence Code CMD MSG CHK DIS

Target Selection Data Structure Page 6 - 13

Error Sequence Code - The Error Sequence Code tells you, according to the following table, where in the selection process an unrecoverable error occurred, or a Message Byte was sent from the initiator. Some of these codes are not possible due to a selection, but may be reported in a Target Mode

Response command Status Block.

Identify Message Received

This byte contains the last Identify message that was received from the initiator. This byte includes the logical unit number (LUN) of the target being selected. If the Error Sequence Code is 5, or the Error field is 33H, this field is invalid.

Initiator Identifier

This byte contains the SCSI ID of the initiator that selected the adapter. If the Error field is 33H, this field is invalid.

Command Descriptor Block Length

This byte indicates the number of command bytes that were received from the initiator, and have been passed on in the CDB fields of the Target Selection Data Structure. If the CMD bit is clear (in the SCSI Flags field), this field is invalid.

Message Bytes Received

This byte contains a SCSI message byte received from the initiator. If the MSG bit is clear (in the SCSI Flags field), this field is invalid. Also, the value of the Error Sequence Code must be considered when examining the Message Byte.

Queue Tag Identifier

This byte contains the queue tag identifier assigned to this SCSI command by the initiator. If the Queue Tag message is 0H, this field is invalid (no queue tag was received).

Queue Tag Message

This byte contains any Queue Tag message received from the initiator.

Sequence Description

0 No message was received.

1 Message received after the RF3880 sent the Status or First Message Byte. 2 Message received after sending the Message Byte.

3 Message received after sending the Queue Tag Message. 4 Message received after a Data Transfer phase.

5 Message received after Selection phase.

6 Message received after sending the Identify message. 7 Message received after a Command phase.

8 Message received in response to SDTR message. 9 Message received in response to WDTR message.

Page 6 - 14 Target Selection Data Structure

SCSI CDB fields

These 12 bytes contain the SCSI 6, 10, or 12 byte command received from the initiator that selected the RF3880. The number of bytes that are valid is specified in the CDB Length field of the Target Selection Data Structure. If the CMD bit is clear (in the SCSI Flags field), this field is invalid.

Semaphore Field

Both the Host driver and the adapter use this field to flag that an action has been taken. The format is as follows:

SAV Selection Area Valid - After the adapter has been selected by an initiator and has placed valid data in the Target Selection Data Structure, it sets the SAV bit to inform the Host. This bit is set immediately before the adapter issues a Selection Interrupt (if not prohibited by a zero Interrupt level in the

Target Mode Enable command).After the data structure is read, it is up to the

Host to zero the structure. The RF3880 will not write new data to this area until it has received a Channel Attention write of 2.

0 ⇒ The Target Selection Data Structure has been read by the Host and the area is ready for use by the adapter again.

1 ⇒ The RF3880 has placed valid data into the memory location to be read by the Host.

BITS

7 6 5 4 3 2 1 0

0 0 0 0 0 0 0 SAV

Target Mode Response Command Page 6 - 15

Target Mode

Related documents