📄 ips.h
字号:
#define IPS_IN_ABORT 1 #define IPS_IN_RESET 2 /* * SCB Flags */ #define IPS_SCB_ACTIVE 0x00001 #define IPS_SCB_WAITING 0x00002 /* * Passthru stuff */ #define IPS_COPPUSRCMD (('C'<<8) | 65) #define IPS_COPPIOCCMD (('C'<<8) | 66) #define IPS_NUMCTRLS (('C'<<8) | 68) #define IPS_CTRLINFO (('C'<<8) | 69) #define IPS_FLASHBIOS (('C'<<8) | 70) /* time oriented stuff */ #define IPS_IS_LEAP_YEAR(y) (((y % 4 == 0) && ((y % 100 != 0) || (y % 400 == 0))) ? 1 : 0) #define IPS_NUM_LEAP_YEARS_THROUGH(y) ((y) / 4 - (y) / 100 + (y) / 400) #define IPS_SECS_MIN 60 #define IPS_SECS_HOUR 3600 #define IPS_SECS_8HOURS 28800 #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 { u_int8_t op_code; u_int8_t command_id; u_int8_t log_drv; u_int8_t sg_count; u_int32_t lba; u_int32_t sg_addr; u_int16_t sector_count; u_int16_t reserved; u_int32_t ccsar; u_int32_t cccr;} IPS_IO_CMD, *PIPS_IO_CMD;typedef struct { u_int8_t op_code; u_int8_t command_id; u_int16_t reserved; u_int32_t reserved2; u_int32_t buffer_addr; u_int32_t reserved3; u_int32_t ccsar; u_int32_t cccr;} IPS_LD_CMD, *PIPS_LD_CMD;typedef struct { u_int8_t op_code; u_int8_t command_id; u_int8_t reserved; u_int8_t reserved2; u_int32_t reserved3; u_int32_t buffer_addr; u_int32_t reserved4;} IPS_IOCTL_CMD, *PIPS_IOCTL_CMD;typedef struct { u_int8_t op_code; u_int8_t command_id; u_int16_t reserved; u_int32_t reserved2; u_int32_t dcdb_address; u_int32_t reserved3; u_int32_t ccsar; u_int32_t cccr;} IPS_DCDB_CMD, *PIPS_DCDB_CMD;typedef struct { u_int8_t op_code; u_int8_t command_id; u_int8_t channel; u_int8_t source_target; u_int32_t reserved; u_int32_t reserved2; u_int32_t reserved3; u_int32_t ccsar; u_int32_t cccr;} IPS_CS_CMD, *PIPS_CS_CMD;typedef struct { u_int8_t op_code; u_int8_t command_id; u_int8_t log_drv; u_int8_t control; u_int32_t reserved; u_int32_t reserved2; u_int32_t reserved3; u_int32_t ccsar; u_int32_t cccr;} IPS_US_CMD, *PIPS_US_CMD;typedef struct { u_int8_t op_code; u_int8_t command_id; u_int8_t reserved; u_int8_t state; u_int32_t reserved2; u_int32_t reserved3; u_int32_t reserved4; u_int32_t ccsar; u_int32_t cccr;} IPS_FC_CMD, *PIPS_FC_CMD;typedef struct { u_int8_t op_code; u_int8_t command_id; u_int8_t reserved; u_int8_t desc; u_int32_t reserved2; u_int32_t buffer_addr; u_int32_t reserved3; u_int32_t ccsar; u_int32_t cccr;} IPS_STATUS_CMD, *PIPS_STATUS_CMD;typedef struct { u_int8_t op_code; u_int8_t command_id; u_int8_t page; u_int8_t write; u_int32_t reserved; u_int32_t buffer_addr; u_int32_t reserved2; u_int32_t ccsar; u_int32_t cccr;} IPS_NVRAM_CMD, *PIPS_NVRAM_CMD;typedef struct { u_int8_t op_code; u_int8_t command_id; u_int8_t reset_count; u_int8_t reset_type; u_int8_t second; u_int8_t minute; u_int8_t hour; u_int8_t day; u_int8_t reserved1[4]; u_int8_t month; u_int8_t yearH; u_int8_t yearL; u_int8_t reserved2;} IPS_FFDC_CMD, *PIPS_FFDC_CMD;typedef struct { u_int8_t op_code; u_int8_t command_id; u_int8_t type; u_int8_t direction; u_int32_t count; u_int32_t buffer_addr; u_int8_t total_packets; u_int8_t packet_num; u_int16_t reserved;} IPS_FLASHFW_CMD, *PIPS_FLASHFW_CMD;typedef struct { u_int8_t op_code; u_int8_t command_id; u_int8_t type; u_int8_t direction; u_int32_t count; u_int32_t buffer_addr; u_int32_t offset;} IPS_FLASHBIOS_CMD, *PIPS_FLASHBIOS_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_FLASHFW_CMD flashfw; IPS_FLASHBIOS_CMD flashbios;} IPS_HOST_COMMAND, *PIPS_HOST_COMMAND;typedef struct { u_int8_t logical_id; u_int8_t reserved; u_int8_t raid_level; u_int8_t state; u_int32_t sector_count;} IPS_DRIVE_INFO, *PIPS_DRIVE_INFO;typedef struct { u_int8_t no_of_log_drive; u_int8_t reserved[3]; IPS_DRIVE_INFO drive_info[IPS_MAX_LD];} IPS_LD_INFO, *PIPS_LD_INFO;typedef struct { u_int8_t device_address; u_int8_t cmd_attribute; u_int16_t transfer_length; u_int32_t buffer_pointer; u_int8_t cdb_length; u_int8_t sense_length; u_int8_t sg_count; u_int8_t reserved; u_int8_t scsi_cdb[12]; u_int8_t sense_info[64]; u_int8_t scsi_status; u_int8_t reserved2[3];} IPS_DCDB_TABLE, *PIPS_DCDB_TABLE;typedef union { struct { volatile u_int8_t reserved; volatile u_int8_t command_id; volatile u_int8_t basic_status; volatile u_int8_t extended_status; } fields; volatile u_int32_t 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 u_int32_t hw_status_start; volatile u_int32_t hw_status_tail; IPS_LD_INFO logical_drive_info;} IPS_ADAPTER, *PIPS_ADAPTER;typedef struct { u_int8_t ucLogDriveCount; u_int8_t ucMiscFlag; u_int8_t ucSLTFlag; u_int8_t ucBSTFlag; u_int8_t ucPwrChgCnt; u_int8_t ucWrongAdrCnt; u_int8_t ucUnidentCnt; u_int8_t ucNVramDevChgCnt; u_int8_t CodeBlkVersion[8]; u_int8_t BootBlkVersion[8]; u_int32_t ulDriveSize[IPS_MAX_LD]; u_int8_t ucConcurrentCmdCount; u_int8_t ucMaxPhysicalDevices; u_int16_t usFlashRepgmCount; u_int8_t ucDefunctDiskCount; u_int8_t ucRebuildFlag; u_int8_t ucOfflineLogDrvCount; u_int8_t ucCriticalDrvCount; u_int16_t usConfigUpdateCount; u_int8_t ucBlkFlag; u_int8_t reserved; u_int16_t usAddrDeadDisk[IPS_MAX_CHANNELS * IPS_MAX_TARGETS];} IPS_ENQ, *PIPS_ENQ;typedef struct { u_int8_t ucInitiator; u_int8_t ucParameters; u_int8_t ucMiscFlag; u_int8_t ucState; u_int32_t ulBlockCount; u_int8_t ucDeviceId[28];} IPS_DEVSTATE, *PIPS_DEVSTATE;typedef struct { u_int8_t ucChn; u_int8_t ucTgt; u_int16_t ucReserved; u_int32_t ulStartSect; u_int32_t ulNoOfSects;} IPS_CHUNK, *PIPS_CHUNK;typedef struct { u_int16_t ucUserField; u_int8_t ucState; u_int8_t ucRaidCacheParam; u_int8_t ucNoOfChunkUnits; u_int8_t ucStripeSize; u_int8_t ucParams; u_int8_t ucReserved; u_int32_t ulLogDrvSize; IPS_CHUNK chunk[IPS_MAX_CHUNKS];} IPS_LD, *PIPS_LD;typedef struct { u_int8_t board_disc[8]; u_int8_t processor[8]; u_int8_t ucNoChanType; u_int8_t ucNoHostIntType; u_int8_t ucCompression; u_int8_t ucNvramType; u_int32_t ulNvramSize;} IPS_HARDWARE, *PIPS_HARDWARE;typedef struct { u_int8_t ucLogDriveCount; u_int8_t ucDateD; u_int8_t ucDateM; u_int8_t ucDateY; u_int8_t init_id[4]; u_int8_t host_id[12]; u_int8_t time_sign[8]; u_int32_t UserOpt; u_int16_t user_field; u_int8_t ucRebuildRate; u_int8_t ucReserve; IPS_HARDWARE hardware_disc; IPS_LD logical_drive[IPS_MAX_LD]; IPS_DEVSTATE dev[IPS_MAX_CHANNELS][IPS_MAX_TARGETS+1];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -