Merge branch 'origin'
[pandora-kernel.git] / drivers / scsi / aacraid / aacraid.h
index d54b1cc..2d430b7 100644 (file)
@@ -481,6 +481,7 @@ enum aac_log_level {
 #define FSAFS_NTC_FIB_CONTEXT                  0x030c
 
 struct aac_dev;
+struct fib;
 
 struct adapter_ops
 {
@@ -489,6 +490,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 +531,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 +668,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 +706,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 +724,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 +734,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 +948,6 @@ struct aac_dev
        const char              *name;
        int                     id;
 
-       u16                     irq_mask;
        /*
         *      negotiated FIB settings
         */
@@ -972,6 +982,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 */
        
@@ -992,6 +1003,9 @@ struct aac_dev
        /*
         *      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;
@@ -1012,6 +1026,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 +1049,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 +1577,7 @@ struct fib_ioctl
 
 struct revision
 {
-       __le32 compat;
+       u32 compat;
        __le32 version;
        __le32 build;
 };
@@ -1757,16 +1774,16 @@ static inline u32 cap_to_cyls(sector_t capacity, u32 divisor)
 struct scsi_cmnd;
 
 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 +1796,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);
+unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index);
 int aac_command_thread(struct aac_dev * dev);
 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[];