linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / message / fusion / mptbase.h
index c537d71..723d543 100644 (file)
@@ -49,6 +49,7 @@
 #define MPTBASE_H_INCLUDED
 /*{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
+#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 
@@ -75,8 +76,8 @@
 #define COPYRIGHT      "Copyright (c) 1999-2005 " MODULEAUTHOR
 #endif
 
-#define MPT_LINUX_VERSION_COMMON       "3.04.01"
-#define MPT_LINUX_PACKAGE_NAME         "@(#)mptlinux-3.04.01"
+#define MPT_LINUX_VERSION_COMMON       "3.03.07"
+#define MPT_LINUX_PACKAGE_NAME         "@(#)mptlinux-3.03.07"
 #define WHAT_MAGIC_STRING              "@" "(" "#" ")"
 
 #define show_mptmod_ver(s,ver)  \
@@ -307,8 +308,7 @@ typedef struct _SYSIF_REGS
        u32     HostIndex;      /* 50     Host Index register        */
        u32     Reserved4[15];  /* 54-8F                             */
        u32     Fubar;          /* 90     For Fubar usage            */
-       u32     Reserved5[1050];/* 94-10F8                           */
-       u32     Reset_1078;     /* 10FC   Reset 1078                 */
+       u32     Reserved5[27];  /* 94-FF                             */
 } SYSIF_REGS;
 
 /*
@@ -331,7 +331,6 @@ typedef struct _SYSIF_REGS
  *     VirtDevice - FC LUN device or SCSI target device
  */
 typedef struct _VirtTarget {
-       struct scsi_target      *starget;
        u8                       tflags;
        u8                       ioc_id;
        u8                       target_id;
@@ -342,13 +341,16 @@ typedef struct _VirtTarget {
        u8                       negoFlags;     /* bit field, see above */
        u8                       raidVolume;    /* set, if RAID Volume */
        u8                       type;          /* byte 0 of Inquiry data */
-       u8                       deleted;       /* target in process of being removed */
        u32                      num_luns;
        u32                      luns[8];               /* Max LUNs is 256 */
+       u8                       inq_data[8];
 } VirtTarget;
 
 typedef struct _VirtDevice {
-       VirtTarget              *vtarget;
+       VirtTarget              *vtarget;
+       u8                       ioc_id;
+       u8                       bus_id;
+       u8                       target_id;
        u8                       configured_lun;
        u32                      lun;
 } VirtDevice;
@@ -362,8 +364,6 @@ typedef struct _VirtDevice {
 #define MPT_TARGET_FLAGS_Q_YES         0x08
 #define MPT_TARGET_FLAGS_VALID_56      0x10
 #define MPT_TARGET_FLAGS_SAF_TE_ISSUED 0x20
-#define MPT_TARGET_FLAGS_RAID_COMPONENT        0x40
-#define MPT_TARGET_FLAGS_LED_ON                0x80
 
 /*
  *     /proc/mpt interface
@@ -447,6 +447,13 @@ typedef struct _mpt_ioctl_events {
  *     Substructure to store SCSI specific configuration page data
  */
                                                /* dvStatus defines: */
+#define MPT_SCSICFG_NEGOTIATE          0x01    /* Negotiate on next IO */
+#define MPT_SCSICFG_NEED_DV            0x02    /* Schedule DV */
+#define MPT_SCSICFG_DV_PENDING         0x04    /* DV on this physical id pending */
+#define MPT_SCSICFG_DV_NOT_DONE                0x08    /* DV has not been performed */
+#define MPT_SCSICFG_BLK_NEGO           0x10    /* WriteSDP1 with WDTR and SDTR disabled */
+#define MPT_SCSICFG_RELOAD_IOC_PG3     0x20    /* IOC Pg 3 data is obsolete */
+                                               /* Args passed to writeSDP1: */
 #define MPT_SCSICFG_USE_NVRAM          0x01    /* WriteSDP1 using NVRAM */
 #define MPT_SCSICFG_ALL_IDS            0x02    /* WriteSDP1 to all IDS */
 /* #define MPT_SCSICFG_BLK_NEGO                0x10       WriteSDP1 with WDTR and SDTR disabled */
@@ -457,6 +464,7 @@ typedef     struct _SpiCfgData {
        IOCPage4_t      *pIocPg4;               /* SEP devices addressing */
        dma_addr_t       IocPg4_dma;            /* Phys Addr of IOCPage4 data */
        int              IocPg4Sz;              /* IOCPage4 size */
+       u8               dvStatus[MPT_MAX_SCSI_DEVICES];
        u8               minSyncFactor;         /* 0xFF if async */
        u8               maxSyncOffset;         /* 0 if async */
        u8               maxBusWidth;           /* 0 if narrow, 1 if wide */
@@ -466,11 +474,13 @@ typedef   struct _SpiCfgData {
        u8               sdp0version;           /* SDP0 version */
        u8               sdp0length;            /* SDP0 length  */
        u8               dvScheduled;           /* 1 if scheduled */
+       u8               forceDv;               /* 1 to force DV scheduling */
        u8               noQas;                 /* Disable QAS for this adapter */
        u8               Saf_Te;                /* 1 to force all Processors as
                                                 * SAF-TE if Inquiry data length
                                                 * is too short to check for SAF-TE
                                                 */
+       u8               mpt_dv;                /* command line option: enhanced=1, basic=0 */
        u8               bus_reset;             /* 1 to allow bus reset */
        u8               rsvd[1];
 }SpiCfgData;
@@ -489,17 +499,9 @@ typedef    struct _RaidCfgData {
        int              isRaid;                /* bit field, 1 if RAID */
 }RaidCfgData;
 
-typedef struct _FcCfgData {
-       /* will ultimately hold fc_port_page0 also */
-       struct {
-               FCPortPage1_t   *data;
-               dma_addr_t       dma;
-               int              pg_sz;
-       }                        fc_port_page1[2];
-} FcCfgData;
-
 #define MPT_RPORT_INFO_FLAGS_REGISTERED        0x01    /* rport registered */
 #define MPT_RPORT_INFO_FLAGS_MISSING   0x02    /* missing from DevPage0 scan */
+#define MPT_RPORT_INFO_FLAGS_MAPPED_VDEV 0x04  /* target mapped in vdev */
 
 /*
  * data allocated for each fc rport device
@@ -511,6 +513,7 @@ struct mptfc_rport_info
        struct scsi_target *starget;
        FCDevicePage0_t pg0;
        u8              flags;
+       u8              remap_needed;
 };
 
 /*
@@ -576,7 +579,6 @@ typedef struct _MPT_ADAPTER
        SpiCfgData              spi_data;       /* Scsi config. data */
        RaidCfgData             raid_data;      /* Raid config. data */
        SasCfgData              sas_data;       /* Sas config. data */
-       FcCfgData               fc_data;        /* Fc config. data */
        MPT_IOCTL               *ioctl;         /* ioctl data pointer */
        struct proc_dir_entry   *ioc_dentry;
        struct _MPT_ADAPTER     *alt_ioc;       /* ptr to 929 bound adapter port */
@@ -629,20 +631,16 @@ typedef struct _MPT_ADAPTER
        struct net_device       *netdev;
        struct list_head         sas_topology;
        struct mutex             sas_topology_mutex;
-       struct mutex             sas_discovery_mutex;
-       u8                       sas_discovery_runtime;
-       u8                       sas_discovery_ignore_events;
-       u16                      handle;
-       int                      sas_index; /* index refrencing */
        MPT_SAS_MGMT             sas_mgmt;
-       struct work_struct       sas_persist_task;
+       int                      num_ports;
+       struct work_struct       mptscsih_persistTask;
 
-       struct work_struct       fc_setup_reset_work;
        struct list_head         fc_rports;
+       spinlock_t               fc_rport_lock; /* list and ri flags */
        spinlock_t               fc_rescan_work_lock;
+       int                      fc_rescan_work_count;
        struct work_struct       fc_rescan_work;
-       char                     fc_rescan_work_q_name[KOBJ_NAME_LEN];
-       struct workqueue_struct *fc_rescan_work_q;
+
 } MPT_ADAPTER;
 
 /*
@@ -730,18 +728,12 @@ typedef struct _mpt_sge {
 #define dhsprintk(x)
 #endif
 
-#if defined(MPT_DEBUG_EVENTS) || defined(MPT_DEBUG_VERBOSE_EVENTS)
+#ifdef MPT_DEBUG_EVENTS
 #define devtprintk(x)  printk x
 #else
 #define devtprintk(x)
 #endif
 
-#ifdef MPT_DEBUG_VERBOSE_EVENTS
-#define devtverboseprintk(x)  printk x
-#else
-#define devtverboseprintk(x)
-#endif
-
 #ifdef MPT_DEBUG_RESET
 #define drsprintk(x)  printk x
 #else
@@ -894,13 +886,6 @@ typedef struct _mpt_sge {
 #define DBG_DUMP_REQUEST_FRAME_HDR(mfp)
 #endif
 
-// debug sas wide ports
-#ifdef MPT_DEBUG_SAS_WIDE
-#define dsaswideprintk(x) printk x
-#else
-#define dsaswideprintk(x)
-#endif
-
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
@@ -980,7 +965,7 @@ typedef struct _MPT_SCSI_HOST {
        wait_queue_head_t         scandv_waitq;
        int                       scandv_wait_done;
        long                      last_queue_full;
-       u16                       tm_iocstatus;
+       u8                        mpt_pq_filter;
 } MPT_SCSI_HOST;
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -1045,7 +1030,10 @@ extern int        mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *cfg);
 extern void     mpt_alloc_fw_memory(MPT_ADAPTER *ioc, int size);
 extern void     mpt_free_fw_memory(MPT_ADAPTER *ioc);
 extern int      mpt_findImVolumes(MPT_ADAPTER *ioc);
+extern int      mpt_read_ioc_pg_3(MPT_ADAPTER *ioc);
 extern int      mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode);
+extern int      mptbase_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum);
+extern int      mpt_alt_ioc_wait(MPT_ADAPTER *ioc);
 
 /*
  *  Public data decl's...