]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/scsi/aacraid/aacraid.h
[SCSI] aacraid: Track command ownership in driver
[mv-sheeva.git] / drivers / scsi / aacraid / aacraid.h
index d54b1cc88d0d9cf67ec56e48ea8a3efc9cd7ffc5..51c96cac484e24c5e9fd78e9a3dd121ca068a595 100644 (file)
@@ -25,7 +25,6 @@
  * These macros convert from physical channels to virtual channels
  */
 #define CONTAINER_CHANNEL              (0)
-#define ID_LUN_TO_CONTAINER(id, lun)   (id)
 #define CONTAINER_TO_CHANNEL(cont)     (CONTAINER_CHANNEL)
 #define CONTAINER_TO_ID(cont)          (cont)
 #define CONTAINER_TO_LUN(cont)         (0)
@@ -481,6 +480,7 @@ enum aac_log_level {
 #define FSAFS_NTC_FIB_CONTEXT                  0x030c
 
 struct aac_dev;
+struct fib;
 
 struct adapter_ops
 {
@@ -489,6 +489,7 @@ struct adapter_ops
        void (*adapter_disable_int)(struct aac_dev *dev);
        int  (*adapter_sync_cmd)(struct aac_dev *dev, u32 command, u32 p1, u32 p2, u32 p3, u32 p4, u32 p5, u32 p6, u32 *status, u32 *r1, u32 *r2, u32 *r3, u32 *r4);
        int  (*adapter_check_health)(struct aac_dev *dev);
+       int  (*adapter_send)(struct fib * fib);
 };
 
 /*
@@ -529,6 +530,13 @@ struct aac_driver_ident
  */
 #define AAC_QUIRK_MASTER 0x0008
 
+/*
+ * Some adapter firmware perform poorly when it must split up scatter gathers
+ * in order to deal with the limits of the underlying CHIM. This limit in this
+ * class of adapters is 17 scatter gather elements.
+ */
+#define AAC_QUIRK_17SG 0x0010
+
 /*
  *     The adapter interface specs all queues to be located in the same
  *     physically contigous block. The host structure that defines the
@@ -659,6 +667,10 @@ struct rx_mu_registers {
                                                Status Register */
        __le32  OIMR;       /*  1334h  | 34h | Outbound Interrupt 
                                                Mask Register */
+       __le32  reserved2;  /*  1338h  | 38h | Reserved */
+       __le32  reserved3;  /*  133Ch  | 3Ch | Reserved */
+       __le32  InboundQueue;/* 1340h  | 40h | Inbound Queue Port relative to firmware */
+       __le32  OutboundQueue;/*1344h  | 44h | Outbound Queue Port relative to firmware */
                            /* * Must access through ATU Inbound 
                                 Translation Window */
 };
