* D E F I N E S
*----------------------------------------------------------------------------*/
-#define MAXIMUM_NUM_CONTAINERS 31
-#define MAXIMUM_NUM_ADAPTERS 8
+#define MAXIMUM_NUM_CONTAINERS 32
-#define AAC_NUM_FIB 578
-//#define AAC_NUM_IO_FIB 512
+#define AAC_NUM_FIB (256 + 64)
#define AAC_NUM_IO_FIB 100
-#define AAC_MAX_TARGET (MAXIMUM_NUM_CONTAINERS+1)
#define AAC_MAX_LUN (8)
#define AAC_MAX_HOSTPHYSMEMPAGES (0xfffff)
/*
* These macros convert from physical channels to virtual channels
*/
-#define CONTAINER_CHANNEL (0)
+#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)
+
#define aac_phys_to_logical(x) (x+1)
#define aac_logical_to_phys(x) (x?x-1:0)
-#define AAC_DETAILED_STATUS_INFO
-
-extern int nondasd;
-extern int paemode;
+/* #define AAC_DETAILED_STATUS_INFO */
struct diskparm
{
#define CT_VOLUME_OF_MIRRORS 12 /* volume of mirror */
#define CT_PSEUDO_RAID 13 /* really raid4 */
#define CT_LAST_VOLUME_TYPE 14
+#define CT_OK 218
/*
* Types of objects addressable in some fashion by the client.
#define FT_SOCK 6 /* socket */
#define FT_FIFO 7 /* fifo */
#define FT_FILESYS 8 /* ADAPTEC's "FSA"(tm) filesystem */
-#define FT_DRIVE 9 /* physical disk - addressable in scsi by bus/target/lun */
+#define FT_DRIVE 9 /* physical disk - addressable in scsi by bus/id/lun */
#define FT_SLICE 10 /* virtual disk - raw volume - slice */
#define FT_PARTITION 11 /* FSA partition - carved out of a slice - building block for containers */
#define FT_VOLUME 12 /* Container - Volume Set */
};
enum aac_log_level {
- LOG_INIT = 10,
- LOG_INFORMATIONAL = 20,
- LOG_WARNING = 30,
- LOG_LOW_ERROR = 40,
- LOG_MEDIUM_ERROR = 50,
- LOG_HIGH_ERROR = 60,
- LOG_PANIC = 70,
- LOG_DEBUG = 80,
- LOG_WINDBG_PRINT = 90
+ LOG_AAC_INIT = 10,
+ LOG_AAC_INFORMATIONAL = 20,
+ LOG_AAC_WARNING = 30,
+ LOG_AAC_LOW_ERROR = 40,
+ LOG_AAC_MEDIUM_ERROR = 50,
+ LOG_AAC_HIGH_ERROR = 60,
+ LOG_AAC_PANIC = 70,
+ LOG_AAC_DEBUG = 80,
+ LOG_AAC_WINDBG_PRINT = 90
};
#define FSAFS_NTC_GET_ADAPTER_FIB_CONTEXT 0x030b
{
void (*adapter_interrupt)(struct aac_dev *dev);
void (*adapter_notify)(struct aac_dev *dev, u32 event);
- void (*adapter_enable_int)(struct aac_dev *dev, u32 event);
- void (*adapter_disable_int)(struct aac_dev *dev, u32 event);
int (*adapter_sync_cmd)(struct aac_dev *dev, u32 command, u32 p1, u32 *status);
int (*adapter_check_health)(struct aac_dev *dev);
};
struct aac_driver_ident
{
- int (*init)(struct aac_dev *dev, unsigned long num);
+ int (*init)(struct aac_dev *dev);
char * name;
char * vname;
char * model;
* dma mask such that fib memory will be allocated where the
* adapter firmware can get to it.
*/
-#define AAC_QUIRK_31BIT 1
+#define AAC_QUIRK_31BIT 0x0001
+
+/*
+ * Some adapter firmware, when the raid card's cache is turned off, can not
+ * split up scatter gathers in order to deal with the limits of the
+ * underlying CHIM. This limit is 34 scatter gather elements.
+ */
+#define AAC_QUIRK_34SG 0x0002
+
+/*
+ * This adapter is a slave (no Firmware)
+ */
+#define AAC_QUIRK_SLAVE 0x0004
+
+/*
+ * This adapter is a master.
+ */
+#define AAC_QUIRK_MASTER 0x0008
/*
* The adapter interface specs all queues to be located in the same
#define InboundMailbox2 IndexRegs.Mailbox[2]
#define InboundMailbox3 IndexRegs.Mailbox[3]
#define InboundMailbox4 IndexRegs.Mailbox[4]
+#define InboundMailbox5 IndexRegs.Mailbox[5]
+#define InboundMailbox6 IndexRegs.Mailbox[6]
+#define InboundMailbox7 IndexRegs.Mailbox[7]
#define INBOUNDDOORBELL_0 cpu_to_le32(0x00000001)
#define INBOUNDDOORBELL_1 cpu_to_le32(0x00000002)
struct aac_fib_context {
s16 type; // used for verification of structure
s16 size;
+ u32 unique; // unique value representing this context
ulong jiffies; // used for cleanup - dmb changed to ulong
struct list_head next; // used to link context's into a linked list
struct semaphore wait_sem; // this is used to wait for the next fib to arrive.
struct list_head fib_list; // this holds fibs and their attachd hw_fibs
};
-struct fsa_scsi_hba {
- u32 size[MAXIMUM_NUM_CONTAINERS];
- u32 type[MAXIMUM_NUM_CONTAINERS];
- u8 valid[MAXIMUM_NUM_CONTAINERS];
- u8 ro[MAXIMUM_NUM_CONTAINERS];
- u8 locked[MAXIMUM_NUM_CONTAINERS];
- u8 deleted[MAXIMUM_NUM_CONTAINERS];
- char devname[MAXIMUM_NUM_CONTAINERS][8];
+struct sense_data {
+ u8 error_code; /* 70h (current errors), 71h(deferred errors) */
+ u8 valid:1; /* A valid bit of one indicates that the information */
+ /* field contains valid information as defined in the
+ * SCSI-2 Standard.
+ */
+ u8 segment_number; /* Only used for COPY, COMPARE, or COPY AND VERIFY Commands */
+ u8 sense_key:4; /* Sense Key */
+ u8 reserved:1;
+ u8 ILI:1; /* Incorrect Length Indicator */
+ u8 EOM:1; /* End Of Medium - reserved for random access devices */
+ u8 filemark:1; /* Filemark - reserved for random access devices */
+
+ u8 information[4]; /* for direct-access devices, contains the unsigned
+ * logical block address or residue associated with
+ * the sense key
+ */
+ u8 add_sense_len; /* number of additional sense bytes to follow this field */
+ u8 cmnd_info[4]; /* not used */
+ u8 ASC; /* Additional Sense Code */
+ u8 ASCQ; /* Additional Sense Code Qualifier */
+ u8 FRUC; /* Field Replaceable Unit Code - not used */
+ u8 bit_ptr:3; /* indicates which byte of the CDB or parameter data
+ * was in error
+ */
+ u8 BPV:1; /* bit pointer valid (BPV): 1- indicates that
+ * the bit_ptr field has valid value
+ */
+ u8 reserved2:2;
+ u8 CD:1; /* command data bit: 1- illegal parameter in CDB.
+ * 0- illegal parameter in data.
+ */
+ u8 SKSV:1;
+ u8 field_ptr[2]; /* byte of the CDB or parameter data in error */
+};
+
+struct fsa_dev_info {
+ u64 last;
+ u64 size;
+ u32 type;
+ u16 queue_depth;
+ u8 valid;
+ u8 ro;
+ u8 locked;
+ u8 deleted;
+ char devname[8];
+ struct sense_data sense_data;
};
struct fib {
#define AAC_OPT_SGMAP_HOST64 cpu_to_le32(1<<10)
#define AAC_OPT_ALARM cpu_to_le32(1<<11)
#define AAC_OPT_NONDASD cpu_to_le32(1<<12)
+#define AAC_OPT_SCSI_MANAGED cpu_to_le32(1<<13)
+#define AAC_OPT_RAID_SCSI_MODE cpu_to_le32(1<<14)
struct aac_dev
{
- struct aac_dev *next;
+ struct list_head entry;
const char *name;
int id;
size_t comm_size;
struct Scsi_Host *scsi_host_ptr;
- struct fsa_scsi_hba fsa_dev;
+ int maximum_num_containers;
+ struct fsa_dev_info *fsa_dev;
pid_t thread_pid;
int cardtype;
*/
union
{
- struct sa_registers *sa;
- struct rx_registers *rx;
- struct rkt_registers *rkt;
+ struct sa_registers __iomem *sa;
+ struct rx_registers __iomem *rx;
+ struct rkt_registers __iomem *rkt;
} regs;
u32 OIMR; /* Mask Register Cache */
/*
- * The following is the number of the individual adapter
+ * AIF thread states
*/
- u32 devnum;
u32 aif_thread;
struct completion aif_completion;
struct aac_adapter_info adapter_info;
* lets break them out so we don't have to do an AND to check them
*/
u8 nondasd_support;
- u8 pae_support;
+ u8 dac_support;
+ u8 raid_scsi_mode;
};
-#define AllocateAndMapFibSpace(dev, MapFibContext) \
- dev->a_ops.AllocateAndMapFibSpace(dev, MapFibContext)
-
-#define UnmapAndFreeFibSpace(dev, MapFibContext) \
- dev->a_ops.UnmapAndFreeFibSpace(dev, MapFibContext)
-
#define aac_adapter_interrupt(dev) \
- dev->a_ops.adapter_interrupt(dev)
+ (dev)->a_ops.adapter_interrupt(dev)
#define aac_adapter_notify(dev, event) \
- dev->a_ops.adapter_notify(dev, event)
+ (dev)->a_ops.adapter_notify(dev, event)
-#define aac_adapter_enable_int(dev, event) \
- dev->a_ops.adapter_enable_int(dev, event)
-
-#define aac_adapter_disable_int(dev, event) \
- dev->a_ops.adapter_disable_int(dev, event)
#define aac_adapter_check_health(dev) \
(dev)->a_ops.adapter_check_health(dev)
u32 committed;
};
+#define CT_FLUSH_CACHE 129
+struct aac_synchronize {
+ u32 command; /* VM_ContainerConfig */
+ u32 type; /* CT_FLUSH_CACHE */
+ u32 cid;
+ u32 parm1;
+ u32 parm2;
+ u32 parm3;
+ u32 parm4;
+ u32 count; /* sizeof(((struct aac_synchronize_reply *)NULL)->data) */
+};
+
+struct aac_synchronize_reply {
+ u32 dummy0;
+ u32 dummy1;
+ u32 status; /* CT_OK */
+ u32 parm1;
+ u32 parm2;
+ u32 parm3;
+ u32 parm4;
+ u32 parm5;
+ u8 data[16];
+};
+
struct aac_srb
{
u32 function;
u32 channel;
- u32 target;
+ u32 id;
u32 lun;
u32 timeout;
u32 flags;
struct aac_fsinfo filesys; /* valid iff ObjType == FT_FILESYS && !(ContentState & FSCS_NOTCLEAN) */
};
+/*
+ * Query for Container Configuration Status
+ */
+
+#define CT_GET_CONFIG_STATUS 147
+struct aac_get_config_status {
+ u32 command; /* VM_ContainerConfig */
+ u32 type; /* CT_GET_CONFIG_STATUS */
+ u32 parm1;
+ u32 parm2;
+ u32 parm3;
+ u32 parm4;
+ u32 parm5;
+ u32 count; /* sizeof(((struct aac_get_config_status_resp *)NULL)->data) */
+};
+
+#define CFACT_CONTINUE 0
+#define CFACT_PAUSE 1
+#define CFACT_ABORT 2
+struct aac_get_config_status_resp {
+ u32 response; /* ST_OK */
+ u32 dummy0;
+ u32 status; /* CT_OK */
+ u32 parm1;
+ u32 parm2;
+ u32 parm3;
+ u32 parm4;
+ u32 parm5;
+ struct {
+ u32 action; /* CFACT_CONTINUE, CFACT_PAUSE or CFACT_ABORT */
+ u16 flags;
+ s16 count;
+ } data;
+};
+
+/*
+ * Accept the configuration as-is
+ */
+
+#define CT_COMMIT_CONFIG 152
+
+struct aac_commit_config {
+ u32 command; /* VM_ContainerConfig */
+ u32 type; /* CT_COMMIT_CONFIG */
+};
+
+/*
+ * Query for Container Configuration Count
+ */
+
+#define CT_GET_CONTAINER_COUNT 4
+struct aac_get_container_count {
+ u32 command; /* VM_ContainerConfig */
+ u32 type; /* CT_GET_CONTAINER_COUNT */
+};
+
+struct aac_get_container_count_resp {
+ u32 response; /* ST_OK */
+ u32 dummy0;
+ u32 MaxContainers;
+ u32 ContainerSwitchEntries;
+ u32 MaxPartitions;
+};
+
+
/*
* Query for "mountable" objects, ie, objects that are typically
* associated with a drive letter on the client (host) side.
struct aac_mntent mnt[1];
};
+#define CT_READ_NAME 130
+struct aac_get_name {
+ u32 command; /* VM_ContainerConfig */
+ u32 type; /* CT_READ_NAME */
+ u32 cid;
+ u32 parm1;
+ u32 parm2;
+ u32 parm3;
+ u32 parm4;
+ u32 count; /* sizeof(((struct aac_get_name_resp *)NULL)->data) */
+};
+
+#define CT_OK 218
+struct aac_get_name_resp {
+ u32 dummy0;
+ u32 dummy1;
+ u32 status; /* CT_OK */
+ u32 parm1;
+ u32 parm2;
+ u32 parm3;
+ u32 parm4;
+ u32 parm5;
+ u8 data[16];
+};
+
/*
* The following command is sent to shut down each container.
*/
{
s32 cnum;
s32 bus;
- s32 target;
+ s32 id;
s32 lun;
u32 valid;
u32 locked;
u32 disknum;
u32 cnum;
};
-
+
struct fib_ioctl
{
- char *fibctx;
- int wait;
- char *fib;
+ u32 fibctx;
+ s32 wait;
+ char __user *fib;
};
struct revision
#define FSACTL_MINIPORT_REV_CHECK CTL_CODE(2107, METHOD_BUFFERED)
#define FSACTL_GET_PCI_INFO CTL_CODE(2119, METHOD_BUFFERED)
#define FSACTL_FORCE_DELETE_DISK CTL_CODE(2120, METHOD_NEITHER)
+#define FSACTL_GET_CONTAINERS 2131
struct aac_common
* only used for debugging.
*/
-#if DBG
+#ifdef DBG
#define FIB_COUNTER_INCREMENT(counter) (counter)++
#else
#define FIB_COUNTER_INCREMENT(counter)
#define WRITE_PERMANENT_PARAMETERS cpu_to_le32(0x0000000b)
#define HOST_CRASHING cpu_to_le32(0x0000000d)
#define SEND_SYNCHRONOUS_FIB cpu_to_le32(0x0000000c)
+#define COMMAND_POST_RESULTS cpu_to_le32(0x00000014)
#define GET_ADAPTER_PROPERTIES cpu_to_le32(0x00000019)
#define RE_INIT_ADAPTER cpu_to_le32(0x000000ee)
* Phases are bit oriented. It is NOT valid to have multiple bits set
*/
-#define SELF_TEST_FAILED cpu_to_le32(0x00000004)
-#define KERNEL_UP_AND_RUNNING cpu_to_le32(0x00000080)
-#define KERNEL_PANIC cpu_to_le32(0x00000100)
+#define SELF_TEST_FAILED (cpu_to_le32(0x00000004))
+#define MONITOR_PANIC (cpu_to_le32(0x00000020))
+#define KERNEL_UP_AND_RUNNING (cpu_to_le32(0x00000080))
+#define KERNEL_PANIC (cpu_to_le32(0x00000100))
/*
* Doorbell bit defines
*/
+#define DoorBellSyncCmdAvailable cpu_to_le32(1<<0) // Host -> Adapter
#define DoorBellPrintfDone cpu_to_le32(1<<5) // Host -> Adapter
#define DoorBellAdapterNormCmdReady cpu_to_le32(1<<1) // Adapter -> Host
#define DoorBellAdapterNormRespReady cpu_to_le32(1<<2) // Adapter -> Host
*/
#define AifCmdEventNotify 1 /* Notify of event */
+#define AifEnConfigChange 3 /* Adapter configuration change */
+#define AifEnContainerChange 4 /* Container configuration change */
+#define AifEnDeviceFailure 5 /* SCSI device failed */
+#define AifEnAddContainer 15 /* A new array was created */
+#define AifEnDeleteContainer 16 /* A container was deleted */
+#define AifEnExpEvent 23 /* Firmware Event Log */
+#define AifExeFirmwarePanic 3 /* Firmware Event Panic */
+#define AifHighPriority 3 /* Highest Priority Event */
+
#define AifCmdJobProgress 2 /* Progress report */
+#define AifJobCtrZero 101 /* Array Zero progress */
+#define AifJobStsSuccess 1 /* Job completes */
#define AifCmdAPIReport 3 /* Report from other user of API */
#define AifCmdDriverNotify 4 /* Notify host driver of event */
+#define AifDenMorphComplete 200 /* A morph operation completed */
+#define AifDenVolumeExtendComplete 201 /* A volume extend completed */
#define AifReqJobList 100 /* Gets back complete job list */
#define AifReqJobsForCtr 101 /* Gets back jobs for specific container */
#define AifReqJobsForScsi 102 /* Gets back jobs for specific SCSI device */
int 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);
int aac_get_containers(struct aac_dev *dev);
int aac_scsi_cmd(struct scsi_cmnd *cmd);
-int aac_dev_ioctl(struct aac_dev *dev, int cmd, void *arg);
-int aac_do_ioctl(struct aac_dev * dev, int cmd, void *arg);
-int aac_rx_init(struct aac_dev *dev, unsigned long devNumber);
-int aac_rkt_init(struct aac_dev *dev, unsigned long devNumber);
-int aac_sa_init(struct aac_dev *dev, unsigned long devNumber);
+int aac_dev_ioctl(struct aac_dev *dev, int cmd, void __user *arg);
+int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg);
+int aac_rx_init(struct aac_dev *dev);
+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);