


/****************************************************************************
;
; NAME: os.h
;
;
; DESCRIPTION:
;
;       Linux driver header
;
;
; REVISION HISTORY:
;
;       $Log: /ESASHBA2/Linux/driver/os.h $
; 
; 25    11/17/08 11:02a Jseba
; Update CompStatErr table for ESAS2HBA
; 
; 24    10/08/08 10:16a Jseba
; ESASHBA2 is now ESAS2HBA
; 
; 23    9/17/08 2:35p Jseba
; Add MODULE_PARAM_STR (2.6 only); initial ESASHBA2 support
; 
; 22    4/24/08 11:35a Jseba
; Fix SUSE build issue with ESASHBA; embed version information with
; MODULE_VERSION; change LinuxPciUnmapSg
; 
; 21    3/19/08 1:21p Jseba
; Add atto_bios_param for 2.6
; 
; 20    3/05/08 1:52p Jseba
; Include oswrap.h
; 
; 19    2/19/08 9:42a Jseba
; Add some includes for ESASHBA only
; 
; 18    11/06/07 12:57p Jseba
; Define ATTO_RESCANS_ENABLED if its a 2.6 kernel and non-EXPRESS2 build
; 
; 17    9/04/07 2:36p Jseba
; Fix 2.4 builds
; 
; 16    8/06/07 3:25p Jseba
; Support for ESASHBA driver
; 
; 15    3/14/07 4:41p Jseba
; Only include config.h if ATTO_USE_CONFIG_H is defined
; 
; 14    12/06/06 4:40p Jseba
; Don't include atto_cfg.h for 2.4 kernels
; 
; 13    11/08/06 11:36a Jseba
; Include atto_cfg.h
; 
; 12    10/09/06 9:50a Jseba
; Add RS_SCSI_ERROR for ESASRAID
; 
; 11    9/29/06 4:30p Jseba
; Some 2.4 kernels actually know about MODULE_PARM_DESC
; 
; 10    9/27/06 9:44a Jseba
; Include <linux/utsrelease.h> if needed
; 
; 9     9/20/06 9:57a Jseba
; Moved CompStatErr definitions here from osutil.c; added EXPRESS2
; support
; 
; 8     8/28/06 11:19a Jseba
; Support for ESASRAID driver
; 
; 7     7/24/06 4:10p Jseba
; Add no-op MODULE_PARM_DESC for 2.4 builds; pull CELERITYFC_SG_SEGS
; 
; 6     3/21/05 10:28a Jseba
; Define MODULE_PARAM_INT and MODULE_PARAM_LONG for generic module
; paramter declarations
; 
; 5     11/19/04 11:20a Jseba
; 64-bit support;  sysfs support
; 
; 4     3/31/04 3:54p Jseba
; Initial support for 2.6 kernel
; 
; 3     12/09/03 9:52a Jseba
; Rename to celerityfc
; 
; 2     11/18/03 10:24a Jseba
; Add modversions.h here (instead of makefile)
; 
; 1     10/24/03 10:38a Jseba
; Initial entry
; 
; 
;
;
; THIS PROGRAM AND THE INFORMATION CONTAINED HEREIN IS THE PROPERTY OF
; ATTO TECHNOLOGY, INC. AND SHALL NOT BE REPRODUCED, COPIED, OR USED IN
; WHOLE OR IN PART OTHER THAN AS PROVIDED FOR IN THE LICENSE AGREEMENT
; PURSUANT TO WHICH IT WAS FURNISHED.
;
; COPYRIGHT (c) ATTO TECHNOLOGY, INC. 2003
; ALL RIGHTS RESERVED.
;
;***************************************************************************/

#ifndef _OS_H_
#define _OS_H_

#ifdef ATTO_USE_CONFIG_H
#include <linux/config.h>
#endif
#define EXPORT_SYMTAB

#ifndef LINUX_VERSION_CODE
#include <linux/version.h>
#ifndef UTS_RELEASE
#include <linux/utsrelease.h>
#endif
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#include <linux/modversions.h>
#endif

#include <linux/kernel.h>

