X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fscsi%2Faacraid%2Faacraid.h;h=7309129568b6889dc3db472b9e59d19d0031b9b2;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=8b077f224b73d85bc2ac5f0ef7541b9caa77c354;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index 8b077f224..730912956 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -7,7 +7,6 @@ *----------------------------------------------------------------------------*/ #define MAXIMUM_NUM_CONTAINERS 32 -#define MAXIMUM_NUM_ADAPTERS 8 #define AAC_NUM_FIB (256 + 64) #define AAC_NUM_IO_FIB 100 @@ -28,10 +27,7 @@ #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 { @@ -60,6 +56,7 @@ 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. @@ -404,15 +401,15 @@ struct aac_init }; 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 @@ -424,8 +421,6 @@ struct adapter_ops { 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); }; @@ -449,7 +444,24 @@ struct aac_driver_ident * 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 @@ -665,14 +677,53 @@ struct aac_fib_context { 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 { @@ -771,10 +822,12 @@ struct aac_adapter_info #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; @@ -817,7 +870,8 @@ struct aac_dev 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; @@ -826,9 +880,9 @@ struct aac_dev */ 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 */ /* @@ -841,26 +895,16 @@ struct aac_dev * 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) #define aac_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) @@ -1025,6 +1069,30 @@ struct aac_write_reply 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; @@ -1171,6 +1239,71 @@ union aac_contentinfo { 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. @@ -1205,6 +1338,31 @@ struct aac_mount { 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. */ @@ -1446,6 +1604,7 @@ void aac_consumer_free(struct aac_dev * dev, struct aac_queue * q, u32 qnum); 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 __user *arg);