📄 gdth.h
字号:
#define DATA_IN 0x01000000L /* data from target */#define DATA_OUT 0x00000000L /* data to target *//* BMIC registers (EISA controllers) */#define ID0REG 0x0c80 /* board ID */#define EINTENABREG 0x0c89 /* interrupt enable */#define SEMA0REG 0x0c8a /* command semaphore */#define SEMA1REG 0x0c8b /* status semaphore */#define LDOORREG 0x0c8d /* local doorbell */#define EDENABREG 0x0c8e /* EISA system doorbell enab. */#define EDOORREG 0x0c8f /* EISA system doorbell */#define MAILBOXREG 0x0c90 /* mailbox reg. (16 bytes) */#define EISAREG 0x0cc0 /* EISA configuration *//* other defines */#define LINUX_OS 8 /* used for cache optim. */#define SCATTER_GATHER 1 /* s/g feature */#define GDTH_MAXSG 32 /* max. s/g elements */#define SECS32 0x1f /* round capacity */#define BIOS_ID_OFFS 0x10 /* offset contr-ID in ISABIOS */#define LOCALBOARD 0 /* board node always 0 */#define ASYNCINDEX 0 /* cmd index async. event */#define SPEZINDEX 1 /* cmd index unknown service */#define GDT_WR_THROUGH 0x100 /* WRITE_THROUGH supported *//* typedefs */typedef u32 ulong32;#define PACKED __attribute__((packed))/* screenservice message */typedef struct { ulong32 msg_handle; /* message handle */ ulong32 msg_len; /* size of message */ ulong32 msg_alen; /* answer length */ unchar msg_answer; /* answer flag */ unchar msg_ext; /* more messages */ unchar msg_reserved[2]; char msg_text[MSGLEN+2]; /* the message text */} PACKED gdth_msg_str;/* IOCTL data structures *//* SCSI drive info */typedef struct { unchar vendor[8]; /* vendor string */ unchar product[16]; /* product string */ unchar revision[4]; /* revision */ ulong32 sy_rate; /* current rate for sync. tr. */ ulong32 sy_max_rate; /* max. rate for sync. tr. */ ulong32 no_ldrive; /* belongs to this logical drv.*/ ulong32 blkcnt; /* number of blocks */ ushort blksize; /* size of block in bytes */ unchar available; /* flag: access is available */ unchar init; /* medium is initialized */ unchar devtype; /* SCSI devicetype */ unchar rm_medium; /* medium is removable */ unchar wp_medium; /* medium is write protected */ unchar ansi; /* SCSI I/II or III? */ unchar protocol; /* same as ansi */ unchar sync; /* flag: sync. transfer enab. */ unchar disc; /* flag: disconnect enabled */ unchar queueing; /* flag: command queing enab. */ unchar cached; /* flag: caching enabled */ unchar target_id; /* target ID of device */ unchar lun; /* LUN id of device */ unchar orphan; /* flag: drive fragment */ ulong32 last_error; /* sense key or drive state */ ulong32 last_result; /* result of last command */ ulong32 check_errors; /* err. in last surface check */ unchar percent; /* progress for surface check */ unchar last_check; /* IOCTRL operation */ unchar res[2]; ulong32 flags; /* from 1.19/2.19: raw reserv.*/ unchar multi_bus; /* multi bus dev? (fibre ch.) */ unchar mb_status; /* status: available? */ unchar res2[2]; unchar mb_alt_status; /* status on second bus */ unchar mb_alt_bid; /* number of second bus */ unchar mb_alt_tid; /* target id on second bus */ unchar res3; unchar fc_flag; /* from 1.22/2.22: info valid?*/ unchar res4; ushort fc_frame_size; /* frame size (bytes) */ char wwn[8]; /* world wide name */} PACKED gdth_diskinfo_str;/* get SCSI channel count */typedef struct { ulong32 channel_no; /* number of channel */ ulong32 drive_cnt; /* drive count */ unchar siop_id; /* SCSI processor ID */ unchar siop_state; /* SCSI processor state */ } PACKED gdth_getch_str;/* get SCSI drive numbers */typedef struct { ulong32 sc_no; /* SCSI channel */ ulong32 sc_cnt; /* sc_list[] elements */ ulong32 sc_list[MAXID]; /* minor device numbers */} PACKED gdth_drlist_str;/* get grown/primary defect count */typedef struct { unchar sddc_type; /* 0x08: grown, 0x10: prim. */ unchar sddc_format; /* list entry format */ unchar sddc_len; /* list entry length */ unchar sddc_res; ulong32 sddc_cnt; /* entry count */} PACKED gdth_defcnt_str;/* disk statistics */typedef struct { ulong32 bid; /* SCSI channel */ ulong32 first; /* first SCSI disk */ ulong32 entries; /* number of elements */ ulong32 count; /* (R) number of init. el. */ ulong32 mon_time; /* time stamp */ struct { unchar tid; /* target ID */ unchar lun; /* LUN */ unchar res[2]; ulong32 blk_size; /* block size in bytes */ ulong32 rd_count; /* bytes read */ ulong32 wr_count; /* bytes written */ ulong32 rd_blk_count; /* blocks read */ ulong32 wr_blk_count; /* blocks written */ ulong32 retries; /* retries */ ulong32 reassigns; /* reassigns */ } PACKED list[1];} PACKED gdth_dskstat_str;/* IO channel header */typedef struct { ulong32 version; /* version (-1UL: newest) */ unchar list_entries; /* list entry count */ unchar first_chan; /* first channel number */ unchar last_chan; /* last channel number */ unchar chan_count; /* (R) channel count */ ulong32 list_offset; /* offset of list[0] */} PACKED gdth_iochan_header;/* get IO channel description */typedef struct { gdth_iochan_header hdr; struct { ulong32 address; /* channel address */ unchar type; /* type (SCSI, FCAL) */ unchar local_no; /* local number */ ushort features; /* channel features */ } PACKED list[MAXBUS];} PACKED gdth_iochan_str;/* get raw IO channel description */typedef struct { gdth_iochan_header hdr; struct { unchar proc_id; /* processor id */ unchar proc_defect; /* defect ? */ unchar reserved[2]; } PACKED list[MAXBUS];} PACKED gdth_raw_iochan_str;/* array drive component */typedef struct { ulong32 al_controller; /* controller ID */ unchar al_cache_drive; /* cache drive number */ unchar al_status; /* cache drive state */ unchar al_res[2]; } PACKED gdth_arraycomp_str;/* array drive information */typedef struct { unchar ai_type; /* array type (RAID0,4,5) */ unchar ai_cache_drive_cnt; /* active cachedrives */ unchar ai_state; /* array drive state */ unchar ai_master_cd; /* master cachedrive */ ulong32 ai_master_controller; /* ID of master controller */ ulong32 ai_size; /* user capacity [sectors] */ ulong32 ai_striping_size; /* striping size [sectors] */ ulong32 ai_secsize; /* sector size [bytes] */ ulong32 ai_err_info; /* failed cache drive */ unchar ai_name[8]; /* name of the array drive */ unchar ai_controller_cnt; /* number of controllers */ unchar ai_removable; /* flag: removable */ unchar ai_write_protected; /* flag: write protected */ unchar ai_devtype; /* type: always direct access */ gdth_arraycomp_str ai_drives[35]; /* drive components: */ unchar ai_drive_entries; /* number of drive components */ unchar ai_protected; /* protection flag */ unchar ai_verify_state; /* state of a parity verify */ unchar ai_ext_state; /* extended array drive state */ unchar ai_expand_state; /* array expand state (>=2.18)*/ unchar ai_reserved[3];} PACKED gdth_arrayinf_str;/* get array drive list */typedef struct { ulong32 controller_no; /* controller no. */ unchar cd_handle; /* master cachedrive */ unchar is_arrayd; /* Flag: is array drive? */ unchar is_master; /* Flag: is array master? */ unchar is_parity; /* Flag: is parity drive? */ unchar is_hotfix; /* Flag: is hotfix drive? */ unchar res[3];} PACKED gdth_arraylist_str;/* cache info/config IOCTL */typedef struct { ulong32 version; /* firmware version */ ushort state; /* cache state (on/off) */ ushort strategy; /* cache strategy */ ushort write_back; /* write back state (on/off) */ ushort block_size; /* cache block size */} PACKED gdth_cpar_str;typedef struct { ulong32 csize; /* cache size */ ulong32 read_cnt; /* read/write counter */ ulong32 write_cnt; ulong32 tr_hits; /* hits */ ulong32 sec_hits; ulong32 sec_miss; /* misses */} PACKED gdth_cstat_str;typedef struct { gdth_cpar_str cpar; gdth_cstat_str cstat;} PACKED gdth_cinfo_str;/* cache drive info */typedef struct { unchar cd_name[8]; /* cache drive name */ ulong32 cd_devtype; /* SCSI devicetype */ ulong32 cd_ldcnt; /* number of log. drives */ ulong32 cd_last_error; /* last error */ unchar cd_initialized; /* drive is initialized */ unchar cd_removable; /* media is removable */ unchar cd_write_protected; /* write protected */ unchar cd_flags; /* Pool Hot Fix? */ ulong32 ld_blkcnt; /* number of blocks */ ulong32 ld_blksize; /* blocksize */ ulong32 ld_dcnt; /* number of disks */ ulong32 ld_slave; /* log. drive index */ ulong32 ld_dtype; /* type of logical drive */ ulong32 ld_last_error; /* last error */ unchar ld_name[8]; /* log. drive name */ unchar ld_error; /* error */} PACKED gdth_cdrinfo_str;/* board features */typedef struct { unchar chaining; /* Chaining supported */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -