struct mly_code_lookup {
char *string;
u_int32_t code;
};
static char *mly_describe_code(struct mly_code_lookup *table, u_int32_t code);
static char *
mly_describe_code(struct mly_code_lookup *table, u_int32_t code)
{
int i;
for (i = 0; table[i].string != NULL; i++)
if (table[i].code == code)
return(table[i].string);
return(table[i+1].string);
}
#if 0
static struct mly_code_lookup mly_table_bustype[] = {
{"SCSI", 0x00},
{"FC-AL", 0x01},
{"PCI", 0x03},
{NULL, 0},
{"unknown bus", 0}
};
#endif
static struct mly_code_lookup mly_table_controllertype[] = {
#if 0
{"DAC960E", 0x01},
{"DAC960M", 0x08},
{"DAC960PD", 0x10},
{"DAC960PL", 0x11},
{"DAC960PDU", 0x12},
{"DAC960PE", 0x13},
{"DAC960PG", 0x14},
{"DAC960PJ", 0x15},
{"DAC960PTL0", 0x16},
{"DAC960PR", 0x17},
{"DAC960PRL", 0x18},
{"DAC960PT", 0x19},
{"DAC1164P", 0x1a},
{"DAC960PTL1", 0x1b},
#endif
{"EXR2000P", 0x1c},
{"EXR3000P", 0x1d},
{"AcceleRAID 352", 0x1e},
{"AcceleRAID 170", 0x1f},
{"AcceleRAID 160", 0x20},
{NULL, 0},
{"unknown adapter", 0}
};
static struct mly_code_lookup mly_table_oemname[] = {
{"Mylex", MLY_OEM_MYLEX},
{"IBM", MLY_OEM_IBM},
{"Hewlett-Packard", MLY_OEM_HP},
{"DEC/Compaq", MLY_OEM_DEC},
{"Siemens", MLY_OEM_SIEMENS},
{"Intel", MLY_OEM_INTEL},
{NULL, 0},
{"unknown OEM", 0}
};
static struct mly_code_lookup mly_table_memorytype[] = {
{"DRAM", 0x01},
{"EDRAM", 0x02},
{"EDO RAM", 0x03},
{"SDRAM", 0x04},
{NULL, 0},
{"unknown memory", 0}
};
static struct mly_code_lookup mly_table_cputype[] = {
{"i960CA", 0x01},
{"i960RD", 0x02},
{"i960RN", 0x03},
{"i960RP", 0x04},
{"NorthBay(?)", 0x05},
{"StrongArm", 0x06},
{"i960RM", 0x07},
{NULL, 0},
{"unknown CPU", 0}
};
static struct mly_code_lookup mly_table_event[] = {
{"pr online", 0x0001},
{"pr standby", 0x0002},
{"p automatic rebuild started", 0x0005},
{"p manual rebuild started", 0x0006},
{"pr rebuild completed", 0x0007},
{"pr rebuild cancelled", 0x0008},
{"pr rebuild failed for unknown reasons", 0x0009},
{"pr rebuild failed due to new physical device", 0x000a},
{"pr rebuild failed due to logical drive failure", 0x000b},
{"sr offline", 0x000c},
{"pr found", 0x000d},
{"pr gone", 0x000e},
{"p unconfigured", 0x000f},
{"p expand capacity started", 0x0010},
{"pr expand capacity completed", 0x0011},
{"pr expand capacity failed", 0x0012},
{"p parity error", 0x0016},
{"p soft error", 0x0017},
{"p miscellaneous error", 0x0018},
{"p reset", 0x0019},
{"p active spare found", 0x001a},
{"p warm spare found", 0x001b},
{"s sense data received", 0x001c},
{"p initialization started", 0x001d},
{"pr initialization completed", 0x001e},
{"pr initialization failed", 0x001f},
{"pr initialization cancelled", 0x0020},
{"P write recovery failed", 0x0021},
{"p scsi bus reset failed", 0x0022},
{"p double check condition", 0x0023},
{"p device cannot be accessed", 0x0024},
{"p gross error on scsi processor", 0x0025},
{"p bad tag from device", 0x0026},
{"p command timeout", 0x0027},
{"pr system reset", 0x0028},
{"p busy status or parity error", 0x0029},
{"pr host set device to failed state", 0x002a},
{"pr selection timeout", 0x002b},
{"p scsi bus phase error", 0x002c},
{"pr device returned unknown status", 0x002d},
{"pr device not ready", 0x002e},
{"p device not found at startup", 0x002f},
{"p COD write operation failed", 0x0030},
{"p BDT write operation failed", 0x0031},
{"p missing at startup", 0x0039},
{"p start rebuild failed due to physical drive too small", 0x003a},
{"m consistency check started", 0x0080},
{"mr consistency check completed", 0x0081},
{"mr consistency check cancelled", 0x0082},
{"mr consistency check completed with errors", 0x0083},
{"mr consistency check failed due to logical drive failure", 0x0084},
{"mr consistency check failed due to physical device failure", 0x0085},
{"lr offline", 0x0086},
{"lr critical", 0x0087},
{"lr online", 0x0088},
{"m automatic rebuild started", 0x0089},
{"m manual rebuild started", 0x008a},
{"mr rebuild completed", 0x008b},
{"mr rebuild cancelled", 0x008c},
{"mr rebuild failed for unknown reasons", 0x008d},
{"mr rebuild failed due to new physical device", 0x008e},
{"mr rebuild failed due to logical drive failure", 0x008f},
{"l initialization started", 0x0090},
{"lr initialization completed", 0x0091},
{"lr initialization cancelled", 0x0092},
{"lr initialization failed", 0x0093},
{"lr found", 0x0094},
{"lr gone", 0x0095},
{"l expand capacity started", 0x0096},
{"lr expand capacity completed", 0x0097},
{"lr expand capacity failed", 0x0098},
{"l bad block found", 0x0099},
{"lr size changed", 0x009a},
{"lr type changed", 0x009b},
{"l bad data block found", 0x009c},
{"l read of data block in bdt", 0x009e},
{"l write back data for disk block lost", 0x009f},
{"e enclosure %d fan %d failed", 0x0140},
{"e enclosure %d fan %d ok", 0x0141},
{"e enclosure %d fan %d not present", 0x0142},
{"e enclosure %d power supply %d failed", 0x0143},
{"e enclosure %d power supply %d ok", 0x0144},
{"e enclosure %d power supply %d not present", 0x0145},
{"e enclosure %d temperature sensor %d failed", 0x0146},
{"e enclosure %d temperature sensor %d critical", 0x0147},
{"e enclosure %d temperature sensor %d ok", 0x0148},
{"e enclosure %d temperature sensor %d not present", 0x0149},
{"e enclosure %d unit %d access critical", 0x014a},
{"e enclosure %d unit %d access ok", 0x014b},
{"e enclosure %d unit %d access offline", 0x014c},
{"c cache write back error", 0x0181},
{"c battery backup unit found", 0x0188},
{"c battery backup unit charge level low", 0x0189},
{"c battery backup unit charge level ok", 0x018a},
{"c installation aborted", 0x0193},
{"c mirror race recovery in progress", 0x0195},
{"c mirror race on critical drive", 0x0196},
{"c memory soft ecc error", 0x019e},
{"c memory hard ecc error", 0x019f},
{"c battery backup unit failed", 0x01a2},
{NULL, 0},
{"? unknown event code", 0}
};
static struct mly_code_lookup mly_table_device_state[] = {
{"offline", MLY_DEVICE_STATE_OFFLINE},
{"unconfigured", MLY_DEVICE_STATE_UNCONFIGURED},
{"online", MLY_DEVICE_STATE_ONLINE},
{"critical", MLY_DEVICE_STATE_CRITICAL},
{"writeonly", MLY_DEVICE_STATE_WRITEONLY},
{"standby", MLY_DEVICE_STATE_STANDBY},
{"missing", MLY_DEVICE_STATE_MISSING},
{NULL, 0},
{"unknown state", 0}
};
static struct mly_code_lookup mly_table_device_type[] = {
{"MLYRAID0", MLY_DEVICE_TYPE_RAID0},
{"MLYRAID1", MLY_DEVICE_TYPE_RAID1},
{"MLYRAID3", MLY_DEVICE_TYPE_RAID3},
{"MLYRAID5", MLY_DEVICE_TYPE_RAID5},
{"MLYRAID6", MLY_DEVICE_TYPE_RAID6},
{"MLYRAID7", MLY_DEVICE_TYPE_RAID7},
{"MLY SPAN", MLY_DEVICE_TYPE_NEWSPAN},
{"MLYRAID3", MLY_DEVICE_TYPE_RAID3F},
{"MLYRAID3", MLY_DEVICE_TYPE_RAID3L},
{"MLY SPAN", MLY_DEVICE_TYPE_SPAN},
{"MLYRAID5", MLY_DEVICE_TYPE_RAID5L},
{"MLYRAIDE", MLY_DEVICE_TYPE_RAIDE},
{"MLY PHYS", MLY_DEVICE_TYPE_PHYSICAL},
{NULL, 0},
{"MLY UNKN", 0}
};
#if 0
static struct mly_code_lookup mly_table_stripe_size[] = {
{"NONE", MLY_STRIPE_ZERO},
{"512B", MLY_STRIPE_512b},
{"1k", MLY_STRIPE_1k},
{"2k", MLY_STRIPE_2k},
{"4k", MLY_STRIPE_4k},
{"8k", MLY_STRIPE_8k},
{"16k", MLY_STRIPE_16k},
{"32k", MLY_STRIPE_32k},
{"64k", MLY_STRIPE_64k},
{"128k", MLY_STRIPE_128k},
{"256k", MLY_STRIPE_256k},
{"512k", MLY_STRIPE_512k},
{"1M", MLY_STRIPE_1m},
{NULL, 0},
{"unknown", 0}
};
static struct mly_code_lookup mly_table_cacheline_size[] = {
{"NONE", MLY_CACHELINE_ZERO},
{"512B", MLY_CACHELINE_512b},
{"1k", MLY_CACHELINE_1k},
{"2k", MLY_CACHELINE_2k},
{"4k", MLY_CACHELINE_4k},
{"8k", MLY_CACHELINE_8k},
{"16k", MLY_CACHELINE_16k},
{"32k", MLY_CACHELINE_32k},
{"64k", MLY_CACHELINE_64k},
{NULL, 0},
{"unknown", 0}
};
#endif