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

📄 dtdecode.h

📁 RAID卡的测试程序
💻 H
📖 第 1 页 / 共 5 页
字号:

/* --- logical drive ----------------------------------------------------- */

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

/***************************************************************************
* Function Name: decod_locateBufferLogDrvInfo
* Description: locate the logical drive info with the specified logical drive
*       id. If the logical drive is not available in the buffer, locate the next
*       available one. 
* Parameters:    
*       [in] pu8Buffer, the pointer to the logical drive info data buffer; 
*       [in] u32Length, the length of the buffer; 
*       [in] u32DevId, the logical drive id
*       [out] ppInfo, the pointer to the logical drive info of the specified
*           logical drive or of the next available one.
* Return: PIERR_NO_ERROR, suceeded; otherwise, failed.
* Remarks: The pu8Buffer points to a buffer of req_data_logdrv_info_t type.  
*       Assuming that the info in the buffer is in the ascending order of
*       the logical drive id.
****************************************************************************/
u32 decod_locateBufferLogDrvInfo(const u8 * pu8Buffer, const u32 u32Length,
    const u32 u32DevId, u8 ** ppInfo);
    
/***************************************************************************
* Function Name: decod_locateBufferLogDrvSettings
* Description: locate the logical drive settings with the specified logical drive
*       id. If the logical drive is not available in the buffer, locate the next
*       available one. 
* Parameters:    
*       [in] pu8Buffer, the pointer to the logical drive settings data buffer; 
*       [in] u32Length, the length of the buffer; 
*       [in] u32DevId, the logical drive id
*       [out] ppSettings, the pointer to the logical drive settings of the specified
*           logical drive or of the next available one.
* Return: PIERR_NO_ERROR, suceeded; otherwise, failed.
* Remarks: The pu8Buffer points to a buffer of req_data_logdrv_settings_t type.  
*       Assuming that the info in the buffer is in the ascending order of
*       the logical drive id.
****************************************************************************/
u32 decod_locateBufferLogDrvSettings(const u8 * pu8Buffer, const u32 u32Length,
    const u32 u32DevId, u8 ** ppSettings);
   
/***************************************************************************
* Function Name: decod_getStringLogDrvOpStatus
* Description: a simple way of get the string of the logical drive 
*       operational status. It only returns the most significant status.
* Parameters:    
*       [out] pstrOpStatus, the op status string to be returned.
*       [in] u32Flags, the logical drive flags.
* Return: none.
* Remarks: none.
****************************************************************************/
void decod_getStringLogDrvOpStatus(char * pstrOpStatus, const u32 u32Flags);

/***************************************************************************
* Function Name: decod_getStringLogDrvOpStatus
* Description: get the string of the full op status of a logical drive.
* Parameters:    
*       [out] pstrOpStatus, the op status string to be returned. This string
*           might be as long as 80 characters.
*       [in] u32Flags, the logical drive flags.
* Return: none.
* Remarks: none.
****************************************************************************/
void decod_getStringLogDrvOpStatusEx(char * pstrOpStatus, const u32 u32Flags);

/***************************************************************************
* Function Name: decod_getLogDrvOpStatus
* Description: get the op status of a logical drive
* Parameters:    
*       [in] u32Flags, the logical drive flags.
*       [out] u16OpStatus, the array of op status to be returned
*       [out] pu32OpStatusCount, the count of the op status in the array.
* Return: none.
* Remarks: none.
****************************************************************************/
void decod_getLogDrvOpStatus(const u32 u32Flags,
    u16 u16OpStatus[], u32 * pu32OpStatusCount);

/***************************************************************************
* Function Name: decod_getStringRAIDLevel
* Description: get the string of the RAID level. If the specified RAID level
*       code is invalid, the returned string will be "Unknown"
* Parameters:    
*       [in] u16RAIDLevel, the specified RAID level code
* Return: the RAID level string.
* Remarks: None.  
****************************************************************************/
const char * decod_getStringRAIDLevel(const u16 u16RAIDLevel);

/***************************************************************************
* Function Name: decod_getRAIDLevel
* Description: get the RAID level of the raid level string
* Parameters:    
*       [in] pstrRAIDLevel, the raid level string
*       [out] pu16RAIDLevel, the RAID level code to be returned;
* Return: PIERR_NO_ERROR, succeeded; otherwise, failed
* Remarks: None.  
****************************************************************************/
const u32 decod_getRAIDLevel(const char * pstrRAIDLevel, u16 * pu16RAIDLevel);

/***************************************************************************
* Function Name: decod_isHybridRAIDLevel
* Description: check whether the raid level is a hybrid raid level
* Parameters:    
*       [in] u16RAIDLevel, the RAID level code
* Return: TRUE/FALSE
* Remarks: None.  
****************************************************************************/
boolean_t decod_isHybridRAIDLevel(const u16 u16RAIDLevel);

/***************************************************************************
* Function Name: decod_getStringLogDrvWritePolicy
* Description: get the string of logical drive write policy setting:
*       "WriteThru" or "WriteBack"
* Parameters:    
*       [in] u32Attrib, the logical drive attribute
* Return: the write policy setting string.
* Remarks: None.  
****************************************************************************/
const char * decod_getStringLogDrvWritePolicy(const u32 u32Attrib);

