c2767dbf1aa632f8efad7b686ed093b83b46b0af
[dragonfly.git] / sys / dev / raid / asr / osd_unix.h
1 /* $FreeBSD: src/sys/dev/asr/osd_unix.h,v 1.1.2.2 2001/08/23 05:21:29 scottl Exp $ */
2 /* $DragonFly: src/sys/dev/raid/asr/osd_unix.h,v 1.3 2004/07/02 15:53:01 joerg Exp $ */
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         __OSD_UNIX_H
26 #define         __OSD_UNIX_H
27
28 /*File - OSD_UNIX.H */
29 /*****************************************************************************/
30 /*                                                                           */
31 /*Description:                                                               */
32 /*                                                                           */
33 /*    This file contains definitions for the UNIX OS dependent layer of the  */
34 /*DPT engine.                                                                */
35 /*                                                                           */
36 /*Copyright Distributed Processing Technology, Corp.                         */
37 /*        140 Candace Dr.                                                    */
38 /*        Maitland, Fl. 32751   USA                                          */
39 /*        Phone: (407) 830-5522  Fax: (407) 260-5366                         */
40 /*        All Rights Reserved                                                */
41 /*                                                                           */
42 /*Author:       Bob Pasteur                                                  */
43 /*Date:         5/28/93                                                      */
44 /*                                                                           */
45 /*Editors:                                                                   */
46 /*              3/7/96  salyzyn@dpt.com                                      */
47 /*                      Added BSDi extensions                                */
48 /*              30/9/99 salyzyn@dpt.com                                      */
49 /*                      Added I2ORESCANCMD                                   */
50 /*              7/12/99 salyzyn@dpt.com                                      */
51 /*                      Added I2ORESETCMD                                    */
52 /*                                                                           */
53 /*Remarks:                                                                   */
54 /*                                                                           */
55 /*                                                                           */
56 /*****************************************************************************/
57
58 /* Definitions - Defines & Constants ---------------------------------------*/
59
60 #define DPT_TurnAroundKey  0x01    /* TurnAround Message Type for engine      */
61 #define DPT_EngineKey      0x02    /* Message Que and Type for engine         */
62 #define DPT_LoggerKey      0x03    /* Message Type For Logger                 */
63 #define DPT_CommEngineKey  0x04    /* Message Que Type Created                */
64  
65 #define MSG_RECEIVE    0x40000000  /* Ored Into Logger PID For Return Msg     */
66
67 #define ENGMSG_ECHO        0x00    /* Turnarround Echo Engine Message         */
68 #define ENGMSG_OPEN        0x01    /* Turnarround Open Engine Message         */
69 #define ENGMSG_CLOSE       0x02    /* Turnarround Close Engine Message        */
70
71   /* Message Que Creation Flags */
72
73 #define MSG_URD            00400  
74 #define MSG_UWR            00200  
75 #define MSG_GRD            00040  
76 #define MSG_GWR            00020  
77 #define MSG_ORD            00004  
78 #define MSG_OWR            00002  
79 #define MSG_ALLRD          00444
80 #define MSG_ALLWR          00222
81
82   /* Message Que Creation Flags */
83
84 #define SHM_URD            00400  
85 #define SHM_UWR            00200  
86 #define SHM_GRD            00040  
87 #define SHM_GWR            00020  
88 #define SHM_ORD            00004  
89 #define SHM_OWR            00002  
90 #define SHM_ALLRD          00444
91 #define SHM_ALLWR          00222
92
93   /* Program Exit Codes */
94
95 #define ExitGoodStatus           0
96 #define ExitBadParameter         1
97 #define ExitSignalFail           3
98 #define ExitMsqAllocFail         5
99 #define ExitBuffAllocFail        6
100 #define ExitMsgSendFail          8
101 #define ExitMsgReceiveFail       9
102
103 #define ExitEngOpenFail          10
104 #define ExitDuplicateEngine      11
105
106 #define ExitCommAllocFail        12 
107 #define ExitDuplicateCommEng     13
108 #define ExitCommConnectFail      14
109
110 #ifndef MAX_HAS
111
112 #define MAX_HAS                  18
113 #define MAX_NAME                 100
114
115 #endif  /* ifndef MAX_HAS */
116
117
118 typedef struct {
119         uCHAR ConfigLength[4];       /* Len in bytes after this field.      */
120         uCHAR EATAsignature[4];
121         uCHAR EATAversion;
122         uCHAR Flags1;                
123         uCHAR PadLength[2];
124         uCHAR HBA[4];
125         uCHAR CPlength[4];           /* Command Packet Length               */
126         uCHAR SPlength[4];           /* Status Packet Length                */
127         uCHAR QueueSize[2];          /* Controller Que depth                */
128         uCHAR SG_Size[4];
129         uCHAR Flags2;
130         uCHAR Reserved0;             /* Reserved Field                       */
131         uCHAR Flags3;
132         uCHAR ScsiValues; 
133         uCHAR MaxLUN;                /* Maximun LUN Supported                */ 
134         uCHAR Flags4;
135         uCHAR RaidNum;               /* RAID HBA Number For Stripping        */
136         uCHAR Reserved3;             /* Reserved Field                       */
137                } DptReadConfig_t;
138
139 #if defined ( _DPT_SOLARIS )
140
141 #include <sys/types.h>
142 #include <sys/ddidmareq.h>
143 #include <sys/mutex.h>
144 #include <sys/scsi/scsi.h>
145 //#define _KERNEL
146 #include <sys/dditypes.h>
147 #include <sys/ddi_impldefs.h>
148 #include <sys/scsi/impl/transport.h>
149 //#undef _KERNEL
150
151 #undef MSG_DISCONNECT
152 #define MSG_DISCONNECT  0x11L
153
154 #define EATAUSRCMD     1
155 #define DPT_SIGNATURE  2
156 #define DPT_NUMCTRLS   3
157 #define DPT_CTRLINFO   4
158 #define DPT_SYSINFO    5
159 #define DPT_BLINKLED   6
160 #define I2OUSRCMD      7
161 //#define I2ORESCANCMD 8        /* Use DPT_IO_ACCESS instead */
162 //#define I2ORESETCMD  9        /* Use DPT_IO_ACCESS instead */
163
164 #define DPT_MAX_DMA_SEGS  32         /* Max used Scatter/Gather seg         */
165
166 struct dpt_sg {
167        paddr_t data_addr;
168        uLONG data_len;
169               };
170
171 typedef struct {
172         uSHORT NumHBAs;
173         uLONG IOAddrs[18];
174                } GetHbaInfo_t;
175
176 #elif defined(_DPT_DGUX)
177
178 #ifndef _IOWR
179 # define _IOWR(x,y,z)   (0x0fff3900|y)
180 #endif
181 #ifndef _IOW
182 # define _IOW(x,y,z)    (0x0fff3900|y)
183 #endif
184 #ifndef _IOR
185 # define _IOR(x,y,z)    (0x0fff3900|y)
186 #endif
187 #ifndef _IO
188 # define _IO(x,y)       (0x0fff3900|y)
189 #endif
190 /* EATA PassThrough Command     */
191 #define EATAUSRCMD      _IOWR('D',65,EATA_CP)
192 /* Get Signature Structure      */
193 #define DPT_SIGNATURE   _IOR('D',67,dpt_sig_S)
194 /* Get Number Of DPT Adapters   */
195 #define DPT_NUMCTRLS    _IOR('D',68,int)
196 /* Get Adapter Info Structure   */
197 #define DPT_CTRLINFO    _IOR('D',69,CtrlInfo)
198 /* Get System Info Structure    */
199 #define DPT_SYSINFO     _IOR('D',72,sysInfo_S)
200 /* Get Blink LED Code           */
201 #define DPT_BLINKLED    _IOR('D',75,int)
202 /* Get Statistical information (if available) */
203 #define DPT_STATS_INFO        _IOR('D',80,STATS_DATA)
204 /* Clear the statistical information          */
205 #define DPT_STATS_CLEAR       _IO('D',81)
206 /* Send an I2O command */
207 #define I2OUSRCMD       _IO('D',76)
208 /* Inform driver to re-acquire LCT information */
209 #define I2ORESCANCMD    _IO('D',77)
210 /* Inform driver to reset adapter */
211 #define I2ORESETCMD     _IO('D',78)
212
213 #elif defined (SNI_MIPS)
214   /* Unix Ioctl Command definitions */
215
216 #define EATAUSRCMD     (('D'<<8)|65)
217 #define DPT_DEBUG      (('D'<<8)|66)
218 #define DPT_SIGNATURE  (('D'<<8)|67)
219 #define DPT_NUMCTRLS   (('D'<<8)|68)
220 #define DPT_CTRLINFO   (('D'<<8)|69)
221 #define DPT_STATINFO   (('D'<<8)|70)
222 #define DPT_CLRSTAT    (('D'<<8)|71)
223 #define DPT_SYSINFO    (('D'<<8)|72)
224 /* Set Timeout Value            */
225 #define DPT_TIMEOUT    (('D'<<8)|73)
226 /* Get config Data              */
227 #define DPT_CONFIG     (('D'<<8)|74)
228 /* Get config Data              */
229 #define DPT_BLINKLED   (('D'<<8)|75)
230 /* Get Statistical information (if available) */
231 #define DPT_STATS_INFO        (('D'<<8)|80)
232 /* Clear the statistical information          */
233 #define DPT_STATS_CLEAR       (('D'<<8)|81)
234 /* Send an I2O command */
235 #define I2OUSRCMD       (('D'<<8)|76)
236 /* Inform driver to re-acquire LCT information */
237 #define I2ORESCANCMD    (('D'<<8)|77)
238 /* Inform driver to reset adapter */
239 #define I2ORESETCMD     (('D'<<8)|78)
240
241 #else  
242
243   /* Unix Ioctl Command definitions */
244
245 #ifdef _DPT_AIX
246
247 #undef _IOWR
248 #undef _IOW
249 #undef _IOR
250 #undef _IO
251 #endif
252
253 #ifndef _IOWR
254 # define _IOWR(x,y,z)   (((x)<<8)|y)
255 #endif
256 #ifndef _IOW
257 # define _IOW(x,y,z)    (((x)<<8)|y)
258 #endif
259 #ifndef _IOR
260 # define _IOR(x,y,z)    (((x)<<8)|y)
261 #endif
262 #ifndef _IO
263 # define _IO(x,y)       (((x)<<8)|y)
264 #endif
265 /* EATA PassThrough Command     */
266 #define EATAUSRCMD      _IOWR('D',65,EATA_CP)
267 /* Set Debug Level If Enabled   */
268 #define DPT_DEBUG       _IOW('D',66,int)
269 /* Get Signature Structure      */
270 #define DPT_SIGNATURE   _IOR('D',67,dpt_sig_S)
271 #if defined __bsdi__
272 #define DPT_SIGNATURE_PACKED   _IOR('D',67,dpt_sig_S_Packed)
273 #endif
274 /* Get Number Of DPT Adapters   */
275 #define DPT_NUMCTRLS    _IOR('D',68,int)
276 /* Get Adapter Info Structure   */
277 #define DPT_CTRLINFO    _IOR('D',69,CtrlInfo)
278 /* Get Statistics If Enabled    */
279 #define DPT_STATINFO    _IO('D',70)
280 /* Clear Stats If Enabled       */
281 #define DPT_CLRSTAT     _IO('D',71)
282 /* Get System Info Structure    */
283 #define DPT_SYSINFO     _IOR('D',72,sysInfo_S)
284 /* Set Timeout Value            */
285 #define DPT_TIMEOUT     _IO('D',73)
286 /* Get config Data              */
287 #define DPT_CONFIG      _IO('D',74)
288 /* Get Blink LED Code           */
289 #define DPT_BLINKLED    _IOR('D',75,int)
290 /* Get Statistical information (if available) */
291 #define DPT_STATS_INFO        _IOR('D',80,STATS_DATA)
292 /* Clear the statistical information          */
293 #define DPT_STATS_CLEAR       _IO('D',81)
294 /* Get Performance metrics */
295 #define DPT_PERF_INFO        _IOR('D',82,dpt_perf_t)
296 /* Send an I2O command */
297 #define I2OUSRCMD       _IO('D',76)
298 /* Inform driver to re-acquire LCT information */
299 #define I2ORESCANCMD    _IO('D',77)
300 /* Inform driver to reset adapter */
301 #define I2ORESETCMD     _IO('D',78)
302 #if defined _DPT_LINUX
303 /* See if the target is mounted */
304 #define DPT_TARGET_BUSY _IOR('D',79, TARGET_BUSY_T)
305 #endif
306
307
308 #endif  /* _DPT_SOLARIS else */
309
310                  /* Adapter Flags Field Bit Definitions */
311
312 #define CTLR_INSTALLED  0x00000001  /* Adapter Was Installed        */
313 #define CTLR_DMA        0x00000002  /* DMA Supported                */
314 #define CTLR_OVERLAP    0x00000004  /* Overlapped Commands Support  */
315 #define CTLR_SECONDARY  0x00000008  /* I/O Address Not 0x1f0        */
316 #define CTLR_BLINKLED   0x00000010  /* Adapter In Blink LED State   */
317 #define CTLR_HBACI      0x00000020  /* Cache Inhibit Supported      */
318 #define CTLR_CACHE      0x00000040  /* Adapter Has Cache            */
319 #define CTLR_SANE       0x00000080  /* Adapter Functioning OK       */
320 #define CTLR_BUS_QUIET  0x00000100  /* Bus Quite On This Adapter    */
321 #define CTLR_ABOVE_16   0x00000200  /* Support For Mem. Above 16 MB */
322 #define CTLR_SCAT_GATH  0x00000400  /* Scatter Gather Supported     */
323
324
325 /* Definitions - Structure & Typedef ---------------------------------------*/
326
327 typedef struct {
328                  uLONG     MsgID;
329                  DPT_TAG_T engineTag;
330                  DPT_TAG_T targetTag;
331                  DPT_MSG_T engEvent;
332                  long      BufferID;
333                  uLONG     FromEngBuffOffset;
334                  uLONG     callerID;
335                  DPT_RTN_T result;
336                  uLONG     timeOut;
337                } MsgHdr;
338
339 #define MsgDataSize sizeof(MsgHdr) - 4
340
341 #ifndef SNI_MIPS
342
343 /*-------------------------------------------------------------------------*/
344 /*                     EATA Command Packet definition                      */
345 /*-------------------------------------------------------------------------*/
346
347 typedef struct EATACommandPacket {
348
349 #ifdef _DPT_UNIXWARE
350
351         uCHAR     EataID[4];
352         uINT      EataCmd;
353         uCHAR     *CmdBuffer;
354
355 #endif   /* _DPT_UNIXWARE */
356
357 #ifdef _DPT_AIX
358
359         uCHAR     HbaTargetID;
360         uCHAR     HbaLUN;
361  
362 #endif  /* _DPT_AIX */
363
364         uCHAR    cp_Flags1;          /* Command Flags                       */
365         uCHAR    cp_Req_Len;         /* AutoRequestSense Data length.       */
366         uCHAR    cp_Resv1[3];        /* Reserved Fields                     */
367         uCHAR    cp_Flags2; 
368         uCHAR    cp_Flags3;
369         uCHAR    cp_ScsiAddr;
370         uCHAR    cp_msg0;            /* Identify and Disconnect Message.    */
371         uCHAR    cp_msg1;
372         uCHAR    cp_msg2;
373         uCHAR    cp_msg3;
374         uCHAR    cp_cdb[12];         /* SCSI cdb for command.               */
375         uLONG    cp_dataLen;         /* Data length in Bytes for command.   */
376         uLONG    cp_Vue;             /* Vendor Unique Area                  */
377         uCHAR    *cp_DataAddr;       /* Data Address For The Command.       */
378         uCHAR    *cp_SpAddr;         /* Status Packet Physical Address.     */
379         uCHAR    *cp_SenseAddr;      /* AutoRequestSense Data Phy Address.  */
380
381 #ifdef _DPT_SOLARIS
382
383         uCHAR     HostStatus;
384         uCHAR     TargetStatus;
385         uCHAR     CdbLength;
386         uCHAR     SG_Size;
387         struct scsi_arq_status ReqSenseData;
388         struct  dpt_sg SG_List[DPT_MAX_DMA_SEGS];
389         union {
390                 char *b_scratch;
391                 struct scsi_cmd *b_ownerp; 
392               } cc;
393         paddr_t ccb_paddr;
394         uSHORT IOAddress;
395         
396 #else  /* _DPT_SOLARIS */
397
398         uLONG     TimeOut ;
399         uCHAR     HostStatus;
400         uCHAR     TargetStatus;
401         uCHAR     Retries; 
402
403 #endif  /* _DPT_SOLARIS else */
404
405                                   } EATA_CP;
406 #endif /* SNI_MIPS */
407
408
409                       /* Control Flags 1 Definitions */
410
411 #define SCSI_RESET        0x01       /* Cause a SCSI Bus reset on the cmd */
412 #define HBA_INIT          0x02       /* Cause Controller to reInitialize  */
413 #define AUTO_REQ_SENSE    0x04       /* Do Auto Request Sense on errors   */
414 #define SCATTER_GATHER    0x08       /* Data Ptr points to a SG Packet    */
415 #define INTERPRET         0x20       /* Interpret the SCSI cdb of own use */
416 #define DATA_OUT          0x04       /* Data Out phase with command       */
417 #define DATA_IN           0x08       /* Data In phase with command        */
418
419                       /* Control Flags 2 Definitions */
420
421 #define FIRMWARE_NESTED   0x01
422
423
424                       /* Control Flags 3 Definitions */
425
426 #define PHYSICAL_UNIT     0x01       /* Send Command Directly To Target   */
427 #define IAT               0x02       /* Inhibit Address Translation       */
428 #define HBACI             0x04       /* Inhibit Caching                   */
429
430
431   /* Structure Returned From Get Controller Info                             */
432
433 typedef struct {
434
435         uCHAR    state;            /* Operational state               */
436         uCHAR    id;               /* Host adapter SCSI id            */
437         int      vect;             /* Interrupt vector number         */
438         int      base;             /* Base I/O address                */
439         int      njobs;            /* # of jobs sent to HA            */
440         int      qdepth;           /* Controller queue depth.         */
441         int      wakebase;         /* mpx wakeup base index.          */
442         uLONG    SGsize;           /* Scatter/Gather list size.       */
443         unsigned heads;            /* heads for drives on cntlr.      */
444         unsigned sectors;          /* sectors for drives on cntlr.    */
445         uCHAR    do_drive32;       /* Flag for Above 16 MB Ability    */
446         uCHAR    BusQuiet;         /* SCSI Bus Quiet Flag             */
447         char     idPAL[4];         /* 4 Bytes Of The ID Pal           */
448         uCHAR    primary;          /* 1 For Primary, 0 For Secondary  */
449         uCHAR    eataVersion;      /* EATA Version                    */
450         uLONG    cpLength;         /* EATA Command Packet Length      */
451         uLONG    spLength;         /* EATA Status Packet Length       */
452         uCHAR    drqNum;           /* DRQ Index (0,5,6,7)             */ 
453         uCHAR    flag1;            /* EATA Flags 1 (Byte 9)           */
454         uCHAR    flag2;            /* EATA Flags 2 (Byte 30)          */
455
456                } CtrlInfo;
457
458 #ifndef SNI_MIPS
459 #ifdef _DPT_UNIXWARE
460
461 typedef struct {
462
463         uINT     state;            /* Operational state            */ 
464         uCHAR    id[4];            /* Host adapter SCSI id         */ 
465         uINT     vect;             /* Interrupt vector number      */ 
466         uLONG    base;             /* Base I/O address             */ 
467         int      ha_max_jobs;      /* Max number of Active Jobs    */
468         uLONG    ha_cacheParams;
469         int      ha_nbus;          /* Number Of Busses on HBA      */
470         int      ha_ntargets;      /* Number Of Targets Supported  */
471         int      ha_nluns;         /* Number Of LUNs Supported     */
472         int      ha_tshift;        /* Shift value for target       */
473         int      ha_bshift;        /* Shift value for bus          */
474         uINT     ha_npend;         /* # of jobs sent to HA         */
475         int      ha_active_jobs;   /* Number Of Active Jobs        */
476
477                } HbaInfo;
478
479         /* SDI ioctl prefix for hba specific ioctl's */
480
481 #define SDI_IOC        (('S'<<24)|('D'<<16)|('I'<<8))
482
483 #define SDI_HBANAME    ((SDI_IOC)|0x14) /* Get HBA module name      */
484 #define SDI_SEND       0x0081           /* Send a SCSI command      */
485
486 #else
487
488 typedef struct {
489
490         uLONG  flags;            /* Operational State Flags         */
491         uCHAR  id[4];            /* Host Adapter SCSI ID            */
492         int    vect;             /* Interrupt Vector Number         */
493         int    base;             /* Base I/O Address                */
494         int    njobs;            /* # Of CCBs Outstanding To HBA    */
495         int    qdepth;           /* Controller Queue depth.         */
496         uLONG  SGsize;           /* Scatter/Gather List Size.       */
497         char   idPAL[4];         /* 4 Bytes Of The ID Pal           */
498         uCHAR  eataVersion;      /* EATA Version                    */
499         uLONG  cpLength;         /* EATA Command Packet Length      */
500         uLONG  spLength;         /* EATA Status Packet Length       */
501         uCHAR  drqNum;           /* DRQ Index (0,5,6,7)             */ 
502         uCHAR  eataflag1;        /* EATA Flags 1 (Byte 9)           */
503         uCHAR  eataflag2;        /* EATA Flags 2 (Byte 30)          */
504         uCHAR  maxChannel;       /* Maximum Channel Number          */
505         uCHAR  maxID;            /* Maximum Target ID               */
506         uCHAR  maxLUN;           /* Maximum LUN                     */
507         uCHAR  HbaBusType;       /* HBA Bus Type, EISA, PCI, etc    */
508         uCHAR  RaidNum;          /* Host Adapter RAID Number        */  
509
510                } HbaInfo;
511
512 #endif  /* _DPT_UNIXWARE */
513 #endif /* SNI_MIPS */
514
515
516 #ifdef _DPT_AIX
517
518 /*
519  * DPT Host Adapter config information structure - this structure contains
520  * configuration information about an adapter.  It is imbedded into the 
521  * dpt_ctl structure.
522  */
523
524 typedef struct dpt_cfg {
525     uchar       flags;                  /* Operational state flags      */
526     uchar       id[4];                  /* Host adapter SCSI IDs        */
527     int         vect;                   /* Interrupt vector number      */
528     ulong       base_addr;              /* Base I/O address             */
529     int         qdepth;                 /* Controller queue depth.      */
530     ulong       SGsize;                 /* Max scatter/gather list sz   */
531     ulong       SGmax;                  /* Max s/g we can use per req   */
532     uchar       eataVersion;            /* EATA version                 */
533     ushort      cpPadLen;               /* # of pad bytes sent to HA for
534                                            PIO commands                 */
535     ulong       cpLength;               /* EATA Command Packet length   */
536     ulong       spLength;               /* EATA Status Packet length    */
537     uchar       eataflag1;              /* EATA Flags 1 (Byte 9)        */
538     uchar       eataflag2;              /* EATA Flags 2 (Byte 30)       */
539     uchar       maxChan;                /* Maximum Channel number       */
540     uchar       maxID;                  /* Maximum target ID            */
541     uchar       maxLUN;                 /* Maximum LUN                  */
542     uchar       HbaBusType;             /* HBA bus type, EISA, PCI, etc */
543     uchar       RaidNum;                /* Host adapter RAID number     */
544 } DptCfg_t;
545
546 #endif /* _DPT_AIX */
547
548
549 #define MAX_ELEMENT_COUNT        64
550 #define MAX_BUCKET_COUNT         10
551
552 /*
553  * DPT statistics structure definitions
554  */
555 typedef struct IO_SIZE_STATS 
556 {
557   uLONG TotalIoCount;
558   uLONG IoCountRead;
559   uLONG IoCountReadSg;
560   uLONG IoCountWrite;
561   uLONG IoCountWriteSg;
562   uLONG UnalignedIoAddress;
563   uLONG SgElementCount[MAX_ELEMENT_COUNT];
564
565 } IO_SIZE_STATS_T, *pIO_SIZE_STATS_T;
566
567 typedef struct STATS_DATA 
568 {
569   uLONG TotalIoCount;
570   uLONG TotalUnCachedIoCount;
571   uLONG MaxOutstandingIoCount;
572   uLONG CurrentOutstandingIoCount;
573   uLONG OutstandingIoRunningCount;
574   uLONG UnalignedPktCount;
575   uLONG UnalignedSgCount;
576   uLONG NonPageListAddressSgCount;
577   uLONG MaxMessagesPerInterrupt;
578   IO_SIZE_STATS_T IoSize[MAX_BUCKET_COUNT];
579
580 } STATS_DATA_T, *pSTATS_DATA_T;
581
582 typedef struct TARGET_BUSY
583 {
584   uLONG channel;
585   uLONG id;
586   uLONG lun;
587   uLONG isBusy;
588 } TARGET_BUSY_T;
589 #endif /* __OSD_UNIX_H */