.bp
.sp 20 
.ft B 
                                                         USING
                                          INTEGRATED SOLUTIONS
                         VME-SCSI GENERAL PURPOSE HOST ADAPTER
.bp
.sp 4
.ft B
A.  OVERVIEW

B.  BASIC OPERATIONS
       1.COMMAND WINDOW
               i.SCSI COMMAND
              ii.VME ADDRESS
             iii.CONTROL & STATUS
       2.CONTROLLER AND TARGET SELECTION
       3.SETTING INTERRUPT

C.  COMMANDS ISSUED TO DRIVE

D.  STATUS RETURNED FROM DRIVE
       1.HOST ADAPTER CODE ( H.A. CODE )
       2.TARGET STATUS

E.  APPENDIX A

.ps 9
.vs 11p
.sp 42 
     Please forward your comments to me so that they can be incorporated in this manual.
     Kaveh G. Moazami
.bp
.sp 4
.ft B
A. OVERVIEW
.sp 2
.ft R
    The VME-SCSI Host Adapter is intended as a general purpose Host Adapter to interface with a variety of peripheral devices. The SCSI commands are literal commands passed to the Host Adapter by the host . Follwing the arbitration and selection phase, I/O activity will be controlled by the target and the Host Adapter is simply a meansfor the target to reach the host memory. The interpretaton of commands shall be done at higher level by the host. The Host Adapter is therefore relieved from most  of the application application specific requirements.  
.sp 4
.ft B
B. BASIC OPERATIONS
 
.ft R
B.1 COMMAND WINDOW
.sp 2
    All accesses to the VME-SCSI board are done through 8 words (16 bytes) registers which shall be refered to as the \fB COMMAND WINDOW \fR. These registers are addressable at 7fffc0 but they are jumper selectable to different values ( see  the Hardware Reference Manual).
The COMMAND WINDOW must be accessed using words  16-bit access only.
These 8 words ( 16 bytes ) are divided into the following groups:
.sp 2
B.1.i SCSI COMMAND (BYTES 0-9):
.sp 2
    To initiate a SCSI command these 10 bytes are used to hold a literal SCSI command. A SCSI command can be either 6 or 10 bytes long; with group 0 ( 6-byte long) commands it is necessary to pad this area with 4 bytes of zeroes.
.sp 1 
Follwing a SCSI operation, this area will hold one of the following depending on the\fB H.A. CODE\fR :
.sp 2
   H.A. CODE        CONTENTS OF BYTES 0-9
   ---------------       ------------------------------------------------------------------------------------
   80                  command string echoed back in here.
   81 or 82           8 or 16 bytes of requested data was immediately returned
                        see H.A. CODE for more details.
   40                  8 bytes of SENSE data was immediately returned and the rest
                        can be accessed through a FOLLOW UP command if desired.
.sp 1 
The request for SENSE data is done automatically by the HOST ADAPTER in cases where SCSI command was finished with some SENSE data. The nature of SENSE data will depend soley upon the controller used.
.sp 2
B.1.ii VME ADDRESS (BYTES 10-13):
.sp 2
    These four bytes will be used to hold the VME address for SCSI commands such as read or write where data shall be transfered between VME memory and the SCSI target.After the command, the VME address will be updated with the address immediately following the last byte transfered. In case of an aborted SCSI command (due to some error), the VME address update should be inspected to see how far the operation proceeded before failing. In some controllers the SENSE data will give information regarding this address (Refer to specific controller).
.sp 2
B.1.iii CONTROL & STATUS (BYTES 14-15):
    These two bytes act as the CONTROL and STATUS registers for  the HOST ADAPTER. Byte  14 should be initialized  with the following information :
.bp
.sp 4 
       7                       0 
      ----------------------------- 
      |   |   |   |   |   |   |   |   | 
      -----------------------------
       |      |    |   |   |   |   |
       |      |    |   |   |   +--+-------------------> bit 0-1 not used
       |      |    |   |   +--------------------------> bit 2 must be set to start 
       |      |    |   |                                 the execution of a command
       |      |    |   +----------------------------->  not used
       |      |    +--------------------------------->  bit 4 must be set to enable
       |      |                                         HOST ADAPTER interrupts
       +----+-------------------------------------->  bit 5-7 must be set with 
                                                       the target id for the 
                                                       controller
.sp 2
Following an operation, these two bytes will contain the return status of the operation. Byte 15 will contain the HOST ADAPTER CODE ( H.A. CODE ) which indicates if the command was executed successfully or not. Byte 14 shall contain the status of the target.
.sp 2
B.2 CONTROLLER AND TARGET SELECTION:
.sp 2
    In a SCSI command, bit 5 to 7 of the second byte always hold the Logical Unit Number (LUN). The range values the LUN may take depends on the kind of controller used. Controller selection by the Host Adapter is accomplished appropriately by setting bits 5-7 in byte 14 of the Command Window ( refer to A.1.iii). These bits should be set to the target id of the desired controller.
