/* Maximum number of adapters supported by current version of the driver */ #define PMCRAID_MAX_ADAPTERS 1024
/* Bit definitions as per firmware, bit position [0][1][2].....[31] */ #define PMC_BIT8(n) (1 << (7-n)) #define PMC_BIT16(n) (1 << (15-n)) #define PMC_BIT32(n) (1 << (31-n))
/* PMC PCI vendor ID and device ID values */ #define PCI_VENDOR_ID_PMC 0x11F8 #define PCI_DEVICE_ID_PMC_MAXRAID 0x5220
/* SET SUPPORTED DEVICES command and the option to select all the *devicestobesupported
*/ #define PMCRAID_SET_SUPPORTED_DEVICES 0xFB #define ALL_DEVICES_SUPPORTED PMC_BIT8(0)
/* This option is used with SCSI WRITE_BUFFER command */ #define PMCRAID_WR_BUF_DOWNLOAD_AND_SAVE 0x05
/* Various timeout values (in milliseconds) used. If any of these are chip *specific,movethemtopmcraid_chip_detailsstructure.
*/ #define PMCRAID_PCI_DEASSERT_TIMEOUT 2000 #define PMCRAID_BIST_TIMEOUT 2000 #define PMCRAID_AENWAIT_TIMEOUT 5000 #define PMCRAID_TRANSOP_TIMEOUT 60000
/* additional IOARCB data which can be CDB or additional request parameters *orlistofIOADLs.Firmwaresupportsmaxof512bytesforIOARCB,hencethen *numberofIOADLsarelimtedto27.Incasetheyaremorethan27,theywill *beusedinchainedform
*/ struct pmcraid_ioarcb_add_data { union { struct pmcraid_ioadl_desc ioadl[PMCRAID_IOADLS_INTERNAL];
__u8 add_cmd_params[PMCRAID_ADD_CMD_PARAM_LEN];
} u;
};
/* extended configuration table sizes are also of 32 bytes in size */ struct pmcraid_config_table_entry_ext { struct pmcraid_config_table_entry cfgte;
};
/* Ptr and bus address of DMA.able control block for this command */ struct pmcraid_control_block *ioa_cb;
dma_addr_t ioa_cb_bus_addr;
dma_addr_t dma_handle;
/* pointer to mid layer structure of SCSI commands */ struct scsi_cmnd *scsi_cmd;
struct list_head free_list; struct completion wait_for_completion; struct timer_list timer; /* needed for internal commands */
u32 timeout; /* current timeout value */
u32 index; /* index into the command list */
u8 completion_req; /* for handling internal commands */
u8 release; /* for handling completions */
/* *PeradapterstructuremaintainedbyLLD
*/ struct pmcraid_instance { /* Array of allowed-to-be-exposed resources, initialized from *ConfigutationTable,laterupdatedwithCCNs
*/ struct pmcraid_resource_entry *res_entries;
struct list_head free_res_q; /* res_entries lists for easy lookup */ struct list_head used_res_q; /* List of to be exposed resources */
spinlock_t resource_lock; /* spinlock to protect resource list */
/* structures related to command blocks */ struct kmem_cache *cmd_cachep; /* cache for cmd blocks */ struct dma_pool *control_pool; /* pool for control blocks */ char cmd_pool_name[64]; /* name of cmd cache */ char ctl_pool_name[64]; /* name of control cache */
struct pmcraid_cmd *cmd_list[PMCRAID_MAX_CMD];
struct list_head free_cmd_pool; struct list_head pending_cmd_pool;
spinlock_t free_pool_lock; /* free pool lock */
spinlock_t pending_pool_lock; /* pending pool lock */
/* Tasklet to handle deferred processing */ struct tasklet_struct isr_tasklet[PMCRAID_NUM_MSIX_VECTORS];
u32 ioa_reset_in_progress:1; /* true if IOA reset is in progress */
u32 ioa_hard_reset:1; /* TRUE if Hard Reset is needed */
u32 ioa_unit_check:1; /* Indicates Unit Check condition */
u32 ioa_bringdown:1; /* whether IOA needs to be brought down */
u32 force_ioa_reset:1; /* force adapter reset ? */
u32 reinit_cfg_table:1; /* reinit config table due to lost CCN */
u32 ioa_shutdown_type:2;/* shutdown type used during reset */ #define SHUTDOWN_NONE 0x0 #define SHUTDOWN_NORMAL 0x1 #define SHUTDOWN_ABBREV 0x2
u32 timestamp_error:1; /* indicate set timestamp for out of sync */
};
/* LLD maintained resource entry structure */ struct pmcraid_resource_entry { struct list_head queue; /* link to "to be exposed" resources */ union { struct pmcraid_config_table_entry cfg_entry; struct pmcraid_config_table_entry_ext cfg_entry_ext;
}; struct scsi_device *scsi_dev; /* Link scsi_device structure */
atomic_t read_failures; /* count of failed READ commands */
atomic_t write_failures; /* count of failed WRITE commands */
/* To indicate add/delete/modify during CCN */
u8 change_detected; #define RES_CHANGE_ADD 0x1 /* add this to mid-layer */ #define RES_CHANGE_DEL 0x2 /* remove this from mid-layer */
/* target indicates the mapped target_id assigned to this resource if *thisisVSETresource.Fornon-VSETresourcesthiswillbeun-used *orzero
*/
u8 target;
};
/* Data structures used in IOASC error code logging */ struct pmcraid_ioasc_error {
u32 ioasc_code; /* IOASC code */
u8 log_level; /* default log level assignment. */ char *error_string;
};
/* Initial log_level assignments for various IOASCs */ #define IOASC_LOG_LEVEL_NONE 0x0 /* no logging */ #define IOASC_LOG_LEVEL_MUST 0x1 /* must log: all high-severity errors */ #define IOASC_LOG_LEVEL_HARD 0x2 /* optional – low severity errors */
/* Error information maintained by LLD. LLD initializes the pmcraid_error_table *statically.
*/ staticstruct pmcraid_ioasc_error pmcraid_ioasc_error_table[] = {
{0x01180600, IOASC_LOG_LEVEL_HARD, "Recovered Error, soft media error, sector reassignment suggested"},
{0x015D0000, IOASC_LOG_LEVEL_HARD, "Recovered Error, failure prediction threshold exceeded"},
{0x015D9200, IOASC_LOG_LEVEL_HARD, "Recovered Error, soft Cache Card Battery error threshold"},
{0x015D9200, IOASC_LOG_LEVEL_HARD, "Recovered Error, soft Cache Card Battery error threshold"},
{0x02048000, IOASC_LOG_LEVEL_HARD, "Not Ready, IOA Reset Required"},
{0x02408500, IOASC_LOG_LEVEL_HARD, "Not Ready, IOA microcode download required"},
{0x03110B00, IOASC_LOG_LEVEL_HARD, "Medium Error, data unreadable, reassignment suggested"},
{0x03110C00, IOASC_LOG_LEVEL_MUST, "Medium Error, data unreadable do not reassign"},
{0x03310000, IOASC_LOG_LEVEL_HARD, "Medium Error, media corrupted"},
{0x04050000, IOASC_LOG_LEVEL_HARD, "Hardware Error, IOA can't communicate with device"},
{0x04080000, IOASC_LOG_LEVEL_MUST, "Hardware Error, device bus error"},
{0x04088000, IOASC_LOG_LEVEL_MUST, "Hardware Error, device bus is not functioning"},
{0x04118000, IOASC_LOG_LEVEL_HARD, "Hardware Error, IOA reserved area data check"},
{0x04118100, IOASC_LOG_LEVEL_HARD, "Hardware Error, IOA reserved area invalid data pattern"},
{0x04118200, IOASC_LOG_LEVEL_HARD, "Hardware Error, IOA reserved area LRC error"},
{0x04320000, IOASC_LOG_LEVEL_HARD, "Hardware Error, reassignment space exhausted"},
{0x04330000, IOASC_LOG_LEVEL_HARD, "Hardware Error, data transfer underlength error"},
{0x04330000, IOASC_LOG_LEVEL_HARD, "Hardware Error, data transfer overlength error"},
{0x04418000, IOASC_LOG_LEVEL_MUST, "Hardware Error, PCI bus error"},
{0x04440000, IOASC_LOG_LEVEL_HARD, "Hardware Error, device error"},
{0x04448200, IOASC_LOG_LEVEL_MUST, "Hardware Error, IOA error"},
{0x04448300, IOASC_LOG_LEVEL_HARD, "Hardware Error, undefined device response"},
{0x04448400, IOASC_LOG_LEVEL_HARD, "Hardware Error, IOA microcode error"},
{0x04448600, IOASC_LOG_LEVEL_HARD, "Hardware Error, IOA reset required"},
{0x04449200, IOASC_LOG_LEVEL_HARD, "Hardware Error, hard Cache Fearuee Card Battery error"},
{0x0444A000, IOASC_LOG_LEVEL_HARD, "Hardware Error, failed device altered"},
{0x0444A200, IOASC_LOG_LEVEL_HARD, "Hardware Error, data check after reassignment"},
{0x0444A300, IOASC_LOG_LEVEL_HARD, "Hardware Error, LRC error after reassignment"},
{0x044A0000, IOASC_LOG_LEVEL_HARD, "Hardware Error, device bus error (msg/cmd phase)"},
{0x04670400, IOASC_LOG_LEVEL_HARD, "Hardware Error, new device can't be used"},
{0x04678000, IOASC_LOG_LEVEL_HARD, "Hardware Error, invalid multiadapter configuration"},
{0x04678100, IOASC_LOG_LEVEL_HARD, "Hardware Error, incorrect connection between enclosures"},
{0x04678200, IOASC_LOG_LEVEL_HARD, "Hardware Error, connections exceed IOA design limits"},
{0x04678300, IOASC_LOG_LEVEL_HARD, "Hardware Error, incorrect multipath connection"},
{0x04679000, IOASC_LOG_LEVEL_HARD, "Hardware Error, command to LUN failed"},
{0x064C8000, IOASC_LOG_LEVEL_HARD, "Unit Attention, cache exists for missing/failed device"},
{0x06670100, IOASC_LOG_LEVEL_HARD, "Unit Attention, incompatible exposed mode device"},
{0x06670600, IOASC_LOG_LEVEL_HARD, "Unit Attention, attachment of logical unit failed"},
{0x06678000, IOASC_LOG_LEVEL_HARD, "Unit Attention, cables exceed connective design limit"},
{0x06678300, IOASC_LOG_LEVEL_HARD, "Unit Attention, incomplete multipath connection between" \ "IOA and enclosure"},
{0x06678400, IOASC_LOG_LEVEL_HARD, "Unit Attention, incomplete multipath connection between" \ "device and enclosure"},
{0x06678500, IOASC_LOG_LEVEL_HARD, "Unit Attention, incomplete multipath connection between" \ "IOA and remote IOA"},
{0x06678600, IOASC_LOG_LEVEL_HARD, "Unit Attention, missing remote IOA"},
{0x06679100, IOASC_LOG_LEVEL_HARD, "Unit Attention, enclosure doesn't support required multipath" \ "function"},
{0x06698200, IOASC_LOG_LEVEL_HARD, "Unit Attention, corrupt array parity detected on device"},
{0x066B0200, IOASC_LOG_LEVEL_HARD, "Unit Attention, array exposed"},
{0x066B8200, IOASC_LOG_LEVEL_HARD, "Unit Attention, exposed array is still protected"},
{0x066B9200, IOASC_LOG_LEVEL_HARD, "Unit Attention, Multipath redundancy level got worse"},
{0x07270000, IOASC_LOG_LEVEL_HARD, "Data Protect, device is read/write protected by IOA"},
{0x07278000, IOASC_LOG_LEVEL_HARD, "Data Protect, IOA doesn't support device attribute"},
{0x07278100, IOASC_LOG_LEVEL_HARD, "Data Protect, NVRAM mirroring prohibited"},
{0x07278400, IOASC_LOG_LEVEL_HARD, "Data Protect, array is short 2 or more devices"},
{0x07278600, IOASC_LOG_LEVEL_HARD, "Data Protect, exposed array is short a required device"},
{0x07278700, IOASC_LOG_LEVEL_HARD, "Data Protect, array members not at required addresses"},
{0x07278800, IOASC_LOG_LEVEL_HARD, "Data Protect, exposed mode device resource address conflict"},
{0x07278900, IOASC_LOG_LEVEL_HARD, "Data Protect, incorrect resource address of exposed mode device"},
{0x07278A00, IOASC_LOG_LEVEL_HARD, "Data Protect, Array is missing a device and parity is out of sync"},
{0x07278B00, IOASC_LOG_LEVEL_HARD, "Data Protect, maximum number of arrays already exist"},
{0x07278C00, IOASC_LOG_LEVEL_HARD, "Data Protect, cannot locate cache data for device"},
{0x07278D00, IOASC_LOG_LEVEL_HARD, "Data Protect, cache data exits for a changed device"},
{0x07279100, IOASC_LOG_LEVEL_HARD, "Data Protect, detection of a device requiring format"},
{0x07279200, IOASC_LOG_LEVEL_HARD, "Data Protect, IOA exceeds maximum number of devices"},
{0x07279600, IOASC_LOG_LEVEL_HARD, "Data Protect, missing array, volume set is not functional"},
{0x07279700, IOASC_LOG_LEVEL_HARD, "Data Protect, single device for a volume set"},
{0x07279800, IOASC_LOG_LEVEL_HARD, "Data Protect, missing multiple devices for a volume set"},
{0x07279900, IOASC_LOG_LEVEL_HARD, "Data Protect, maximum number of volument sets already exists"},
{0x07279A00, IOASC_LOG_LEVEL_HARD, "Data Protect, other volume set problem"},
};
/* macros to help in debugging */ #define pmcraid_err(...) \
printk(KERN_ERR "MaxRAID: "__VA_ARGS__)
#define pmcraid_info(...) \ if (pmcraid_debug_log) \
printk(KERN_INFO "MaxRAID: "__VA_ARGS__)
/* check if given command is a SCSI READ or SCSI WRITE command */ #define SCSI_READ_CMD 0x1 /* any of SCSI READ commands */ #define SCSI_WRITE_CMD 0x2 /* any of SCSI WRITE commands */ #define SCSI_CMD_TYPE(opcode) \
({ u8 op = opcode; u8 __type = 0;\ if (op == READ_6 || op == READ_10 || op == READ_12 || op == READ_16)\
__type = SCSI_READ_CMD;\ elseif (op == WRITE_6 || op == WRITE_10 || op == WRITE_12 || \
op == WRITE_16)\
__type = SCSI_WRITE_CMD;\
__type;\
})
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.