Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
[pandora-kernel.git] / drivers / scsi / dpt / dptsig.h
1 /*      BSDI dptsig.h,v 1.7 1998/06/03 19:15:00 karels Exp      */
2
3 /*
4  * Copyright (c) 1996-1999 Distributed Processing Technology Corporation
5  * All rights reserved.
6  *
7  * Redistribution and use in source form, with or without modification, are
8  * permitted provided that redistributions of source code must retain the
9  * above copyright notice, this list of conditions and the following disclaimer.
10  *
11  * This software is provided `as is' by Distributed Processing Technology and
12  * any express or implied warranties, including, but not limited to, the
13  * implied warranties of merchantability and fitness for a particular purpose,
14  * are disclaimed. In no event shall Distributed Processing Technology be
15  * liable for any direct, indirect, incidental, special, exemplary or
16  * consequential damages (including, but not limited to, procurement of
17  * substitute goods or services; loss of use, data, or profits; or business
18  * interruptions) however caused and on any theory of liability, whether in
19  * contract, strict liability, or tort (including negligence or otherwise)
20  * arising in any way out of the use of this driver software, even if advised
21  * of the possibility of such damage.
22  *
23  */
24
25 #ifndef __DPTSIG_H_
26 #define __DPTSIG_H_
27 #ifdef _SINIX_ADDON
28 #include "dpt.h"
29 #endif
30 /* DPT SIGNATURE SPEC AND HEADER FILE                           */
31 /* Signature Version 1 (sorry no 'A')                           */
32
33 /* to make sure we are talking the same size under all OS's     */
34 typedef unsigned char sigBYTE;
35 typedef unsigned short sigWORD;
36 #if (defined(_MULTI_DATAMODEL) && defined(sun) && !defined(_ILP32))
37 typedef uint32_t sigLONG;
38 #else
39 typedef unsigned long sigLONG;
40 #endif
41
42 /*
43  * use sigWORDLittleEndian for:
44  *  dsCapabilities
45  *  dsDeviceSupp
46  *  dsAdapterSupp
47  *  dsApplication
48  * use sigLONGLittleEndian for:
49  *      dsOS
50  * so that the sig can be standardised to Little Endian
51  */
52 #if (defined(_DPT_BIG_ENDIAN))
53 # define sigWORDLittleEndian(x) ((((x)&0xFF)<<8)|(((x)>>8)&0xFF))
54 # define sigLONGLittleEndian(x) \
55         ((((x)&0xFF)<<24) |             \
56          (((x)&0xFF00)<<8) |    \
57          (((x)&0xFF0000L)>>8) | \
58          (((x)&0xFF000000L)>>24))
59 #else
60 # define sigWORDLittleEndian(x) (x)
61 # define sigLONGLittleEndian(x) (x)
62 #endif
63
64 /* must make sure the structure is not word or double-word aligned      */
65 /* ---------------------------------------------------------------      */
66 /* Borland will ignore the following pragma:                            */
67 /* Word alignment is OFF by default.  If in the, IDE make               */
68 /* sure that Options | Compiler | Code Generation | Word Alignment      */
69 /* is not checked.  If using BCC, do not use the -a option.             */
70
71 #ifndef NO_PACK
72 #if defined (_DPT_AIX)
73 #pragma options align=packed
74 #else
75 #pragma pack(1)
76 #endif  /* aix */
77 #endif
78 /* For the Macintosh */
79 #ifdef STRUCTALIGNMENTSUPPORTED
80 #pragma options align=mac68k
81 #endif
82
83
84 /* Current Signature Version - sigBYTE dsSigVersion; */
85 /* ------------------------------------------------------------------ */
86 #define SIG_VERSION 1
87
88 /* Processor Family - sigBYTE dsProcessorFamily;  DISTINCT VALUES */
89 /* ------------------------------------------------------------------ */
90 /* What type of processor the file is meant to run on. */
91 /* This will let us know whether to read sigWORDs as high/low or low/high. */
92 #define PROC_INTEL      0x00    /* Intel 80x86 */
93 #define PROC_MOTOROLA   0x01    /* Motorola 68K */
94 #define PROC_MIPS4000   0x02    /* MIPS RISC 4000 */
95 #define PROC_ALPHA      0x03    /* DEC Alpha */
96 #define PROC_POWERPC    0x04    /* IBM Power PC */
97 #define PROC_i960       0x05    /* Intel i960 */
98 #define PROC_ULTRASPARC 0x06    /* SPARC processor */
99
100 /* Specific Minimim Processor - sigBYTE dsProcessor;    FLAG BITS */
101 /* ------------------------------------------------------------------ */
102 /* Different bit definitions dependent on processor_family */
103
104 /* PROC_INTEL: */
105 #define PROC_8086       0x01    /* Intel 8086 */
106 #define PROC_286        0x02    /* Intel 80286 */
107 #define PROC_386        0x04    /* Intel 80386 */
108 #define PROC_486        0x08    /* Intel 80486 */
109 #define PROC_PENTIUM    0x10    /* Intel 586 aka P5 aka Pentium */
110 #define PROC_SEXIUM     0x20    /* Intel 686 aka P6 aka Pentium Pro or MMX */
111
112 /* PROC_i960: */
113 #define PROC_960RX      0x01    /* Intel 80960RC/RD */
114 #define PROC_960HX      0x02    /* Intel 80960HA/HD/HT */
115
116 /* PROC_MOTOROLA: */
117 #define PROC_68000      0x01    /* Motorola 68000 */
118 #define PROC_68010      0x02    /* Motorola 68010 */
119 #define PROC_68020      0x04    /* Motorola 68020 */
120 #define PROC_68030      0x08    /* Motorola 68030 */
121 #define PROC_68040      0x10    /* Motorola 68040 */
122
123 /* PROC_POWERPC */
124 #define PROC_PPC601             0x01    /* PowerPC 601 */
125 #define PROC_PPC603             0x02    /* PowerPC 603 */
126 #define PROC_PPC604             0x04    /* PowerPC 604 */
127
128 /* PROC_MIPS4000: */
129 #define PROC_R4000      0x01    /* MIPS R4000 */
130
131 /* Filetype - sigBYTE dsFiletype;       DISTINCT VALUES */
132 /* ------------------------------------------------------------------ */
133 #define FT_EXECUTABLE   0       /* Executable Program */
134 #define FT_SCRIPT       1       /* Script/Batch File??? */
135 #define FT_HBADRVR      2       /* HBA Driver */
136 #define FT_OTHERDRVR    3       /* Other Driver */
137 #define FT_IFS          4       /* Installable Filesystem Driver */
138 #define FT_ENGINE       5       /* DPT Engine */
139 #define FT_COMPDRVR     6       /* Compressed Driver Disk */
140 #define FT_LANGUAGE     7       /* Foreign Language file */
141 #define FT_FIRMWARE     8       /* Downloadable or actual Firmware */
142 #define FT_COMMMODL     9       /* Communications Module */
143 #define FT_INT13        10      /* INT 13 style HBA Driver */
144 #define FT_HELPFILE     11      /* Help file */
145 #define FT_LOGGER       12      /* Event Logger */
146 #define FT_INSTALL      13      /* An Install Program */
147 #define FT_LIBRARY      14      /* Storage Manager Real-Mode Calls */
148 #define FT_RESOURCE     15      /* Storage Manager Resource File */
149 #define FT_MODEM_DB     16      /* Storage Manager Modem Database */
150
151 /* Filetype flags - sigBYTE dsFiletypeFlags;    FLAG BITS */
152 /* ------------------------------------------------------------------ */
153 #define FTF_DLL         0x01    /* Dynamic Link Library */
154 #define FTF_NLM         0x02    /* Netware Loadable Module */
155 #define FTF_OVERLAYS    0x04    /* Uses overlays */
156 #define FTF_DEBUG       0x08    /* Debug version */
157 #define FTF_TSR         0x10    /* TSR */
158 #define FTF_SYS         0x20    /* DOS Loadable driver */
159 #define FTF_PROTECTED   0x40    /* Runs in protected mode */
160 #define FTF_APP_SPEC    0x80    /* Application Specific */
161 #define FTF_ROM         (FTF_SYS|FTF_TSR)       /* Special Case */
162
163 /* OEM - sigBYTE dsOEM;         DISTINCT VALUES */
164 /* ------------------------------------------------------------------ */
165 #define OEM_DPT         0       /* DPT */
166 #define OEM_ATT         1       /* ATT */
167 #define OEM_NEC         2       /* NEC */
168 #define OEM_ALPHA       3       /* Alphatronix */
169 #define OEM_AST         4       /* AST */
170 #define OEM_OLIVETTI    5       /* Olivetti */
171 #define OEM_SNI         6       /* Siemens/Nixdorf */
172 #define OEM_SUN         7       /* SUN Microsystems */
173
174 /* Operating System  - sigLONG dsOS;    FLAG BITS */
175 /* ------------------------------------------------------------------ */
176 #define OS_DOS          0x00000001 /* PC/MS-DOS                         */
177 #define OS_WINDOWS      0x00000002 /* Microsoft Windows 3.x             */
178 #define OS_WINDOWS_NT   0x00000004 /* Microsoft Windows NT              */
179 #define OS_OS2M         0x00000008 /* OS/2 1.2.x,MS 1.3.0,IBM 1.3.x - Monolithic */
180 #define OS_OS2L         0x00000010 /* Microsoft OS/2 1.301 - LADDR      */
181 #define OS_OS22x        0x00000020 /* IBM OS/2 2.x                      */
182 #define OS_NW286        0x00000040 /* Novell NetWare 286                */
183 #define OS_NW386        0x00000080 /* Novell NetWare 386                */
184 #define OS_GEN_UNIX     0x00000100 /* Generic Unix                      */
185 #define OS_SCO_UNIX     0x00000200 /* SCO Unix                          */
186 #define OS_ATT_UNIX     0x00000400 /* ATT Unix                          */
187 #define OS_UNIXWARE     0x00000800 /* USL Unix                          */
188 #define OS_INT_UNIX     0x00001000 /* Interactive Unix                  */
189 #define OS_SOLARIS      0x00002000 /* SunSoft Solaris                   */
190 #define OS_QNX          0x00004000 /* QNX for Tom Moch                  */
191 #define OS_NEXTSTEP     0x00008000 /* NeXTSTEP/OPENSTEP/MACH            */
192 #define OS_BANYAN       0x00010000 /* Banyan Vines                      */
193 #define OS_OLIVETTI_UNIX 0x00020000/* Olivetti Unix                     */
194 #define OS_MAC_OS       0x00040000 /* Mac OS                            */
195 #define OS_WINDOWS_95   0x00080000 /* Microsoft Windows '95             */
196 #define OS_NW4x         0x00100000 /* Novell Netware 4.x                */
197 #define OS_BSDI_UNIX    0x00200000 /* BSDi Unix BSD/OS 2.0 and up       */
198 #define OS_AIX_UNIX     0x00400000 /* AIX Unix                          */
199 #define OS_FREE_BSD     0x00800000 /* FreeBSD Unix                      */
200 #define OS_LINUX        0x01000000 /* Linux                             */
201 #define OS_DGUX_UNIX    0x02000000 /* Data General Unix                 */
202 #define OS_SINIX_N      0x04000000 /* SNI SINIX-N                       */
203 #define OS_PLAN9        0x08000000 /* ATT Plan 9                        */
204 #define OS_TSX          0x10000000 /* SNH TSX-32                        */
205
206 #define OS_OTHER        0x80000000 /* Other                             */
207
208 /* Capabilities - sigWORD dsCapabilities;        FLAG BITS */
209 /* ------------------------------------------------------------------ */
210 #define CAP_RAID0       0x0001  /* RAID-0 */
211 #define CAP_RAID1       0x0002  /* RAID-1 */
212 #define CAP_RAID3       0x0004  /* RAID-3 */
213 #define CAP_RAID5       0x0008  /* RAID-5 */
214 #define CAP_SPAN        0x0010  /* Spanning */
215 #define CAP_PASS        0x0020  /* Provides passthrough */
216 #define CAP_OVERLAP     0x0040  /* Passthrough supports overlapped commands */
217 #define CAP_ASPI        0x0080  /* Supports ASPI Command Requests */
218 #define CAP_ABOVE16MB   0x0100  /* ISA Driver supports greater than 16MB */
219 #define CAP_EXTEND      0x8000  /* Extended info appears after description */
220 #ifdef SNI_MIPS
221 #define CAP_CACHEMODE   0x1000  /* dpt_force_cache is set in driver */
222 #endif
223
224 /* Devices Supported - sigWORD dsDeviceSupp;    FLAG BITS */
225 /* ------------------------------------------------------------------ */
226 #define DEV_DASD        0x0001  /* DASD (hard drives) */
227 #define DEV_TAPE        0x0002  /* Tape drives */
228 #define DEV_PRINTER     0x0004  /* Printers */
229 #define DEV_PROC        0x0008  /* Processors */
230 #define DEV_WORM        0x0010  /* WORM drives */
231 #define DEV_CDROM       0x0020  /* CD-ROM drives */
232 #define DEV_SCANNER     0x0040  /* Scanners */
233 #define DEV_OPTICAL     0x0080  /* Optical Drives */
234 #define DEV_JUKEBOX     0x0100  /* Jukebox */
235 #define DEV_COMM        0x0200  /* Communications Devices */
236 #define DEV_OTHER       0x0400  /* Other Devices */
237 #define DEV_ALL         0xFFFF  /* All SCSI Devices */
238
239 /* Adapters Families Supported - sigWORD dsAdapterSupp; FLAG BITS */
240 /* ------------------------------------------------------------------ */
241 #define ADF_2001        0x0001  /* PM2001           */
242 #define ADF_2012A       0x0002  /* PM2012A          */
243 #define ADF_PLUS_ISA    0x0004  /* PM2011,PM2021    */
244 #define ADF_PLUS_EISA   0x0008  /* PM2012B,PM2022   */
245 #define ADF_SC3_ISA     0x0010  /* PM2021           */
246 #define ADF_SC3_EISA    0x0020  /* PM2022,PM2122, etc */
247 #define ADF_SC3_PCI     0x0040  /* SmartCache III PCI */
248 #define ADF_SC4_ISA     0x0080  /* SmartCache IV ISA */
249 #define ADF_SC4_EISA    0x0100  /* SmartCache IV EISA */
250 #define ADF_SC4_PCI     0x0200  /* SmartCache IV PCI */
251 #define ADF_SC5_PCI     0x0400  /* Fifth Generation I2O products */
252 /*
253  *      Combinations of products
254  */
255 #define ADF_ALL_2000    (ADF_2001|ADF_2012A)
256 #define ADF_ALL_PLUS    (ADF_PLUS_ISA|ADF_PLUS_EISA)
257 #define ADF_ALL_SC3     (ADF_SC3_ISA|ADF_SC3_EISA|ADF_SC3_PCI)
258 #define ADF_ALL_SC4     (ADF_SC4_ISA|ADF_SC4_EISA|ADF_SC4_PCI)
259 #define ADF_ALL_SC5     (ADF_SC5_PCI)
260 /* All EATA Cacheing Products */
261 #define ADF_ALL_CACHE   (ADF_ALL_PLUS|ADF_ALL_SC3|ADF_ALL_SC4)
262 /* All EATA Bus Mastering Products */
263 #define ADF_ALL_MASTER  (ADF_2012A|ADF_ALL_CACHE)
264 /* All EATA Adapter Products */
265 #define ADF_ALL_EATA    (ADF_2001|ADF_ALL_MASTER)
266 #define ADF_ALL         ADF_ALL_EATA
267
268 /* Application - sigWORD dsApplication;         FLAG BITS */
269 /* ------------------------------------------------------------------ */
270 #define APP_DPTMGR      0x0001  /* DPT Storage Manager */
271 #define APP_ENGINE      0x0002  /* DPT Engine */
272 #define APP_SYTOS       0x0004  /* Sytron Sytos Plus */
273 #define APP_CHEYENNE    0x0008  /* Cheyenne ARCServe + ARCSolo */
274 #define APP_MSCDEX      0x0010  /* Microsoft CD-ROM extensions */
275 #define APP_NOVABACK    0x0020  /* NovaStor Novaback */
276 #define APP_AIM         0x0040  /* Archive Information Manager */
277
278 /* Requirements - sigBYTE dsRequirements;         FLAG BITS             */
279 /* ------------------------------------------------------------------   */
280 #define REQ_SMARTROM    0x01    /* Requires SmartROM to be present      */
281 #define REQ_DPTDDL      0x02    /* Requires DPTDDL.SYS to be loaded     */
282 #define REQ_HBA_DRIVER  0x04    /* Requires an HBA driver to be loaded  */
283 #define REQ_ASPI_TRAN   0x08    /* Requires an ASPI Transport Modules   */
284 #define REQ_ENGINE      0x10    /* Requires a DPT Engine to be loaded   */
285 #define REQ_COMM_ENG    0x20    /* Requires a DPT Communications Engine */
286
287 /*
288  * You may adjust dsDescription_size with an override to a value less than
289  * 50 so that the structure allocates less real space.
290  */
291 #if (!defined(dsDescription_size))
292 # define dsDescription_size 50
293 #endif
294
295 typedef struct dpt_sig {
296     char    dsSignature[6];      /* ALWAYS "dPtSiG" */
297     sigBYTE dsSigVersion;        /* signature version (currently 1) */
298     sigBYTE dsProcessorFamily;   /* what type of processor */
299     sigBYTE dsProcessor;         /* precise processor */
300     sigBYTE dsFiletype;          /* type of file */
301     sigBYTE dsFiletypeFlags;     /* flags to specify load type, etc. */
302     sigBYTE dsOEM;               /* OEM file was created for */
303     sigLONG dsOS;                /* which Operating systems */
304     sigWORD dsCapabilities;      /* RAID levels, etc. */
305     sigWORD dsDeviceSupp;        /* Types of SCSI devices supported */
306     sigWORD dsAdapterSupp;       /* DPT adapter families supported */
307     sigWORD dsApplication;       /* applications file is for */
308     sigBYTE dsRequirements;      /* Other driver dependencies */
309     sigBYTE dsVersion;           /* 1 */
310     sigBYTE dsRevision;          /* 'J' */
311     sigBYTE dsSubRevision;       /* '9'   ' ' if N/A */
312     sigBYTE dsMonth;             /* creation month */
313     sigBYTE dsDay;               /* creation day */
314     sigBYTE dsYear;              /* creation year since 1980 (1993=13) */
315     /* description (NULL terminated) */
316     char  dsDescription[dsDescription_size];
317 } dpt_sig_S;
318 /* 32 bytes minimum - with no description.  Put NULL at description[0] */
319 /* 81 bytes maximum - with 49 character description plus NULL. */
320
321 /* This line added at Roycroft's request */
322 /* Microsoft's NT compiler gets confused if you do a pack and don't */
323 /* restore it. */
324
325 #ifndef NO_UNPACK
326 #if defined (_DPT_AIX)
327 #pragma options align=reset
328 #elif defined (UNPACK_FOUR)
329 #pragma pack(4)
330 #else
331 #pragma pack()
332 #endif  /* aix */
333 #endif
334 /* For the Macintosh */
335 #ifdef STRUCTALIGNMENTSUPPORTED
336 #pragma options align=reset
337 #endif
338
339 #endif