⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ips.h

📁 linux和2410结合开发 用他可以生成2410所需的zImage文件
💻 H
📖 第 1 页 / 共 3 页
字号:
/*****************************************************************************//* ips.h -- driver for the IBM ServeRAID controller                          *//*                                                                           *//* Written By: Keith Mitchell, IBM Corporation                               *//*                                                                           *//* Copyright (C) 1999 IBM Corporation                                        *//*                                                                           *//* This program is free software; you can redistribute it and/or modify      *//* it under the terms of the GNU General Public License as published by      *//* the Free Software Foundation; either version 2 of the License, or         *//* (at your option) any later version.                                       *//*                                                                           *//* This program is distributed in the hope that it will be useful,           *//* but WITHOUT ANY WARRANTY; without even the implied warranty of            *//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             *//* GNU General Public License for more details.                              *//*                                                                           *//* NO WARRANTY                                                               *//* THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR        *//* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT      *//* LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,      *//* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is    *//* solely responsible for determining the appropriateness of using and       *//* distributing the Program and assumes all risks associated with its        *//* exercise of rights under this Agreement, including but not limited to     *//* the risks and costs of program errors, damage to or loss of data,         *//* programs or equipment, and unavailability or interruption of operations.  *//*                                                                           *//* DISCLAIMER OF LIABILITY                                                   *//* NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY   *//* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL        *//* DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND   *//* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR     *//* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE    *//* USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED  *//* HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES             *//*                                                                           *//* You should have received a copy of the GNU General Public License         *//* along with this program; if not, write to the Free Software               *//* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA *//*                                                                           *//* Bugs/Comments/Suggestions should be mailed to:                            *//*      ipslinux@us.ibm.com                                                  *//*                                                                           *//*****************************************************************************/#ifndef _IPS_H_   #define _IPS_H_   #include <asm/uaccess.h>   #include <asm/io.h>   /* type definitions */   #define u_int8_t  uint8_t   #define u_int16_t uint16_t   #define u_int32_t uint32_t   #define u_int64_t uint64_t   /* Prototypes */   extern int ips_detect(Scsi_Host_Template *);   extern int ips_release(struct Scsi_Host *);   extern int ips_eh_abort(Scsi_Cmnd *);   extern int ips_eh_reset(Scsi_Cmnd *);   extern int ips_queue(Scsi_Cmnd *, void (*) (Scsi_Cmnd *));   extern int ips_biosparam(Disk *, kdev_t, int *);   extern const char * ips_info(struct Scsi_Host *);   extern void do_ipsintr(int, void *, struct pt_regs *);   /*    * Some handy macros    */   #ifndef LinuxVersionCode      #define LinuxVersionCode(x,y,z)  (((x)<<16)+((y)<<8)+(z))   #endif   #define IPS_HA(x)                   ((ips_ha_t *) x->hostdata)   #define IPS_COMMAND_ID(ha, scb)     (int) (scb - ha->scbs)   #define IPS_IS_TROMBONE(ha)         (((ha->device_id == IPS_DEVICEID_COPPERHEAD) && \                                         (ha->revision_id >= IPS_REVID_TROMBONE32) && \                                         (ha->revision_id <= IPS_REVID_TROMBONE64)) ? 1 : 0)   #define IPS_IS_CLARINET(ha)         (((ha->device_id == IPS_DEVICEID_COPPERHEAD) && \                                         (ha->revision_id >= IPS_REVID_CLARINETP1) && \                                         (ha->revision_id <= IPS_REVID_CLARINETP3)) ? 1 : 0)   #define IPS_IS_MORPHEUS(ha)         (ha->device_id == IPS_DEVICEID_MORPHEUS)   #define IPS_USE_I2O_DELIVER(ha)     ((IPS_IS_MORPHEUS(ha) || \                                         (IPS_IS_TROMBONE(ha) && \                                          (ips_force_i2o))) ? 1 : 0)   #define IPS_USE_I2O_STATUS(ha)      (IPS_IS_MORPHEUS(ha))   #define IPS_USE_MEMIO(ha)           ((IPS_IS_MORPHEUS(ha) || \                                         ((IPS_IS_TROMBONE(ha) || IPS_IS_CLARINET(ha)) && \                                          (ips_force_memio))) ? 1 : 0)   #ifndef VIRT_TO_BUS      #define VIRT_TO_BUS(x)           (unsigned int)virt_to_bus((void *) x)   #endif   #ifndef UDELAY      #define UDELAY udelay   #endif   #ifndef MDELAY      #define MDELAY mdelay   #endif   #ifndef verify_area_20      #define verify_area_20(t,a,sz)   (0) /* success */   #endif   #ifndef DECLARE_MUTEX_LOCKED      #define DECLARE_MUTEX_LOCKED(sem) struct semaphore sem = MUTEX_LOCKED;   #endif      /*    * Lock macros    */   #define IPS_SCB_LOCK(cpu_flags)      spin_lock_irqsave(&ha->scb_lock, cpu_flags)   #define IPS_SCB_UNLOCK(cpu_flags)    spin_unlock_irqrestore(&ha->scb_lock, cpu_flags)   #define IPS_QUEUE_LOCK(queue)        spin_lock_irqsave(&(queue)->lock, (queue)->cpu_flags)   #define IPS_QUEUE_UNLOCK(queue)      spin_unlock_irqrestore(&(queue)->lock, (queue)->cpu_flags)   #define IPS_HA_LOCK(cpu_flags)       spin_lock_irqsave(&ha->ips_lock, cpu_flags)   #define IPS_HA_UNLOCK(cpu_flags)     spin_unlock_irqrestore(&ha->ips_lock, cpu_flags)   /*    * Adapter address map equates    */   #define IPS_REG_HISR                 0x08    /* Host Interrupt Status Reg   */   #define IPS_REG_CCSAR                0x10    /* Cmd Channel System Addr Reg */   #define IPS_REG_CCCR                 0x14    /* Cmd Channel Control Reg     */   #define IPS_REG_SQHR                 0x20    /* Status Q Head Reg           */   #define IPS_REG_SQTR                 0x24    /* Status Q Tail Reg           */   #define IPS_REG_SQER                 0x28    /* Status Q End Reg            */   #define IPS_REG_SQSR                 0x2C    /* Status Q Start Reg          */   #define IPS_REG_SCPR                 0x05    /* Subsystem control port reg  */   #define IPS_REG_ISPR                 0x06    /* interrupt status port reg   */   #define IPS_REG_CBSP                 0x07    /* CBSP register               */   #define IPS_REG_FLAP                 0x18    /* Flash address port          */   #define IPS_REG_FLDP                 0x1C    /* Flash data port             */   #define IPS_REG_NDAE                 0x38    /* Anaconda 64 NDAE Register   */   #define IPS_REG_I2O_INMSGQ           0x40    /* I2O Inbound Message Queue   */   #define IPS_REG_I2O_OUTMSGQ          0x44    /* I2O Outbound Message Queue  */   #define IPS_REG_I2O_HIR              0x30    /* I2O Interrupt Status        */   #define IPS_REG_I960_IDR             0x20    /* i960 Inbound Doorbell       */   #define IPS_REG_I960_MSG0            0x18    /* i960 Outbound Reg 0         */   #define IPS_REG_I960_MSG1            0x1C    /* i960 Outbound Reg 1         */   #define IPS_REG_I960_OIMR            0x34    /* i960 Oubound Int Mask Reg   */   /*    * Adapter register bit equates    */   #define IPS_BIT_GHI                  0x04    /* HISR General Host Interrupt */   #define IPS_BIT_SQO                  0x02    /* HISR Status Q Overflow      */   #define IPS_BIT_SCE                  0x01    /* HISR Status Channel Enqueue */   #define IPS_BIT_SEM                  0x08    /* CCCR Semaphore Bit          */   #define IPS_BIT_ILE                  0x10    /* CCCR ILE Bit                */   #define IPS_BIT_START_CMD            0x101A  /* CCCR Start Command Channel  */   #define IPS_BIT_START_STOP           0x0002  /* CCCR Start/Stop Bit         */   #define IPS_BIT_RST                  0x80    /* SCPR Reset Bit              */   #define IPS_BIT_EBM                  0x02    /* SCPR Enable Bus Master      */   #define IPS_BIT_EI                   0x80    /* HISR Enable Interrupts      */   #define IPS_BIT_OP                   0x01    /* OP bit in CBSP              */   #define IPS_BIT_I2O_OPQI             0x08    /* General Host Interrupt      */   #define IPS_BIT_I960_MSG0I           0x01    /* Message Register 0 Interrupt*/   #define IPS_BIT_I960_MSG1I           0x02    /* Message Register 1 Interrupt*/   /*    * Adapter Command ID Equates    */   #define IPS_CMD_GET_LD_INFO          0x19   #define IPS_CMD_GET_SUBSYS           0x40   #define IPS_CMD_READ_CONF            0x38   #define IPS_CMD_RW_NVRAM_PAGE        0xBC   #define IPS_CMD_READ                 0x02   #define IPS_CMD_WRITE                0x03   #define IPS_CMD_FFDC                 0xD7   #define IPS_CMD_ENQUIRY              0x05   #define IPS_CMD_FLUSH                0x0A   #define IPS_CMD_READ_SG              0x82   #define IPS_CMD_WRITE_SG             0x83   #define IPS_CMD_DCDB                 0x04   #define IPS_CMD_DCDB_SG              0x84   #define IPS_CMD_CONFIG_SYNC          0x58   #define IPS_CMD_ERROR_TABLE          0x17   #define IPS_CMD_RW_BIOSFW            0x22   /*    * Adapter Equates    */   #define IPS_CSL                      0xFF   #define IPS_POCL                     0x30   #define IPS_NORM_STATE               0x00   #define IPS_MAX_ADAPTERS             16   #define IPS_MAX_IOCTL                1   #define IPS_MAX_IOCTL_QUEUE          8   #define IPS_MAX_QUEUE                128   #define IPS_BLKSIZE                  512   #define IPS_MAX_SG                   17   #define IPS_MAX_LD                   8   #define IPS_MAX_CHANNELS             4   #define IPS_MAX_TARGETS              15   #define IPS_MAX_CHUNKS               16   #define IPS_MAX_CMDS                 128   #define IPS_MAX_XFER                 0x10000   #define IPS_NVRAM_P5_SIG             0xFFDDBB99   #define IPS_MAX_POST_BYTES           0x02   #define IPS_MAX_CONFIG_BYTES         0x02   #define IPS_GOOD_POST_STATUS         0x80   #define IPS_SEM_TIMEOUT              2000   #define IPS_IOCTL_COMMAND            0x0D   #define IPS_IOCTL_NEW_COMMAND        0x81   #define IPS_INTR_ON                  0   #define IPS_INTR_IORL                1   #define IPS_INTR_HAL                 2   #define IPS_ADAPTER_ID               0xF   #define IPS_VENDORID                 0x1014   #define IPS_DEVICEID_COPPERHEAD      0x002E   #define IPS_DEVICEID_MORPHEUS        0x01BD   #define IPS_SUBDEVICEID_4M           0x01BE   #define IPS_SUBDEVICEID_4L           0x01BF   #define IPS_SUBDEVICEID_4MX          0x0208   #define IPS_SUBDEVICEID_4LX          0x020E   #define IPS_IOCTL_SIZE               8192   #define IPS_STATUS_SIZE              4   #define IPS_STATUS_Q_SIZE            (IPS_MAX_CMDS+1) * IPS_STATUS_SIZE   #define IPS_IMAGE_SIZE               500 * 1024   #define IPS_MEMMAP_SIZE              128   #define IPS_ONE_MSEC                 1   #define IPS_ONE_SEC                  1000   /*    * Geometry Settings    */   #define IPS_COMP_HEADS               128   #define IPS_COMP_SECTORS             32   #define IPS_NORM_HEADS               254   #define IPS_NORM_SECTORS             63   /*    * Adapter Basic Status Codes    */   #define IPS_BASIC_STATUS_MASK        0xFF   #define IPS_GSC_STATUS_MASK          0x0F   #define IPS_CMD_SUCCESS              0x00   #define IPS_CMD_RECOVERED_ERROR      0x01   #define IPS_INVAL_OPCO               0x03   #define IPS_INVAL_CMD_BLK            0x04   #define IPS_INVAL_PARM_BLK           0x05   #define IPS_BUSY                     0x08   #define IPS_CMD_CMPLT_WERROR         0x0C   #define IPS_LD_ERROR                 0x0D   #define IPS_CMD_TIMEOUT              0x0E   #define IPS_PHYS_DRV_ERROR           0x0F   /*    * Adapter Extended Status Equates    */   #define IPS_ERR_SEL_TO               0xF0   #define IPS_ERR_OU_RUN               0xF2   #define IPS_ERR_HOST_RESET           0xF7   #define IPS_ERR_DEV_RESET            0xF8   #define IPS_ERR_RECOVERY             0xFC   #define IPS_ERR_CKCOND               0xFF   /*    * Operating System Defines    */   #define IPS_OS_WINDOWS_NT            0x01   #define IPS_OS_NETWARE               0x02   #define IPS_OS_OPENSERVER            0x03   #define IPS_OS_UNIXWARE              0x04   #define IPS_OS_SOLARIS               0x05   #define IPS_OS_OS2                   0x06   #define IPS_OS_LINUX                 0x07   #define IPS_OS_FREEBSD               0x08   /*    * Adapter Revision ID's    */   #define IPS_REVID_SERVERAID          0x02   #define IPS_REVID_NAVAJO             0x03   #define IPS_REVID_SERVERAID2         0x04   #define IPS_REVID_CLARINETP1         0x05   #define IPS_REVID_CLARINETP2         0x07   #define IPS_REVID_CLARINETP3         0x0D   #define IPS_REVID_TROMBONE32         0x0F   #define IPS_REVID_TROMBONE64         0x10   /*    * NVRAM Page 5 Adapter Defines    */   #define IPS_ADTYPE_SERVERAID         0x01   #define IPS_ADTYPE_SERVERAID2        0x02   #define IPS_ADTYPE_NAVAJO            0x03   #define IPS_ADTYPE_KIOWA             0x04   #define IPS_ADTYPE_SERVERAID3        0x05   #define IPS_ADTYPE_SERVERAID3L       0x06   #define IPS_ADTYPE_SERVERAID4H       0x07   #define IPS_ADTYPE_SERVERAID4M       0x08   #define IPS_ADTYPE_SERVERAID4L       0x09   #define IPS_ADTYPE_SERVERAID4MX      0x0A   #define IPS_ADTYPE_SERVERAID4LX      0x0B   /*    * Adapter Command/Status Packet Definitions    */   #define IPS_SUCCESS                  0x01 /* Successfully completed       */   #define IPS_SUCCESS_IMM              0x02 /* Success - Immediately        */   #define IPS_FAILURE                  0x04 /* Completed with Error         */   /*    * Logical Drive Equates    */   #define IPS_LD_OFFLINE               0x02   #define IPS_LD_OKAY                  0x03   #define IPS_LD_FREE                  0x00   #define IPS_LD_SYS                   0x06   #define IPS_LD_CRS                   0x24   /*    * DCDB Table Equates    */   #define IPS_NO_DISCONNECT            0x00   #define IPS_DISCONNECT_ALLOWED       0x80   #define IPS_NO_AUTO_REQSEN           0x40   #define IPS_DATA_NONE                0x00   #define IPS_DATA_UNK                 0x00   #define IPS_DATA_IN                  0x01   #define IPS_DATA_OUT                 0x02   #define IPS_TRANSFER64K              0x08   #define IPS_NOTIMEOUT                0x00   #define IPS_TIMEOUT10                0x10   #define IPS_TIMEOUT60                0x20   #define IPS_TIMEOUT20M               0x30   /*    * SCSI Inquiry Data Flags    */   #define IPS_SCSI_INQ_TYPE_DASD       0x00   #define IPS_SCSI_INQ_TYPE_PROCESSOR  0x03   #define IPS_SCSI_INQ_LU_CONNECTED    0x00   #define IPS_SCSI_INQ_RD_REV2         0x02   #define IPS_SCSI_INQ_REV2            0x02   #define IPS_SCSI_INQ_REV3            0x03   #define IPS_SCSI_INQ_Address16       0x01   #define IPS_SCSI_INQ_Address32       0x02   #define IPS_SCSI_INQ_MedChanger      0x08   #define IPS_SCSI_INQ_MultiPort       0x10   #define IPS_SCSI_INQ_EncServ         0x40   #define IPS_SCSI_INQ_SoftReset       0x01   #define IPS_SCSI_INQ_CmdQue          0x02   #define IPS_SCSI_INQ_Linked          0x08   #define IPS_SCSI_INQ_Sync            0x10   #define IPS_SCSI_INQ_WBus16          0x20   #define IPS_SCSI_INQ_WBus32          0x40   #define IPS_SCSI_INQ_RelAdr          0x80   /*    * SCSI Request Sense Data Flags    */   #define IPS_SCSI_REQSEN_VALID        0x80   #define IPS_SCSI_REQSEN_CURRENT_ERR  0x70   #define IPS_SCSI_REQSEN_NO_SENSE     0x00   /*    * SCSI Mode Page Equates    */   #define IPS_SCSI_MP3_SoftSector      0x01   #define IPS_SCSI_MP3_HardSector      0x02   #define IPS_SCSI_MP3_Removeable      0x04   #define IPS_SCSI_MP3_AllocateSurface 0x08   /*    * Configuration Structure Flags    */   #define IPS_CFG_USEROPT_UPDATECOUNT(cfg)   (((cfg)->UserOpt & 0xffff000) >> 16)   #define IPS_CFG_USEROPT_CONCURSTART(cfg)   (((cfg)->UserOpt & 0xf000) >> 12)   #define IPS_CFG_USEROPT_STARTUPDELAY(cfg)  (((cfg)->UserOpt & 0xf00) >> 8)   #define IPS_CFG_USEROPT_REARRANGE(cfg)     ((cfg)->UserOpt & 0x80)   #define IPS_CFG_USEROPT_CDBOOT(cfg)        ((cfg)->UserOpt & 0x40)   #define IPS_CFG_USEROPT_CLUSTER(cfg)       ((cfg)->UserOpt & 0x20)   /*    * Host adapter Flags (bit numbers)    */   #define IPS_IN_INTR                  0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -