aic7880.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:4k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* aic7880.h - AIC 7880 SCSI Host Adapter header file */
  2. /* Copyright 1984-1998 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01e,29sep98,fle  made it refgen parsable
  7. 01d,17mar98,sbs  added AIC7880 PCI specific definitions.
  8.                  added import of aic7880Intr().
  9. 01c,05aug97,dds  removed #include "him/custom.h".
  10. 01c,05aug97,dds  removed #include "him/custom.h".
  11. 01b,11jul97,dds  added #include "him/custom.h".
  12. 01a,19jun97,dds  created.
  13. */
  14. /*
  15. DESCRIPTION
  16. This is the header file for the AIC-7880 driver
  17. */
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. #include "semLib.h"
  22. #include "scsiLib.h"
  23. extern int himDebug;
  24. #undef HIM_DEBUG
  25. #define HIM_MSG          logMsg
  26. #define HIM_DEBUG_MSG                                                  
  27.     if (himDebug)                                                      
  28.         HIM_MSG
  29. /* Adaptec AIC 7880 PCI SCSI Host Adapter definitions */
  30. #define AIC7880_PCI_VENDOR_ID       0x9004
  31. #define AIC7880_PCI_DEVICE_ID       0x8178
  32. /* AIC 7880 SCSI Host Adapter Segment Pointer structure */
  33. typedef struct segmentPtr
  34.     {
  35.     int dataPtr;
  36.     int dataLen;
  37.     } SEG_PTR;
  38. /* AIC 7880 SCSI Host Adapter Thread Structure */
  39. typedef struct aic7880Thread      
  40.     {
  41.     SCSI_THREAD     scsiThread; /* generic SCSI thread structure  */
  42.     struct sp     * pScb;  /* ptr to SCSI Command block      */
  43.     SEG_PTR       * segPtr;     /* Scatter/Gather Segment Pointer */
  44.     } AIC_7880_THREAD;
  45. /* AIC 7880 SCSI Controller Structure */
  46. typedef struct                     
  47.     {
  48.     SCSI_CTRL         scsiCtrl;          /* generic SCSI controller info */
  49.     struct cfp      * aic7880CfpStruct;  /* pointer to a 7880 SCSI Ctrlr */
  50.     AIC_7880_THREAD * pHwThread;         /* ptr to current thread        */
  51.     } AIC_7880_SCSI_CTRL;
  52. /* Interrupt codes  */
  53. #define INTMASK                  0xe0  
  54. #define HA_NOT_FOUND             0x00
  55. #define HA_FOUND                 0x01
  56. #define HA_FOUND_DISABLED        0x81
  57. /* Sync offset and period (SXFER register) */
  58. #define AIC_7880_MIN_REQ_ACK_OFFSET   1   /* Minimum sync offset        */
  59. #define AIC_7880_MAX_REQ_ACK_OFFSET   8   /* Maximum sync offset        */
  60. #define AIC_7880_DBLSPD_50                    12
  61. #define AIC_7880_DBLSPD_64                    16
  62. #define AIC_7880_DBLSPD_75                    19
  63. #define AIC_7880_PERIOD_100                   25
  64. #define AIC_7880_PERIOD_125                   31
  65. #define AIC_7880_PERIOD_150                   37
  66. #define AIC_7880_PERIOD_175                   43
  67. #define AIC_7880_PERIOD_200                   49
  68. #define AIC_7880_PERIOD_225                   55
  69. #define AIC_7880_PERIOD_250                   61
  70. #define AIC_7880_PERIOD_275                   67
  71. #define AIC_7880_MAX_XFER_WIDTH                2
  72. #define SIMPLE_QUEUE_TAG                    0x00
  73. #define HEAD_OF_QUEUE_TAG                   0x01
  74. #define ORDERED_QUEUE_TAG                   0x02
  75. /* SCB command status */
  76. #define AIC_7880_REQUEST_IN_PROGRESS  0x00  /* SCSI request in progress     */
  77. #define AIC_7880_CMD_COMPLETE         0x01  /* SCSI command completed       */
  78. #define AIC_7880_REQUEST_ABORTED      0x02  /* SCSI request aborted         */
  79. #define AIC_7880_CMD_COMP_WITH_ERROR  0x04  /* error executing SCSI request */
  80. #define AIC_7880_INVALID_REQUEST      0x08  /* invalid SCSI request         */
  81. /* host adapter status */
  82. #define AIC_7880_NO_STATUS            0x00  /* host adapter stat unavailable */
  83. #define AIC_7880_CMD_ABORT            0x04  /* cmd aborted by host           */
  84. #define AIC_7880_CMD_ABORT_BY_HA      0x05  /* cmd aborted by host adapter   */
  85. #define AIC_7880_UNEXPECTED_BUS_FREE  0x13  /* unexpected bus free           */
  86. #define AIC_7880_PHASE_MISMATCH       0x14  /* phase mismatch detected       */
  87. #define AIC_7880_HA_HW_ERROR          0x20  /* host adapter H/W error        */
  88. #define AIC_7880_BUS_RESET            0x22  /* SCSI bus reset                */
  89. #define AIC_7880_BUS_RESET_OTHER_DEV  0x23  /* SCSI bus reset from other dev */
  90. #define AIC_7880_SELECT_TIMEOUT       0x11  /* SCSI selection timeout        */
  91. #define AIC_7880_REQ_SENSE_FAILED     0x1b  /* SCSI Request Sense Failed     */
  92. #define AIC_7880_SCSI_BUS_RESET       0x44  /* SCSI bus reset                */
  93. /* imports */
  94. IMPORT VOID  aic7880Intr ();
  95. /*
  96.  *  AIC7880LIB.C
  97.  */
  98. AIC_7880_SCSI_CTRL * aic7880CtrlCreate (int busNo, int devNo, int scsiBusId);
  99. #ifdef __cplusplus
  100. }
  101. #endif