Home TOC Prev Next Gloss

Table of Contents

Chapter 1 SCSI Bus Overview Chapter 2 Logical Characteristics Chapter 3 Commands and Status
SCSI

SCSI

CHAPTER 1

SCSI BUS OVERVIEW

1.1 Introduction

The Small Computer System Interface (SCSI) is a parallel I/0 bus and protocol that permits the connection of a variety of peripherals including disk drives, tape drives, modems, printers, scanners, optical devices, test equipment, and medical devices to a host computer. This chapter provides an overview of the SCSI system.

1.2 The SCSI Bus

The SCSI bus connects all parts of a computer system so that they can communicate with each other. The bus frees the host processor from the responsibility of I/O internal tasks.

The SCSI protocol is a peer-to-peer relationship: one device does not have to be subordinated to another device in order to perform I/0 activities. A total of eight devices can be connected to the bus simultaneously. Only two of these devices can communicate on the bus at any given time.

NOTE:

The word "device" refers to the SCSI host adaptor or a device controller connected to the SCSI bus; it does not refer to the peripheral device.

A unique SCSI device ID (7-0) is assigned to the SCSI host adaptor and to each (device controller. One of the devices on the bus must be the initiator (usually the host adaptort). The other device is the target (usually the peripheral device controller). When two devices communicate on the bus, one device initiates the cornrnunication to the target, and the target performs the task. SCSI devices usually have a fixed role as an initiator or a target, although some devices can perform both roles.

The SCSI interface on Digital systems is a single-ended configuration with a cable length of up to six meters. The SCSI cable is always terminated on the SCSI host adaptor module; an external terminator must be provided for the last peripheral device placed on the bus. Figure 1 shows a typical SCSI configuration. scsi-1.gif

Fig. 1 SCSI Configuration

1.3 SCSI Bus Phases

The Small Computer System Interface bus can be time-shared, which results in greater usage of bus bandwidth. This is how it works: while one device is using the bus, other devices may be active and performing internal activities. Devices do not use the bus unless they are involved in data transfer or have status to report. Devices may disconnect from the bus while time-consuming activities internal to the device are occurring. As soon as a device is ready to resume communication, the device can arbitrate for the bus (when the bus is free) to reattach to the host. System performance is significantly increased when devices disconnect and reconnect to the bus. During the bus phases (Figure 2), devices must first contend for access to the bus. Then a physical path is established between the initiator and target. Remember, the SCSI bus cannot be in more than one phase at a time.

scsi-12.gif On a busy system, the SCSI bus may be free. for as little as 1.2ps while there is no device requosting the bus. Or, it could remain in the bus free state indefinitely.

A device can arbitrate and win the bus in 3.6ps or less. Devices that lose arbitration can try again when the bus is free.



The Selection phase can occur in 580 ns. lf the target does not respond, the bus is free in about 250ms. The target controls the bus alter the selection phase.

This is tlie first information transfer phase in the connection. lt allows the initiator to send an Identify message to the target. Messages are always transferred asynchronously.

Six Inquiry command bytes are transferred asynchronously from the initiator to the target.


The target responds with Inquiry data. The data is transferred synchronously it both the taraet and the initiator have previously established a synchronous data trans!Dr agrcement.


The target sends a single status byte asynchronously.



The last information that is transferred in the connection is typically the Command Complete message.


The target releases all signals within 10ls of the initiator's acknowiedgement of the previous message. The initiator releases any signals it may be driving within 800ns of its detection of the BSY signal.

Figure 2: Bus Phases for INQUIRY Command

1.4 SCSI Bus signals

The SCSI bus uses eighteen signals. Nine are control signals used to develop logical bus phases, and nine are data signals, including parity, for messages, commands, status, and data.

The state of the SEL, BSY, and I/O signals and the sequence of the phases determine when the Bus Free, Arbitration, Selection, and Reselection phases are entered.

Table 1 describes the nine control signals.

'I'o determine the current phase, you need to know information about the previous phase and the state of the signals. The initiator and target drive these signals to change from one phase to another phase.

Table 1: SCSI Bus Signals
Signal Description
BSY(BUSY) An 'OR-tied signal which indicates that the bus is being used.
SEL(SELECT) A signal used by an initiator to select a target, or by a target to reselect an initiator.
C/D (CONTROL/DATA) A signal drven by a target to indicate whether or not control or data information is on the data bus. True indicates control.
I/0 (INPUT/OUTPUT) A signal driven by a target to control the direction of data movement on the data bus. True indicates input to the initiator. This signal is also used to distinguish between selection and reselection phases.
MSG (MESSAGE) A signal driven by a target during the Message phase.
REQ (REQUEST) A signal driven by a target to request a REO/ACK data transfer handshake.
ACK (ACKNOWLEDGE) A signal driven by an iniüator to acknowledge a REO/ACK data transfer.
ATN (ATTENTION) A signal driven by an inifiator to indicate the Atterifion conditioti (inidator has a message for the target).
RST (RESET) An 'OR-tied' signal and hard Res.et condition.
DB (7-0,P) (DATA BUS) Eight data-bit(DB) signals, plus a parity-bit signal that form a Data Bus. DB(7) is the most significant bit and has the highest phohty during the Arbitradon phase. Bit number, significance, and priority decreaso downward to DB (0). A data bit is defined as one when the signal value is true, and defined as zero when the signal value is false. Data parity DB(P) shall be odd, but parity is undefined during the Arbitradon phase.

NOTE

For the measurements which follow, SCSI bus termination is assumed to be external to the SCSI device. SCSI deviees may have the provision of allowing optional internal termination.

1.4.1 Single-Ended Cable:

All assigned signals are terminated with 220 ohms to +5 volts (nominal) and 330 ohms to ground at each end of the cable.

All signals use open-collector or three-state drivers.

1.4.2 Output Characteristics:

Each signal driven by a SCSI device has the following output characteristics when measured at the SCSI device's connector:

Signal assertion 0.0 volts dc to 0.5 volts dc at 48 milliamps (sinking).
Signal negation 2.5 volts dc to 5.25 volts dc.
1.4.3 Input Characteristics:

SCSI device signal receivers have the following input charactelistics:

Signal true = 0.0 volts dc to 0.8 volts dc
Maximum total input load = 0.4 milliamps at 0.5 volts dc
Signal false = 2.0 volts dc to 5.25 volts dc
Minimum input hysteresis = 0.2 volts dc
1.4.4 Termination Power:

SCSI initiators supply terminator power to the Termpwr pin(s). This power supplied through a diode or similar semiconductor that prevents backflow of power to the SCSI device. Any SCSI device may supply terminator power.

All terminators independent of location are powered from the Termpwr pin(s).

1.4.5 SCSI Bus:

Communication on the SCSI bus is allowed between only two SCSI devices at any given time. There is a maximum of eight SCSI devices. Each SCSI device has a SCSI ID bit assigned. When two SCSI devices communicate on the SCSI bus:

One acts as an initiator and the other acts as a target.

The initiator originates an operation and the target performs the operation.

A SCSI device usually has a fixed role as an initiator or target, but some devices are able to assume either role. In most cases, the host is the initiator and the device is the target.

An initiator may address up to eight peripheral devices that are connected to a target. These are called Logical Units Numbers (LUNs). Digital devices currently only support a single LUN per deviee.

Figure 3: SCSI ID Bits

DB(7)   DB(6)   DB(5)    DB(4)   DB(3)   DB(2)   DB(l)   DB(O)  DATA BUS
  |       |       |       |       |       |       |       |
  |       |       |       |       |       |       |     SCSI ID=0
  |       |       |       |       |       |     SCSI ID=l
  |       |       |       |       |     SCSI ID=2
  |       |       |       |     SCSI ID=3
  |       |       |     SCSI ID=4
  |       |     SCSI ID=5
  |     SCSI ID=6
SCSI ID=7
Fig. 3 SCSI ID Bits

1.4.6 Figure SCSI Configurations

Up to eight SCSI devices can be supported on the SCSI bus. They ean be any combination of initiators and targets. Certain SCSI bus functions are assi,-ned to the initiator and certain SCSI bus functions are assigned to the target. The initiator arbitrates for the SCSI bus and seleets a particular target. The target requests the transfer of Cornmand, Data, Status, or other information on the Data Bus, and in some cases it arbitrates for the SCSI bus and reselects an initiator for the purpose of continuing an operation.

Information transfers on the Data Bus are asynchronous and follow a defined REQ/ACK handshake protocol. One byte of information may be transferred with each handshake. An option is defined for synchronous data transfer.

1.4.7 Signal Values

Signals may assume true or false values. There are two methods of di-iving these signals. In both cases, tlie signal shall be actively driven true, or asserted. In the case of OR-tied drivers, the diiver does not drive the signal to the false state, rather the bias circuitry of the bus terminators pulls the signal false whenever it is released by the drivers at every SCSI device. If any driver is asserted, then the signal is true.

In the case of non-OR-tied drivers, the sigrial may be actively driven false, or negated. The advantage to actively driving signals false during the information transfcr is that the transition from true to false occurs more quickly, and the noise margin is much higher than if the signal is simply released; this is required to reliably transfer data at maximum rates.

1.4.8 OR-Tied Signals

The BSY and RST signals are OR-tied only. In the ordinary operation of the bus, these signals may be simultaneously driven true by several drivers. No signals other than BSY, RST and DB(P) are simultaneously driven by two or more drivers, and any signal other than BSY and RST may employ OR-tied or non-OR-tied drivers. DB(P) is not driven false during the Arbitration phase.

Table 2: Signal Sources

A Cable Signals C/D, I/O

							MSG,	ACK,	DB(7.0)
	Bus Phase	BSY	SEL	REQ	ATN	DB(P)
	BUS FREE	None	None	None	None	None
	ARBITRATION	All	Win	None	None	S ID
	SELECTION	I&T	Init	None	Init	Init
	RESELECTION	I&T	Targ	Targ	Init	Targ
	COMMAND		Targ	None	Targ	lnit	lnit
	DATA IN		Targ	None	Targ	Init	Targ
	DATA OUT	Targ	None	Targ	Init	Init
	STATUS		Targ	None	Targ	Init	Targ
	MESSAGE IN	Targ	None	Targ	Init	Targ
	MESSAGE OUT	Targ	None	Targ	lnit	Init


All:  The signal is driven by all SCSI devices that are actively arbitrating.

S ID: A unique data bit (the SCSI ID) is driven by each SCSI device that is actively arbitrating; the other seven data bits are released (i.e., not driven) by this SCSI device. The parity bit (DB(P» may be undriven or driven to ihe true state, but is never driven to ihe 'talse state during this phase. I&T. The signal shall be driven by the initiator, target, or both, as specified in the Selection phase and Reselection phase. Init: If driven, this signal shall be driven only by the active initiator. None: The signal shall be released; that is, not be driven by any SCSI device. The bias circuitry of the bus terminators pulls the signal to the false state.

1.4.9 Cables

SCSI supports cable lengths of up to 6 metres, and this should be adhered to. A brief overview of SCSI development is necessary here, because many problems are caused by bad termination and cabling arrangements.

1.4.10 Development-the pitfalls

1.4.10.1 Compatibility

Because SCSI is an ANSI standard, many people believe that SCSI provides compatibility across all SCSI device types from all SCSI manufacturers, when in fact nothing could be further from the truth. The spec is ambiguous , complex and specifie to individual device types and vendors.

1.4.10.2 Electrical Integrity

When the SCSI bus was first dreamt up, some decisions were made around the parts which were cheap and readily available, rather than to the optimum electrical characteristics of the bus. Relatively low impedance iibbon cables and twisted pairs were chosen. The best off-the-shelf dliver/ receivers were designed for I/O BACKPLANE drivers, resulting in a drive current of 48mA. Terminators were chosen to match the drivers, and stub lengths were designed to handle most known PD topologies.

The result of these convenient choices is that the cable is incorrectly terminated. Stubs, receivers, terminators and connectors all contain some mismatch, and further amplify the problem. The result is that every time a signal transition takes place, ringing is observed on the bus. The uncontrolled rise-times of the drivers add to the problem by adding considerable high frequency content to the transition, and of course the faster the repetition the less likely the bus will settle correctly before the next transition.

This phenornenon creates the situation where the larger the number of devices, the longer the stubs, the longer the cable and the faster the bus is operated, the higlier the probability of creating an error during transmission. The problem is so severe, that glitches and false triggering have been seen with as few as 2 devices connected to the bus. Attempts to connect the full complement of 7 devices almost always results in high data error rates, or in many cases total bus hangs. The reason for this is that over the length of the bus, the signals show little or no voltage margins at some or maybe even all of the device connection points.

1.4.10.3 Common Mode Noise

Any time a cable is led from one cabinet to another, the possibility of voltage/noise dlifferences over ground lines becomes a reality. The situation is exacerbated by different power supplies, or even worse, seperate AC supplies to the expansion boxes. DECs own drives use a single ended cable, whicli means the noise immunity is limited to the signal margins of the bus. SCSI-2 does allow for the use of difterential drivers, and some discussion exists on the possibility of providingjumpers on drive /controller modules to switch between single-ended or differential drivers. However the counter arguement is that this will add to the total connector count on the bus and degrade the signal integrity even further. Currently Digital ships only devices conforming to the single-ended driver standard.

There is also a problem with trying to configure devices/controllers which support differntial signals, to those which support single-ended signals. The termination is different, but as if that isn't bad enough, the actual pinout on the connectors is also different. 'Ib glve an example, the single- ended cable has a supply to the terminator on pin 26 of +5v. The differential cable has 'polarity' across pins 25 and 26, the difference being that -ve is on pin 26. Also, to show how there would certainly be parity errors, notice that pin 2 of the single-ended cable is used for data -bit 0, yot it is GROUND on the differential cable. These anomolies in pinout exist throughout almost every signal on the SCSI bus, the result being that it just doesn't work at all. These many problems with the poor electrical design of the cable has meant that very few systems can be fully configured. So although the ANSI SCSI spec allows a logical connection of up to 8 'nodes', this is never practical in the electrical environment in which these devices reside. The result is that we see many systems restricted to 4 devices per SCSI controller. Controllers such as the KZQSA do not support disk drives, and they only support a maximum of 4 tape drives. Connecting disks onto the controllers often works, but tests with such configurations have always shown high error rates and so the KZQSA is marketed as a tape controller.

CHAPTER 2

LOGICAL CHARACTERISTICS

This chapter provides an overview of the eight SCSI Bus Phases. It also contains relevant SCSI Bus information related to these eight Phases.

2.1 SCSI Bus Phases

The SCSI architecture includes eight distinct phases:

Bus Free phase
Arbitration phase
Selection phase
Reselection phase.

Command phase  >  These phases are collectively 
Data phase     >  termed the Information Transfer 
Message phase  >  Status phase Phases
The SCSI bus can never be in more than one phase at any given time. Unless otherwise noted in the following description, signals that are not mentioned shall not be asserted.

2.1.1 Bus Free Phase

The Bus Free Phase is used to indicate that no SCSI device is actively using the SCSI bus and that it is available for subsequent users. SCSI devices shall detect the Bus Free Phase after SEL and BSY are both false for at least a bus settle delay. SCSI devices shall release all SCSI bus signals hin a bus clear delay after BSY and SEI, become continuously false fbr a bus settle delay. If a SCSI device requires more than a bus settle delay to detect the Bus Free Phase then it releases all SCSI bus signals within a bus clear delay minus the excess time to detect the Bus Free Phase. The total time to clear the SCSI bus does not exceed a bus settle delay plus a bus clear delay. Initiators normally do not expect Bus Free Phase to begin because of the target's release of BSY except after one of the following occurrences:

* After a Reset condition is detected

* After an Abort message is successfully received by a target

* After a Bus Device Reset message is successfully received by a target

* After a Disconnect message is successfully transmitted from a target

* After a Command Complete message is successfully transmitted from a target

* Aftei- a Release Recovery message is successfully received by a target.

The Bus Free Phase may also be entered after an unsuccessful selection or reselection, of SEL rather than the relase of BSY that first allhough in this case it is the established the Bus Free Phase.

If an initiator detects the release of BSY by the target at other times, the target is indicating an error condition to the initiator. The target may perform this transition to the Bus Free Phase independent of the state of the ATN signal. The initiator manages this condition as an unsuccessful I/0 process termination. The target terminates the I/0 process by clearing all pending data and status information for the affected logical unit or process. The target may optionally prepare sense bytes that could be read by a Request Sense command. When an initiator detects an unexpected Bus Free Kondition it is normal that a Request Sense command is attempted to obtain any valid sense information that may be available. If the error that caused the Bus Free terminatiori of the 1/0 process is still present, the Request Sense command may not be successful.

2.1.2 Arbitration Phase

The Arbitration Phase allows one SCSI device to gain control of the SCSI bus so that it can assume the role of an initiator or target. The procedure for an SCSI device to obtain control of the SCSI bus is as follows:

1. The SCSI device shall first wait for the Bus Free Phase to occur. The Bus Free Phase is detected whenever both BSY and SEL are simultaneously and continuously false for a minimum of a bus settle delay

NOTE:

This bus settle delay is necessary because a transmission line phenomenon known as a "wire-OR glitch" may cause BSY to briefly appear false, even though it is being driven true.

2. The SCSI device waits a minimum of a bus free delay alter detection of the Bus Free Phase (that is after BSY and SEL are both false for a bus settle delay) before driving any signal

3. Following the bus free delay in Step (2), the SCSI device may arbitrate for the SCSI bus by asserting both BSY and its own SCST ID, however the SCSI device does not arbitrate (that is assert BSY and its SCSI ID) if more than a bus settle delay has passed since the Bus Free Phase was last observed

4. After waiting at least an arbitration delay (measured from its assertion of BSY) the SCSI device examines the Data Bus lf a higher priority SCSI ID bit is true on the DATA BUS (DB(7) is the highest), then the SCSI device has lost the arbitration and the SCSI device releases its'signals and returns to Step (1)' If no higher priority SCSI ID bit is true on the Data Bus, then the SCSI device has won the arbitration and it asserts SEL. Any other SCSI device that is participating in the Arbitration Phase has lost the arbitration and releases BSY and its SCSI ID bit within a bus clear delay after SEL becomes true. A SCSI device that loses arbitration returns to step (1)

5. The SCSI device that wins arbitration shall wait at least a bus clear delay plus a bus settle delay after asserting SEL before changing any signals.

scsi-1.gif

Fig. 3.1 SCSI Arbitration

NOTE:

The SCSI ID bit is a single bit on the Data Bus that corresponds to the SCSI device's unique SCSI address. All other seven Data Bus bits are released by the SCSI device. Parity is not valid during the Arbitration Phase. During the Arbitration Phase, DB(P) may be released or asserted, but is not actively driven false.

2.1.3 Selection Phase

The Selection Phase allows an initiator to select a target for the purpose of initiating some target function for example the Read or Write command.

NOTE:

During the Selection Phase the I/0 signal is negated so that this phase can be distinguished from the Reselection Phase.

The SCSI device that won the arbitration has both BSY and SEL asserted and has delayed at least a bus clear delay plus a bus settle delay before ending the Arbitration Phase. The SCSI device that won the arbitration becomes an initiator by not asserting the I/0 signal.

The initiator sets the Data Bus to a value which is the OR of its SCSI ID bit and the target's SCSI ID bit. The initiator then waits at least two deskew delays and releases BSY. The initiator then waits at least a bus settle delay before looking for a response from the target.

Figure 4: Selection Phase

	DB(0)	DB(l)	DB(2)	DB(3)	DB(4)	DB(5)	DB(6)	DB(7)
    	  1	  0	  0	  0	  0	  0	  1	  0

In this example, SCSI ID 6 (host) has asserted both it's own SCSI ID (DB(6)) and that of a device (DB(0)).

The target determines that it is selected when SEL and it's SCSI ID bit are true and BSY and I/0 are false for at least a bus settle delay. The selected targtt examines the r)ata Bus in order to determine the SCSI ID of the selecting initiator. The sclected target th('.n ;-ts,-,erts BSY within a selection; this is required for correct operation of the time-out procedure.

The target shall not respond to a selection if bad parity is detected. Also, if more than two SCSI ID bits are on the Data Bus, the target does not respond to selection.

2.1.4 Reselection Phase

Reselection is an optional phase that allows a target to reconnect to an initiator for the purpose of continuing some operation that was previously started by the initiator but was suspended by the target. For example, a host system may have requested a Read from a disk. The disk can Disconnect and Reconnect if the Read involves a time consuming seek operation to be performed. This is one of the optimization features of SCSI.

2.1.4.1 Reselection

Upon completing the Arbitration Phase, the winning SCSI device has both BSY and SEL asserted and has delayed at least a bus clear delay plus a bus settle delay. The winning SCSI device becomes a target by asserting the I/0 signal. The winning SCSI device also sets the Data Bus to a value that is the OR of it is SCSI ID bit and the initiator's SCSI ID bit. The target waits at least two deskew delays and releases BSY. The target then waits at least a bus settle delay before looking for a response from the initiator.

The initiator determines that it is reselected when SEL, I/0 and its SCSI ID bit are true and BSY is false for at least a bus settle delay. The reselected initiator may examine the Data Bus in order to determine the SCSI ID of the reselecting target. The reselected initiator then asserts BSY within a selection abort time of its most recent detection of being reselected; this is required for correct operation of the time-out procedure. The initiator does not respond to a Reselection Phase if bad partiy is detected. Also, the initiator may not respond to a Reselection Phase if'other than two SCSI ID bits are on the Data Bus.

After the target detects BSY, it also asserts BSY and wait at least two deskew delays and then release SEL. The target may then change the I/0 signal and the Data Bus. After the reselected initiator detects SEL false, it releases BSY. The target continues asserting BSY until it relinquishes the SCSI bus.

2.1.5 Information Transfer Phases

The Command, Data, Status, and Message Phases are all grouped together as the Information Tansfer Phases because they are all used to transfer data or control infol-mation via the Data Bus. The actual content of the information is the scope of this section.

The C/D, I/O, and MSG signals are used to distinguish between the different Information Tansfer Phases. The target drives these three signals and therefore controls all changes from one phase to another. The initiator can request a Message Out Phase by asserting ATN, while the target ean cause the Bus Free Phase by releasing MSG, C/D, I/0 and BSY. The Information Tansfer Phases use one or more REQ/ACK handshakes to control the information transfer. Each REQ/ACK handshake allows the transfer of one byte of information. During the information transfer phases BSY remains true and SEL remains false. Additionally, during the Information Tansfer Phases, the target shall continuously envelope the REQ/ACK handshake(s) with C/D, I/0 and MSG in such a manner that these control signals are valid for a bus settle delay before the assertion of REQ of the first handshake and remain valid until after the negation of ACK at the end of the handshake of the last transfer of the phase.

Figure 5: Information Transfer Phases

			Signal
MSG    C/D      I/0   	Phase Name      Direction of Transfer     	Comment

0	0	0	Data Out   	Initiator To Target    \	Data
0	0	1	Data In     	Initiator From Target  /	Phase
0	1	0	Command		Initiator To Target
0	1	1	Status		Initiator From Target
1	0	0	*
1	0	1	*
1	1	0	Message Out	Initiator TO Target    \   Message
1	1	1	Message In	Initiator From Target  /   Phase

Key:	0 =	False
	1 = 	True
	* =	Reserved for future specitication

2.1.5.1 Asynchronous Information Transfer

The target controls the direction of information transfer by means of the I/0 signal. When I/0 is true, information is transferred from the target to the initiator. When I/0 is false, information is transferred from the initiator to the target.

If I/O is true (transfer to the initiator), the target first drives DB (7-0,P) to their desired values, delays at least one deskew delay plus a cable skew delay, then assert REQ. DB(7-0,P) remains valid until ACK is true at the target. The initiator reads DB(7-0,P) after REQ is true, then signals its acceptance of the data by asserting ACK. When ACK becomes true at the target, the target may change or release DB(7-0,P) and negate REQ. After REQ is false the initiator then negates ACK. After ACK is false the target may continue the transfer by driving DB(7-0,P) and asserting REQ, as described above.

If I/0 is false (transfer to the target) the target requests information by asserting REQ. The initiator drives DB(7-0,P) to their desired values, delays at least one deskew delay plus a cable skew delay and asserts ACK. The initiator continues to drive DB(7-0,P) until REQ is false. When ACK becomes true at the target, the target reads DB(7-0,P) then negates REQ. When REQ becomes false at the initiator, the initiator may change or release DB(7-0,P) and negates ACK. The target may continue the transfer by asserting REQ, as described above.

2.1.5.2 Synchronous Data Transfer

Synchronous data transfer is only used in data phases. lt is used in a data phase if a synchronous data transfer agreement has been established between the target and initiator.

The REQ/ACK offset specifies the Maximum number of REQ pulses that can be sent by the, target in advance of the number of ACK pulses received from the initiator, establishing a pacing mechanism. If the number of REQ pulses exceeds the number of ACK.pulses by the REQ/ACK offset, the target shall not assert REQ until alter the leading edge of the next ACK pulse is received. A requirement for successful conipletion of' the data phase is that the number of ACK and REQ pulses be equal.

The target asserts the REQ signal for a minimum of an assertion period. The target shall wait at least a transfer period from the last transition of REQ to false before asserting the REQ signal. The initiator sends one pulse on the ACK signal for each REQ pulse received. The ACK signal may be asserted as soon as the leading edge of the corresponding REQ pulse has been received. The initiator asserts the ACK signal for a minimum of an assertion period. The initiator waits at least the greater of a transfer period from the last transition of ACK to true or for a minimum of a negation period from the last transition of ACK to false before asserting the ACK signal.

If I/0 is true (transfer to the initiator), the target first drives DB(7-0,P) to their desired values, waits at least one deskskew delay plus one cable skew delay, then assert REQ. DB(70,P) shall be held valid for a minimum of one deskew delay plus one cable skew delay plus one hold time after the assertion of REQ. The target asserts REQ for a minimum of an assertion period. The target may then negate REQ and change or release DB(7-0,P). The initiator reads the value on DB(7-0,P) within one hold tirne of thc transition of REQ to true. The initiator then responds with an ACK pulse.

If I/0 is false (transfer to the target), the initiator transfers one hyte for each REQ pulse received. After recciving the leading edge of a REQ pulse, the initiator first drives DB (7-0,P) to their desired values, delays at least one deskew delay plu one cable skew delay, then asserts ACK. The initiator holds DB(7-0,P) valid for at least one deskew delay plus one cable skew delay plus one, hold time after the assertion or ACK. 'I'he initiator asserts ACK for a minimum of an assertion period. The initiator may then negate ACK and may change or release DB (7-0, P). The target reads the value of DB(7-0,P) within one hold time of the transition of ACK to true.

2.1.6 Command Phase

The Command Phase allows the target to request command information from the initiator.

The target shall assert the C/D signal and negate the I/0 and MSG during the REQ/ACK handshake(s) of this phase.

2.1.7 Data Phase

The Data Phase is a term that encompasses both the Data In Phase and the Data Out Phase.

2.1.7.1 Data In Phase

The Data In Phase allows the target to request that data be sent to the initiator from the target.

The target asserts the I/0 signal and negate the C/D and MSG signals during the REQ/ACK handshake(s) of this phase.

2.1.7.2 Data Out Phase

The Data Out Phase allows the target to request that data be sent from the initiator to the target.

The target negates the C/D, I/0, and MSG signals during the REQ/ACK handshake(s) of this phase.

2.1.8 Status Phase

The Status Phase allows the target to request that status information be sent from the target to the initiator.

The target asserts C/D and I/0 and negates the MSG signal during the REQ/ACK handshake of this phase.

2.1.9 Message Phase

The Message Phase is a term that references either a Message In, or a Message Out Phase. Multiple messages may be sent during either phase. The first byte transferred in either of these phases is either a single-byte message or the first byte of a multiple-byte message. Multiple-byte messages are wholly contained within a single message phase.

2.1.9.1 Message In Phase

The Message In Phase allows the target to request that message(s) be sent to the initiator from the target.

The target asserts C/D, 1/0, and MSG during the REQ/ACK handshake(s) of this phase.

2.1.9.2 Message Out Phase

The Message Out Phase allows the target to request tliat message(s) be sent from the initiator to the target. The target invokes this phase in response to the Attention condition created by the initiator.

The target asserts C/D and MSG and negate I/0 during the REQ/ACK handshake(s) of this phase. The target haiidshakes byte(s) in this phase until ATN is negated, except when rgiecting a message.

If the target detects one or more parity erroks) on the message byte(s) received, it may indicate its desire to retry the message(s) by asserting REQ after detecting ATN has gone false and prior to changing to any other phase. The initiator, upon detecting this condition, shall be send all of the previous message byte(s) in the same order as previously sent during this phase. When re-sending more than one message byte, the initiator shall assert ATN prior to asserting ACK on the first byte and shall maintain ATN asserted until the last byte is sent.

The target may act on messages as received as long as no parity error is detected and may ignore all remaining messages sent under one ATN condition after a partiy error is detected. Whcn a sequence of messages is re-sent by an initiator because of a target detected parity error, the target shall not act on any message which it acted on the first time reccived.

If the target receives all of the message byte(s) successfully, that is no parity errors, it shall indicate that it does not wish to retry by changing to any information transfer phase other than the Message Out Phase and transfer at least one byte. The target may also indicate that it has successfully received the message byte(s) by changing to the Bus Free Phase for example the Abort or Bus Device Reset messages).

2.2 SCSI Bus Conditions

The SCSI bus has two asynchronous conditions; the Attention condition and the Reset condition. These conditions cause the SCSI device to perform certain actions and can alter the phase sequence.

2.2.1 Attention Condition

The Attention condition allows an initiator to inform a target that the initiator has a message ready. The target may get this message by performing a Message Out Phase.

The initiator creates the Attention condition by asserting ATN at any time except during the Arbitration or Bus Free Phases.

The initiator asserts the ATN signal before negating ACK for the last byte transferred in a bus phase for the Attention Kondition to be honored before transition to a new bus phase. An ATN asscrted later might not be honored until a later bus phase and then may not result in the expected action. The initiator negates ATN before asserting ACK when transferring the last byte of the messages. If the target detects that the initiator failed to meet this requirement, then the target goes to Bus Free Phase (unexpected Bus Free). A target shall re,spond witli Message Out Phase as follows:

2.2.2 Reset Condition

The Reset Kondition is used to immediately clear all SCSI devices from the bus. This condition takes precedence over all other phases and conditions. Any SCSI device may create the Reset Kondition by asserting RST for a minimum of a reset hold time During the Reset Kondition the state of all SCSI bus signals other than RST is not defined.

All SCSI devices release all SCSI bus signals (except RST) within a bus clear delay of the transition of RST to true. The Bus Free Phase always follows the Reset Kondition

Hard Reset Alternative

SCSI devices are required to implement "Hard Reset" as defined in the ANSI standard. The device, upon detection of the Reset Kondition

1. Clears all I/0 processes including queued YO processes

2. Releases all SCSI device reservations

3. Returns any SCSI device operating modes to their appropriate initial conditions, similar to those conditions that would be found after an normal power-on reset. Mode Select conditions are restored to their last saved values if saved values have been established. Mode Select conditions for which no values have been saved are returned to their default values

4. Unit Attention Kondition is set.

Soft Reset Alternative

This alternative is not currently supported.

2.3 SCSI Bus Phase Sequences

The order in which phases are used on the SCSI bus follows a prescribed sequence.

The Reset condition can abort any phase and is always followed by the Bus Free Phase. Also any other phase can be followed by the Bus Free Phase but many such instances are error conditions. (See Section 2.1.1).

The normal Progression is from the Bus Free Phase to Arbitration, from Arbitration to Selection or Reselection, and from Selection or Reselection to one or more of the Information Transfer Phases (Command, Data, Status, or Message). Normally, the final Information Humanster Phase is Message In Phase where a Disconnect, Command Complete, or Linked Command Complete message is transferred, followed by Bus Free Phase. scsi-4.gif

Fig. 6 SCSI Phase Sequences

2.4 SCSI Pointers

Consider the system shown in Figure 7 in which an initiator and target communicate on the SCSI bus in order to execute an I/0 operation.

scsi-7.gif

Figure 7: Simplified I/0 Operation

The SCSI architecture provides for two sets of three pointers within each initialor. The pointers reside in the initiator SCSI bus control section (often referred to as a host adapter). The first set of pointers are known as the current (or active) pointers. These pointers are used to represent the state of the interface and point to the next command, data, or status byte to be transferred between the initiator's memory and the target. There is only one set of current pointers in each initiator. The current pointers are used by the target currently connected to the initiator.

The second set of pointers are known as the saved pointers. There is one set of saved pointers for each I/0 process that is currently active (whetlier or not it is currently coniieccod). Th,e saved command pointer always four points to the start of the command descriptor block for the current I/0 process. The saved status pointer always points to the start of the status area for the current PO process. At the beginning of each I/0 process, the saved data pointer points to the start of the data area. lt remains at this value until the tarc,'et sends a Save Data Pointer message to the in'itiator. In response to this message, the initiator stores the value of the current data pointer into the saved data pointer. The Target may restore the current pointers to their saved values by sending a Restore Poiiiters message to the initiator. The initiator then moves the saved value of each pointer into the corresponding current pointer. Whenever an SCSI device disconnects from the bus, only the saved pointer values are retained. The current pointer values are restored from the saved values upon the next reconnection.

2.5 Message Systern Description

The message system allows communication between an initiator and target for the purpose of interface management. A message may be one, two, or multiple bytes in length. One or more messages may be sent during a single Message Phase, but a message may not be split over Message Phases. The initiator is required to end the Message Out Phase (by negating ATN) when it sends certain messages identified in Figure 8.

One byte, two byte and extended message formats are defined. The first byte of the message determines the format as follows:

Figure 8: Message Values

Value		Message Format

00h		One-Byte Message (Command Complete)
Olh		Extended Messages
02h - 1 Fh	One-Byte Messages
20h - 2Fh	Two-Byte Messages
30h - 7Fh	Reserved
80h - FFh	One-Byte Message (Identify)

One-byte messages consist of a single byte transferred duling a Message phase. The value of the byte determines which message is to be performed as defined in Figure 9.

'Avo-byte messages consist of two consecutive bytes transferred during a Message Phase. The value of the first byte determines which message is to be performed as defined in the next figure. The second byte is a parameter byte which is used as defined in the message description. A value of one in the first byte of a message indicates the beginning of a multiple-byte extended message. The minimum number of bytes sent for an extended message is three.

Figure 9: Message Codes

	Code	Support	Message Name	Direction	Negate ATN
			before
	Init/Targ		Last ACK

	06h	O	M	Abort		Out	Yes
	23h	O	O	Abort Tag (Two Bytes)		Out	Yes
	0Ch	O	M	Bus Device Reset		Out	Yes
	0Eh	O	O	Clear Queue		Out	Yes	00h	M	M	Command Complete	In		---
	04h	M	M	Disconnect	In		---
	04h	O	O	Disconnect		Out	Yes
	...	O	O	Extended Identify	In	Out	No
	80h&	M	O	lndentity	In		---
	80h&	M	M	Identify		Out	No
	24h	O	O	Ignore Wide Residue (Two Bytes)	In		---
	0Fh	O	O	Initiate Recovery	In	Out	Yes
	05h	M	M	Initiator Detected Error		Out	Yes
	0Ah	O	O	Linked Command Complete	In		---
	0Bh	O	O	Linked Command Compiete (With Flag)	In	---
	09h	M	M	Message Parity Error		Out	Yes
	07h	M	M	Message Reject	In	Out	Yes
	...	O	O	Modity Date Pointer	In		---
	08h	M	M	No Operation		Out	Yes
				Queue Tag Messages(Two Bytes)
	2 h	O	O	Head Of Queue Tag		Out	No
	20h	O	O	Mundane Queue Tag	In	Out	No
	22h	O	O	Ordored Queue Tag		Out	No
	10h	O	O	Release Recovery		Out	Yes
	03h	M	M	Restore Pointers	In		---
	02h	M	M	Save Date Pointer	In		---
	***	M	M	Synchronous Data Transfer Request	In	Out	Yes
	***	O	O	Wide Dita Transfer Request	In	Out	Yes
	0Dh			Reserved
	11h -	lFh		Reserved
	25h -	2Fh		Reserved for two-byte messages
	30h -	7Fh		Reserved

Key:
M	= 	Mandatory support
O	= 	Optional support
In	=	Target to initiator
Out	Initiator to target
Yes	Initiatorshall negate ATN before last ACK of message
No =	Initiator may or may not negate ACK before last ACK of message (see Section 2.2.1 Not applicable

***= Extended message

80h& = Codes 80h through FFh are used for IDENTIFY messages
Table 3: Extended Message Format

	Byte	Value	Description
	0	0lh	Extended message
	1	n	Extended message length
	2	y	Extended message code
	3 -n + 1	x	Extended message arguments
The extended message length specifies the length in bytes of the extended message code plus the extended message arguments to follow. Therefore, the total length of the message is equal to the extended message length plus two. A value of zero for the extended message length indicates 256 bytes follow.

The extended message codes are listed in Table 4. The extended message arguments are specified within the exte nded message descriptions.

The first message sent by the initiator after the Selection Phase shall be the Identify, Abort, or Bus Device Reset message. If a target receives any other message it shall go to Bus Free Phase (unexpected Bus Free).

If the first message is Identify message, then it may be imme(Iiately followed by other messages, such as the first of a pair of Synchronous Data Uansfer Request messages. The Identify message establishes a logical connection between the initiator and the specified logic-al unit or target routine within the target known as an I - T - L nexus or I_@R nexus. After the Reslection Phase, the target's first message shall be Identify. This allows the I - T - L nexus or I - T - R nexus to be re-established. Only one logi@ unit or target routine shall be identified for any connection; a second Identify message with a different lo,-ical unit number or target routine number shall not be sent before the SCSI bus has been released (Bus Free Phase).

All initiators implement the mandatory messages tabulated in the "Init" column of Figure 9. All targets shall implement the mandatory messages tabulated in the "Targ" column of Figure 9 Whenever an I - T - L nexus or I-T-R nexus is estabilished by an initiator that is allowing disconnection, the initiator ensures that the active pointers are equal to the saved pointers for that particular logical unit or target routine. An implied restore pointers operation occurs as a result of a reconnection.

Table 4: Extended Message Codes

	Code	(y)	Description
	02h		Extended Identify
	00h		Modify Data Pointer
	Olh		Synchronous Data Transfer Request
	03h		Wide Data Transfer Request
	04h	7Fh	Reserved
	80h	FFh	Vendor Unique
2.6 Messages

The SCSI messages are defined in this section.

2.6.1 Abort

This message is sent from the initiator to the target to clear the present I/0 process plus any queued I/0 process for the I-T-x nexus. The target shall go to the Bus Free Phase following successful receipt of this message. Pending data, status, and queued I/0 processes for any other. I-T-x nexus shall not be cleared. If only an I-T nexus has been established, the target shall go to the Bus Free phase. No status or message is sent for the I/0 process and the I/0 process queue is not affected. It is not an error to issue this message to an l_@x nexus that does not currently have an active or queued I/0 process. @ansmission of this message terminates any extended Kontingent allegiance condition that may exist between the I-T-x nexus.

2.6.2 Bus Device Reset

This message is sent from an initiator to direct a target to clear all current I/0 processes on that SCSI device. This message forces a hard reset Kondition to the selected SCSI dlive. The target goes to the Bus Free Phase following successful receipt of this message. The target creates a unit attention condition for all initiators.

2.6.3 Command Complete

This message is sent from a target to an initiator to indicate that the execution of a command has terminated and that valid status has been sent to the initiator. After successfully sending this message, the target enters the Bus Free Phase by releasing BSY. The tar,-et considers the message transmission to be successful when it detects the negation of ACK for the Command Complete message with the ATN signal false.

2.6.4 Disconnect

This message is sent from a target to inform an initiator that the present connection is going to be broken (thc target plans to disconnect by releasing BSY), but that a latcr reconnect will be required in order to complete the eurrent 1/0 process. This message does not cause the initiator to save the data pointer. After successfully sending this message, the target goes to the Bus Free Phase by releasing the BSY signal. The target considers the message transmission to be successful when it detects the negation of the ACK signal for the Disconnect message with the ATN signal false.

NOTE:

Targets which break data transfers into multiple connections should end each successful connection (except the last) with a Save Data Pointer - Disconnect message sequence. However, in the case of VMS, any deviee which issues a Disconnect will have an implied Save Data Pointers performed by the Port Driver.

This message may also be sent from an initiator to a target to instruct the target to disconnect from the SCSI bus. If this option is supported and after the Disconnect message, the target shall switch to Message In Phase, send the Disconnect message to the initiator (possibly preceded by Save Data Pointer message), and then disconnect by releasing BSY After releasing BSY, the target does not participate in another Arbitration phase for at least a disconnection delay. If this option is not supported or the target cannot disconnect at the time when it receives the Disconnect message from the initiator, the target responds by sending Message Reject message to the initiator.

2.6.5 Identify

The Identify message is sent by either the initiator or the target to establish an I - T - L nexus or an 1-T-R nexus. The logical unit number addresses one of up to eight logical devices attached to a target. There are however, no Digital devices which currently support multiple LUNS.

NOTE:

Use of the Identify message to establish an I-R nexus allows connection to one of up to eight target routines or functions in the target itself. These target routines or functions are expected to be used for maintenance and diagnostic purposes.

Figure 10: Identify Message Format


Bit    7           6           5           4           3           2          1       0
Byte

0   Identify    DiscPriv    Luntar     Reserved    Reserved                Luntpn

2.6.6 Initiator Detected Error

This message is sent from an initiator to inform a target that an error has occurred that does not preclude the target from retrying the operation. The source of the error may either be reiated to previous activities on the SCSI bus or may be internal to the initiator and unrelated to any previous SCSI bus activity. Although present pointer integrity is not assured, a Restore Pointers message or disconnect followed by a reconnect, shall cause the pointers to be restored to their defined prior state.

2.6.7 Message Parity Error

This message is sent from the initiator to the target to indicate that the last message byte it received had a parity error. In order to indicate its intentions of sending this message, the initiator asserts the ATN signal prior to its release of ACK for the REQ/ACK handshake of the message that has the parity error. This provides an interlock so that the target can determine which message has the parity error. If the target receives this message under any other circumstance, it shall signal catastrophic error condition by releasing the BSY signal without any further information transfer attempt.

2.6.8 Message Reject

This message is sent from either the initiator or target to indicate that the last message byte it reeeived was inappropriate or had not been impleiuented.

In order to indicate its intentions of sending this message, the initiator asserts the ATN signal prior to its release of ACK for the REQ/ACK handshake of the message byte that is to be rejected. If the target receives this message under any other circumstance, it rejects this message.

When a target sends this message, it changes to Message In Phase and sends this message prior to requesting additional message bytes from the initiator. This provides an interlock so that the initiator can determine which message byte is rejected.

2.6.9 No Operation

This message is sent from an initiator in response to a target's request for a message when the initiator does not currently have any other valid message to send.

2.6.10 Restore Pointers

This message is sent from a target to direct the initiator to restore the most recently saved pointers (for the cux.-i.-ent nexus) to the active stale. Pointers to the command- data, and scatus locations for the nexus are restored to the active, pointers. Command and stitus pointers are restoi.-ed to the beginning of the preseiit command and status areas. The data pointer are restored to the vali-ie at the beginning of the data area in the absence of a Save Data Pointer mess,--ige or to the value at the point at which the last Save Data Pointer message occurred for that nexus.

2.6.11 Save Data Pointer

This message is sent from a tai-get to direct the initiator to save a copy of the present aetive data pointers for the current nexus.

The target sends a Save Data Pointer message before sending a Restore Pointers message for the purpose of restoring the status pointer. The target sends a Save Data Pointer message before sending a Disconnect message if data transfer has occurred for the I/0 process. Exception: If the initiator has accepted a Modify Data Pointer message from the logical unit of the 1/0 process, it is permissible for the target to omit sending the Save Data Pointer message before sending a Disconnect message following the completion of the data transfer for the I/0 process.

Table 5: Synchronous Data Transfer Request

	Byte	Value	Description

	0	0lh	Extended message
	1	03h	Extended message length
	2	0lh	Synchronous Data Transfer Request code
	3	m	Transfer period ( m times 4 nanoseconds)
	4	x	REQ/ACK offset

A Synchronous Data Transfer Request (SDTR) message exchange shall be initiated by an SCSI device whenever a previously-arranged data transfer agreement may have become invalid. The agreement becomes invalid after any condition which may leave the data transfer agreement in an indeterminate state such as:

  • After a hard reset condition
  • After a Bus Device Reset message
  • After a power cycle.
In addition, a SCSI device may initiate an SDTR niessage exchange whenever it is appropriate to negotiate a new data transfer agreenlent (eithei- synchronous or ,tsynclironous). SCSI devices that are capable of synchronous data transfers shall not respond to an SDTR message with a Message LI%,eiect message.

The SDTR message exchange establishes the permissible transfer periods and the REQ/ACK offsets for all logical units on the two devices. The transfer period is the minimum time allowed between leading edges of successive REQ pulses and of successive ACK to mcet the device requirements for successful reception of data.

The REQ/ACK offsct is the maximum number of REQ pulses allowed to be outstanding before the leading edge of ilt's corresponding ACK pulse is received at the target. This value is chosen to prevent overflow conditions in the device's reception buffer and offset counter. A REQ/ACK offset value oi. zero indicates asynchi-oi.Lous data transfer mode; a value of FFh indicates unlimited REQ/ACK offset.

The originating device (the device that sends the first of the pair of SDTR messages) sets its values according to the rules above to permit it to receive data successfully. If the responding device can also receive data successfully with these values, it returns the same values in it.-, SDTR message. If it requires a larger transfer period, a smaller REQ/ACK offset, or both m order to receive data successfully, it substitutes values in its SDTR message as required, retunüng unchanged any value not required to be changed. Each device when transmitting data shall respect the limits set by the other's SDTR message, but it is permitted to transfer data with larger transfer periods, smaller REQ/ACK offsets, or both, than specified in the other's SDTR message. The successful completion of an exchange of SDTR messages implies an agreement as follows:


		Responding Device SDTR
		response	Implied Agreement

	1	Non-zero REO/ACK offset	Each device transmits data with a transfer period equal to or
			greater than and a REO/ACK off set equal to or less than the values
			received in the other device's SDTR niessage.
	2.	REQ/ACK offset equal to zero	Asynchronous transfer
	3.	MESSAGE REJECT message	Asynchronous transfer
If the initiator recognizes that negotiation is required, it asserts the ATN signal and sends a SDTR message to begin the negotiatiiig process. After successfully completing the Message Out Phase, the target responds with the proper SDTR niessage. lf'an abnormal conditioll prevents the target from returning an appropriate response, both devices go to asynchronous data transfer mode for data transfers between the two devices.

Following target response 1. above, the implied agreement for sytichi-oiious operation is considered to be negated by both initiator and the target if the initiator asserts gl'N and thc first message out is either Message Parity Error or Message Reject. In this case, both devices shall go to asynchronous data transfer mode for data transfers between the two devices. For the Message Parity Error case, the implied agreement is reinstated if a retransmittal of the second of the pair of messages is successfully accomplished. AI'ter a velidor-specific number of retry attempts (greater than zero), if the target receives a Message Parity Error message, it terminates the retry activity. This may be done by either changing to any other information transfer phase and transferring at least one byte of information or by goin- to the Bus Free phase. The initiat-or accepts such actioii as abortiiig and both deviees go to asynchronous data t'ransfer mode for data transfers.between the two devices.

If the target recognizes that negotiation is required, it sends an SDTR message to the initiator. Prior to releasing ACK on the last byte of the SDTR message from the target, the initiator asserts ATIN and responds with its SDTR message or with a Message Reject message. If an abnormal condition prevents the initiator from returning an appropriate response, both devices go to @isylichronous data transfcr mode for data transf("rs betwccn the two devices.

Following an initiator's responding SDTR message, an implied agreement for synchronous operation is not considered to exist until the target leaves the Message Out Phase, indicating that the target has accepted the negotiation. After a vendor-specific number of retry attempts (greater than zero), if the target has not received the initiator's responding SDTR message, it goes to the Bus Free Phase without any further infonnation transfer attempt. This indicates that a catastrophic error condition has occurred. Both devices go to asynchronous data transfer mode for data transfers between the two devices. If, following an initiator's responding SDTR message, the target shifts to Message In Phase and the first message in is Message Reject, the implied agreement is considered to be negated and both devices go to asynchronous data transfer mode for data transfers between the two devices.

The implied synchronous agreement remains in effect until a Bus Device Reset message is received, until a hard Reset condition occurs, or until one of the two SCSI devices elects to modify the agreement. The default data transfer mode is asynchronous data transfer mode. The default data transfer mode is entered at power on, after a Bus Device Reset message, or after a hard Reset condition.

CHAPTER 3

COMMANDS AND STATUS

3.1 Introduction

This chapter defines the SCSI command and status structures and gives several examples. By keeping to a minimum the functions essential to communicate via this protocol, a widt-, range of peripheral devices can operate in the same environment. Because subsets of the full architecture may be implemented, optional functions are noted.

3.2 Command Implementation Requirernents

The first byte of all SCSI commands shall contain an operation code. Three bits (bits 7 - 5) of the second byte of each SCSI command specify the logical unit if its is not specified using the Identify message. The last byte of all SCSI commands shall contain a control block.

3.3 Command Descriptor Block

A request to a peripheral device is performed by sending a command descriptor block to the target. For several commands, the request is accompanied by a list of parameters sen.t during the Data Out Phase. See the specific commands for detailed information.

The command descriptor block always has an operation code as the first byte of the command. This is followed by an optional logical unit number, command parameters (if any), and a control byte. For all commands, if there is an invalid parameter in the command descriptor block, then the target shall terminate the command without altering the medium.

3.4 Opcodes

Opcodes are divided into two sections. Bits 5 - 7 identify a particular Group of commands. Bits 0 - 4 identify a specific command. There is a possiblity, therefore, to have 8 groups of commands and each group to hold 32 commands. Most of the commands are contained within Group 0.

The group code specifies one of the following groups:

·	Group 0 - six-byte commands (see Figure 11)

·	Group 1 - ten-byte commands (see Figure 12)

·	Group 2 - 7bn Byte Commands (See Figure 12)

·	Group 3 - reserved

·	Group 4 - reserved

·	Group 5 - twelve-byte commands (see Figure 13)

·	Group 6 - Digital Unique

0   Group 7 - Digital Unique

3.4.1 Logical Unit Number

Digital drives support only one logical unit, LUN=0. The target shall ignore the logical unit number specified within the Command Descriptor Block if an Identify message was received.

3.4.2 Logical Block Address

The logical block address begins with block zero and is contiguous up to the last logical block on the drive. A six-byte command descriptor block contains a 21-bit logical block address. The ten-byte and the twelve-byte command descriptor blocks contain 32-bit logical block addresses. Logical block addresses in additional parameter data have their length specified for each occurrence. See the specific command descriptions.

3.4.3 Transfer Length

The transfer length field specifies the amount of data to be transferred, usually the number of logical blocks. For several commands the traiisfer length indicates the requested number of bytes to be sent as defined in the command description. For these commands the transfer length field may be identified by a different name. See the following descriptions and the individual command descriptions for fi-irther information.

Commands that use one byte for transfer length allow up to 256 blocks of data to be transferred by one command. A transfer length value of 1 to 255 indicates the number of blocks that shall be transferred. A value of zero indicates 256 blocks.

Commands that use multiple bytes for transfer length allow 65,535 or greater blocks of data to be transferred by one command. In this case, a transfer length of zero indicates that no data transfer shall take place. A value of one or greater indicates the number of blocks that shall be transferred. Refer to the specific command description for further information.

3.4.4 Parameter List Length

The parameter list length is used to specify the number of bytes sent during the Data Out Phase. This field is typically used in command descriptor blocks for parameters that are sent to a target that is mode parame@,rs, dioagnostic parameters, log parameters.

3.4.5 Allocatlon Length

The allocation length field specifies Ulie inaxinium number of bytes tliat an initiator has allocated for returned data. An allocation length of zero indicates that no data shall be transferred. This condition shall not be considered as an error. The target shall terminate the Data In Phase when allocation length bytes have been transferl-ed or when all available data have been transferred to the initiator, whichever is less.

The allocation length is typically used to return sense data, for example mode data, log dat.-i, diagnostic data, to an initiator.

3.4.6 Control Byte

The control byte is the last byte of every command descriptor block. The Flag, Link, and Digital Unique fields are not supported and must be set to zero. If any of the link, flag, or Digital unique bits are set to one, the drive shall return Check Condition status with the sense key set to Illegal Request.

3.5 Status

A status byte shall be sent from the target to the initiator during the Status phase at the termination of each command.

A description of the status byte codes is shown in Figure 15

Figure 11: Status Byte Code Bit Values

Bits of Status Byte
7	6	5	4	3	2	1	0	Status (es) Represented
R	R	0	0	0	0	0	R	Good
R	R	0	0	0	0	1	R	Check Condition
R	R	0	0	1	0	0	R	Busy
R	R	0	1	1	0	0	R	Reservation Conflict

All Other Codes       					Reserved
Key: R - Reserved bit = 0

Figure 16: Status-Definitions

Status Code	Description
Good		This status indicates that the target has successfully completed 
		the command.

Check		Any error,exception,or abnormal condition that causes sense
Condition	data to be set, shall cause a Check Condition status.The Request
 		Sense comrnand should be issued following a Check 
		Condition status,to determine the nature of the condition.

Busy		The target is busy.This status shall be returned whenever a target
		is unable to process the command from an otherwise
		acceptable initiator.The normal Initiator recovery action is to 
		issue the command again at a later time.

Reservation	This status shall be returned whenever a SCSI device attempts
		Conflict to access a logical unit or an extent within a logical unit that is
		reserved with a conflicting reservation type for another SCSI 
		device (see Reserve and Release Unit commands).The normal
		Initiator recovery action is to issue the command again at a later 
		time.

3.6 Command Examples

The following sections give examples of typieal command processing in the SCSI environment.

3.6.1 Single Command Example

A typical operation on the SCSI bus is likely to include a single Read command to a peripheral device. This operation is described in detail starting with a request from the initiator. This example assumes that no linked commands and no malfunctions or errors occur.

The initiator lias active pointers and a set of stored pointers representing aetive disconneeted SCSI devices (an initiator without disconnect capability does not require stored pointers). the initiator sets up the active pointers for the operation requested, arbitrates for the SCSI bus, and selects the target. Once this process is completed, the target assumes control of the operation.

The target obtains the command from the initiator (in this case, a Read command). The target interprets the command and executes it. In this case, the target gets the data from the peripheral device and sends it to the initiator. At the completion of the Read command, the target sends a status byte to the initiator. To end the operation, tlie target sends a Command Complete message to the initiator.

3.6.2 Disconnect Example

In the above single command example, the length of time necessary to obtain the data may require a time-consuming physical seek. In order to improve system throughput, the target may disconnect from the initiator, thei-eby freeing the SCSI bus to allow other I/0 process to occur. The initiator must be capable of being reselected and of restoring pointers. The target must be capable of arbitration and reselection.

After the target has received the Rcad command (and has determined that there will be a delay), it disconnects by sending a Disconnect message and releasing BSY

When the data are ready to be transferred, the target reconnects to the initiator. As a result of this reconnection, the initiator restores the pointers to their most recent saved values (which, in this case, are the initial values) and the target continues (as in the single command example) to finish the operation. The initiator recognizes that the Operation is complete when Command Complete message is received.

If target wishes to disconnect after transferring part of the data (for example while crossing a cylinder boundary), it may do so by sending a Save Data Pointer message and a Disconnect message to the initiator and then disconnecting. When reconnection is completed, the current data pointer value is restored to its value immediately prior to the Save Data Pointer message. On those occasions when an error or exception Kondition occurs and the target elects to repeat the information transfer, the target may repeat the transfer by either issuing a Restore Pointers message or by disconnecting without issuing a Save Data Pointer message. When reconnection is completed, the most recent saved pointer values are restored.

Fig. 17 shows an example of the SCSI signals, its sequence and the timing.

scsi-1.gif

Fig. 17 SCSI Timing Diagram

Home TOC Prev Next Gloss