ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / drivers / scsi / dpt / dpti_ioctl.h
1 /***************************************************************************
2                           dpti_ioctl.h  -  description
3                              -------------------
4     begin                : Thu Sep 7 2000
5     copyright            : (C) 2001 by Adaptec
6     email                : deanna_bonds@adaptec.com
7
8     See Documentation/scsi/dpti.txt for history, notes, license info
9     and credits
10  ***************************************************************************/
11
12 /***************************************************************************
13  *                                                                         *
14  *   This program is free software; you can redistribute it and/or modify  *
15  *   it under the terms of the GNU General Public License as published by  *
16  *   the Free Software Foundation; either version 2 of the License, or     *
17  *   (at your option) any later version.                                   *
18  *                                                                         *
19  ***************************************************************************/
20
21 /***************************************************************************
22  * This file is generated from  osd_unix.h                                 *
23  * *************************************************************************/
24
25 #ifndef _dpti_ioctl_h
26 #define _dpti_ioctl_h
27
28 // IOCTL interface commands
29
30 #ifndef _IOWR
31 # define _IOWR(x,y,z)   (((x)<<8)|y)
32 #endif
33 #ifndef _IOW
34 # define _IOW(x,y,z)    (((x)<<8)|y)
35 #endif
36 #ifndef _IOR
37 # define _IOR(x,y,z)    (((x)<<8)|y)
38 #endif
39 #ifndef _IO
40 # define _IO(x,y)       (((x)<<8)|y)
41 #endif
42 /* EATA PassThrough Command     */
43 #define EATAUSRCMD      _IOWR('D',65,EATA_CP)
44 /* Set Debug Level If Enabled   */
45 #define DPT_DEBUG       _IOW('D',66,int)
46 /* Get Signature Structure      */
47 #define DPT_SIGNATURE   _IOR('D',67,dpt_sig_S)
48 #if defined __bsdi__
49 #define DPT_SIGNATURE_PACKED   _IOR('D',67,dpt_sig_S_Packed)
50 #endif
51 /* Get Number Of DPT Adapters   */
52 #define DPT_NUMCTRLS    _IOR('D',68,int)
53 /* Get Adapter Info Structure   */
54 #define DPT_CTRLINFO    _IOR('D',69,CtrlInfo)
55 /* Get Statistics If Enabled    */
56 #define DPT_STATINFO    _IO('D',70)
57 /* Clear Stats If Enabled       */
58 #define DPT_CLRSTAT     _IO('D',71)
59 /* Get System Info Structure    */
60 #define DPT_SYSINFO     _IOR('D',72,sysInfo_S)
61 /* Set Timeout Value            */
62 #define DPT_TIMEOUT     _IO('D',73)
63 /* Get config Data              */
64 #define DPT_CONFIG      _IO('D',74)
65 /* Get Blink LED Code           */
66 #define DPT_BLINKLED    _IOR('D',75,int)
67 /* Get Statistical information (if available) */
68 #define DPT_STATS_INFO        _IOR('D',80,STATS_DATA)
69 /* Clear the statistical information          */
70 #define DPT_STATS_CLEAR       _IO('D',81)
71 /* Get Performance metrics */
72 #define DPT_PERF_INFO        _IOR('D',82,dpt_perf_t)
73 /* Send an I2O command */
74 #define I2OUSRCMD       _IO('D',76)
75 /* Inform driver to re-acquire LCT information */
76 #define I2ORESCANCMD    _IO('D',77)
77 /* Inform driver to reset adapter */
78 #define I2ORESETCMD     _IO('D',78)
79 /* See if the target is mounted */
80 #define DPT_TARGET_BUSY _IOR('D',79, TARGET_BUSY_T)
81
82
83   /* Structure Returned From Get Controller Info                             */
84
85 typedef struct {
86         uCHAR    state;            /* Operational state               */
87         uCHAR    id;               /* Host adapter SCSI id            */
88         int      vect;             /* Interrupt vector number         */
89         int      base;             /* Base I/O address                */
90         int      njobs;            /* # of jobs sent to HA            */
91         int      qdepth;           /* Controller queue depth.         */
92         int      wakebase;         /* mpx wakeup base index.          */
93         uLONG    SGsize;           /* Scatter/Gather list size.       */
94         unsigned heads;            /* heads for drives on cntlr.      */
95         unsigned sectors;          /* sectors for drives on cntlr.    */
96         uCHAR    do_drive32;       /* Flag for Above 16 MB Ability    */
97         uCHAR    BusQuiet;         /* SCSI Bus Quiet Flag             */
98         char     idPAL[4];         /* 4 Bytes Of The ID Pal           */
99         uCHAR    primary;          /* 1 For Primary, 0 For Secondary  */
100         uCHAR    eataVersion;      /* EATA Version                    */
101         uLONG    cpLength;         /* EATA Command Packet Length      */
102         uLONG    spLength;         /* EATA Status Packet Length       */
103         uCHAR    drqNum;           /* DRQ Index (0,5,6,7)             */ 
104         uCHAR    flag1;            /* EATA Flags 1 (Byte 9)           */
105         uCHAR    flag2;            /* EATA Flags 2 (Byte 30)          */
106 } CtrlInfo;
107
108 typedef struct {
109         uSHORT length;          // Remaining length of this
110         uSHORT drvrHBAnum;      // Relative HBA # used by the driver
111         uLONG baseAddr;         // Base I/O address
112         uSHORT blinkState;      // Blink LED state (0=Not in blink LED)
113         uCHAR pciBusNum;        // PCI Bus # (Optional)
114         uCHAR pciDeviceNum;     // PCI Device # (Optional)
115         uSHORT hbaFlags;        // Miscellaneous HBA flags
116         uSHORT Interrupt;       // Interrupt set for this device.
117 #   if (defined(_DPT_ARC))
118         uLONG baseLength;
119         ADAPTER_OBJECT *AdapterObject;
120         LARGE_INTEGER DmaLogicalAddress;
121         PVOID DmaVirtualAddress;
122         LARGE_INTEGER ReplyLogicalAddress;
123         PVOID ReplyVirtualAddress;
124 #   else
125         uLONG reserved1;        // Reserved for future expansion
126         uLONG reserved2;        // Reserved for future expansion
127         uLONG reserved3;        // Reserved for future expansion
128 #   endif
129 } drvrHBAinfo_S;
130
131 typedef struct TARGET_BUSY
132 {
133   uLONG channel;
134   uLONG id;
135   uLONG lun;
136   uLONG isBusy;
137 } TARGET_BUSY_T;
138
139 #endif
140