gdth.h

来自「Linux Kernel 2.6.9 for OMAP1710」· C头文件 代码 · 共 1,080 行 · 第 1/4 页

H
1,080
字号
/* service errors */#define S_OK            1                       /* no error */#define S_GENERR        6                       /* general error */#define S_BSY           7                       /* controller busy */#define S_CACHE_UNKNOWN 12                      /* cache serv.: drive unknown */#define S_RAW_SCSI      12                      /* raw serv.: target error */#define S_RAW_ILL       0xff                    /* raw serv.: illegal */#define S_NOFUNC        -2                      /* unknown function */#define S_CACHE_RESERV  -24                     /* cache: reserv. conflict */   /* timeout values */#define INIT_RETRIES    100000                  /* 100000 * 1ms = 100s */#define INIT_TIMEOUT    100000                  /* 100000 * 1ms = 100s */#define POLL_TIMEOUT    10000                   /* 10000 * 1ms = 10s *//* priorities */#define DEFAULT_PRI     0x20#define IOCTL_PRI       0x10#define HIGH_PRI        0x08/* data directions */#define GDTH_DATA_IN    0x01000000L             /* data from target */#define GDTH_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 *//* DMA memory mappings */#define GDTH_MAP_NONE   0#define GDTH_MAP_SINGLE 1#define GDTH_MAP_SG     2#define GDTH_MAP_IOCTL  3 /* other defines */#define LINUX_OS        8                       /* used for cache optim. */#define SCATTER_GATHER  1                       /* s/g feature */#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 COALINDEX       (GDTH_MAXCMDS + 2)/* features */#define SCATTER_GATHER  1                       /* s/g feature */#define GDT_WR_THROUGH  0x100                   /* WRITE_THROUGH supported */#define GDT_64BIT       0x200                   /* 64bit / drv>2TB support */#include "gdth_ioctl.h"/* 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 *//* Status coalescing buffer for returning multiple requests per interrupt */typedef struct {    ulong32     status;    ulong32     ext_status;    ulong32     info0;    ulong32     info1;} PACKED gdth_coal_status;/* performance mode data structure */typedef struct {    ulong32     version;            /* The version of this IOCTL structure. */    ulong32     st_mode;            /* 0=dis., 1=st_buf_addr1 valid, 2=both  */    ulong32     st_buff_addr1;      /* physical address of status buffer 1 */    ulong32     st_buff_u_addr1;    /* reserved for 64 bit addressing */    ulong32     st_buff_indx1;      /* reserved command idx. for this buffer */    ulong32     st_buff_addr2;      /* physical address of status buffer 1 */    ulong32     st_buff_u_addr2;    /* reserved for 64 bit addressing */    ulong32     st_buff_indx2;      /* reserved command idx. for this buffer */    ulong32     st_buff_size;       /* size of each buffer in bytes */    ulong32     cmd_mode;           /* 0 = mode disabled, 1 = cmd_buff_addr1 */     ulong32     cmd_buff_addr1;     /* physical address of cmd buffer 1 */       ulong32     cmd_buff_u_addr1;   /* reserved for 64 bit addressing */    ulong32     cmd_buff_indx1;     /* cmd buf addr1 unique identifier */    ulong32     cmd_buff_addr2;     /* physical address of cmd buffer 1 */       ulong32     cmd_buff_u_addr2;   /* reserved for 64 bit addressing */    ulong32     cmd_buff_indx2;     /* cmd buf addr1 unique identifier */    ulong32     cmd_buff_size;      /* size of each cmd bufer in bytes */    ulong32     reserved1;    ulong32     reserved2;} PACKED gdth_perf_modes;/* 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 log. 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_alist_str;typedef struct {    ulong32     entries_avail;                  /* allocated entries */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?