📄 i2types.h
字号:
/*******************************************************************************
* Filename : i2types.h
* Description : I2 types header file
* It defines the data structures used in I2 APIs
* Created on : 02/05/2004
* CVS Version : $Id: i2types.h,v 1.1 2004/03/24 03:24:12 weny Exp $
*
* Copyright (C) 2004-2004 Promise Technology Inc.
* All Rights Reserved
******************************************************************************/
#ifndef I2_TYPES_H
#define I2_TYPES_H
/* --- standard C lib header files ------------------------------------------ */
#include <time.h>
/* --- internal header files ------------------------------------------------ */
#include "pibasic.h"
#include "i2limit.h"
#include "errorlog.h"
#include "mic.h"
#include "bgaschd.h"
#include "userdata.h"
#include "swmgt.h"
#include "emaildata.h"
#include "imexportdata.h"
#ifdef EMBEDDED
#include "../../utils/ptiflash/imgheader.h"
#include "../../utils/ptiflash/ptiflashlib/ptiflashlib.h"
#endif
/* --- constants & data structures ------------------------------------------ */
#define NULL_SUBSYS_ID 0
typedef struct
{
u16 di_u16CtrlId;
u8 di_u8Padding1[2];
u16 di_u16SubsysId;
u8 di_u8Padding2[2];
} device_id_t;
/*
* di_u16CtrlId - index of HBA controller or index of controller inside the subsystem
* di_u16SubsysId - index of subsystem. A HBA should have subsys index as NULL_SUBSYS_ID
*/
#define NULL_SESSION_ID 0
typedef u32 session_id_t;
#define DEFAULT_I2API_TIMEOUT 60 /* seconds */
typedef struct
{
error_handler_t * ip_pehErrorHandler; /* error handler */
#ifndef PLATFORM_64BIT
void * ip_pPadding1; /* padding for 8 byte alignment */
#endif
u32 ip_u32Version; /* Library version signature*/
boolean_t ip_bUseDefault; /* use the default param */
u8 ip_u8Padding2[3]; /* padding for 8 byte alignment */
u32 ip_u32Timeout; /* timeout of request in seconds */
u8 ip_AppName[8]; /* Application name */
u8 ip_u8Reserved3[99]; /* reserved for future improvement */
boolean_t ip_bPluginParamValid; /* whether the plug-in param is valid */
u8 ip_u8PluginParam[128]; /* plug-in specific parameters */
} i2api_param_t;
/*
* ip_pehErrorHandler - the error handler to pass to the I2 API. It must be set either to NULL or to the pointer of a valid error handler.
*
* ip_u32Version - I2 API library version signature. It must be set to I2API_VERSION.
*
* ip_bUseDefault - whether to use default parameters. If it is set to TRUE, all of the rest parameter will be ignored by the I2 API and default values will be used; if it is FALSE, the rest of the parameters should be set accordingly.
*
* ip_u32Timeout - the max timeout of each API. The default value is 60 seconds.
*
* ip_bPluginParamValid - whether the plugin parameter is valid or not. If it is set to TRUE, the plugin parameters should be set accordingly to the particular plugin; if it is FALSE, the plugin parameters will be ignored and the default values will be used. The default value is FALSE.
* If an application links with a particular I2 API plugin directly, it may concern about the plugin specific parameter to take more advantage of the plugin's capability; otherwise, it should be set to FALSE to use the default plugin parameters.
*
* ip_u8PluginParam - the plugin specific parameters
*/
/* discover */
#define I2_DOI_IDTYPE_UNKNOWN 0
#define I2_DOI_IDTYPE_WWN 1
#define I2_DOI_IDTYPE_SN 2 /* serial number */
#define I2_DOI_IDTYPE_OTHER 3
typedef struct
{
u8 doi_u8Vendor[24];
u8 doi_u8Model[16];
u8 doi_u8Padding1[7];
u8 doi_u8IDType; /* I2_DOI_IDTYPE_WWN, I2_DOI_IDTYPE_SN, I2_DOI_IDTYPE_OTHER */
u8 doi_u8ID[64];
} device_object_identifier_t;
typedef struct
{
u8 dph_u8Port;
u8 dph_u8Path; /* ? */
u8 dph_u8Target;
u8 dph_u8Lun;
u8 dph_u8Padding1[4];
u8 dph_u8DeviceName[MAX_PATH_LENGTH+1];
u32 dph_u32IRQ; // Interrupt number;
u32 dph_u32SlotNumber; // Slot this controller take place;
u32 dph_u32BIOSMemStart; // BIOS rom start address
u32 dph_u32BIOSMemRange; // size of BIOS rom
u8 dph_pu8BusMasterBase; // Controller base; change it to value from pointer which will be different from subsystem
u32 dph_pu32BaseAddressATA; // For ATA base address; change it to value from pointer which will be different from subsystem
u32 dph_pu32BaseAddressXOR; // For XOR, HOST DMA base address; change it to value from pointer which will be different from subsystem
u32 dph_pu32BaseAddressSEQ; // For SEQ base address; change it to value from pointer which will be different from subsystem
u32 dph_pu32BaseAddressMMIO; // For memory mapped IO base address; change it to value from pointer which will be different from subsystem
u32 dph_pu32BaseAddressSDRAM; // For SDRAM base address; change it to value from pointer which will be different from subsystem
} discover_path_hba_t;
typedef struct
{
u8 dps_u8Port;
u8 dps_u8Path; /* for windows, bus, target and lun are valid only for SCSIPORT */
u8 dps_u8Target;
u8 dps_u8Lun;
u8 dps_u8Padding1[4];
u8 dps_u8DeviceName[MAX_PATH_LENGTH+1];
} discover_path_scsi_t;
typedef struct
{
discover_path_scsi_t dpi_dpsScsiPath;
u8 dpi_u8Padding1[7]; /* not supported for now */
u8 dpi_u8HostIPAddrType; /* not supported for now */
u8 dpi_u8HostIPAddr[64]; /* not supported for now */
} discover_path_iscsi_t;
typedef struct
{
u32 dpr_u32BaudRate;
u8 dpr_u8DataBit;
u8 dpr_u8Parity;
u8 dpr_u8StopBit;
u8 dpr_u8ControlFlow;
u8 dpr_u8DeviceName[MAX_PATH_LENGTH+1];
} discover_path_rs232_t;
typedef struct
{
u16 dpt_u16PortNumber;
u8 dpt_u8Padding1[6];
u8 dpt_u8UserName[32];
u8 dpt_u8Password[32];
u8 dpt_u8HostName[128];
} discover_path_tcpip_t;
typedef struct
{
u16 dpw_u16PortNumber;
boolean_t dpw_bUseSSL;
u8 dpw_u8Padding1[5];
u8 dpw_u8UserName[32];
u8 dpw_u8Password[32];
u8 dpw_u8HostName[128];
u8 dpw_u8NameSpace[MAX_PATH_LENGTH+1];
} discover_path_wbem_t;
#define I2_COMMPATH_UNKNOW 0
#define I2_COMMPATH_HBA 1
#define I2_COMMPATH_SCSI 2
#define I2_COMMPATH_iSCSI 3
#define I2_COMMPATH_FC 4
#define I2_COMMPATH_RS232 5
#define I2_COMMPATH_TCPIP 6
#define I2_COMMPATH_WBEM 7
typedef struct
{
u8 dp_u8Padding1[7];
u8 dp_u8CommPath;
union
{
discover_path_hba_t dp_dphHba;
discover_path_scsi_t dp_dpsScsi;
discover_path_iscsi_t dp_dpiIscsi;
discover_path_rs232_t dp_dprRS232;
discover_path_tcpip_t dp_dptTCPIP;
discover_path_wbem_t dp_dpwWbem;
} dp_uPath;
} discover_path_t;
typedef struct
{
device_id_t ddp_diIndex;
device_object_identifier_t ddp_doiIdentity;
u8 ddp_u8Padding1[4];
u16 ddp_u16NumOfPaths; /* the actual length of the discover path array */
u16 ddp_u16CurrentPath; /* the current path thru which the API manages the device */
discover_path_t ddp_dpDiscoverPaths[1]; /* variable length array */
} device_discover_path_t;
typedef struct req_param_device_ids
{
u32 rpdi_u32DevId;
u32 rpdi_u32Count;
} req_param_device_ids_t;
typedef struct
{
u32 rpdd_u32Count;
u32 rpdd_u32Reserved;
req_param_device_ids_t rpdd_rpdiIdRange[1];
} req_param_device_del_t;
typedef struct
{
u32 rpad_u32Count;
u32 rpad_u32Ids[1]; /* the list of ids to be deleted */
} req_param_array_del_t;
/* request param */
typedef struct req_param_ctrl_info
{
req_param_device_ids_t rpci_rpdiDeviceIds;
u16 rpci_u16PageCode;
u16 rpci_u32Reserved[3];
} req_param_ctrl_info_t;
typedef struct req_param_ctrl_settings
{
req_param_device_ids_t rpcs_rpdiDeviceIds;
u16 rpcs_u16PageCode;
u16 rpcs_u32Reserved[3];
} req_param_ctrl_settings_t;
typedef struct req_param_phydrv_info
{
req_param_device_ids_t rppi_rpdiDeviceIds;
u16 rppi_u16PageCode;
u16 rppi_u16Reserved[3];
} req_param_phydrv_info_t;
typedef struct req_param_phydrv_settings
{
req_param_device_ids_t rpps_rpdiDeviceIds;
u16 rpps_u16PageCode;
u16 rpps_u16Reserved[3];
} req_param_phydrv_settings_t;
typedef struct req_param_logdrv_info
{
req_param_device_ids_t rpli_rpdiDeviceIds;
} req_param_logdrv_info_t;
typedef struct req_param_logdrv_settings
{
/* rpls_rpdiDeviceIds.rpdi_u32DevId is valid only for get LD settings */
req_param_device_ids_t rpls_rpdiDeviceIds;
} req_param_logdrv_settings_t;
/* array info */
typedef struct req_param_array_info
{
req_param_device_ids_t rpai_rpdiDeviceIds;
} req_param_array_info_t;
/* array process */
typedef struct req_param_array_process
{
u8 rpap_u8ActionType;
u8 rpap_u8Reserved[3];
u32 rpap_u32ArrayId;
} req_param_array_process_t;
/* get disk array cfg info */
typedef struct
{
req_param_device_ids_t rpai_rpdiDeviceIds;
} req_param_array_cfg_t;
/* add, modify disk array config */
typedef struct
{
boolean_t rpad_bAutoId;
boolean_t rpad_bMediaPatrlEnable;
boolean_t rpad_bReseved[2];
u32 rpad_u32ArrayId;
u8 rpad_u8Name[MAX_ARRAY_NAME_BYTES];
} req_param_array_dacfg_t;
typedef struct
{
u32 rpap_u32NumberOfPd;
u32 rpap_u32Reserved;
u32 rpap_u32PdIds[MAX_PHYDRV_PER_ARRAY];
} req_param_array_pdcfg_t;
/* Create Array Flags */
#define LD_F_QUICK_INIT 0x01 /* init flags are exclusive */
#define LD_F_FOREGRND_INIT 0x02
#define LD_F_BACKGRND_INIT 0x04
typedef struct
{
boolean_t rpal_bAutoId; /* auto choose an Id for the logical drive */
boolean_t rpal_bAutoSize; /* use up the max supported size of the disk array */
boolean_t rpal_bAutoFit; /* auto fit the logical drive in a fragment - only valid for addld */
boolean_t rpal_bAutoRaidLevel; /* auto set the raid level best suitable for the configuration */
u8 rpal_bInit; /* init the logical after creating it, use LD_F__XXXX for NAPA */
u8 rpal_u8Reserved[1];
u16 rpal_u16RaidLevel; /* ignored if AutoRaidLevel is set to TRUE */
u16 rpal_u16NoOfAxle; /* 0 means auto number of axle */
u16 rpal_u16LdId; /* ignored if AutoId is set to TRUE */
u32 rpal_u32LDAttrib; /* read/write policy */
u32 rpal_u32StripeSize; /* in blocks */
u64 rpal_u64FragmentEndAddr; /* in bytes, the ending address of the fragment where the ld tries to fit */
/* Ignored if AutoFit is set to TRUE */
u64 rpal_u64Size; /* in blocks. Ingored if AutoSize is set to TRUE */
u8 rpal_u8Name[MAX_LD_NAME_BYTES];
} req_param_array_ld_t;
typedef struct
{
u32 rpal_u32NumberOfLd;
u32 rpal_u32NumRepeatLd;
req_param_array_ld_t rpal_rpalLogDrvs[1];
} req_param_array_ldcfg_t;
typedef struct
{
req_param_array_dacfg_t rpaa_rpadDaCfg;
req_param_array_pdcfg_t rpaa_rpapPdCfg;
req_param_array_ldcfg_t rpaa_rpalLdCfg;
} req_param_array_add_t;
typedef struct
{
u32 rpml_u32LdId;
u64 rpml_u64LdSize; /* in Block */
u16 rpml_u16RaidLevel;
u16 rpml_u16StripeSize; /* in Block */
} req_param_migrate_ldcfg_t;
typedef struct
{
u32 rpmp_u32PdId;
u32 rpmp_u32SequenceNo;
} req_param_migrate_pdcfg_t;
typedef struct
{
u32 rpm_u32DaId;
u32 rpm_u32NumOfLd;
u32 rpm_u32NumOfPd;
req_param_migrate_ldcfg_t rpm_LdCfg[MAX_LOGDRV_PER_ARRAY];
req_param_migrate_pdcfg_t rpm_PdCfg[MAX_PHYDRV_PER_ARRAY];
} req_param_migrate_t;
typedef struct
{
u32 rpla_u32DiskArrayId;
u32 rpla_u32Reserved;
req_param_array_ldcfg_t rpla_rpalLdList;
} req_param_logdrv_add_t;
typedef struct
{
u32 rpld_u32DiskArrayId;
u32 rpld_u32Count;
u32 rpld_u32Ids[1]; /* the list of ids to be deleted */
} req_param_logdrv_del_t;
typedef struct
{
req_param_device_ids_t rpas_rpdiDeviceIds;
} req_param_array_settings_t;
/* please do NOT delete the following commented lines */
/*typedef req_param_ids_t req_param_array_setting_t;*/
typedef struct
{
req_param_device_ids_t rpsi_rpdiDeviceIds;
} req_param_spare_info_t;
typedef struct
{
boolean_t rps_bDedicated;
boolean_t rps_bTemp;
u8 rps_u8Reserved[6];
u64 rps_u64StartLBA; /* for non-grouping RAID engine only */
u64 rps_u64SpareSize; /* for non-grouping RAID engine only, in number of blocks */
u32 rps_u32PdId;
u32 rps_u32NumberOfAssciatedArrays;
u32 rps_u32ArrayIds[MAX_ASSOCIATED_ARRAYS_PER_ARRAY];
} req_param_sparecfg_t;
typedef struct
{
u32 rpsa_u32NoOfSpare;
u32 rpsa_u32Reserved;
req_param_sparecfg_t rpsa_rpsSpares[1];
} req_param_spare_add_t;
typedef req_param_array_del_t req_param_spare_del_t;
typedef struct
{
u32 rpr_u32ArrayId;
u32 rpr_u32SeqNo;
u32 rpr_u32Type;
u32 rpr_u32Reserved;
} req_param_rbprogress_t;
typedef struct
{
u32 rpr_u32ArrayId;
u32 rpr_u32SeqNo;
u32 rpr_u32PdId; /* valid for start only. Set to 0 for stop/pause/resume */
u32 rpr_u32Type;
} req_param_rbctrl_t;
typedef struct
{
u32 rphr_u32ArrayId;
u32 rphr_u32PdId; /* valid for start only. Set to 0 for stop/pause/resume */
u32 rphr_u32ExtentIndex; /* if value == 0xFFFFFFFF, use disk ID to start rebuild */
u32 rphr_Reserved;
} req_param_hba_rbctrl_t;
typedef struct
{
u32 rpli_u32LdId; /* if it is 0xFFFF, all lds */
u8 rpli_bQuickInit; /*use CREATE_LD_F__XXXX for NAPA */
u8 rpli_u8Reserved[1]; /* for alignment */
u16 rpli_u16QuickInitSize; /* in MB */
u16 rpli_u16PatternLength;
u8 rpli_u8Pattern[PMIC_SECTOR_SIZE];
} req_param_ld_init_t;
typedef struct
{
u32 rpls_u32LdId; /* if it is 0xFFFF, all lds */
u32 rpls_u32Reserved;
} req_param_ld_synch_t;
typedef struct
{
u32 rpr_u32LdId; /* if it is 0xFFFF, all lds */
boolean_t rpr_bAutoFix; /* valid only for starting RC */
boolean_t rpr_bPauseOnError; /* valid only for starting RC */
u8 rpr_u8Reserved[2];
} req_param_rc_t;
#define EVENT_LOCATION_RAM 0x01
#define EVENT_LOCATION_MDD 0x02
#define EVENT_LOCATION_NVRAM 0x04
typedef struct
{
u32 rpe_u32SeqNo;
u32 rpe_u32Count;
u8 rpe_u8EventLocation; /* EVENT_LOCATION_RAM, MDD, or NVRAM */
u8 rpe_u8Reserved[3];
u32 rpe_u32SeverityMask;
u64 rpe_u64EventClassMask;
} req_param_event_t;
typedef struct
{
u32 rpec_u32SeverityMask;
u32 rpec_u32Reserved;
u64 rpec_u64EventClassMask;
} req_param_event_count_t;
typedef struct
{
u32 rpes_u32SeverityMask;
u32 rpes_u32Reserved;
u64 rpes_u64EventClassMask;
} req_param_event_subscribe_t;
typedef struct
{
u32 rpei_u32EventId;
u32 rpei_u32EventCount;
} req_param_event_info_t;
typedef struct req_param_session_login
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -