⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dtdecode.h

📁 RAID卡的测试程序
💻 H
📖 第 1 页 / 共 5 页
字号:
* Description: get the string of date in the format of "<month> <day>, <year>". 
* Parameters:    
*       [out] pstrDate, the string buffer where the date string will return
*       [in] u8Month, the month of the year
*       [in] u8Day, the day of the month
*       [in] u16Year, the year
* Return: None. 
* Remarks: This function does not check the size of the string buffer. 
*       please make sure it is big enough to avoid memory access violation.  
****************************************************************************/
void decod_getStringDate(char * pstrDate, const u8 u8Month, 
    const u8 u8Day, const u16 u16Year);

/***************************************************************************
* Function Name: decod_getStringTime 
* Description: get the string of time in the format of 
*       "hh:mm:ss <month> <day>, <year>". 
* Parameters:    
*       [out] pstrTime, the string buffer where the time string will return
*       [in] tTime, the time
* Return: None. 
* Remarks: This function does not check the size of the string buffer. 
*       please make sure it is big enough to avoid memory access violation.  
****************************************************************************/
void decod_getStringTime(char * pstrTime, const time_t tTime);

/***************************************************************************
* Function Name: decod_getStringTimePeriod 
* Description: get the string of time period in the format of 
*       "[# hr] [# min] [# sec]"
* Parameters:    
*       [out] pstrTime, the string buffer where the period string will return
*       [in] u32Period, the time
* Return: None. 
* Remarks: This function does not check the size of the string buffer. 
*       please make sure it is big enough to avoid memory access violation.  
****************************************************************************/
void decod_getStringTimePeriod(char * pstrTime, const u32 u32Period);

/***************************************************************************
* Function Name: decod_getStringOpStatus 
* Description: get the operational status string 
* Parameters:    
*       [in] u16OpStatus, the operational status code.
* Return: The operational status string 
* Remarks: none.  
****************************************************************************/
const char * decod_getStringOpStatus(const u16 u16OpStatus);


/***************************************************************************
* Function Name: decod_getStringMemoryType 
* Description: get the memory type string 
* Parameters:    
*       [in] u8Type, the memory type code
* Return: The memory type string 
* Remarks: none.  
****************************************************************************/
const char * decod_getStringMemoryType(const u8 u8Type);
const char * decod_getStringFlashType(const u8 u8Type);
const char * decod_getStringNvramType(const u8 u8Type);

/***************************************************************************
* Function Name: decod_getStringMemoryECCType 
* Description: get the memory ECC type string 
* Parameters:    
*       [in] u8Type, the memory type code
* Return: the memory ECC type string 
* Remarks: none.  
****************************************************************************/
const char * decod_getStringMemoryECCType(const u8 u8Type);
const char * decod_getStringMasterMode(const u8 u8Mode);
const char * decod_getStringActiveMode(const u8 u8Mode);

/***************************************************************************
* Function Name: decod_getStringSize 
* Description: get the size string in GB, MB, KB and B. The size string will
*       be the format of "xxxx.xxGB|MB|KB|B" 
* Parameters:    
*       [out] pstrSize, the size string to be returned;
*       [in] u64Size, the size in bytes
* Return: none. 
* Remarks: This function does not check the size of the string buffer. 
*       please make sure it is big enough to avoid memory access violation.  
****************************************************************************/
void decod_getStringSize(char * pstrSize, const u64 u64Size);

/***************************************************************************
* Function Name: decod_getSize 
* Description: get the size accordign to the size stirng. The size string will
*       be the format of "xxxx.xxGB|MB|KB|B" 
* Parameters:    
*       [in] pstrSize, the size string;
*       [out] pu64Size, the size in bytes to be returned
* Return: PIERR_NO_ERROR, succeeded; otherwise, failed. 
* Remarks: none.   
****************************************************************************/
u32 decod_getSize(const char * pstrSize, u64 * pu64Size);

/***************************************************************************
* Function Name: decod_getStringFwRevision 
* Description: get the firmware revision string in the format of "#.##-##". 
* Parameters:    
*       [out] pstrRevision, the size string to be returned;
*       [in] u8Major, the major version number;
*       [in] u8Minor, the minor version number;
*       [in] u8BuildNo, the build number;
* Return: none. 
* Remarks: This function does not check the size of the string buffer. 
*       please make sure it is big enough to avoid memory access violation.  
****************************************************************************/
void decod_getStringFwRevision(char * pstrRevision, const u8 u8Major, 
    const u8 u8Minor, const u8 u8OEMCode, const u8 u8BuildNo);

/***************************************************************************
* Function Name: decod_getStringFeatureEnable 
* Description: get the enable/disable status of a feature 
* Parameters:    
*       [in] u8Enable, the enable status
* Return: the string of the feature status. Either "Enabled" or "Disabled".
* Remarks: none.  
****************************************************************************/
const char * decod_getStringFeatureEnable(const u8 u8Enable);

/***************************************************************************
* Function Name: decod_getStringFeatureSupport 
* Description: get the string of whether a feature is supported or not
* Parameters:    
*       [in] u8Support, the status of support
* Return: the string of the feature support status. Either "Yes" or "No".
* Remarks: none.  
****************************************************************************/
const char * decod_getStringFeatureSupport(const u8 u8Support);
    
/* --- subsystem --------------------------------------------------------- */
/***************************************************************************
* Function Name: decod_getStringSubsysInterConnectType 
* Description: get the string of the inter-enclosure connection type of the
*       subsystem. The max string length is 32.
* Parameters:    
*       [out] pstrType, the string buffer where the type string will return
*       [in] u8Type, the type code
* Return: None. 
* Remarks: This function does not check the size of the string buffer. 
*       please make sure it is big enough to avoid memory access violation.  
****************************************************************************/
void decod_getStringSubsysInterConnectType(char * pstrType, const u8 u8Type);

/* --- controller -------------------------------------------------------- */
/***************************************************************************
* Function Name: decod_getBufferCountCtrlInfo
* Description: get the count of controller(s) that the controller info buffer
*       contains.
* Parameters:    
*       [in] pu8Buffer, the pointer to a controller info data buffer; 
*       [in] u32Length, the length of the buffer; 
*       [out] pu32Count, the count of controller(s) to be returned.
* Return: PIERR_NO_ERROR, suceeded; otherwise, failed.
* Remarks: The pu8Buffer points to a buffer of req_data_ctrl_info_t type.  
*       Assuming that the page(s) in the buffer is in the ascending order of
*       the controller id and the page code.
****************************************************************************/
u32 decod_getBufferCountCtrlInfo(const u8 * pu8Buffer, const u32 u32Length, u32 * pu32Count);

/***************************************************************************
* Function Name: decod_locateBufferCtrlInfo
* Description: locate the beginning of the specified page of the specified
*       controller in the controller info data buffer. If the page of the 
*       specified controller does not exist, locate the next available one.
* Parameters:    
*       [in] pu8Buffer, the pointer to a controller info data buffer; 
*       [in] u32Length, the length of the buffer; 
*       [in] u32DevId, the id of the controller;
*       [in] u16PageCode, the page code;
*       [out] ppPage, the pointer to the beginning of the page will be 
*           returned here.
* Return: PIERR_NO_ERROR, suceeded; otherwise, failed.
* Remarks: The pu8Buffer points to a buffer of req_data_ctrl_info_t type.
*       Assuming that the page(s) in the buffer is in the ascending order of
*       the controller id and the page code.
****************************************************************************/
u32 decod_locateBufferCtrlInfo(const u8 * pu8Buffer, const u32 u32Length,
    const u32 u32DevId, const u16 u16PageCode, u8 ** ppPage);

/***************************************************************************
* Function Name: decod_locateBufferCtrlInfoPrecise
* Description: locate the beginning of the specified page of the specified
*       controller in the controller info data buffer. If the page of the 
*       specified controller does not exist, return PIERR_NOT_FOUND.
* Parameters:    
*       [in] pu8Buffer, the pointer to a controller info data buffer; 
*       [in] u32Length, the length of the buffer; 
*       [in] u32DevId, the id of the controller;
*       [in] u16PageCode, the page code;
*       [out] ppPage, the pointer to the beginning of the page will be 
*           returned here.
* Return: PIERR_NO_ERROR, suceeded; otherwise, failed.
* Remarks: The pu8Buffer points to a buffer of req_data_ctrl_info_t type.
*       Assuming that the page(s) in the buffer is in the ascending order of
*       the controller id and the page code.
****************************************************************************/
u32 decod_locateBufferCtrlInfoPrecise(const u8 * pu8Buffer, const u32 u32Length,
    const u32 u32DevId, const u16 u16PageCode, u8 ** ppPage);

/***************************************************************************
* Function Name: decod_getStringCtrlCmdProtocol 
* Description: get controller supported SCSI command protocal name.
* Parameters:    
*       [in] u8Protocol, the protocol code
* Return: the name of the protocol. 
* Remarks: none.  
****************************************************************************/
const char * decod_getStringCtrlCmdProtocol(const u8 u8Protocol);

/***************************************************************************
* Function Name: decod_getStringCtrlCacheLineSize 
* Description: get controller cache line size string in "xxxxMB" or "xxxxKB".
* Parameters:    
*       [in] u8CacheLineSize, the code of cache line size
* Return: the cache line size string. 
* Remarks: none.  
****************************************************************************/
const char * decod_getStringCtrlCacheLineSize(const u8 u8CacheLineSize);

u32 decod_getCtrlCoercionMethod(const char * pstrMethod, u8 * pu8Value);
const char * decod_getStringCtrlCoercionMethod(u8 u8Mode);

/***************************************************************************
* Function Name: decod_getStringDebugLevel
* Description: get the string of the controller debug level
* Parameters:
*       [in] u8DebugLevel, controller debug level, from controller info page 0
*       ci_DebugLevel.
* Return: the debug level string
* Remarks: none.
****************************************************************************/
const char * decod_getStringControllerDebugLevel(const u8 u8DebugLevel);

/***************************************************************************
* Function Name: decod_getControllerDebugLevel
* Description: get the debug level from the debug level string
* Parameters:
*       [in] pstrDebugLevel, the debug level string
*       [out] pu8DebugLevel, the debug level to be returned.
* Return: PIERR_NO_ERROR or PIERR_NOT_FOUND.
* Remarks: none.
****************************************************************************/
u32 decod_getControllerDebugLevel(const char * pstrDebugLevel, u8 * pu8DebugLevel);

/***************************************************************************
* Function Name: decod_isValidBgaRate 
* Description: validate whether the bga rate is in valid range.
*       the valid bga rate range is 0 .. 99. 0 is lowest priority rate; 
*       99 is the highest priority rate.
* Parameters:    
*       [in] u32BgaRate, the bga rate.
* Return: PIERR_NO_ERROR, valid; PIERR_INVALID_BGA_RATE, invalid. 
* Remarks: none.  
****************************************************************************/
u32 decod_validateBgaRate(const u32 u32BgaRate);
u32 decod_getBgaRate(const char * pstrRate, u8 * pu8Rate);
const char * decod_getStringBgaRate(u8 u8Rate);

⌨️ 快捷键说明

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