The maximum configuration possible is for one Host Adapter to be connected to 7 controllers, each of which is in turn connected to 8 peripherals.
.sp 2
B.3 SETTING INTERRUPTS:
.sp 2
    When an interrupt is enabled by setting bit 4 in Command Window byte 14 (refer to A.1.iii), an interrupt will occur at the completion of every SCSI command. From the time that the start bit is set, until after the completion of interrupts, communication with the Command Window is impossible. During this time the Command Window will contain FFFF.
The default interrupt vector is set to 7CH. This is jumper selectable to a different value ( refer to SCSI Hardware Reference Manual).
.sp 2
.ft B
C. COMMANDS ISSUED TO DRIVE:
.ft R
.sp 2
    There are two types of command given to the Host Adapter : SCSI commands and Host Adapter specific commands. In the case of SCSI commands, the Host Adapter will act as an arm of the target used to reach into host memory. SCSI commands are literally placed in the Command Window by the host and passed directly to the target and the result is returned to the host the same way. The interpretation of the commands and their result will be done by the Taget and the Host. The Host Adapter specific commands are used to invoke other Host Adapter functions. For the list of these commands refer to Appendix A. 
.sp 2
.ft B
D. STATUS RETURNED FROM DRIVE:
.ft R
.sp 2
    When a command is completed, status and error conditions are placed in the CONTROL & STATUS register of the Command Window. Byte 15 contains the H.A. Code which can contain the following values:
.bp
.sp 4 
   H.A.        CONDITION              SYMPTOM   
   CODE
   ---------  -----------------                --------------------------------------------------------
   01h      Interrupt Error              Internal Host Adapter error
                                              Improper response from SCSI-
                                              PROTOCOL CONVERTER
                                              Response: Reset board to clear
                                              SCSI bus.
   04h      Phase Error                  Internal Host Adapter error
                                              Host Adapter went into bad SCSI 
                                              phase change
                                              Response: reset board to clear
                                              SCSI bus.
   10h      VME Error                   Bad VME address. Address could be
                                              odd or non-existent.
   20h      Select Target Error         Host Adapter could not select 
                                              target.
                                              Response: reset board to clear
                                              SCSI bus.
   40h      Sense Data Exists           Check Sense data in SCSI command
                                              string of Command Window . 
                                              The number of bytes returned are
                                              target specific (see Appendix A). 
   80h      No Error                     Command completed successfully.
                                              Command will echoed back in SCSI
                                              Command string of Command Window.
   81h      No Error/Immediate data  8 bytes of requested data was 
                                              immediately returned at SCSI 
                                              command string of Command Window. 
   82h      No Error/Immediate data  16 bytes of requested data was
                                              immediately returned at SCSI 
                                              command string of Command Window.
                                              The first 8 bytes are immediate 
                                              while the second 8 bytes will be
                                              returned through Follow-up command.
                                              (see Appendix A list of commands)
.sp 2
    Byte 14 of CONTROL & STATUS is used to hold the status returned from a SCSI target. This byte can take the following values:
.sp 2
   TARGET           CONDITION              SYMPTOM   
   STATUS  
   ------------       --------------           -----------------------------------------------------------
    00h             No error              Good status
    08h             Target Busy               
    0?h             ---------                For Target specific Status 
                                              refer to Appendix A and
                                              the applicable manual on the target 
.bp
.sp 4 
.ft B
E. APPENDIX A:
.ft R
.sp 2
    The follwing is a list of SCSI commands acquired from Optical Storage International (OSI) Laserdrive ld1200 product specefication. For further information refer to engineering specification  part number Y075110023 available from OSI.
.sp 2
    The SCSI commands for Laserdrive 1200 are the following: 

     SCSI COMMANDS( GROUP 0) 
     ----------------------------------------- 
    OPERATION                    DESCRIPTION
    CODE
   --------------------                   ----------------------------
   00h                                 TEST UNIT READY
   01h                                 REZERO UNIT
   02h                                 REQUEST SENSE
   08h                                 READ
   0ah                                 WRITE
   0bh                                 SEEK
   0ch                                 SEARCH FOR EMPTY BLOCK
   12h                                 INQUIRY
   15h                                 MODE SELECT
   16h                                 RESERVE
   17h                                 RELEASE
   18h                                 COPY
   19h                                 SALVAGE
   1ah                                 MODE SENSE
   1bh                                 START/STOP UNIT
   1ch                                 RECEIVE DIAGNOSTIC RESULT
   1dh                                 SEND DIAGNOSTIC
.sp 2
     SCSI COMMANDS( GROUP 1)
     -----------------------------------------
    OPERATION                 DESCRIPTION
    CODE
   ---------------------                  --------------------------------
   25h                                 READ CAPACITY
   28h                                 READ
   2ah                                 WRITE
   2bh                                 SEEK
   2eh                                 WRITE AND VERIFY
.sp 2
    The HOST ADAPTER specific commands are as following: 

    OPERATION                 DESCRIPTION
    CODE 
   ----------------------                ----------------------------------------------
   f0h                                Follow-up command to acquire 8 more 
                                       bytes of immediate data. H.A. Code of
                                       82h will indicate when this command 
                                       should be used. 
   feh                                Read Host Adapter Firmware Version level
   ffh                                 Reset SCSI bus
.sp 2
   There will be additional commands to control various parameters of the board.


