home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / cbm / os-include.lha / os-include / devices / scsidisk.i < prev    next >
Text File  |  1993-10-15  |  4KB  |  117 lines

  1.     IFND    DEVICES_SCSIDISK_I
  2. DEVICES_SCSIDISK_I    EQU    1
  3. **
  4. **    $VER: scsidisk.i 36.2 (7.11.90)
  5. **    Includes Release 40.15
  6. **
  7. **    SCSI exec-level device command
  8. **
  9. **    (C) Copyright 1988-1993 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. **
  12.  
  13.  
  14.     IFND EXEC_TYPES_I
  15.     INCLUDE "exec/types.i"
  16.     ENDC ; EXEC_TYPES_I
  17.  
  18.  
  19. ;---------------------------------------------------------------------
  20. ;
  21. ;   SCSI Command
  22. ;    Several Amiga SCSI controller manufacturers are converging on
  23. ;    standard ways to talk to their controllers.  This include
  24. ;    file describes an exec-device command (e.g. for hddisk.device)
  25. ;    that can be used to issue SCSI commands
  26. ;
  27. ;   UNIT NUMBERS
  28. ;    Unit numbers to the OpenDevice call have encoded in them which
  29. ;    SCSI device is being referred to.  The three decimal digits of
  30. ;    the unit number refer to the SCSI Target ID (bus address) in
  31. ;    the 1's digit, the SCSI logical unit (LUN) in the 10's digit,
  32. ;    and the controller board in the 100's digit.
  33. ;
  34. ;    Examples:
  35. ;          0    drive at address 0
  36. ;         12    LUN 1 on multiple drive controller at address 2
  37. ;        104    second controller board, address 4
  38. ;         88    not valid: both logical units and addresses
  39. ;            range from 0..7.
  40. ;
  41. ;   CAVEATS
  42. ;    Original 2090 code did not support this command.
  43. ;
  44. ;    Commodore 2090/2090A unit numbers are different.  The SCSI
  45. ;    logical unit is the 100's digit, and the SCSI Target ID
  46. ;    is a permuted 1's digit: Target ID 0..6 maps to unit 3..9
  47. ;    (7 is reserved for the controller).
  48. ;
  49. ;        Examples:
  50. ;          3    drive at address 0
  51. ;        109    drive at address 6, logical unit 1
  52. ;          1    not valid: this is not a SCSI unit.  Perhaps
  53. ;            it's an ST506 unit.
  54. ;
  55. ;    Some controller boards generate a unique name (e.g. 2090A's
  56. ;    iddisk.device) for the second controller board, instead of
  57. ;    implementing the 100's digit.
  58. ;
  59. ;    There are optional restrictions on the alignment, bus
  60. ;    accessability, and size of the data for the data phase.
  61. ;    Be conservative to work with all manufacturer's controllers.
  62. ;
  63. ;---------------------------------------------------------------------
  64.  
  65. HD_SCSICMD    EQU    28    ; issue a SCSI command to the unit
  66.                 ; io_Data points to a SCSICmd
  67.                 ; io_Length is sizeof(struct SCSICmd)
  68.                 ; io_Actual and io_Offset are not used
  69.  
  70.  STRUCTURE    SCSICmd,0
  71.     APTR    scsi_Data        ; word aligned data for SCSI Data Phase
  72.                 ; (optional) data need not be byte aligned
  73.                 ; (optional) data need not be bus accessable
  74.     ULONG   scsi_Length        ; even length of Data area
  75.                 ; (optional) data can have odd length
  76.                 ; (optional) data length can be > 2**24
  77.     ULONG   scsi_Actual        ; actual Data used
  78.     APTR    scsi_Command    ; SCSI Command (same options as scsi_Data)
  79.     UWORD   scsi_CmdLength    ; length of Command
  80.     UWORD   scsi_CmdActual    ; actual Command used
  81.     UBYTE   scsi_Flags        ; includes intended data direction
  82.     UBYTE   scsi_Status        ; SCSI status of command
  83.     APTR    scsi_SenseData    ; sense data: filled if SCSIF_[OLD]AUTOSENSE
  84.                 ; is set and scsi_Status has CHECK CONDITION
  85.                 ; (bit 1) set
  86.     UWORD   scsi_SenseLength    ; size of scsi_SenseData, also bytes to
  87.                 ; request w/ SCSIF_AUTOSENSE, must be 4..255
  88.     UWORD   scsi_SenseActual    ; amount actually fetched (0 means no sense)
  89.     LABEL   scsi_SIZEOF
  90.  
  91.  
  92. ;------ scsi_Flags ------
  93. SCSIF_WRITE        EQU    0    ; intended data direction is out
  94. SCSIF_READ        EQU    1    ; intended data direction is in
  95. SCSIB_READ_WRITE    EQU    0    ; (the bit to test)
  96.  
  97. SCSIF_NOSENSE        EQU    0    ; no automatic request sense
  98. SCSIF_AUTOSENSE        EQU    2    ; do standard extended request sense
  99.                     ; on check condition
  100. SCSIF_OLDAUTOSENSE    EQU    6    ; do 4 byte non-extended request
  101.                     ; sense on check condition
  102. SCSIB_AUTOSENSE        EQU    1    ; (the bit to test)
  103. SCSIB_OLDAUTOSENSE    EQU    2    ; (the bit to test)
  104.  
  105. ;------ SCSI io_Error values ------
  106. HFERR_SelfUnit        EQU    40    ; cannot issue SCSI command to self
  107. HFERR_DMA        EQU    41    ; DMA error
  108. HFERR_Phase        EQU    42    ; illegal or unexpected SCSI phase
  109. HFERR_Parity        EQU    43    ; SCSI parity error
  110. HFERR_SelTimeout    EQU    44    ; Select timed out
  111. HFERR_BadStatus        EQU    45    ; status and/or sense error
  112.  
  113. ;------ OpenDevice io_Error values ------
  114. HFERR_NoBoard        EQU    50    ; Open failed for non-existant board
  115.  
  116.     ENDC    ; DEVICES_SCSIDISK_I
  117.