197 | 197 |
};
|
198 | 198 |
unsigned int i;
|
199 | 199 |
|
200 | |
pr_attr("Attributes Defined/Set", NULL);
|
|
200 |
pr_list_start("Attributes Defined/Set", NULL);
|
201 | 201 |
for (i = 0; i < ARRAY_SIZE(attributes); i++)
|
202 | 202 |
{
|
203 | 203 |
if (!(defined.l & (1UL << i)))
|
204 | 204 |
continue;
|
205 | |
pr_subattr(attributes[i], "%s", set.l & (1UL << i) ? "Yes" : "No");
|
|
205 |
pr_list_item("%s: %s", attributes[i], set.l & (1UL << i) ? "Yes" : "No");
|
206 | 206 |
}
|
|
207 |
pr_list_end();
|
207 | 208 |
}
|
208 | 209 |
|
209 | 210 |
static void dmi_hp_203_assoc_hndl(const char *fname, u16 num)
|
|
281 | 282 |
"Rear USB Port",
|
282 | 283 |
"Internal USB",
|
283 | 284 |
"Internal SD Card",
|
284 | |
"Internal Virutal USB (Embedded NAND)",
|
|
285 |
"Internal Virtual USB (Embedded NAND)",
|
285 | 286 |
"Embedded SATA Port",
|
286 | 287 |
"Embedded Smart Array",
|
287 | 288 |
"PCI Slot",
|
|
298 | 299 |
pr_attr(fname, "%s", str);
|
299 | 300 |
}
|
300 | 301 |
|
|
302 |
static int dmi_hp_224_status(u8 code)
|
|
303 |
{
|
|
304 |
static const char * const present[] = {
|
|
305 |
"Not Present", /* 0x00 */
|
|
306 |
"Present/Enabled",
|
|
307 |
"Present/Disabled",
|
|
308 |
"Reserved" /* 0x03 */
|
|
309 |
};
|
|
310 |
|
|
311 |
pr_attr("Status", "%s", present[code & 0x03]);
|
|
312 |
if ((code & 0x03) == 0x00)
|
|
313 |
return 0;
|
|
314 |
pr_attr("Option ROM Measuring", "%s", (code & (1 << 2)) ? "Yes" : "No");
|
|
315 |
pr_attr("Hidden", "%s", (code & (1 << 3)) ? "Yes" : "No");
|
|
316 |
return 1;
|
|
317 |
}
|
|
318 |
|
|
319 |
static void dmi_hp_224_ex_status(u8 status, u8 code)
|
|
320 |
{
|
|
321 |
const char *str = "Reserved";
|
|
322 |
static const char * const disable_reason[] = {
|
|
323 |
"Not Specified", /* 0x00 */
|
|
324 |
"User Disabled",
|
|
325 |
"Error Condition",
|
|
326 |
"Reserved" /* 0x03 */
|
|
327 |
};
|
|
328 |
static const char * const error_condition[] = {
|
|
329 |
"Not Specified", /* 0x00 */
|
|
330 |
"Self-Test", /* 0x01 */
|
|
331 |
};
|
|
332 |
if ((status & 0x03) == 0x02)
|
|
333 |
pr_attr("Disable Reason", "%s", disable_reason[code & 0x03]);
|
|
334 |
if ((code & 0x03) == 0x02) {
|
|
335 |
u8 error = (code >> 2) & 0x0f;
|
|
336 |
if (error < ARRAY_SIZE(error_condition))
|
|
337 |
str = error_condition[error];
|
|
338 |
pr_attr("Error Condition", "%s", str);
|
|
339 |
}
|
|
340 |
}
|
|
341 |
|
|
342 |
static void dmi_hp_224_module_type(u8 code)
|
|
343 |
{
|
|
344 |
const char *str = "Reserved";
|
|
345 |
static const char * const type[] = {
|
|
346 |
"Not Specified", /* 0x00 */
|
|
347 |
"TPM 1.2",
|
|
348 |
"TPM 2.0",
|
|
349 |
"Intel PTT fTPM" /* 0x03 */
|
|
350 |
};
|
|
351 |
if ((code & 0x0f) < ARRAY_SIZE(type))
|
|
352 |
str = type[code & 0x0f];
|
|
353 |
pr_attr("Type", "%s", str);
|
|
354 |
pr_attr("Standard Algorithm Supported", "%s", (code & (1 << 4)) ? "Yes" : "No");
|
|
355 |
pr_attr("Chinese Algorithm Supported", "%s", (code & (1 << 5)) ? "Yes" : "No");
|
|
356 |
}
|
|
357 |
|
|
358 |
static void dmi_hp_224_module_attr(u8 code)
|
|
359 |
{
|
|
360 |
static const char * const phys_attr[] = {
|
|
361 |
"Not Specified", /* 0x00 */
|
|
362 |
"Pluggable and Optional",
|
|
363 |
"Pluggable but Standard",
|
|
364 |
"Soldered Down on System Board" /* 0x03 */
|
|
365 |
};
|
|
366 |
static const char * const fips_attr[] = {
|
|
367 |
"Not Specified", /* 0x00 */
|
|
368 |
"Not FIPS Certified",
|
|
369 |
"FIPS Certified",
|
|
370 |
"Reserved" /* 0x03 */
|
|
371 |
};
|
|
372 |
pr_attr("Trusted Module Attributes", "%s", phys_attr[code & 0x3]);
|
|
373 |
pr_attr("FIPS Certification", "%s", fips_attr[((code >> 2) & 0x03)]);
|
|
374 |
}
|
|
375 |
|
|
376 |
static void dmi_hp_224_chipid(u16 code)
|
|
377 |
{
|
|
378 |
const char *str = "Reserved";
|
|
379 |
static const char * const chipid[] = {
|
|
380 |
"None", /* 0x00 */
|
|
381 |
"STMicroGen10 TPM",
|
|
382 |
"Intel firmware TPM (PTT)",
|
|
383 |
"Nationz TPM",
|
|
384 |
"STMicroGen10 Plus TPM",
|
|
385 |
"STMicroGen11 TPM", /* 0x05 */
|
|
386 |
};
|
|
387 |
if ((code & 0xff) < ARRAY_SIZE(chipid))
|
|
388 |
str = chipid[code & 0xff];
|
|
389 |
pr_attr("Chip Identifier", "%s", str);
|
|
390 |
}
|
|
391 |
|
|
392 |
static void dmi_hp_230_method_bus_seg_addr(u8 code, u8 bus_seg, u8 addr)
|
|
393 |
{
|
|
394 |
const char *str = "Reserved";
|
|
395 |
static const char * const method[] = {
|
|
396 |
"Not Available", /* 0x00 */
|
|
397 |
"IPMI I2C",
|
|
398 |
"iLO",
|
|
399 |
"Chassis Manager", /* 0x03 */
|
|
400 |
};
|
|
401 |
if (code < ARRAY_SIZE(method))
|
|
402 |
str = method[code];
|
|
403 |
pr_attr("Access Method", "%s", str);
|
|
404 |
if (code == 0 || code >= ARRAY_SIZE(method))
|
|
405 |
return;
|
|
406 |
if (bus_seg != 0xFF)
|
|
407 |
{
|
|
408 |
if (code == 2)
|
|
409 |
pr_attr("I2C Segment Number", "%d", bus_seg);
|
|
410 |
else
|
|
411 |
pr_attr("I2C Bus Number", "%d", bus_seg);
|
|
412 |
}
|
|
413 |
if (addr != 0xFF)
|
|
414 |
pr_attr("I2C Address", "0x%02x", addr >> 1);
|
|
415 |
}
|
|
416 |
|
301 | 417 |
static void dmi_hp_238_loc(const char *fname, unsigned int code)
|
302 | 418 |
{
|
303 | 419 |
const char *str = "Reserved";
|
|
307 | 423 |
"Rear of Server",
|
308 | 424 |
"Embedded internal SD Card",
|
309 | 425 |
"iLO USB",
|
310 | |
"HP NAND Controller (USX 2065 or other)",
|
|
426 |
"USB Hub for NAND Controller",
|
311 | 427 |
"Reserved",
|
312 | 428 |
"Debug Port", /* 0x07 */
|
313 | 429 |
};
|
|
347 | 463 |
str = speed[code];
|
348 | 464 |
|
349 | 465 |
pr_attr(fname, "%s", str);
|
|
466 |
}
|
|
467 |
|
|
468 |
static void dmi_hp_242_hdd_type(u8 code)
|
|
469 |
{
|
|
470 |
const char *str = "Reserved";
|
|
471 |
static const char * const type[] = {
|
|
472 |
"Undetermined", /* 0x00 */
|
|
473 |
"NVMe SSD",
|
|
474 |
"SATA",
|
|
475 |
"SAS",
|
|
476 |
"SATA SSD",
|
|
477 |
"NVMe Manged by VROC/VMD", /* 0x05 */
|
|
478 |
};
|
|
479 |
if (code < ARRAY_SIZE(type))
|
|
480 |
str = type[code];
|
|
481 |
|
|
482 |
pr_attr("Hard Drive Type", "%s", str);
|
|
483 |
}
|
|
484 |
|
|
485 |
static void dmi_hp_242_form_factor(u8 code)
|
|
486 |
{
|
|
487 |
const char *str = "Reserved";
|
|
488 |
static const char * const form[] = {
|
|
489 |
"Reserved", /* 0x00 */
|
|
490 |
"Reserved",
|
|
491 |
"3.5\" form factor",
|
|
492 |
"2.5\" form factor",
|
|
493 |
"1.8\" form factor",
|
|
494 |
"Less than 1.8\" form factor",
|
|
495 |
"mSATA",
|
|
496 |
"M.2",
|
|
497 |
"MicroSSD",
|
|
498 |
"CFast", /* 0x09 */
|
|
499 |
};
|
|
500 |
if (code < ARRAY_SIZE(form))
|
|
501 |
str = form[code];
|
|
502 |
|
|
503 |
pr_attr("Form Factor", "%s", str);
|
|
504 |
}
|
|
505 |
|
|
506 |
static void dmi_hp_242_speed(const char *attr, u16 speed)
|
|
507 |
{
|
|
508 |
if (speed)
|
|
509 |
pr_attr(attr, "%hu Gbit/s", speed);
|
|
510 |
else
|
|
511 |
pr_attr(attr, "%s", "Unknown");
|
350 | 512 |
}
|
351 | 513 |
|
352 | 514 |
static int dmi_decode_hp(const struct dmi_header *h)
|
|
598 | 760 |
pr_subattr("UEFI", "%s", feat & 0x1400 ? "Yes" : "No");
|
599 | 761 |
break;
|
600 | 762 |
|
|
763 |
case 224:
|
|
764 |
/*
|
|
765 |
* Vendor Specific: Trusted Module (TPM or TCM) Status
|
|
766 |
*
|
|
767 |
* Offset | Name | Width | Description
|
|
768 |
* -------------------------------------
|
|
769 |
* 0x00 | Type | BYTE | 0xE0, Trusted Module (TPM or TCM) Status
|
|
770 |
* 0x01 | Length | BYTE | Length of structure
|
|
771 |
* 0x02 | Handle | WORD | Unique handle
|
|
772 |
* 0x04 | Status | BYTE | Status Flag Byte
|
|
773 |
* 0x05 | Ex Stat| BYTE | TPM Extended Status
|
|
774 |
* 0x06 | Type | BYTE | Trusted Module Type
|
|
775 |
* 0x07 | Attrib | BYTE | Trusted Module Attributes
|
|
776 |
* 0x08 | Handle | WORD | Handle to map to Type 216
|
|
777 |
* 0x0A | Chip ID| WORD | Chip Identifier Values
|
|
778 |
*/
|
|
779 |
pr_handle_name("%s Trusted Module (TPM or TCM) Status", company);
|
|
780 |
if (h->length < 0x05) break;
|
|
781 |
if (!dmi_hp_224_status(data[0x04]))
|
|
782 |
break;
|
|
783 |
if (h->length < 0x0a) break;
|
|
784 |
dmi_hp_224_ex_status(data[0x04], data[0x05]);
|
|
785 |
dmi_hp_224_module_type(data[0x06]);
|
|
786 |
dmi_hp_224_module_attr(data[0x07]);
|
|
787 |
if (!(opt.flags & FLAG_QUIET))
|
|
788 |
pr_attr("Associated Handle", "0x%04X", WORD(data + 0x8));
|
|
789 |
if (h->length < 0x0c) break;
|
|
790 |
dmi_hp_224_chipid(WORD(data + 0x0a));
|
|
791 |
break;
|
|
792 |
|
|
793 |
case 230:
|
|
794 |
/*
|
|
795 |
* Vendor Specific: Power Supply Information OEM SMBIOS Record
|
|
796 |
*
|
|
797 |
* This record is used to communicate additional Power Supply Information
|
|
798 |
* beyond the Industry Standard System Power Supply (Type 39) Record.
|
|
799 |
*
|
|
800 |
* Offset| Name | Width | Description
|
|
801 |
* -----------------------------------------
|
|
802 |
* 0x00 | Type | BYTE | 0xE6, Power Supply Information Indicator
|
|
803 |
* 0x01 | Length | BYTE | Length of structure
|
|
804 |
* 0x02 | Handle | WORD | Unique handle
|
|
805 |
* 0x04 | Assoc Handle| WORD | Associated Handle (Type 39)
|
|
806 |
* 0x06 | Manufacturer| STRING| Actual third party manufacturer
|
|
807 |
* 0x07 | Revision | STRING| Power Supply Revision Level
|
|
808 |
* 0x08 | FRU Access | BYTE | Power Supply FRU Access Method
|
|
809 |
* 0x09 | I2C Bus Num | BYTE | I2C Bus #. Value based upon context
|
|
810 |
* 0x0A | I2C Address | BYTE | I2C Address
|
|
811 |
*/
|
|
812 |
pr_handle_name("%s Power Supply Information", company);
|
|
813 |
if (h->length < 0x0B) break;
|
|
814 |
if (!(opt.flags & FLAG_QUIET))
|
|
815 |
pr_attr("Associated Handle", "0x%04X", WORD(data + 0x4));
|
|
816 |
pr_attr("Manufacturer", "%s", dmi_string(h, data[0x06]));
|
|
817 |
pr_attr("Revision", "%s", dmi_string(h, data[0x07]));
|
|
818 |
dmi_hp_230_method_bus_seg_addr(data[0x08], data[0x09], data[0x0A]);
|
|
819 |
break;
|
|
820 |
|
601 | 821 |
case 233:
|
602 | 822 |
/*
|
603 | 823 |
* Vendor Specific: HPE ProLiant NIC MAC Information
|
|
769 | 989 |
pr_attr("Lowest Supported Version", "Not Available");
|
770 | 990 |
break;
|
771 | 991 |
|
|
992 |
case 242:
|
|
993 |
/*
|
|
994 |
* Vendor Specific: HPE Hard Drive Inventory Record
|
|
995 |
*
|
|
996 |
* This record provides a mechanism for software to gather information for
|
|
997 |
* NVMe and SATA drives that are directly attached to the system. This
|
|
998 |
* record does not contain drive information for drives attached to a HBA
|
|
999 |
* (i.e. a SmartArray controller). This record will only contain information
|
|
1000 |
* for a hard drive detected by the BIOS during POST and does not
|
|
1001 |
* comprehend a hot plug event after the system has booted.
|
|
1002 |
*
|
|
1003 |
* Offset | Name | Width | Description
|
|
1004 |
* ---------------------------------------
|
|
1005 |
* 0x00 | Type | BYTE | 0xF2, HPE Hard Drive Inventory Record
|
|
1006 |
* 0x01 | Length | BYTE | Length of structure
|
|
1007 |
* 0x02 | Handle | WORD | Unique handle
|
|
1008 |
* 0x04 | Hndl Assoc | WORD | Handle to map to Type 203
|
|
1009 |
* 0x06 | HDD Type | BYTE | Hard drive type
|
|
1010 |
* 0x07 | HDD Uniq ID| QWORD | SATA-> WWID. NVMe -> IEEE Ext Uniq ID.
|
|
1011 |
* 0x0F | Capacity | DWORD | Drive Capacity in Mbytes
|
|
1012 |
* 0x13 | Hours | 16BYTE| Number of poweron hours
|
|
1013 |
* 0x23 | Reserved | BYTE | Reserved
|
|
1014 |
* 0x24 | Power | BTYE | Wattage
|
|
1015 |
* 0x25 | Form Factor| BYTE | HDD Form Factor
|
|
1016 |
* 0x26 | Health | BYTE | Hard Drive Health Status
|
|
1017 |
* 0x27 | Serial Num | STRING| NVMe/SATA Serial Number
|
|
1018 |
* 0x28 | Model Num | STRING| NVMe/SATA Model Number
|
|
1019 |
* 0x29 | FW Rev | STRING| Firmware revision
|
|
1020 |
* 0x2A | Location | STRING| Drive location
|
|
1021 |
* 0x2B | Crypt Stat | BYTE | Drive encryption status from BIOS
|
|
1022 |
* 0x2C | Capacity | QWORD | Hard Drive capacity in bytes
|
|
1023 |
* 0x34 | Block Size | DWORD | Logical Block Size in bytes
|
|
1024 |
* 0x38 | Rot Speed | WORD | Nominal Rotational Speed (RPM)
|
|
1025 |
* 0x3A | Neg Speed | WORD | Current negotiated bus speed
|
|
1026 |
* 0x3C | Cap Speed | WORD | Fastest Capable Bus Speed of drive
|
|
1027 |
*/
|
|
1028 |
if (gen < G10) return 0;
|
|
1029 |
pr_handle_name("%s ProLiant Hard Drive Inventory Record", company);
|
|
1030 |
if (h->length < 0x2C) break;
|
|
1031 |
if (!(opt.flags & FLAG_QUIET))
|
|
1032 |
pr_attr("Associated Handle", "0x%04X", WORD(data + 0x4));
|
|
1033 |
dmi_hp_242_hdd_type(data[0x06]);
|
|
1034 |
pr_attr("ID", "%lx", QWORD(data + 0x07));
|
|
1035 |
if (h->length < 0x3E)
|
|
1036 |
pr_attr("Capacity", "%u MB", DWORD(data + 0x0F));
|
|
1037 |
else
|
|
1038 |
dmi_print_memory_size("Capacity", QWORD(data + 0x2C), 0);
|
|
1039 |
/* NB: Poweron low QWORD good for 2,104,351,365,926,255 years */
|
|
1040 |
pr_attr("Poweron", "%ld hours", QWORD(data + 0x13));
|
|
1041 |
if (data[0x24])
|
|
1042 |
pr_attr("Power Wattage", "%hhu W", data[0x24]);
|
|
1043 |
else
|
|
1044 |
pr_attr("Power Wattage", "%s", "Unknown");
|
|
1045 |
dmi_hp_242_form_factor(data[0x25]);
|
|
1046 |
feat = data[0x26];
|
|
1047 |
pr_attr("Health Status", "%s", (feat == 0x00) ? "OK" :
|
|
1048 |
(feat == 0x01) ? "Warning" :
|
|
1049 |
(feat == 0x02) ? "Critical" :
|
|
1050 |
(feat == 0xFF) ? "Unknown" : "Reserved");
|
|
1051 |
pr_attr("Serial Number", dmi_string(h, data[0x27]));
|
|
1052 |
pr_attr("Model Number", dmi_string(h, data[0x28]));
|
|
1053 |
pr_attr("Firmware Revision", dmi_string(h, data[0x29]));
|
|
1054 |
pr_attr("Location", dmi_string(h, data[0x2A]));
|
|
1055 |
feat = data[0x2B];
|
|
1056 |
pr_attr("Encryption Status", "%s", (feat == 0) ? "Not Encrypted" :
|
|
1057 |
(feat == 1) ? "Encrypted" :
|
|
1058 |
(feat == 2) ? "Unknown" :
|
|
1059 |
(feat == 3) ? "Not Supported" : "Reserved");
|
|
1060 |
if (h->length < 0x3E) break;
|
|
1061 |
pr_attr("Block Size", "%u bytes", DWORD(data + 0x34));
|
|
1062 |
/* Rotational Speed: 0 -> Not Reported, 1 -> N/A (SSD) */
|
|
1063 |
if (data[0x38] > 1)
|
|
1064 |
pr_attr("Rotational Speed", "%hhu RPM", data[0x38]);
|
|
1065 |
dmi_hp_242_speed("Negotiated Speed", WORD(data + 0x3A));
|
|
1066 |
dmi_hp_242_speed("Capable Speed", WORD(data + 0x3C));
|
|
1067 |
break;
|
772 | 1068 |
default:
|
773 | 1069 |
return 0;
|
774 | 1070 |
}
|