Get Attribute information from the device.
int CoHWRaidGetDrvAttr(int fd, PCoHWRAIDDrvAttr attr, void* pv)
int fd
Please specify handle acquired by CoHWRaidOpen function.
PCoHWRAIDDrvAttr attr
Specify a pointer variable to store the Attribute information of drive1/2.
enum hwraid_drives {
HWRAID_BOARD = 0, // RAID Board
HWRAID_DRIVE1, // RAID Drive 1
HWRAID_DRIVE2, // RAID Drive 2
HWRAID_DRIVE_NUM // max_num
};
typedef struct co_hwraid_smart_attr{
struct cohwraid_attr_data {
// SMART attribute parsed data
struct attr_parsed {
uint8_t id; // id
uint16_t flags; // flags
uint8_t current; // current value
uint8_t worst; // worst value
uint8_t raw[6]; // raw data
uint8_t threshold; // threshold
} attr[30];
uint8_t attr_raw[512]; // attribute(raw)
uint8_t thresh_raw[512]; // attribute threshold(raw)
} attr_data[HWRAID_DRIVE_NUM];
} CoHWRAIDDrvAttr, *PCoHWRAIDDrvAttr;
The attribute information about drive1 is stored in attr.attr_data[HWRAID_DRIVE1],
and the attribute information about drive2 is stored in attr.attr_data[HWRAID_DRIVE2].
The obtained 512-byte raw values are stored in the attr_raw and threshold_raw structure
members, respectively. "struct attr_parsed attr[30]" contains information extracted
from raw values. If the function fails, 0 or an indeterminate value is returned.
void* pv
Reserved. Please set NULL.
If the function succeeds, NO_ERROR is returned.
If the function fails, DRIVER_FAIL is returned.
The other errors : Error code details
Function List