ips.h

来自「讲述linux的初始化过程」· C头文件 代码 · 共 1,040 行 · 第 1/3 页

H
1,040
字号
   #define IPS_SECS_DAY                 86400   #define IPS_DAYS_NORMAL_YEAR         365   #define IPS_DAYS_LEAP_YEAR           366   #define IPS_EPOCH_YEAR               1970   /*    * Scsi_Host Template    */#if LINUX_VERSION_CODE < LinuxVersionCode(2,3,27) #define IPS {                            \    next : NULL,                          \    module : NULL,                        \    proc_info : NULL,                     \    proc_dir : NULL,                      \    name : NULL,                          \    detect : ips_detect,                  \    release : ips_release,                \    info : ips_info,                      \    command : NULL,                       \    queuecommand : ips_queue,             \    eh_strategy_handler : NULL,           \    eh_abort_handler : ips_eh_abort,      \    eh_device_reset_handler : NULL,       \    eh_bus_reset_handler : NULL,          \    eh_host_reset_handler : ips_eh_reset, \    abort : NULL,                         \    reset : NULL,                         \    slave_attach : NULL,                  \    bios_param : ips_biosparam,           \    can_queue : 0,                        \    this_id: -1,                          \    sg_tablesize : IPS_MAX_SG,            \    cmd_per_lun: 16,                      \    present : 0,                          \    unchecked_isa_dma : 0,                \    use_clustering : ENABLE_CLUSTERING,   \    use_new_eh_code : 1                   \}#else #define IPS {                            \    next : NULL,                          \    module : NULL,                        \    proc_info : NULL,                     \    name : NULL,                          \    detect : ips_detect,                  \    release : ips_release,                \    info : ips_info,                      \    command : NULL,                       \    queuecommand : ips_queue,             \    eh_strategy_handler : NULL,           \    eh_abort_handler : ips_eh_abort,      \    eh_device_reset_handler : NULL,       \    eh_bus_reset_handler : NULL,          \    eh_host_reset_handler : ips_eh_reset, \    abort : NULL,                         \    reset : NULL,                         \    slave_attach : NULL,                  \    bios_param : ips_biosparam,           \    can_queue : 0,                        \    this_id: -1,                          \    sg_tablesize : IPS_MAX_SG,            \    cmd_per_lun: 16,                      \    present : 0,                          \    unchecked_isa_dma : 0,                \    use_clustering : ENABLE_CLUSTERING,   \    use_new_eh_code : 1                   \}#endif/* * IBM PCI Raid Command Formats */typedef struct {   u8        op_code;   u8        command_id;   u8        log_drv;   u8        sg_count;   u32       lba;   u32       sg_addr;   u16       sector_count;   u16       reserved;   u32       ccsar;   u32       cccr;} IPS_IO_CMD, *PIPS_IO_CMD;typedef struct {   u8        op_code;   u8        command_id;   u16       reserved;   u32       reserved2;   u32       buffer_addr;   u32       reserved3;   u32       ccsar;   u32       cccr;} IPS_LD_CMD, *PIPS_LD_CMD;typedef struct {   u8        op_code;   u8        command_id;   u8        reserved;   u8        reserved2;   u32       reserved3;   u32       buffer_addr;   u32       reserved4;} IPS_IOCTL_CMD, *PIPS_IOCTL_CMD;typedef struct {   u8        op_code;   u8        command_id;   u16       reserved;   u32       reserved2;   u32       dcdb_address;   u32       reserved3;   u32       ccsar;   u32       cccr;} IPS_DCDB_CMD, *PIPS_DCDB_CMD;typedef struct {   u8        op_code;   u8        command_id;   u8        channel;   u8        source_target;   u32       reserved;   u32       reserved2;   u32       reserved3;   u32       ccsar;   u32       cccr;} IPS_CS_CMD, *PIPS_CS_CMD;typedef struct {   u8        op_code;   u8        command_id;   u8        log_drv;   u8        control;   u32       reserved;   u32       reserved2;   u32       reserved3;   u32       ccsar;   u32       cccr;} IPS_US_CMD, *PIPS_US_CMD;typedef struct {   u8        op_code;   u8        command_id;   u8        reserved;   u8        state;   u32       reserved2;   u32       reserved3;   u32       reserved4;   u32       ccsar;   u32       cccr;} IPS_FC_CMD, *PIPS_FC_CMD;typedef struct {   u8        op_code;   u8        command_id;   u8        reserved;   u8        desc;   u32       reserved2;   u32       buffer_addr;   u32       reserved3;   u32       ccsar;   u32       cccr;} IPS_STATUS_CMD, *PIPS_STATUS_CMD;typedef struct {   u8        op_code;   u8        command_id;   u8        page;   u8        write;   u32       reserved;   u32       buffer_addr;   u32       reserved2;   u32       ccsar;   u32       cccr;} IPS_NVRAM_CMD, *PIPS_NVRAM_CMD;typedef struct {   u8     op_code;   u8     command_id;   u8     reset_count;   u8     reset_type;   u8     second;   u8     minute;   u8     hour;   u8     day;   u8     reserved1[4];   u8     month;   u8     yearH;   u8     yearL;   u8     reserved2;} IPS_FFDC_CMD, *PIPS_FFDC_CMD;typedef union {   IPS_IO_CMD        basic_io;   IPS_LD_CMD        logical_info;   IPS_IOCTL_CMD     ioctl_info;   IPS_DCDB_CMD      dcdb;   IPS_CS_CMD        config_sync;   IPS_US_CMD        unlock_stripe;   IPS_FC_CMD        flush_cache;   IPS_STATUS_CMD    status;   IPS_NVRAM_CMD     nvram;   IPS_FFDC_CMD      ffdc;} IPS_HOST_COMMAND, *PIPS_HOST_COMMAND;typedef struct {   u8         logical_id;   u8         reserved;   u8         raid_level;   u8         state;   u32        sector_count;} IPS_DRIVE_INFO, *PIPS_DRIVE_INFO;typedef struct {   u8             no_of_log_drive;   u8             reserved[3];   IPS_DRIVE_INFO drive_info[IPS_MAX_LD];} IPS_LD_INFO, *PIPS_LD_INFO;typedef struct {   u8         device_address;   u8         cmd_attribute;   u16        transfer_length;   u32        buffer_pointer;   u8         cdb_length;   u8         sense_length;   u8         sg_count;   u8         reserved;   u8         scsi_cdb[12];   u8         sense_info[64];   u8         scsi_status;   u8         reserved2[3];} IPS_DCDB_TABLE, *PIPS_DCDB_TABLE;typedef union {   struct {      volatile u8  reserved;      volatile u8  command_id;      volatile u8  basic_status;      volatile u8  extended_status;   } fields;   volatile u32    value;} IPS_STATUS, *PIPS_STATUS;typedef struct {   IPS_STATUS           status[IPS_MAX_CMDS + 1];   volatile PIPS_STATUS p_status_start;   volatile PIPS_STATUS p_status_end;   volatile PIPS_STATUS p_status_tail;   volatile u32         hw_status_start;   volatile u32         hw_status_tail;   IPS_LD_INFO          logical_drive_info;} IPS_ADAPTER, *PIPS_ADAPTER;typedef struct {   u8        ucLogDriveCount;   u8        ucMiscFlag;   u8        ucSLTFlag;   u8        ucBSTFlag;   u8        ucPwrChgCnt;   u8        ucWrongAdrCnt;   u8        ucUnidentCnt;   u8        ucNVramDevChgCnt;   u8        CodeBlkVersion[8];   u8        BootBlkVersion[8];   u32       ulDriveSize[IPS_MAX_LD];   u8        ucConcurrentCmdCount;   u8        ucMaxPhysicalDevices;   u16       usFlashRepgmCount;   u8        ucDefunctDiskCount;   u8        ucRebuildFlag;   u8        ucOfflineLogDrvCount;   u8        ucCriticalDrvCount;   u16       usConfigUpdateCount;   u8        ucBlkFlag;   u8        reserved;   u16       usAddrDeadDisk[IPS_MAX_CHANNELS * IPS_MAX_TARGETS];} IPS_ENQ, *PIPS_ENQ;typedef struct {   u8        ucInitiator;   u8        ucParameters;   u8        ucMiscFlag;   u8        ucState;   u32       ulBlockCount;   u8        ucDeviceId[28];} IPS_DEVSTATE, *PIPS_DEVSTATE;typedef struct {   u8        ucChn;   u8        ucTgt;   u16       ucReserved;   u32       ulStartSect;   u32       ulNoOfSects;} IPS_CHUNK, *PIPS_CHUNK;typedef struct {   u16       ucUserField;   u8        ucState;   u8        ucRaidCacheParam;   u8        ucNoOfChunkUnits;   u8        ucStripeSize;   u8        ucParams;   u8        ucReserved;   u32       ulLogDrvSize;   IPS_CHUNK chunk[IPS_MAX_CHUNKS];} IPS_LD, *PIPS_LD;typedef struct {   u8        board_disc[8];   u8        processor[8];   u8        ucNoChanType;   u8        ucNoHostIntType;   u8        ucCompression;   u8        ucNvramType;   u32       ulNvramSize;} IPS_HARDWARE, *PIPS_HARDWARE;typedef struct {   u8             ucLogDriveCount;   u8             ucDateD;   u8             ucDateM;   u8             ucDateY;   u8             init_id[4];   u8             host_id[12];   u8             time_sign[8];   struct {      u32         usCfgDrvUpdateCnt:16;      u32         ConcurDrvStartCnt:4;      u32         StartupDelay:4;      u32         auto_rearrange:1;      u32         cd_boot:1;      u32         cluster:1;      u32         reserved:5;   } UserOpt;   u16            user_field;   u8             ucRebuildRate;   u8             ucReserve;   IPS_HARDWARE   hardware_disc;   IPS_LD         logical_drive[IPS_MAX_LD];   IPS_DEVSTATE   dev[IPS_MAX_CHANNELS][IPS_MAX_TARGETS+1];   u8             reserved[512];

⌨️ 快捷键说明

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