#include <asm/page.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/segment.h>
#include <asm/uaccess.h>
#include <asm/byteorder.h>
#include <asm/pgtable.h>
#include <linux/types.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/sched.h>
#include <linux/pci.h>
#include <linux/proc_fs.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#include <linux/blk.h>
#include <linux/tqueue.h>
#else
#include <linux/moduleparam.h>
#include <linux/blkdev.h>
#include <linux/workqueue.h>
#endif
#include <linux/vmalloc.h>
#include <linux/interrupt.h>
#define __KERNEL_SYSCALLS__
#include <linux/unistd.h>
#include <linux/smp_lock.h>
#include <linux/module.h>
#include <asm/system.h>

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#include <asm/div64.h>
#include <sd.h>
#include <scsi.h>
#include <hosts.h>
#else

#if defined (ESASHBA) || defined (ESAS2HBA)
#include <linux/hdreg.h>
#ifdef ATTO_USE_SCSIREQUEST_H
#include <scsi/scsi_request.h>
#endif
#ifdef ATTO_USE_SCSIREQUEST_H_IN_SRC_TREE
#include "/usr/src/linux/include/scsi/scsi_request.h"
#endif
#endif

#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_eh.h>

#include "oswrap.h"
#include "attover.h"

typedef struct scsi_host_template Scsi_Host_Template;
typedef struct scsi_device        Scsi_Device;
typedef struct scsi_cmnd          Scsi_Cmnd;

#define SCSI_DATA_UNKNOWN       (DMA_BIDIRECTIONAL)
#define SCSI_DATA_WRITE         (DMA_TO_DEVICE)
#define SCSI_DATA_READ          (DMA_FROM_DEVICE)
#define SCSI_DATA_NONE          (DMA_NONE)
#define scsi_to_pci_dma_dir(scsi_dir)   ((int)(scsi_dir))

#endif

void LinuxPciUnmapSg (void *_cmd);

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#include "atto_cfg.h"
#endif

/* Some macros to get necessary data from Scsi_Cmnds */

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)

#define CMD_HOST(c)     (c)->host
#define CMD_TARG(c)     (c)->target
#define CMD_LUN(c)      (c)->lun
#define CMD_TAGS(c)     (c)->device->tagged_queue

#else

#define CMD_HOST(c)     (c)->device->host
#define CMD_TARG(c)     (c)->device->id
#define CMD_LUN(c)      (c)->device->lun
#define CMD_TAGS(c)     (c)->device->tagged_supported

#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)

#define MODULE_PARAM_INT(_n)                \
module_param (_n, int, S_IRUGO | S_IRUSR);

#define MODULE_PARAM_LONG(_n)               \
module_param (_n, long, S_IRUGO | S_IRUSR);

#define MODULE_PARAM_STR(_n)                \
module_param_string (_n, _n, ATTO_PARAM_STR_LEN, S_IRUGO | S_IRUSR);

#else
#define MODULE_PARAM_INT(_n)    MODULE_PARM(_n, "i")
#define MODULE_PARAM_LONG(_n)   MODULE_PARM(_n, "l")
#ifndef MODULE_PARM_DESC
#define MODULE_PARM_DESC(_a, _b)
#endif
#endif

#define GetPciDevFromHostData(_host)  (*(struct pci_dev **)(((PBYTE) (*((void **)(_host)))) + global_pci_dev_offset))

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) && !defined EXPRESS2
#define ATTO_RESCANS_ENABLED
#endif

/* SCSI functions */

