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