?? libscsi.h
字號:
* @nldrv : Number of logical drives configured * @rsvd : * @size : size of each logical drive * @prop : * @state : state of each logical drive */typedef struct { unsigned char nldrv; unsigned char rsvd[3]; unsigned int size[MAX_LOGICAL_DRIVES_8LD]; unsigned char prop[MAX_LOGICAL_DRIVES_8LD]; unsigned char state[MAX_LOGICAL_DRIVES_8LD];} __attribute__ ((packed)) mraid_ldrv_info_t;/** * mraid_pdrv_info_t - information about the physical drives * @pdrv_state : state of each physical drive */typedef struct { unsigned char pdrv_state[MBOX_MAX_PHYSICAL_DRIVES]; unsigned char rsvd;} __attribute__ ((packed)) mraid_pdrv_info_t;/** * mraid_inquiry_t - RAID inquiry, mailbox command 0x05 * @mraid_adapinfo_t : adapter information * @mraid_ldrv_info_t : logical drives information * @mraid_pdrv_info_t : physical drives information */typedef struct { mraid_adapinfo_t adapter_info; mraid_ldrv_info_t logdrv_info; mraid_pdrv_info_t pdrv_info;} __attribute__ ((packed)) mraid_inquiry_t;/** * mraid_extinq_t - RAID extended inquiry, mailbox command 0x04 * * @raid_inq : raid inquiry * @phys_drv_format : * @stack_attn : * @modem_status : * @rsvd : */typedef struct { mraid_inquiry_t raid_inq; unsigned short phys_drv_format[MAX_MBOX_CHANNELS]; unsigned char stack_attn; unsigned char modem_status; unsigned char rsvd[2];} __attribute__ ((packed)) mraid_extinq_t;/** * adap_device_t - device information * @channel : channel fpor the device * @target : target ID of the device */typedef struct { unsigned char channel; unsigned char target;}__attribute__ ((packed)) adap_device_t;/** * adap_span_40ld_t - 40LD span * @start_blk : starting block * @num_blks : number of blocks */typedef struct { unsigned int start_blk; unsigned int num_blks; adap_device_t device[MAX_ROW_SIZE_40LD];}__attribute__ ((packed)) adap_span_40ld_t;/** * adap_span_8ld_t - 8LD span * @start_blk : starting block * @num_blks : number of blocks */typedef struct { unsigned int start_blk; unsigned int num_blks; adap_device_t device[MAX_ROW_SIZE_8LD];}__attribute__ ((packed)) adap_span_8ld_t;/** * logdrv_param_t - logical drives parameters * * @span_depth : total number of spans * @level : RAID level * @read_ahead : read ahead, no read ahead, adaptive read ahead * @stripe_sz : encoded stripe size * @status : status of the logical drive * @write_mode : write mode, write_through/write_back * @direct_io : direct io or through cache * @row_size : number of stripes in a row */typedef struct { unsigned char span_depth; unsigned char level; unsigned char read_ahead; unsigned char stripe_sz; unsigned char status; unsigned char write_mode; unsigned char direct_io; unsigned char row_size;} __attribute__ ((packed)) logdrv_param_t;/** * logdrv_40ld_t - logical drive definition for 40LD controllers * @lparam : logical drives parameters * @span : span */typedef struct { logdrv_param_t lparam; adap_span_40ld_t span[SPAN_DEPTH_8_SPANS];}__attribute__ ((packed)) logdrv_40ld_t;/** * logdrv_8ld_span8_t - logical drive definition for 8LD controllers * @lparam : logical drives parameters * @span : span * * 8-LD logical drive with upto 8 spans */typedef struct { logdrv_param_t lparam; adap_span_8ld_t span[SPAN_DEPTH_8_SPANS];}__attribute__ ((packed)) logdrv_8ld_span8_t;/** * logdrv_8ld_span4_t - logical drive definition for 8LD controllers * @lparam : logical drives parameters * @span : span * * 8-LD logical drive with upto 4 spans */typedef struct { logdrv_param_t lparam; adap_span_8ld_t span[SPAN_DEPTH_4_SPANS];}__attribute__ ((packed)) logdrv_8ld_span4_t;/** * phys_drive_t - physical device information * @type : Type of the device * @cur_status : current status of the device * @tag_depth : Level of tagging * @sync_neg : sync negotiation - ENABLE or DISBALE * @size : configurable size in terms of 512 byte */typedef struct { unsigned char type; unsigned char cur_status; unsigned char tag_depth; unsigned char sync_neg; unsigned int size;}__attribute__ ((packed)) phys_drive_t;/** * disk_array_40ld_t - disk array for 40LD controllers * @numldrv : number of logical drives * @resvd : * @ldrv : logical drives information * @pdrv : physical drives information */typedef struct { unsigned char numldrv; unsigned char resvd[3]; logdrv_40ld_t ldrv[MAX_LOGICAL_DRIVES_40LD]; phys_drive_t pdrv[MBOX_MAX_PHYSICAL_DRIVES];}__attribute__ ((packed)) disk_array_40ld_t;/** * disk_array_8ld_span8_t - disk array for 8LD controllers * @numldrv : number of logical drives * @resvd : * @ldrv : logical drives information * @pdrv : physical drives information * * Disk array for 8LD logical drives with upto 8 spans */typedef struct { unsigned char numldrv; unsigned char resvd[3]; logdrv_8ld_span8_t ldrv[MAX_LOGICAL_DRIVES_8LD]; phys_drive_t pdrv[MBOX_MAX_PHYSICAL_DRIVES];}__attribute__ ((packed)) disk_array_8ld_span8_t;/** * disk_array_8ld_span4_t - disk array for 8LD controllers * @numldrv : number of logical drives * @resvd : * @ldrv : logical drives information * @pdrv : physical drives information * * Disk array for 8LD logical drives with upto 4 spans */typedef struct { unsigned char numldrv; unsigned char resvd[3]; logdrv_8ld_span4_t ldrv[MAX_LOGICAL_DRIVES_8LD]; phys_drive_t pdrv[MBOX_MAX_PHYSICAL_DRIVES];}__attribute__ ((packed)) disk_array_8ld_span4_t;/** * private_bios_data - bios private data for boot devices * @geometry : bits 0-3 - BIOS geometry, 0x0001 - 1GB, 0x0010 - 2GB, * 0x1000 - 8GB, Others values are invalid * @unused : bits 4-7 are unused * @boot_drv : logical drive set as boot drive, 0..7 - for 8LD cards, * 0..39 - for 40LD cards * @cksum : 0-(sum of first 13 bytes of this structure) */struct private_bios_data { unsigned char geometry :4; unsigned char unused :4; unsigned char boot_drv; unsigned char rsvd[12]; unsigned short cksum;} __attribute__ ((packed));/** * mbox_sgl64 - 64-bit scatter list for mailbox based controllers * @address : address of the buffer * @length : data transfer length */typedef struct { unsigned long long address; unsigned int length;} __attribute__ ((packed)) mbox_sgl64;/** * mbox_sgl32 - 32-bit scatter list for mailbox based controllers * @address : address of the buffer * @length : data transfer length */typedef struct { unsigned int address; unsigned int length;} __attribute__ ((packed)) mbox_sgl32;#define MEGASCSI_MAX_CHANNEL 4#define MEGASCSI_MAX_PDRIVES (75)#define MEGASCSI_MAX_LDRIVES 8#define MEGASCSI_MAX_SPANDEPTH 4#define MEGASCSI_MAX_DEVDEPTH 8#define MEGASCSI_MAX_TARGET 16#define MEGASCSI_BIG_MAX_PDRIVES (256)#define MEGASCSI_BIG_MAX_LDRIVES 40#define MEGASCSI_BIG_MAX_SPANDEPTH 8#define MEGASCSI_BIG_MAX_DEVDEPTH 32#define MEGASCSI_MAXCMDS 126 /* theoretical limit is 250 */#define MEGASCSI_SECTOR_SIZE 512#define MEGASCSI_MAXOFFSETS 26#define MEGASCSI_SGEPERCMD 32 /* to prevent page boundary crossing */#define MEGASCSI_MAX_BUSYWAIT 10 /* wait up to 10 usecs */#define MEGASCSI_MAX_POLLWAIT 1000000 /* wait up to 1000 000 usecs */ #define MEGASCSI_MAXFER (MEGASCSI_MAXOFFSETS * PAGE_SIZE)/* commands */#define MEGASCSI_PASSTHRU 0x03 /* pass scsi cdb to the device */#define MEGASCSI_EINQUIRY 0x04 /* extended inquiry */#define MEGASCSI_INQUIRY 0x05 /* inquiry */#define MEGASCSI_CHSTATE 0x06 /* pad[0] -- state */#define MEGASCSI_STATE_ON 3#define MEGASCSI_STATE_FAIL 4#define MEGASCSI_STATE_SPARE 6#define MEGASCSI_RCONFIG 0x07 /* read configuration up to 4 spans */#define MEGASCSI_REBUILDPD 0x08 /* rebuild physical drive */#define MEGASCSI_EINQUIRY3 0x0c#define MEGASCSI_SPEAKER 0x51 /* speaker control */#define MEGASCSI_SPKR_OFF 0#define MEGASCSI_SPKR_ON 1#define MEGASCSI_SPKR_SHUT 2#define MEGASCSI_SPKR_GVAL 3#define MEGASCSI_SPKR_TEST 4#define MEGASCSI_NEWCFG 0x99#define MEGASCSI_NEWOP 0xa0#define MEGASCSI_FCOP 0xa1#define MEGASCSI_FC_RDCONF 0x04#define MEGASCSI_FC_RDFCONF 0x05#define MEGASCSI_FC_PRODINF 0x0e#define MEGASCSI_FC_EINQ3 0x0f#define MEGASCSI_FC_EINQ4 0x1f#define MEGASCSI_FC_EINQ3_SOLICITED_NOTIFY 0x01#define MEGASCSI_FC_EINQ3_SOLICITED_FULL 0x02#define MEGASCSI_FC_EINQ3_UNSOLICITED 0x03/* command structures */#pragma pack(1)struct megascsi_iocmd { unsigned char acc_cmd; unsigned char acc_id; union {#define acc_mbox _._megascsi_mbox struct { unsigned short amb_nsect; unsigned int amb_lba; unsigned int amb_data; unsigned char amb_ldn; /* logical drive no */ unsigned char amb_nsge; unsigned char amb_reserved; } _megascsi_mbox;#define acc_io _._megascsi_io struct { unsigned char aio_channel; unsigned char aio_param; unsigned char aio_pad[4]; unsigned int aio_data; unsigned char aio_pad1[3]; } _megascsi_io;#define acc_passthru _._megascsi_passru struct { unsigned short apt_dummy0; unsigned int apt_dummy1; unsigned int apt_data; unsigned char apt_dummy2; unsigned char apt_dummy3; unsigned char apt_reserved; } _megascsi_passru;#define acc_ldrv _._megascsi_ldrv struct { unsigned short ald_dummy0; unsigned int ald_dummy1; unsigned int ald_data; unsigned char ald_ldrv; unsigned char ald_dummy2; unsigned char ald_reserved; } _megascsi_ldrv; } _; unsigned char acc_busy; unsigned char acc_nstat; unsigned char acc_status;#define MEGASCSI_MAXSTATACK 0x2e unsigned char acc_cmplidl[MEGASCSI_MAXSTATACK]; unsigned char acc_poll; unsigned char acc_ack; unsigned char acc_pad[0x3e]; /* pad to 128 bytes */};struct megascsi_sgent { unsigned int asg_addr; unsigned int asg_len;};struct megascsi_iocmd64 { unsigned char acc_cmd; unsigned char acc_id; union { struct { unsigned short amb_nsect; unsigned int amb_lba; unsigned int amb_reserved1; unsigned char amb_ldn; /* logical drive no */ unsigned char amb_nsge; /* high bit == 1 */ unsigned char amb_reserved; } _megascsi_mbox; struct { unsigned char aio_channel; unsigned char aio_param; unsigned char aio_pad[4]; unsigned int aio_data; unsigned char aio_pad1[3]; } _megascsi_io; struct { unsigned short apt_dummy0; unsigned int apt_dummy1; unsigned int apt_data; unsigned char apt_dummy2; unsigned char apt_dummy3; unsigned char apt_reserved; } _megascsi_passru; struct { unsigned short ald_dummy0; unsigned int ald_dummy1; unsigned int ald_data; unsigned char ald_ldrv; unsigned char ald_dummy2; unsigned char ald_reserved; } _megascsi_ldrv; } _; unsigned char acc_busy; unsigned int acc_data_l; unsigned int acc_data_h; unsigned int acc_reserved; unsigned char acc_nstat; unsigned char acc_status; unsigned char acc_cmplidl[MEGASCSI_MAXSTATACK]; unsigned char acc_poll; unsigned char acc_ack; unsigned char acc_pad[0x32]; /* pad to 128 bytes */};struct megascsi_sgent64 { unsigned int asg_addr_l; unsigned int asg_addr_h; unsigned int asg_len;};struct megascsi_passthrough { unsigned char apt_param;#define MEGASCSI_PTPARAM(t,a,l) (((l) << 7) | (((a) & 1) << 3) | ((t) & 3))#define MEGASCSI_TIMEOUT_6 0#define MEGASCSI_TIMEOUT_60 1#define MEGASCSI_TIMEOUT_10m 2#define MEGASCSI_TIMEOUT_3h 3 unsigned char apt_ldn; unsigned char apt_channel; unsigned char apt_target; unsigned char apt_qtag; unsigned char apt_qact;#define MEGASCSI_MAX_CDB 10 unsigned char apt_cdb[MEGASCSI_MAX_CDB]; unsigned char apt_ncdb; unsigned char apt_nsense;#define MEGASCSI_MAX_SENSE 32 unsigned char apt_sense[MEGASCSI_MAX_SENSE]; unsigned char apt_nsg; unsigned char apt_scsistat; unsigned int apt_data; unsigned int apt_datalen;};struct megascsi_inquiry { unsigned char ain_maxcmd; unsigned char ain_rbldrate; /* rebuild rate %% */ unsigned char ain_targets; /* max targets per channel */ unsigned char ain_channels; unsigned char ain_fwver[4]; unsigned short ain_flashage; unsigned char ain_chipset; /* parity generation policy */ unsigned char ain_ramsize; unsigned char ain_flushintv; unsigned char ain_biosver[4]; unsigned char ain_brdtype; unsigned char ain_scsisensealert; unsigned char ain_wrcfgcnt; /* write config count */ unsigned char ain_drvinscnt; /* drive insertion count */ unsigned char ain_insdrv; /* inserted drive */ unsigned char ain_battery; /* battery status */ unsigned char ain_reserved; unsigned char ain_nlogdrv; unsigned char ain_reserved1[3]; unsigned int ain_ldsize[MEGASCSI_MAX_LDRIVES]; unsigned char ain_ldprop[MEGASCSI_MAX_LDRIVES]; unsigned char ain_ldstat[MEGASCSI_MAX_LDRIVES]; unsigned char ain_pdstat[MEGASCSI_MAX_PDRIVES]; unsigned char ain_predictivefailure; unsigned char ain_pdfmtinp[MEGASCSI_MAX_PDRIVES]; unsigned char ain_reserved2[MEGASCSI_MAX_PDRIVES]; unsigned int ain_esize; /* extended data size */ unsigned short ain_ssid; /* subsystem id */ unsigned short ain_ssvid; /* subsystem vendor id */ unsigned int ain_signature;#define MEGASCSI_SIGN431 0xfffe0001#define MEGASCSI_SIGN438 0xfffd0002#define MEGASCSI_SIGN762 0xfffc0003#define MEGASCSI_SIGNT5 0xfffb0004#define MEGASCSI_SIGN466 0xfffa0005};#define MAX_NOTIFY_SIZE 0x80/* #define CUR_NOTIFY_SIZE (sizeof(struct megascsi_notify)) */struct megascsi_notify{ unsigned int ano_eventcounter; /* incremented for changes */ unsigned char ano_paramcounter; /* param change */ unsigned char ano_parmegad; /* param modified */#define MEGASCSI_PARAM_RBLD_RATE 0x01 /* new rebuild rate */#define MEGASCSI_PARAM_CACHE_FLUSH_INTERVAL 0x02 /* new cache flush interval */#define MEGASCSI_PARAM_SENSE_ALERT 0x03 /* pd caused check condition */#define MEGASCSI_PARAM_DRIVE_INSERTED 0x04 /* pd inserted */#define MEGASCSI_PARAM_BATTERY_STATUS 0x05 /* battery status */#define MEGASCSI_PARAM_NVRAM_EVENT_ALERT 0x06 /* NVRAM # of entries */#define MEGASCSI_PARAM_PATROL_READ_UPDATE 0x07 /* # pd done with patrol read */#define MEGASCSI_PARAM_PATROL_READ_STATUS 0x08 /* 0 stopped * 2 aborted
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -