pci2000.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. /****************************************************************************
  2. * Perceptive Solutions, Inc. PCI-2000 device driver for Linux.
  3. *
  4. * pci2000.h - Linux Host Driver for PCI-2000 IntelliCache SCSI Adapters
  5. *
  6. * Copyright (c) 1997-1999 Perceptive Solutions, Inc.
  7. * All Rights Reserved.
  8. *
  9. * Redistribution and use in source and binary forms, with or without
  10. * modification, are permitted provided that redistributions of source
  11. * code retain the above copyright notice and this comment without
  12. * modification.
  13. *
  14. * Technical updates and product information at:
  15. * http://www.psidisk.com
  16. *
  17. * Please send questions, comments, bug reports to:
  18. * tech@psidisk.com Technical Support
  19. *
  20. ****************************************************************************/
  21. #ifndef _PCI2000_H
  22. #define _PCI2000_H
  23. #include <linux/types.h>
  24. #ifndef PSI_EIDE_SCSIOP
  25. #define PSI_EIDE_SCSIOP 1
  26. #define LINUXVERSION(v,p,s) (((v)<<16) + ((p)<<8) + (s))
  27. /************************************************/
  28. /* definition of standard data types */
  29. /************************************************/
  30. #define CHAR char
  31. #define UCHAR unsigned char
  32. #define SHORT short
  33. #define USHORT unsigned short
  34. #define BOOL long
  35. #define LONG long
  36. #define ULONG unsigned long
  37. #define VOID void
  38. typedef CHAR *PCHAR;
  39. typedef UCHAR *PUCHAR;
  40. typedef SHORT *PSHORT;
  41. typedef USHORT *PUSHORT;
  42. typedef BOOL *PBOOL;
  43. typedef LONG *PLONG;
  44. typedef ULONG *PULONG;
  45. typedef VOID *PVOID;
  46. /************************************************/
  47. /* Misc. macros */
  48. /************************************************/
  49. #define ANY2SCSI(up, p) \
  50. ((UCHAR *)up)[0] = (((ULONG)(p)) >> 8); \
  51. ((UCHAR *)up)[1] = ((ULONG)(p));
  52. #define SCSI2LONG(up) \
  53. ( (((long)*(((UCHAR *)up))) << 16) \
  54. + (((long)(((UCHAR *)up)[1])) << 8) \
  55. + ((long)(((UCHAR *)up)[2])) )
  56. #define XANY2SCSI(up, p) \
  57. ((UCHAR *)up)[0] = ((long)(p)) >> 24; \
  58. ((UCHAR *)up)[1] = ((long)(p)) >> 16; \
  59. ((UCHAR *)up)[2] = ((long)(p)) >> 8; \
  60. ((UCHAR *)up)[3] = ((long)(p));
  61. #define XSCSI2LONG(up) \
  62. ( (((long)(((UCHAR *)up)[0])) << 24) \
  63. + (((long)(((UCHAR *)up)[1])) << 16) \
  64. + (((long)(((UCHAR *)up)[2])) << 8) \
  65. + ((long)(((UCHAR *)up)[3])) )
  66. /************************************************/
  67. /* SCSI CDB operation codes */
  68. /************************************************/
  69. #define SCSIOP_TEST_UNIT_READY 0x00
  70. #define SCSIOP_REZERO_UNIT 0x01
  71. #define SCSIOP_REWIND 0x01
  72. #define SCSIOP_REQUEST_BLOCK_ADDR 0x02
  73. #define SCSIOP_REQUEST_SENSE 0x03
  74. #define SCSIOP_FORMAT_UNIT 0x04
  75. #define SCSIOP_READ_BLOCK_LIMITS 0x05
  76. #define SCSIOP_REASSIGN_BLOCKS 0x07
  77. #define SCSIOP_READ6 0x08
  78. #define SCSIOP_RECEIVE 0x08
  79. #define SCSIOP_WRITE6 0x0A
  80. #define SCSIOP_PRINT 0x0A
  81. #define SCSIOP_SEND 0x0A
  82. #define SCSIOP_SEEK6 0x0B
  83. #define SCSIOP_TRACK_SELECT 0x0B
  84. #define SCSIOP_SLEW_PRINT 0x0B
  85. #define SCSIOP_SEEK_BLOCK 0x0C
  86. #define SCSIOP_PARTITION 0x0D
  87. #define SCSIOP_READ_REVERSE 0x0F
  88. #define SCSIOP_WRITE_FILEMARKS 0x10
  89. #define SCSIOP_FLUSH_BUFFER 0x10
  90. #define SCSIOP_SPACE 0x11
  91. #define SCSIOP_INQUIRY 0x12
  92. #define SCSIOP_VERIFY6 0x13
  93. #define SCSIOP_RECOVER_BUF_DATA 0x14
  94. #define SCSIOP_MODE_SELECT 0x15
  95. #define SCSIOP_RESERVE_UNIT 0x16
  96. #define SCSIOP_RELEASE_UNIT 0x17
  97. #define SCSIOP_COPY 0x18
  98. #define SCSIOP_ERASE 0x19
  99. #define SCSIOP_MODE_SENSE 0x1A
  100. #define SCSIOP_START_STOP_UNIT 0x1B
  101. #define SCSIOP_STOP_PRINT 0x1B
  102. #define SCSIOP_LOAD_UNLOAD 0x1B
  103. #define SCSIOP_RECEIVE_DIAGNOSTIC 0x1C
  104. #define SCSIOP_SEND_DIAGNOSTIC 0x1D
  105. #define SCSIOP_MEDIUM_REMOVAL 0x1E
  106. #define SCSIOP_READ_CAPACITY 0x25
  107. #define SCSIOP_READ 0x28
  108. #define SCSIOP_WRITE 0x2A
  109. #define SCSIOP_SEEK 0x2B
  110. #define SCSIOP_LOCATE 0x2B
  111. #define SCSIOP_WRITE_VERIFY 0x2E
  112. #define SCSIOP_VERIFY 0x2F
  113. #define SCSIOP_SEARCH_DATA_HIGH 0x30
  114. #define SCSIOP_SEARCH_DATA_EQUAL 0x31
  115. #define SCSIOP_SEARCH_DATA_LOW 0x32
  116. #define SCSIOP_SET_LIMITS 0x33
  117. #define SCSIOP_READ_POSITION 0x34
  118. #define SCSIOP_SYNCHRONIZE_CACHE 0x35
  119. #define SCSIOP_COMPARE 0x39
  120. #define SCSIOP_COPY_COMPARE 0x3A
  121. #define SCSIOP_WRITE_DATA_BUFF 0x3B
  122. #define SCSIOP_READ_DATA_BUFF 0x3C
  123. #define SCSIOP_CHANGE_DEFINITION 0x40
  124. #define SCSIOP_READ_SUB_CHANNEL 0x42
  125. #define SCSIOP_READ_TOC 0x43
  126. #define SCSIOP_READ_HEADER 0x44
  127. #define SCSIOP_PLAY_AUDIO 0x45
  128. #define SCSIOP_PLAY_AUDIO_MSF 0x47
  129. #define SCSIOP_PLAY_TRACK_INDEX 0x48
  130. #define SCSIOP_PLAY_TRACK_RELATIVE 0x49
  131. #define SCSIOP_PAUSE_RESUME 0x4B
  132. #define SCSIOP_LOG_SELECT 0x4C
  133. #define SCSIOP_LOG_SENSE 0x4D
  134. #define SCSIOP_MODE_SELECT10 0x55
  135. #define SCSIOP_MODE_SENSE10 0x5A
  136. #define SCSIOP_LOAD_UNLOAD_SLOT 0xA6
  137. #define SCSIOP_MECHANISM_STATUS 0xBD
  138. #define SCSIOP_READ_CD 0xBE
  139. // SCSI read capacity structure
  140. typedef struct _READ_CAPACITY_DATA
  141. {
  142. ULONG blks; /* total blocks (converted to little endian) */
  143. ULONG blksiz; /* size of each (converted to little endian) */
  144. } READ_CAPACITY_DATA, *PREAD_CAPACITY_DATA;
  145. // SCSI inquiry data
  146. typedef struct _INQUIRYDATA
  147. {
  148. UCHAR DeviceType :5;
  149. UCHAR DeviceTypeQualifier :3;
  150. UCHAR DeviceTypeModifier :7;
  151. UCHAR RemovableMedia :1;
  152. UCHAR Versions;
  153. UCHAR ResponseDataFormat;
  154. UCHAR AdditionalLength;
  155. UCHAR Reserved[2];
  156. UCHAR SoftReset :1;
  157. UCHAR CommandQueue :1;
  158. UCHAR Reserved2 :1;
  159. UCHAR LinkedCommands :1;
  160. UCHAR Synchronous :1;
  161. UCHAR Wide16Bit :1;
  162. UCHAR Wide32Bit :1;
  163. UCHAR RelativeAddressing :1;
  164. UCHAR VendorId[8];
  165. UCHAR ProductId[16];
  166. UCHAR ProductRevisionLevel[4];
  167. UCHAR VendorSpecific[20];
  168. UCHAR Reserved3[40];
  169. } INQUIRYDATA, *PINQUIRYDATA;
  170. #endif
  171. // function prototypes
  172. int Pci2000_Detect (struct scsi_host_template *tpnt);
  173. int Pci2000_Command (Scsi_Cmnd *SCpnt);
  174. int Pci2000_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *));
  175. int Pci2000_Abort (Scsi_Cmnd *SCpnt);
  176. int Pci2000_Reset (Scsi_Cmnd *SCpnt, unsigned int flags);
  177. int Pci2000_Release (struct Scsi_Host *pshost);
  178. int Pci2000_BiosParam (struct scsi_device *sdev,
  179. struct block_device *bdev,
  180. sector_t capacity, int geom[]);
  181. #endif