home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / KERNEL-S / V1.2 / LINUX-1.2 / LINUX-1 / linux / drivers / scsi / in2000.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-29  |  3.0 KB  |  121 lines

  1. #ifndef _IN2000_H
  2.  
  3. /* $Id: in2000.h,v 1.2 1994/08/25 06:27:38 root Exp root $
  4.  *
  5.  * Header file for the Always IN 2000 driver for Linux
  6.  *
  7.  */
  8.  
  9. #include <linux/types.h>
  10. #include <linux/ioport.h>
  11.  
  12. /* The IN-2000 is based on a WD33C93 */
  13.  
  14. #define    INSTAT    (base + 0x0)    /* R: Auxiliary Status; W: register select */
  15. #define    INDATA    (base + 0x1)    /* R/W: Data port */
  16. #define    INFIFO    (base + 0x2)    /* R/W FIFO, Word access only */
  17. #define    INREST    (base + 0x3)    /* W: Reset everything */
  18. #define    INFCNT    (base + 0x4)    /* R: FIFO byte count */
  19. #define    INFRST    (base + 0x5)    /* W: Reset Fifo count and to write */
  20. #define    INFWRT    (base + 0x7)    /* W: Set FIFO to read */
  21. #define    INFLED    (base + 0x8)    /* W: Set LED; R: Dip Switch settings */
  22. #define    INNLED    (base + 0x9)    /* W: reset LED */
  23. #define    INVERS    (base + 0xa)    /* R: Read hw version, end-reset */
  24. #define    ININTR    (base + 0xc)    /* W: Interrupt Mask Port */
  25. #define G2CNTRL_HRDY    0x20        /* Sets HOST ready */
  26.  
  27. /* WD33C93 defines */
  28. #define    OWNID    0
  29. #undef    CONTROL
  30. #define    CONTROL    1
  31. #define    TIMEOUT    2
  32. #define    TOTSECT    3
  33. #define    TOTHEAD    4
  34. #define    TOTCYLH 5
  35. #define    TOTCYLL    6
  36. #define    LADRSHH    7
  37. #define    LADRSHL    8
  38. #define    LADRSLH    9
  39. #define    LADRSLL    10
  40. #define    SECTNUM    11
  41. #define    HEADNUM    12
  42. #define    CYLNUMH    13
  43. #define    CYLNUML    14
  44. #define    TARGETU    15
  45. #define    CMDPHAS    16
  46. #define    SYNCTXR    17
  47. #define    TXCNTH    18
  48. #define    TXCNTM    19
  49. #define TXCNTL    20
  50. #define DESTID    21
  51. #define    SRCID    22
  52. #define    SCSIST    23
  53. #define    COMMAND    24
  54. #define    WDDATA    25
  55. #define    AUXSTAT    31
  56.  
  57. /* OWNID Register Bits */
  58. #define    OWN_EAF    0x08
  59. #define    OWN_EHP    0x10
  60. #define    OWN_FS0    0x40
  61. #define    OWN_FS1    0x80
  62. /* AUX Register Bits */
  63. #define    AUX_DBR    0
  64. #define    AUX_PE    1
  65. #define    AUX_CIP    0x10
  66. #define    AUX_BSY    0x20
  67. #define    AUX_LCI    0x40
  68. #define    AUX_INT    0x80
  69.  
  70. /* Select timeout const, 1 count = 8ms */
  71. #define IN2000_TMOUT 0x1f
  72.  
  73. /* These belong in scsi.h also */
  74. #undef any2scsi
  75. #define any2scsi(up, p)                \
  76. (up)[0] = (((unsigned long)(p)) >> 16);        \
  77. (up)[1] = (((unsigned long)(p)) >> 8);        \
  78. (up)[2] = ((unsigned long)(p));
  79.  
  80. #undef scsi2int
  81. #define scsi2int(up) ( ((((long)*(up))&0x1f) << 16) + (((long)(up)[1]) << 8) + ((long)(up)[2]) )
  82.  
  83. #undef xany2scsi
  84. #define xany2scsi(up, p)    \
  85. (up)[0] = ((long)(p)) >> 24;    \
  86. (up)[1] = ((long)(p)) >> 16;    \
  87. (up)[2] = ((long)(p)) >> 8;    \
  88. (up)[3] = ((long)(p));
  89.  
  90. #define xscsi2int(up) ( (((long)(up)[0]) << 24) + (((long)(up)[1]) << 16) \
  91.               + (((long)(up)[2]) <<  8) +  ((long)(up)[3]) )
  92.  
  93. #define MAX_CDB 12
  94. #define MAX_SENSE 14
  95. #define MAX_STATUS 32
  96.  
  97. int in2000_detect(Scsi_Host_Template *);
  98. int in2000_command(Scsi_Cmnd *);
  99. int in2000_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
  100. int in2000_abort(Scsi_Cmnd *);
  101. int in2000_reset(Scsi_Cmnd *);
  102. int in2000_biosparam(Disk *, int, int*);
  103.  
  104.  
  105. #ifndef NULL
  106.     #define NULL 0
  107. #endif
  108.  
  109. /* next may be "SG_NONE" or "SG_ALL" or nr. of (1k) blocks per R/W Cmd. */
  110. #define IN2000_SG SG_ALL
  111. #define IN2000 {NULL, NULL, "Always IN2000", in2000_detect, NULL,    \
  112.         NULL, in2000_command,        \
  113.         in2000_queuecommand,        \
  114.         in2000_abort,            \
  115.         in2000_reset,            \
  116.             NULL,                        \
  117.         in2000_biosparam,               \
  118.         1, 7, IN2000_SG, 1, 0, 0}
  119.  
  120. #endif
  121.