Section 5
SCSI Programming Guidelines
This buffer also serves as an on-board cache (DisCache). The caching function can be enabled/disabled,
and various cache parameters can be configured to best fit the applciation via the
MODE SELECT
command. Refer to the section on the MODE SELECT command (5.11.1
O)
and Appendix A for a more
detailed discussion
of
the DisCache feature.
5.10
CONFIGURING THE
PRODRIVE
5.10.1
PRODRIVE
OPERATING MODES
The
manner
in which the ProDrive operates
can
be changed to more precisely match its features with user
requirements. This is referred to as changing the Operating Mode
of
the drive and
is
done through the use
of
the
MODE
SELECT
and
MODE
SENSE commands.
The
MODE
SELECT
command is used to set the
Operating Mode
of
the ProDrive to achieve the desired behavior. The
MODE
SENSE command may
be
used to detennine the current Operating Mode
of
the drive,
or
to
gather other infonnation that would be
useful in setting the Operating Mode.
An example
of
a common user-adjusted Operating Mode parameter is the number
of
retries the drive should
attempt when it detects a read error.
If
an initiator wished to retry only once when the drive detected
incorrect data, the initiator's software could first issue a
MODE
SENSE command to the ProDrive to
determine its current configuration. The data returned to the initiator during the DATA phase
of
the
MODE
SENSE command would contain the current Mode Parameters, including how many retries the drive will
attempt when it detects a read error.
If
the number
of
retries is not set to the desired number, the initiator
could then send a
MODE
SELECT command with the data byte corresponding to the Retry Count
Parameter
set
to one. From then on, the ProDrive would only retry once
on
READ
commands.
5.10.2
OPERATING MODE TABLES
The
ProDrive Operating Mode is detennined by the contents
of
the Current Mode Table. Because
of
the
need for frequent and fast access to its parameters, the Current Mode Table is stored in RAM. This table is
referenced whenever there
is
more than one possible way for the drive to behave. In the previous example,
the initiator will have set the Retry Count in the Current Mode Table to one. Each time a
READ
command is executed, the firmware checks the Current Mode Table and looks up the Retry Count
Parameter.
It
then uses this number to detennine how many times it should attempt to re-read a block
if
the data is detected to be incorrect.
Storing the Current Mode Table in
RAM
means that the drive's Operating Mode is lost when
power
is
removed
or
the drive is reset. For this reason, a copy
of
the Current Mode Table can be saved
on
the disk
itself. This saved copy is called the
Saved Mode Table. The Saved Mode Table is stored
on
a hidden area
of
the disk that is not accessible by the user. This way, no user data storage area is sacrificed, nor can a
user inadvertently erase the table. The
Saved Mode Table is used to load the Current Mode Table at power-
up
or
whenever the drive is reset. The contents
of
the Current Mode Table can be copied into the Saved
Mode Table
via
the
MODE
SELECT
command.
If
the Save Parameters bit is set to one in the
MODE
SELECT
command (bit 0
of
byte 1), the entire contents
of
the Current Mode Table will be transferred to
the
Saved Mode Table when the command is completed.
NOTE:
If
the
MODE
SELECT command makes changes to
the
Current Mode Table, these changes will
be implemented first and then incorporated in the
Saved Mode Table. In other words,
if
a
MODE
SELECT
command contains new mode information and the Save Parameters bit is set, the new
mode
information will appear in the Saved Mode Table as well as in the Current Mode Table.
The
Saved
Mode
Table is a very powerful tool for the user. Using the Save Parameters bit allows the drive
to be pennanently configured to the user's requirements with the execution
of
a single
MODE
SELECT
command.
This
means that a once-in-a-lifetime configuration can be done (e.g., at the user's factory),
eliminating the burden from the device driver
of
sending vendor specific
MODE
SELECT commands after
every reset.
5-20
SCSI
Programming
Guidelines