@@ -693,8 +705,8 @@ struct rx_inbound {
 #define OutboundDoorbellReg    MUnit.ODR
 
 struct rx_registers {
-       struct rx_mu_registers          MUnit;          /* 1300h - 1334h */
-       __le32                          reserved1[6];   /* 1338h - 134ch */
+       struct rx_mu_registers          MUnit;          /* 1300h - 1344h */
+       __le32                          reserved1[2];   /* 1348h - 134ch */
        struct rx_inbound               IndexRegs;
 };
 
@@ -711,8 +723,8 @@ struct rx_registers {
 #define rkt_inbound rx_inbound
 
 struct rkt_registers {
-       struct rkt_mu_registers         MUnit;           /* 1300h - 1334h */
-       __le32                          reserved1[1010]; /* 1338h - 22fch */
+       struct rkt_mu_registers         MUnit;           /* 1300h - 1344h */
+       __le32                          reserved1[1006]; /* 1348h - 22fch */
        struct rkt_inbound              IndexRegs;       /* 2300h - */
 };
 
@@ -721,8 +733,6 @@ struct rkt_registers {
 #define rkt_writeb(AEP, CSR, value)    writeb(value, &((AEP)->regs.rkt->CSR))
 #define rkt_writel(AEP, CSR, value)    writel(value, &((AEP)->regs.rkt->CSR))
 
-struct fib;
-
 typedef void (*fib_callback)(void *ctxt, struct fib *fibctx);
 
 struct aac_fib_context {
@@ -937,7 +947,6 @@ struct aac_dev
        const char              *name;
        int                     id;
 
-       u16                     irq_mask;
        /*
         *      negotiated FIB settings
         */
@@ -972,6 +981,7 @@ struct aac_dev
        struct adapter_ops      a_ops;
        unsigned long           fsrev;          /* Main driver's revision number */
        
+       unsigned                base_size;      /* Size of mapped in region */
        struct aac_init         *init;          /* Holds initialization info to communicate with adapter */
        dma_addr_t              init_pa;        /* Holds physical address of the init struct */
        
@@ -986,12 +996,15 @@ struct aac_dev
        int                     maximum_num_physicals;
        int                     maximum_num_channels;
        struct fsa_dev_info     *fsa_dev;
-       pid_t                   thread_pid;
+       struct task_struct      *thread;
        int                     cardtype;
        
        /*
         *      The following is the device specific extension.
         */
+#if (!defined(AAC_MIN_FOOTPRINT_SIZE))
+#      define AAC_MIN_FOOTPRINT_SIZE 8192
+#endif
        union
        {
                struct sa_registers __iomem *sa;
@@ -1003,7 +1016,6 @@ struct aac_dev
         *      AIF thread states
         */
        u32                     aif_thread;
-       struct completion       aif_completion;
        struct aac_adapter_info adapter_info;
        struct aac_supplement_adapter_info supplement_adapter_info;
        /* These are in adapter info but they are in the io flow so
@@ -1012,6 +1024,7 @@ struct aac_dev
        u8                      nondasd_support; 
        u8                      dac_support;
        u8                      raid_scsi_mode;
+       u8                      new_comm_interface;
        /* macro side-effects BEWARE */
 #      define                  raw_io_interface \
          init->InitStructRevision==cpu_to_le32(ADAPTER_INIT_STRUCT_REVISION_4)
@@ -1034,6 +1047,8 @@ struct aac_dev
 #define aac_adapter_check_health(dev) \
        (dev)->a_ops.adapter_check_health(dev)
 
+#define aac_adapter_send(fib) \
+       ((fib)->dev)->a_ops.adapter_send(fib)
 
 #define FIB_CONTEXT_FLAG_TIMED_OUT             (0x00000001)
 
@@ -1560,7 +1575,7 @@ struct fib_ioctl
 
 struct revision
 {
-       __le32 compat;
+       u32 compat;
        __le32 version;
        __le32 build;
 };
@@ -1755,18 +1770,23 @@ static inline u32 cap_to_cyls(sector_t capacity, u32 divisor)
 }
 
 struct scsi_cmnd;
+/* SCp.phase values */
+#define AAC_OWNER_MIDLEVEL     0x101
+#define AAC_OWNER_LOWLEVEL     0x102
+#define AAC_OWNER_ERROR_HANDLER        0x103
+#define AAC_OWNER_FIRMWARE     0x106
 
 const char *aac_driverinfo(struct Scsi_Host *);
-struct fib *fib_alloc(struct aac_dev *dev);
-int fib_setup(struct aac_dev *dev);
-void fib_map_free(struct aac_dev *dev);
-void fib_free(struct fib * context);
-void fib_init(struct fib * context);
+struct fib *aac_fib_alloc(struct aac_dev *dev);
+int aac_fib_setup(struct aac_dev *dev);
+void aac_fib_map_free(struct aac_dev *dev);
+void aac_fib_free(struct fib * context);
+void aac_fib_init(struct fib * context);
 void aac_printf(struct aac_dev *dev, u32 val);
-int fib_send(u16 command, struct fib * context, unsigned long size, int priority, int wait, int reply, fib_callback callback, void *ctxt);
+int aac_fib_send(u16 command, struct fib * context, unsigned long size, int priority, int wait, int reply, fib_callback callback, void *ctxt);
 int aac_consumer_get(struct aac_dev * dev, struct aac_queue * q, struct aac_entry **entry);
 void aac_consumer_free(struct aac_dev * dev, struct aac_queue * q, u32 qnum);
-int fib_complete(struct fib * context);
+int aac_fib_complete(struct fib * context);
 #define fib_data(fibctx) ((void *)(fibctx)->hw_fib->data)
 struct aac_dev *aac_init_adapter(struct aac_dev *dev);
 int aac_get_config_status(struct aac_dev *dev);
@@ -1779,13 +1799,14 @@ int aac_rkt_init(struct aac_dev *dev);
 int aac_sa_init(struct aac_dev *dev);
 unsigned int aac_response_normal(struct aac_queue * q);
 unsigned int aac_command_normal(struct aac_queue * q);
-int aac_command_thread(struct aac_dev * dev);
+unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index);
+int aac_command_thread(void *data);
 int aac_close_fib_context(struct aac_dev * dev, struct aac_fib_context *fibctx);
-int fib_adapter_complete(struct fib * fibptr, unsigned short size);
+int aac_fib_adapter_complete(struct fib * fibptr, unsigned short size);
 struct aac_driver_ident* aac_get_driver_ident(int devtype);
 int aac_get_adapter_info(struct aac_dev* dev);
 int aac_send_shutdown(struct aac_dev *dev);
-int probe_container(struct aac_dev *dev, int cid);
+int aac_probe_container(struct aac_dev *dev, int cid);
 extern int numacb;
 extern int acbsize;
 extern char aac_driver_version[];