mc: Fix manufacturer ID masking

A potential future problem has been identified in the manufacturer
ID processing code for `mc info` command. Only 16 of 24 bits were
used. This is fixed now.

Also added support for ID 0x0FFFFF, the 'reserved' value as per
IPMI specification. It is now reported as 'Unspecified' unlike other
non-listed IDs that are still reported as 'Unknown'.

ID 0xFFFFFE is used for debugging purposes in hope that IANA won't
reach that number of entities any soon. If it will though, then
IANA's assignment will take precedence.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
This commit is contained in:
Alexander Amelkin 2018-07-26 19:54:57 +03:00
parent 6ee52071dd
commit 329ebdff84
No known key found for this signature in database
GPG Key ID: E893587B5B74178D
3 changed files with 16 additions and 4 deletions

View File

@ -260,6 +260,8 @@ struct ipmi_rs {
typedef enum IPMI_OEM {
IPMI_OEM_UNKNOWN = 0,
IPMI_OEM_DEBUG = 0xFFFFFE, /* Hoping IANA won't hit this soon */
IPMI_OEM_RESERVED = 0x0FFFFF, /* As per IPMI 2.0 specification */
/* 2 for [IBM] */
IPMI_OEM_IBM_2 = 2,
IPMI_OEM_HP = 11,

View File

@ -92,8 +92,8 @@ struct ipm_devid_rsp {
#define IPM_DEV_IPMI_VERSION_MINOR(x) \
((x & IPM_DEV_IPMI_VER_MINOR_MASK) >> IPM_DEV_IPMI_VER_MINOR_SHIFT)
#define IPM_DEV_MANUFACTURER_ID_MASK 0x0FFFFF
#define IPM_DEV_MANUFACTURER_ID(x) (ipmi24toh(x) & IPM_DEV_MANUFACTURER_ID_MASK)
#define IPM_DEV_MANUFACTURER_ID_RESERVED 0x0FFFFF
#define IPM_DEV_MANUFACTURER_ID(x) ipmi24toh(x)
#define IPM_DEV_ADTL_SUPPORT_BITS (8)

View File

@ -38,17 +38,27 @@
const struct valstr ipmi_oem_info[] = {
/* These are at the top so they are found first */
{ IPMI_OEM_UNKNOWN, "Unknown" },
{ IPMI_OEM_RESERVED, "Unspecified" },
/* The included file is auto-generated from offical IANA PEN list */
#include "ipmi_pen_list.inc.c"
{ 0xffff , NULL },
/*
* This debug ID is at the bottom so that if IANA assigns it to
* any entity, that IANA's value is found first and reported.
*/
{ IPMI_OEM_DEBUG, "A Debug Assisting Company, Ltd." },
{ -1 , NULL },
};
const struct oemvalstr ipmi_oem_product_info[] = {
/* Keep OEM grouped together */
/* For ipmitool debugging */
{ IPMI_OEM_DEBUG, 0x1234, "Great Debuggable BMC" },
/* Intel stuff, thanks to Tim Bell */
{ IPMI_OEM_INTEL, 0x000C, "TSRLT2" },
{ IPMI_OEM_INTEL, 0x001B, "TIGPR2U" },