home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / TRSICAT.LZX / CATS_CD2_TRSI / Inc&AD1.3 / Includes / devices / scsidisk.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-12  |  3.4 KB  |  96 lines

  1. #ifndef    DEVICES_SCSIDISK_H
  2. #define    DEVICES_SCSIDISK_H
  3. /*
  4. **    $Filename: devices/scsidisk.h $
  5. **    $Release: 1.3 $
  6. **
  7. **    SCSI exec-level device command
  8. **
  9. **    (C) Copyright 1988 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. /*--------------------------------------------------------------------
  14.  *
  15.  *   SCSI Command
  16.  *    Several Amiga SCSI controller manufacturers are converging on
  17.  *    standard ways to talk to their controllers.  This include
  18.  *    file describes an exec-device command (e.g. for hddisk.device)
  19.  *    that can be used to issue SCSI commands
  20.  *
  21.  *   UNIT NUMBERS
  22.  *    Unit numbers to the OpenDevice call have encoded in them which
  23.  *    SCSI device is being referred to.  The three decimal digits of
  24.  *    the unit number refer to the SCSI Target ID (bus address) in
  25.  *    the 1's digit, the SCSI logical unit (LUN) in the 10's digit,
  26.  *    and the controller board in the 100's digit.
  27.  *
  28.  *    Examples:
  29.  *          0    drive at address 0
  30.  *         12    LUN 1 on multiple drive controller at address 2
  31.  *        104    second controller board, address 4
  32.  *         88    not valid: both logical units and addresses
  33.  *            range from 0..7.
  34.  *
  35.  *   CAVEATS
  36.  *    Original 2090 code did not support this command.
  37.  *
  38.  *    Commodore 2090/2090A unit numbers are different.  The SCSI
  39.  *    logical unit is the 100's digit, and the SCSI Target ID
  40.  *    is a permuted 1's digit: Target ID 0..6 maps to unit 3..9
  41.  *    (7 is reserved for the controller).
  42.  *
  43.  *        Examples:
  44.  *          3    drive at address 0
  45.  *        109    drive at address 6, logical unit 1
  46.  *          1    not valid: this is not a SCSI unit.  Perhaps
  47.  *            it's an ST506 unit.
  48.  *
  49.  *    Some controller boards generate a unique name (e.g. 2090A's
  50.  *    iddisk.device) for the second controller board, instead of
  51.  *    implementing the 100's digit.
  52.  *
  53.  *    There are optional restrictions on the alignment, bus
  54.  *    accessability, and size of the data for the data phase.
  55.  *    Be conservative to work with all manufacturer's controllers.
  56.  *
  57.  *------------------------------------------------------------------*/
  58.  
  59. #define    HD_SCSICMD    28    /* issue a SCSI command to the unit */
  60.                 /* io_Data points to a SCSICmd */
  61.                 /* io_Length is sizeof(struct SCSICmd) */
  62.                 /* io_Actual and io_Offset are not used */
  63.  
  64. struct SCSICmd {
  65.     UWORD  *scsi_Data;        /* word aligned data for SCSI Data Phase */
  66.                 /* (optional) data need not be byte aligned */
  67.                 /* (optional) data need not be bus accessable */
  68.     ULONG   scsi_Length;    /* even length of Data area */
  69.                 /* (optional) data can have odd length */
  70.                 /* (optional) data length can be > 2**24 */
  71.     ULONG   scsi_Actual;    /* actual Data used */
  72.     UBYTE  *scsi_Command;    /* SCSI Command (same options as scsi_Data) */
  73.     UWORD   scsi_CmdLength;    /* length of Command */
  74.     UWORD   scsi_CmdActual;    /* actual Command used */
  75.     UBYTE   scsi_Flags;        /* includes intended data direction */
  76.     UBYTE   scsi_Status;    /* SCSI status of command */
  77. };
  78.  
  79.  
  80. /*----- scsi_Flags -----*/
  81. #define    SCSIF_WRITE        0    /* intended data direction is out */
  82. #define    SCSIF_READ        1    /* intended data direction is in */
  83.  
  84. /*----- SCSI io_Error values -----*/
  85. #define    HFERR_SelfUnit        40    /* cannot issue SCSI command to self */
  86. #define    HFERR_DMA        41    /* DMA error */
  87. #define    HFERR_Phase        42    /* illegal or unexpected SCSI phase */
  88. #define    HFERR_Parity        43    /* SCSI parity error */
  89. #define    HFERR_SelTimeout    44    /* Select timed out */
  90. #define    HFERR_BadStatus        45    /* status and/or sense error */
  91.  
  92. /*----- OpenDevice io_Error values -----*/
  93. #define    HFERR_NoBoard        50    /* Open failed for non-existant board */
  94.  
  95. #endif    /* DEVICES_SCSIDISK_H */
  96.