int atto_init_device (Scsi_Host_Template *sht, struct pci_dev *pcid);
int atto_detect (Scsi_Host_Template *);
int atto_release (struct Scsi_Host *);
const char *atto_info (struct Scsi_Host *);
int atto_ioctl_handler (void *hostdata, int cmd, void *arg);
int atto_ioctl (Scsi_Device *dev, int cmd, void *arg);
int atto_queuecommand (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
int atto_abort (Scsi_Cmnd *);
int atto_reset (Scsi_Cmnd *, unsigned int);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
int atto_proc_info (char *, char **, off_t, int, int, int);
int atto_bios_param (Disk *, kdev_t, int []);
#else
int atto_proc_info (struct Scsi_Host *, char *, char **, off_t, int, int);
int atto_bios_param (struct scsi_device *sdev, struct block_device *bdev,
                     sector_t capacity, int geometry []);
int atto_slave_alloc (Scsi_Device *dev);
int atto_slave_configure (Scsi_Device *dev);
void atto_slave_destroy (Scsi_Device *dev);
int atto_change_queue_depth (Scsi_Device *dev, int depth);
int atto_change_queue_type (Scsi_Device *dev, int type);
#endif
int atto_proc_ioctl (struct inode *inode, struct file *fp,
                     unsigned int cmd, unsigned long arg);

/* SCSI error handler (eh) functions */

int atto_eh_abort (Scsi_Cmnd *cmd);
int atto_device_reset (Scsi_Cmnd *cmd);
int atto_host_reset (Scsi_Cmnd *cmd);
int atto_bus_reset (Scsi_Cmnd *cmd);

#ifdef DECLARE_COMPSTAT
unsigned char CompStatErr [] = {
#ifdef CELERITYFC
/* RS_SUCCESS       0   */      DID_OK                ,
/* RS_ABT_SUCCESS   1   */      DID_ABORT             ,
/* RS_INFO          2   */      DID_ERROR             ,
/* RS_FAILED        3   */      DID_ERROR             ,
/* RS_ABORTED       4   */      DID_ERROR             ,
/* RS_SEL           5   */      DID_NO_CONNECT        ,
/* RS_RESET         6   */      DID_RESET             ,
/* RS_RESET_DONE    7   */      DID_RESET             ,
/* RS_RESET_FAIL    8   */      DID_ERROR             ,
/* RS_EARLY_RSP     9   */      DID_ERROR             ,
/* RS_TIMEOUT       A   */      DID_ERROR             ,
/* RS_LINK_FAIL     B   */      DID_ERROR             ,
/* RS_OVERRUN       C   */      DID_OK                ,
/* RS_RSP_OVER      D   */      DID_ERROR             ,
/* RS_LOST_FRAME    E   */      DID_ERROR             ,
/* RS_DATA_UFLO     F   */      DID_OK                ,
/* RS_PROG_ERROR   10   */      DID_ERROR             ,
/* RS_SEST_ERROR   11   */      DID_ERROR             ,
/* RS_SEST_INVAL   12   */      DID_ERROR             ,
/* RS_SEQ_ABT      13   */      DID_ERROR             ,
/* RS_REJECT       14   */      DID_ERROR             ,
/* RS_NO_RSP       15   */      DID_ERROR             ,
/* RS_SNS_VALID    16   */      DID_ERROR             ,
/* RS_RSP_VALID    17   */      DID_ERROR             ,
/* RS_EDC_IN       18   */      DID_ERROR             ,
/* RS_EDC_OUT      19   */      DID_ERROR             ,
/* UNASSIGNED      1A   */      DID_ERROR             ,
/* UNASSIGNED      1B   */      DID_ERROR             ,
/* UNASSIGNED      1C   */      DID_ERROR             ,
/* UNASSIGNED      1D   */      DID_ERROR             ,
/* UNASSIGNED      1E   */      DID_ERROR             ,
/* UNASSIGNED      1F   */      DID_ERROR             ,
/* RS_SCSI_ERROR   20   */      DID_ERROR             ,
/* RS_UNDERRUN     21   */      DID_OK                ,
/* RS_RSP_UNDER    22   */      DID_ERROR             ,
/* RS_RSP_INFO     23   */      DID_ERROR             ,
/* RS_RSP_CODE     24   */      DID_ERROR             ,
/* RS_FLASH        25   */      DID_ERROR             ,
/* RS_BUSY         26   */      DID_BUS_BUSY          ,
/* RS_DATA_DIR     27   */      DID_ERROR             ,
/* RS_RQ_TIMEOUT   28   */      DID_ERROR             ,
/* RS_SEL2         29   */      DID_NO_CONNECT        ,
/* RS_ADDR_ERR     2A   */      DID_ERROR             ,
#endif

#ifdef ESASRAID
/* RS_SUCCESS       0x00 */     DID_OK                ,
/* RS_INV_FUNC      0x01 */     DID_ERROR             ,
/* RS_BUSY          0x02 */     DID_BUS_BUSY          ,
/* RS_SEL           0x03 */     DID_NO_CONNECT        ,
/* RS_NO_LUN        0x04 */     DID_NO_CONNECT        ,
/* RS_TIMEOUT       0x05 */     DID_ERROR             ,
/* RS_OVERRUN       0x06 */     DID_OK                ,
/* RS_UNDERRUN      0x07 */     DID_OK                ,
/* RS_SCSI_ERROR    0x08 */     DID_ERROR             ,
/* RS_FCP_ERROR     0x09 */     DID_ERROR             ,
/* RS_ABORTED       0x0A */     DID_ERROR             ,
/* RS_RESID_MISM    0x0B */     DID_ERROR             ,
/* RS_TM_FAILED     0x0C */     DID_ERROR             ,
/* RS_RESET         0x0D */     DID_RESET             ,
/* RS_ERR_DMA_SG    0x0E */     DID_ERROR             ,
/* RS_ERR_DMA_DATA  0x0F */     DID_ERROR             ,
#endif

#ifdef EXPRESS2
/* RS_SUCCESS       0   */      DID_OK                ,
/* RS_INV_FUNC      1   */      DID_ERROR             ,
/* RS_BUSY          2   */      DID_BUS_BUSY          ,
/* RS_INV_SGL       3   */      DID_ERROR             ,
/* RS_INT_ERR       4   */      DID_ERROR             ,
/* RS_INSUF_RESRC   5   */      DID_ERROR             ,
/* RS_INV_FLD       6   */      DID_ERROR             ,
/* RS_INV_STATE     7   */      DID_ERROR             ,
/* UNASSIGNED       8   */      DID_ERROR             ,
/* UNASSIGNED       9   */      DID_ERROR             ,
/* UNASSIGNED       A   */      DID_ERROR             ,
/* UNASSIGNED       B   */      DID_ERROR             ,
/* UNASSIGNED       C   */      DID_ERROR             ,
/* UNASSIGNED       D   */      DID_ERROR             ,
/* UNASSIGNED       E   */      DID_ERROR             ,
/* UNASSIGNED       F   */      DID_ERROR             ,
/* UNASSIGNED      10   */      DID_ERROR             ,
/* UNASSIGNED      11   */      DID_ERROR             ,
/* UNASSIGNED      12   */      DID_ERROR             ,
/* UNASSIGNED      13   */      DID_ERROR             ,
/* UNASSIGNED      14   */      DID_ERROR             ,
/* UNASSIGNED      15   */      DID_ERROR             ,
/* UNASSIGNED      16   */      DID_ERROR             ,
/* UNASSIGNED      17   */      DID_ERROR             ,
/* UNASSIGNED      18   */      DID_ERROR             ,
/* UNASSIGNED      19   */      DID_ERROR             ,
/* UNASSIGNED      1A   */      DID_ERROR             ,
/* UNASSIGNED      1B   */      DID_ERROR             ,
/* UNASSIGNED      1C   */      DID_ERROR             ,
/* UNASSIGNED      1D   */      DID_ERROR             ,
/* UNASSIGNED      1E   */      DID_ERROR             ,
/* UNASSIGNED      1F   */      DID_ERROR             ,
/* RS_INV_ACT      20   */      DID_ERROR             ,
/* RS_INV_TYPE     21   */      DID_ERROR             ,
/* RS_INV_PAGE     22   */      DID_ERROR             ,
/* RS_INV_DATA     23   */      DID_ERROR             ,
/* RS_NO_DFLTS     24   */      DID_ERROR             ,
/* RS_CANT_COMMIT  25   */      DID_ERROR             ,
/* UNASSIGNED      26   */      DID_ERROR             ,
/* UNASSIGNED      27   */      DID_ERROR             ,
/* UNASSIGNED      28   */      DID_ERROR             ,
/* UNASSIGNED      29   */      DID_ERROR             ,
/* UNASSIGNED      2A   */      DID_ERROR             ,
/* UNASSIGNED      2B   */      DID_ERROR             ,
/* UNASSIGNED      2C   */      DID_ERROR             ,
/* UNASSIGNED      2D   */      DID_ERROR             ,
/* UNASSIGNED      2E   */      DID_ERROR             ,
/* UNASSIGNED      2F   */      DID_ERROR             ,
/* RS_NO_LUN       30   */      DID_ERROR             ,
/* UNASSIGNED      31   */      DID_ERROR             ,
/* UNASSIGNED      32   */      DID_ERROR             ,
/* UNASSIGNED      33   */      DID_ERROR             ,
/* UNASSIGNED      34   */      DID_ERROR             ,
/* UNASSIGNED      35   */      DID_ERROR             ,
/* UNASSIGNED      36   */      DID_ERROR             ,
/* UNASSIGNED      37   */      DID_ERROR             ,
/* UNASSIGNED      38   */      DID_ERROR             ,
/* UNASSIGNED      39   */      DID_ERROR             ,
/* UNASSIGNED      3A   */      DID_ERROR             ,
/* UNASSIGNED      3B   */      DID_ERROR             ,
/* UNASSIGNED      3C   */      DID_ERROR             ,
/* UNASSIGNED      3D   */      DID_ERROR             ,
/* UNASSIGNED      3E   */      DID_ERROR             ,
/* UNASSIGNED      3F   */      DID_ERROR             ,
/* RS_RECOV_ERR    40   */      DID_ERROR             ,
/* RS_INV_BUS      41   */      DID_ERROR             ,
/* RS_INV_TRGID    42   */      DID_NO_CONNECT        ,
/* RS_SEL          43   */      DID_NO_CONNECT        ,
/* RS_OVERRUN      44   */      DID_OK                ,
/* RS_UNDERRUN     45   */      DID_OK                ,
/* RS_SCSI_ERROR   46   */      DID_ERROR             ,
/* RS_SCSI_GE      47   */      DID_ERROR             ,
/* RS_ABORT        48   */      DID_ERROR             ,
/* RS_RESID_MISM   49   */      DID_ERROR             ,
/* RS_TM_FAILED    4A   */      DID_ERROR             ,
/* RS_RESET_IOC    4B   */      DID_RESET             ,
/* RS_RESET_EXT    4C   */      DID_RESET             ,
#endif


#ifdef ESASHBA

#ifdef ESAS2HBA
/* RS_SUCCESS                00 */  DID_OK                ,
/* RS_ABORTED                01 */  DID_ERROR             ,
/* RS_OVERRUN                02 */  DID_OK                ,
/* RS_UNDERRUN               03 */  DID_OK                ,
/*                           04 */  DID_ERROR             ,
/*                           05 */  DID_ERROR             ,
/* RS_NOT_VALID              06 */  DID_ERROR             ,
/* RS_SEL                    07 */  DID_ERROR             ,
/*                           08 */  DID_ERROR             ,
/* RS_LINK_FAILURE           09 */  DID_ERROR             ,
/* RS_PROG_ERROR             0A */  DID_ERROR             ,
/*                           0B */  DID_ERROR             ,
/*                           0C */  DID_ERROR             ,
/* RS_HW_TIMEOUT             0D */  DID_ERROR             ,
/* RS_XE_BREAK               0E */  DID_ERROR             ,
/* RS_XE_PHY_NOT_READY       0F */  DID_ERROR             ,
/* RS_OE_INV_PROTOCOL        10 */  DID_ERROR             ,
/* RS_OE_ZONE_VIOLATION      11 */  DID_ERROR             ,
/* RS_OE_BREAK               12 */  DID_ERROR             ,
/* RS_OE_IT_NEXUS_LOSS       13 */  DID_ERROR             ,
/* RS_OE_BAD_DESTINATION     14 */  DID_ERROR             ,
/* RS_OE_INV_RATE            15 */  DID_ERROR             ,
/* RS_OE_STP_RESOURCES_BUSY  16 */  DID_ERROR             ,
/* RS_OE_WRONG_DESTINATION   17 */  DID_ERROR             ,
/* RS_OE_UNKNOWN_ERROR       18 */  DID_ERROR             ,
/* RS_XE_NAK_RECEIVED        19 */  DID_ERROR             ,
/* RS_XE_ACK_NAK_TIMEOUT     1A */  DID_ERROR             ,
/* RS_XE_PEER_ABORTED        1B */  DID_ERROR             ,
/* RS_XE_RX_FRAME            1C */  DID_ERROR             ,
/* RS_XE_DMA                 1D */  DID_ERROR             ,
/*                           1E */  DID_ERROR             ,
/* RS_XE_SATA_LINK_TIMEOUT   1F */  DID_ERROR             ,
/* RS_XE_SATA                20 */  DID_ERROR             ,
/* RS_XE_REJECTED_NCQ_MODE   21 */  DID_ERROR             ,
/*                           22 */  DID_ERROR             ,
/* RS_XE_ABORTED_NCQ_MODE    23 */  DID_ERROR             ,
/* RS_XE_OPEN_RETRY_TIMEOUT  24 */  DID_ERROR             ,
/*                           25 */  DID_ERROR             ,
/* RS_XE_UNEXPECTED_PHASE    26 */  DID_ERROR             ,
/* RS_XE_XFER_RDY_OVERRUN    27 */  DID_ERROR             ,
/* RS_XE_XFER_RDY_NOT_EXP    28 */  DID_ERROR             ,
/*                           29 */  DID_ERROR             ,
/*                           2A */  DID_ERROR             ,
/*                           2B */  DID_ERROR             ,
/*                           2C */  DID_ERROR             ,
/*                           2D */  DID_ERROR             ,
/*                           2E */  DID_ERROR             ,
/*                           2F */  DID_ERROR             ,
/* RS_XE_CMD_ACK_NAK_TIMEOUT 30 */  DID_ERROR             ,
/* RS_XE_BREAK_B4_ACK_NAK    31 */  DID_ERROR             ,
/*                           32 */  DID_ERROR             ,
/*                           33 */  DID_ERROR             ,
/* RS_XE_OFFSET_MISMATCH     34 */  DID_ERROR             ,
/* RS_XE_XFER_ZERO_DATA_LEN  35 */  DID_ERROR             ,
/* RS_CMD_FRAME_ISSUED       36 */  DID_ERROR             ,
/* RS_INTERNAL_SMP_RSRC      37 */  DID_ERROR             ,
/* RS_RESET                  38 */  DID_RESET             ,
/* RS_DS_NON_OPERATIONAL     39 */  DID_ERROR             ,
/* RS_DS_IN_RECOVERY         3A */  DID_ERROR             ,
/* RS_TM_TAG_NOT_FOUND       3B */  DID_ERROR             ,
/* RS_PIO_SETUP_ERROR        3C */  DID_ERROR             ,
/* RS_SSP_EXT_IU_ZERO_LEN    3D */  DID_ERROR             ,
/*                           3E */  DID_ERROR             ,
/*                           3F */  DID_ERROR             ,
/* RS_SCSI_ERROR             40 */  DID_ERROR             ,
/* RS_BUSY                   41 */  DID_BUS_BUSY          ,
/* RS_NO_LUN                 42 */  DID_NO_CONNECT        ,
/* RS_TIMEOUT                43 */  DID_ERROR             ,
/* RS_DEGRADED               44 */  DID_ERROR             ,
/* RS_SEL2                   45 */  DID_NO_CONNECT        ,
/* RS_ERROR                  46 */  DID_ERROR             ,

#else /* ESASHBA */
/* RS_SUCCESS      0x00 */      DID_OK                ,
/* RS_ERROR        0x01 */      DID_ERROR             ,
/* RS_BUSY         0x02 */      DID_BUS_BUSY          ,
/* RS_SEL          0x03 */      DID_NO_CONNECT        ,
/* RS_NO_LUN       0x04 */      DID_NO_CONNECT        ,
/* RS_TIMEOUT      0x05 */      DID_ERROR             ,
/* RS_OVERRUN      0x06 */      DID_OK                ,
/* RS_UNDERRUN     0x07 */      DID_OK                ,
/* RS_DEGRADED     0x08 */      DID_ERROR             ,
/* RS_ABORTED      0x09 */      DID_ERROR             ,
/* RS_RESET        0x0A */      DID_RESET             ,
/* RS_SEL2         0x0B */      DID_BUS_BUSY          ,
#endif
#endif
} ;

int MaxCompStat = sizeof (CompStatErr) / sizeof (*CompStatErr);

#define RS_SUCCESS    0
#ifdef CELERITYFC
#define RS_SCSI_ERROR 0x20
#endif
#ifdef ESASRAID
#define RS_SCSI_ERROR 0x08
#endif
#ifdef EXPRESS2
#define RS_SCSI_ERROR 0x46
#endif
#ifdef ESASHBA
#define RS_SCSI_ERROR 0x10
#endif

#endif

#endif /* _OS_H_ */
