#define MEGARAID_VERSION \ "v2.00.4 (Release Date: Thu Feb 9 08:51:30 EST 2006)\n"
/* * Driver features - change the values to enable or disable features in the * driver.
*/
/* * Command coalescing - This feature allows the driver to be able to combine * two or more commands and issue as one command in order to boost I/O * performance. Useful if the nature of the I/O is sequential. It is not very * useful for random natured I/Os.
*/ #define MEGA_HAVE_COALESCING 0
/* * Clustering support - Set this flag if you are planning to use the * clustering services provided by the megaraid controllers and planning to * setup a cluster
*/ #define MEGA_HAVE_CLUSTERING 1
/* * Driver statistics - Set this flag if you are interested in statics about * number of I/O completed on each logical drive and how many interrupts * generated. If enabled, this information is available through /proc * interface and through the private ioctl. Setting this flag has a * performance penalty.
*/ #define MEGA_HAVE_STATS 0
/* * Enhanced /proc interface - This feature will allow you to have a more * detailed /proc interface for megaraid driver. E.g., a real time update of * the status of the logical drives, battery status, physical drives etc.
*/ #define MEGA_HAVE_ENH_PROC 1
#define MBOX_BUSY_WAIT 10 /* wait for up to 10 usec for
mailbox to be free */ #define DEFAULT_INITIATOR_ID 7
#define MAX_SGLIST 64 /* max supported in f/w */ #define MIN_SGLIST 26 /* guaranteed to support these many */ #define MAX_COMMANDS 126 #define CMDID_INT_CMDS MAX_COMMANDS+1 /* make sure CMDID_INT_CMDS is less than max commands
supported by any f/w */
#define MAX_CDB_LEN 10 #define MAX_EXT_CDB_LEN 16 /* we support cdb length up to 16 */
/* * Flags to follow the scb as it transitions between various stages
*/ #define SCB_FREE 0x0000 /* on the free list */ #define SCB_ACTIVE 0x0001 /* off the free list */ #define SCB_PENDQ 0x0002 /* on the pending queue */ #define SCB_ISSUED 0x0004 /* issued - owner f/w */ #define SCB_ABORT 0x0008 /* Got an abort for this one */ #define SCB_RESET 0x0010 /* Got a reset for this one */
/* * Utilities declare this strcture size as 1024 bytes. So more fields can * be added in future.
*/ typedefstruct {
u32 data_size; /* current size in bytes (not including resvd) */
u32 config_signature; /* Current value is 0x00282008 * 0x28=MAX_LOGICAL_DRIVES, * 0x20=Number of stripes and
* 0x08=Number of spans */
struct notify {
u32 global_counter; /* Any change increments this counter */
u8 param_counter; /* Indicates any params changed */
u8 param_id; /* Param modified - defined below */
u16 param_val; /* New val of last param modified */
u8 ldrv_op_counter; /* Indicates ldrv op started/completed */
u8 ldrv_opid; /* ldrv num */
u8 ldrv_opcmd; /* ldrv operation - defined below */
u8 ldrv_opstatus; /* status of the operation */
u8 ldrv_state_counter; /* Indicates change of ldrv state */
u8 ldrv_state_id; /* ldrv num */
u8 ldrv_state_new; /* New state */
u8 ldrv_state_old; /* old state */
u8 pdrv_state_counter; /* Indicates change of ldrv state */
u8 pdrv_state_id; /* pdrv id */
u8 pdrv_state_new; /* New state */
u8 pdrv_state_old; /* old state */
u8 pdrv_fmt_counter; /* Indicates pdrv format started/over */
u8 pdrv_fmt_id; /* pdrv id */
u8 pdrv_fmt_val; /* format started/over */
u8 pdrv_fmt_rsvd;
u8 targ_xfer_counter; /* Indicates SCSI-2 Xfer rate change */
u8 targ_xfer_id; /* pdrv Id */
u8 targ_xfer_val; /* new Xfer params of last pdrv */
u8 targ_xfer_rsvd;
u8 fcloop_id_chg_counter; /* Indicates loopid changed */
u8 fcloopid_pdrvid; /* pdrv id */
u8 fcloop_id0; /* loopid on fc loop 0 */
u8 fcloop_id1; /* loopid on fc loop 1 */
u8 fcloop_state_counter; /* Indicates loop state changed */
u8 fcloop_state0; /* state of fc loop 0 */
u8 fcloop_state1; /* state of fc loop 1 */
u8 fcloop_state_rsvd;
} __attribute__ ((packed));
u8 battery_status;
u8 num_ldrv; /* No. of Log Drives configured */
u8 recon_state[MAX_LOGICAL_DRIVES_40LD / 8]; /* State of
reconstruct */
u16 ldrv_op_status[MAX_LOGICAL_DRIVES_40LD / 8]; /* logdrv
Status */
u32 ldrv_size[MAX_LOGICAL_DRIVES_40LD];/* Size of each log drv */
u8 ldrv_prop[MAX_LOGICAL_DRIVES_40LD];
u8 ldrv_state[MAX_LOGICAL_DRIVES_40LD];/* State of log drives */
u8 pdrv_state[FC_MAX_PHYSICAL_DEVICES];/* State of phys drvs. */
u16 pdrv_format[FC_MAX_PHYSICAL_DEVICES / 16];
typedefstruct {
u8 type; /* Type of the device */
u8 cur_status; /* current status of the device */
u8 tag_depth; /* Level of tagging */
u8 sync_neg; /* sync negotiation - ENABLE or DISABLE */
u32 size; /* configurable size in terms of 512 byte
blocks */
}__attribute__ ((packed)) phys_drv;
typedefstruct {
u8 nlog_drives; /* number of logical drives */
u8 resvd[3];
logdrv_40ld ldrv[MAX_LOGICAL_DRIVES_40LD];
phys_drv pdrv[MAX_PHYSICAL_DRIVES];
}__attribute__ ((packed)) disk_array_40ld;
typedefstruct {
u8 nlog_drives; /* number of logical drives */
u8 resvd[3];
logdrv_8ld ldrv[MAX_LOGICAL_DRIVES_8LD];
phys_drv pdrv[MAX_PHYSICAL_DRIVES];
}__attribute__ ((packed)) disk_array_8ld;
/* * User ioctl structure. * This structure will be used for Traditional Method ioctl interface * commands (0x80),Alternate Buffer Method (0x81) ioctl commands and the * Driver ioctls. * The Driver ioctl interface handles the commands at the driver level, * without being sent to the card.
*/ /* system call imposed limit. Change accordingly */ #define IOCTL_MAX_DATALEN 4096
/* * struct mcontroller is used to pass information about the controllers in the * system. Its up to the application how to use the information. We are passing * as much info about the cards as possible and useful. Before issuing the * call to find information about the cards, the application needs to issue a * ioctl first to find out the number of controllers in the system.
*/ #define MAX_CONTROLLERS 32
/* * The ioctl command. No other command shall be used for this interface
*/ #define USCSICMD VENDOR_SPECIFIC_COMMANDS
/* * Data direction flags
*/ #define UIOC_RD 0x00001 #define UIOC_WR 0x00002
/* * ioctl opcodes
*/ #define MBOX_CMD 0x00000 /* DCMD or passthru command */ #define GET_DRIVER_VER 0x10000 /* Get driver version */ #define GET_N_ADAP 0x20000 /* Get number of adapters */ #define GET_ADAP_INFO 0x30000 /* Get information about a adapter */ #define GET_CAP 0x40000 /* Get ioctl capabilities */ #define GET_STATS 0x50000 /* Get statistics, including error info */
/* * The ioctl structure. * MBOX macro converts a nitioctl_t structure to megacmd_t pointer and * MBOX_P macro converts a nitioctl_t pointer to megacmd_t pointer.
*/ typedefstruct { char signature[8]; /* Must contain "MEGANIT" */
u32 opcode; /* opcode for the command */
u32 adapno; /* adapter number */ union {
u8 __raw_mbox[18]; void __user *__uaddr; /* xferaddr for non-mbox cmds */
}__ua;
u32 xferlen; /* xferlen for DCMD and non-mbox
commands */
u32 flags; /* data direction flags */
}nitioctl_t;
/* * I/O statistics for some applications like SNMP agent. The caller must * provide the number of logical drives for which status should be reported.
*/ typedefstruct { int num_ldrv; /* Number for logical drives for which the
status should be reported. */
u32 nreads[MAX_LOGICAL_DRIVES_40LD]; /* number of reads for
each logical drive */
u32 nreadblocks[MAX_LOGICAL_DRIVES_40LD]; /* number of blocks read for each logical
drive */
u32 nwrites[MAX_LOGICAL_DRIVES_40LD]; /* number of writes for each logical
drive */
u32 nwriteblocks[MAX_LOGICAL_DRIVES_40LD]; /* number of blocks writes for each
logical drive */
u32 rd_errors[MAX_LOGICAL_DRIVES_40LD]; /* number of read errors for each
logical drive */
u32 wr_errors[MAX_LOGICAL_DRIVES_40LD]; /* number of write errors for each
logical drive */
}megastat_t;
struct private_bios_data {
u8 geometry:4; /* * bits 0-3 - BIOS geometry * 0x0001 - 1GB * 0x0010 - 2GB * 0x1000 - 8GB * Others values are invalid
*/
u8 unused:4; /* bits 4-7 are unused */
u8 boot_drv; /* * logical drive set as boot drive * 0..7 - for 8LD cards * 0..39 - for 40LD cards
*/
u8 rsvd[12];
u16 cksum; /* 0-(sum of first 13 bytes of this structure) */
} __attribute__ ((packed));
/* * Mailbox and firmware commands and subopcodes used in this driver.
*/
int has_64bit_addr; /* are we using 64-bit addressing */ int support_ext_cdb; int boot_ldrv_enabled; int boot_ldrv; int boot_pdrv_enabled; /* boot from physical drive */ int boot_pdrv_ch; /* boot physical drive channel */ int boot_pdrv_tgt; /* boot physical drive target */
int support_random_del; /* Do we support random deletion of
logdrvs */ int read_ldidmap; /* set after logical drive deltion. The logical drive number must be read from the
map */
atomic_t quiescent; /* a stage reached when delete logical drive needs to be done. Stop sending requests to the hba till
delete operation is completed */
spinlock_t lock;
u8 logdrv_chan[MAX_CHANNELS+NVIRT_CHAN]; /* logical drive are on
what channels. */ int mega_ch_class;
u8 sglen; /* f/w supported scatter-gather list length */
scb_t int_scb; struct mutex int_mtx; /* To synchronize the internal
commands */ int int_status; /* status of internal cmd */ struct completion int_waitq; /* wait queue for internal
cmds */
int has_cluster; /* cluster support on this HBA */
}adapter_t;
struct mega_hbas { int is_bios_enabled;
adapter_t *hostdata_addr;
};
/* * For state flag. Do not use LSB(8 bits) which are * reserved for storing info about channels.
*/ #define IN_ABORT 0x80000000L #define IN_RESET 0x40000000L #define BOARD_MEMMAP 0x20000000L #define BOARD_IOMAP 0x10000000L #define BOARD_40LD 0x08000000L #define BOARD_64BIT 0x04000000L
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.