/***************************************************************************
* Function Name: decod_getLogDrvWritePolicy
* Description: get the logical drive write policy setting by parsing the
*       input string
* Parameters:    
*       [in] pstrWritePolicy, the input string of the write policy. The valid
*           strings are: "WriteThru" and "WriteBack". They are not case sensitive.
*       [out] pu32Attrib, the write policy setting in the LD attribute
* Return: PIERR_NO_ERROR, or PIERR_INVALID_WRITE_POLICY
* Remarks: None.  
****************************************************************************/
u32 decod_getLogDrvWritePolicy(const char * pstrWritePolicy, u32 * pu32Attrib);

/***************************************************************************
* Function Name: decod_getStringLogDrvReadPolicy
* Description: get the string of logical drive read policy setting:
*       "NoCache", "ReadCache", or "ReadAhead".
* Parameters:    
*       [in] u32Attrib, the logical drive attribute
* Return: the read policy setting string.
* Remarks: None.  
****************************************************************************/
const char * decod_getStringLogDrvReadPolicy(const u32 u32Attrib);

/***************************************************************************
* Function Name: decod_getLogDrvReadPolicy
* Description: get the logical drive read policy setting by parsing the
*       input string
* Parameters:    
*       [in] pstrReadPolicy, the input string of the read policy. The valid
*           strings are: "NoCache", "ReadCache" and "ReadAhead". They are not 
*           case sensitive.
*       [out] pu32Attrib, the read policy setting in the LD attribute
* Return: PIERR_NO_ERROR, or PIERR_INVALID_WRITE_POLICY
* Remarks: None.  
****************************************************************************/
u32 decod_getLogDrvReadPolicy(const char * pstrReadPolicy, u32 * pu32Attrib);

/***************************************************************************
* Function Name: decod_getStringLogDrvCachePolicy
* Description: get the string of logical drive cache policy setting:
* Parameters:    
*       [in] u32Attrib, the logical drive attribute
* Return: the cache policy setting string.
* Remarks: None.  
****************************************************************************/
const char * decod_getStringLogDrvCachePolicy(const u32 u32Attrib);

/***************************************************************************
* Function Name: decod_getStringLogDrvInitStatus
* Description: get the logocal drive initialization status 
* Parameters:    
* Return: the string of the feature status. 
* Remarks: none.  
****************************************************************************/
const char * decod_getStringLogDrvInitStatus(const u32 u32Flags);
const char * decod_getStringLogDrvSyncStatus(const u32 u32Flags);

/***************************************************************************
* Function Name: decod_isLogDrv<state/condition>
* Description: check whether the logical drive is in certain state or condition
* Parameters:    
*       [in] u32Flags/u32Attrib, the logical drive flags/attribute
* Return: TRUE or FALSE
* Remarks: None.  
****************************************************************************/
boolean_t decod_isLogDrvSynchronized(const u32 u32Flags);
boolean_t decod_isLogDrvInitialized(const u32 u32Flags);
boolean_t decod_isLogDrvInitializing(const u32 u32Flags);
boolean_t decod_isLogDrvRebuilding(const u32 u32Flags);
boolean_t decod_isLogDrvOnline(const u32 u32Flags);
boolean_t decod_isLogDrvOffline(const u32 u32Flags);
boolean_t decod_isLogDrvCritical(const u32 u32Flags);

/***************************************************************************
* Function Name: decod_isSupportedStripeSize
* Description: check whether the stripe size is supported
* Parameters:    
*       [in] u32StripeSize, the specified stripe size in blocks
* Return: TRUE or FALSE
* Remarks: None.  
****************************************************************************/
boolean_t decod_isSupportedStripeSize(const u32 u32StripeSize);

/***************************************************************************
* Function Name: decod_getStringLogDrvSerialNo
* Description: get the string of logical drive serial number
* Parameters:
*       [out] pstrSerialNo, the serial number string to be returned;
*       [in] pu8SerialNo, the serial number data from f/w
* Return: none.
* Remarks: none.  
****************************************************************************/
void decod_getStringLogDrvSerialNo(char * pstrSerialNo, const u8 * pu8SerialNo);

/***************************************************************************
* Function Name: decod_getLogDrvUserName
* Description: get the string of logical drive user defined name
* Parameters:
*       [out] pstrName, the name string to be returned;
*       [in] pu8Name, the user defined name data from f/w
* Return: none.
* Remarks: none.  
****************************************************************************/
void decod_getStringLogDrvUserName(char * pstrName, const u8 * pu8Name);

/* --- physical drive ---------------------------------------------------- */

u32 decod_locatePDPage0Settings(const u8 * pu8Buffer, const u32 u32Length, 
    u32 u32Index, micPDSetPage0Internal_t ** ppSettings);
u32 decod_locatePDPage1Settings(const u8 * pu8Buffer, const u32 u32Length, 
    u32 u32Index, micPDSettingsPage1Internal_t ** ppSettings);
u32 decod_locateBufferPhyDrvSettingsPrecise(const u8 * pu8Buffer, const u32 u32Length,
    const u32 u32DevId, const u16 u16PageCode, u8 ** ppSettings);

u32 decod_getPDTransferMode(const char * pstrTransferMode, u8 * pu8Value);
const char * decod_getStringPDUltraDMAMode(u8 u8Mode);
const char * decod_getStringPDMultiDMAMode(u8 u8Mode);

/***************************************************************************
* Function Name: decod_getBufferCountPhyDrvInfo
* Description: get the count of physical drive(s) that the logical drive info 
*       buffer contains.
* Parameters:    
*       [in] pu8Buffer, the pointer to the physical drive info data buffer; 
*       [in] u32Length, the length of the buffer; 

⌨️ 快捷键说明

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