Compare commits

..

12 Commits

Author SHA1 Message Date
2bf9964ce5 WIP: nm: Reduce complexity and use of magic numbers
The nm module has a lot of repeated code such as searching
for a subcommand, or verification of command line arguments.
It also extensively uses magic numbers for option processing.
This commit improves code reuse, reduces complexity of code,
and gets rid of at least some of magic numbers in the code.

This is a work in progress on this branch.
2019-08-30 17:32:32 +03:00
b6098c3bdb nm: Refactor to fix issues found by Codacy
Some ternary operator precedence clarification,
removal of useless variables, etc.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-08-30 13:42:42 +03:00
0c8ceb78a4 nm: Refactor to reduce complexity of nm_suspend()
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-08-30 13:42:42 +03:00
97da8c83ae dcmi: Refactor to simplify read length calculation
Multiple functions use a very complex equation employing
division, modulo, and ternary conditionals to perform a
very simple task of finding the minimum of two values.

Replace all those equations with a call to __min() macro.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-08-30 13:42:42 +03:00
8e4459f3dc Refactor to reduce complexity of dict print funcs
Dictionary print functions (print_valstr, print_valstr_2col,
dcmi_print_strs) are used in various modules and are excessively
complex. One of the reasons is support for loglevel -1, which means
printing to STDOUT. Another reason is support in dcmi_print_strs()
for so called 'horizontal printing' when only strings without
descriptions are printed in one line with separators.

Horizontal printing was in fact broken as dcmi_print_strs() was
always called with loglevel set to LOG_ERR, which resulted in using
lprintf() that adds a '\n' at the end of each printout.

This commit:
* Fixes horizontal printout for dcmi_print_strs();
* Reduces complexity of all three functions by introducing
  a macro helper called uprintf() that automatically chooses
  either printf() or lprintf() based on the selected loglevel;

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-08-30 13:42:17 +03:00
161bb88c6e nm: Refactor to get rid of magic numbers in cmd
Replace all magic numbers for nm commands with enum values.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-08-30 13:33:19 +03:00
67928205e7 nm: Refactor error checking
Make chk_nm_rsp() search for the codes really defined in the
NM dictionary and not just check some arbitrary completion codes
range. For all codes not defined in NM dictionary, print strings
from the generic IPMI completion codes dictionary.

Rename chk_nm_rsp() to is_nm_err() to better reflect the purpose
of the function. Make it 'bool'. Use centralized exiting for the
function.

Also fix wording for invalid NM ID.

End-user-impact: On invalid responses from the NM, instead of
                 "A valid NM command was not returned!" accompanied
                 by a single byte of data, the following message
                 with full 3 bytes of data will now be printed:
                 "No valid NM ID in response!"
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-08-30 13:33:19 +03:00
7469522fbb nm: Refactor to get rid of magic completion codes
Replace all magic numbers implied to mean NM completions codes
with descriptive macro names.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-08-30 13:33:19 +03:00
5372a57297 dcmi: Refactor macro names
Make DCMI command macros more relevant and easy to read.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-08-30 13:33:18 +03:00
be9f1660fb nm: Refactor to reduce code duplication
Add nm_set_id() and nm_check_id() functions, use them and
the existing htoipmi24() to reduce code duplication.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-08-30 13:31:15 +03:00
e0811437a2 nm: Fix coding style
Fix whitespaces, line lengths, etc.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-08-29 16:24:39 +03:00
75eada4859 nm: Separate code from dcmi
Move Node Manager related code to separate ipmi_nm.* files.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-08-29 16:24:39 +03:00
23 changed files with 2620 additions and 3450 deletions

View File

@ -22,18 +22,12 @@ project is tested automatically to build cleanly for the following
- Ubuntu 16.04 Xenial
- MacOS X 10.14 (Xcode 10.2)
For Ubuntu 16.04 it is recommended to do the following before building:
$ sudo apt install automake gcc git libreadline-dev libssl-dev libsystemd-dev libtool make wget
For Fedora 31 it is recommended to do the following before building:
$ sudo dnf install automake gcc git libtool make openssl-devel readline-devel systemd-devel wget
Basic Installation
==================
Briefly, the followong shell command should configure, build, and
install this package:
`./bootstrap && ./configure && make && sudo make install`
`./bootstrap && ./configure && make && make install`
The following more-detailed instructions are generic; see the
`README' file for instructions specific to this package. Some

View File

@ -616,18 +616,30 @@ fi
AC_SUBST(IPMITOOL_INTF_LIB)
if test "x$xenable_ipmishell" = "xyes"; then
AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses readline termcap])
AC_SEARCH_LIBS([initscr], [ncurses curses], [have_curses=yes])
AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes])
if test "x$have_curses" != "xyes" || test "x$have_readline" != "xyes"; then
xenable_ipmishell=no
fi
fi
dnl check for readline library to enable ipmi shell
AC_ARG_ENABLE([ipmishell],
[AC_HELP_STRING([--enable-ipmishell],
[enable IPMI shell interface [default=auto]])],
[xenable_ipmishell=$enableval],
[])
dnl check for readline library to enable ipmi shell
if test "x$xenable_ipmishell" = "xyes"; then
AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses readline termcap])
AC_SEARCH_LIBS([initscr], [ncurses curses], [have_curses=yes])
AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes])
if test "x$have_curses" != "xyes"; then
AC_MSG_ERROR([** Unable to find curses required by ipmishell.])
fi
if test "x$have_readline" != "xyes"; then
AC_MSG_ERROR([** Unable to find readline required by ipmishell.])
xenable_ipmishell=no
fi
AC_DEFINE(HAVE_READLINE, [1], [Define to 1 if readline present.])
fi

View File

@ -259,15 +259,11 @@ system. It is thus recommended that IPMI password management only be done
over IPMIv2.0 \fIlanplus\fP interface or the system interface on the
local station.
For IPMI v1.5, the maximum password length is 16 characters; longer
passwords might be truncated or rejected by the server, or rejected
by
.BR ipmitool .
For IPMI v2.0, the maximum password length is 20 characters; longer
passwords will be rejected by
.BR ipmitool .
For IPMI v1.5, the maximum password length is 16 characters.
Passwords longer than 16 characters will be truncated.
For IPMI v2.0, the maximum password length is 20 characters;
longer passwords are truncated.
.SH "COMMANDS"
.TP
\fIhelp\fP
@ -3530,13 +3526,12 @@ Displays a list of user information for all defined userids.
Sets the username associated with the given userid.
.TP
\fIpassword\fP <\fBuserid\fR> [<\fBpassword\fR> [<\fB16|20\fR>]]
\fIpassword\fP <\fBuserid\fR> [<\fBpassword\fR>]
.br
Sets the password for the given userid. If no password is given,
the password is cleared (set to the NULL password). Be careful when
removing passwords from administrator\-level accounts. If specified,
16 or 20 determines the maximum password length.
removing passwords from administrator\-level accounts.
.RE
.TP
\fIdisable\fP <\fBuserid\fR>

View File

@ -24,23 +24,22 @@
/* DCMI commands per DCMI 1.5 SPEC */
#define IPMI_DCMI 0xDC /* Group Extension Identification */
#define IPMI_DCMI_COMPAT 0x01
#define IPMI_DCMI_GETRED 0x02
#define IPMI_DCMI_GETLMT 0x03
#define IPMI_DCMI_SETLMT 0x04
#define IPMI_DCMI_PWRACT 0x05
#define IPMI_DCMI_GETASSET 0x06
#define IPMI_DCMI_SETASSET 0x08
#define IPMI_DCMI_GETMNGCTRLIDS 0x09
#define IPMI_DCMI_SETMNGCTRLIDS 0x0A
#define IPMI_DCMI_SETTERMALLIMIT 0x0B
#define IPMI_DCMI_GETTERMALLIMIT 0x0C
#define IPMI_DCMI_GETSNSR 0x07
#define IPMI_DCMI_PWRMGT 0x08
#define IPMI_DCMI_GETTEMPRED 0x10
#define IPMI_DCMI_SETCONFPARAM 0x12
#define IPMI_DCMI_GETCONFPARAM 0x13
#define IPMI_DCMI 0xDC /* Group Extension Identification */
#define IPMI_DCMI_GET_CAPS 0x01 /* Get Capabilities */
#define IPMI_DCMI_GET_PWR_READING 0x02 /* Get Power Reading */
#define IPMI_DCMI_GET_PWR_LIM 0x03 /* Get Power Limit */
#define IPMI_DCMI_SET_PWR_LIM 0x04 /* Set Power Limit */
#define IPMI_DCMI_ACT_PWR_LIM 0x05 /* Activate/Deactivate Power Limit */
#define IPMI_DCMI_GET_ASSET_TAG 0x06 /* Get Asset Tag */
#define IPMI_DCMI_SET_ASSET_TAG 0x08 /* Set Asset Tag */
#define IPMI_DCMI_GET_MC_ID 0x09 /* Get Management Controller ID String */
#define IPMI_DCMI_SET_MC_ID 0x0A /* Set Management Controller ID String */
#define IPMI_DCMI_SET_THERM_LIM 0x0B /* Set Thermal Limit */
#define IPMI_DCMI_GET_THERM_LIM 0x0C /* Get Thermal Limit */
#define IPMI_DCMI_GET_SENSOR_INFO 0x07 /* Get DCMI Sensor Info */
#define IPMI_DCMI_GET_TEMP 0x10 /* Get Temperature Readings */
#define IPMI_DCMI_SET_CONF_PARAM 0x12 /* Set DCMI Configuration Parameters */
#define IPMI_DCMI_GET_CONF_PARAM 0x13 /* Get DCMI Configuration Parameters */
#define IPMI_DCMI_CONFORM 0x0001
#define IPMI_DCMI_1_1_CONFORM 0x0101
@ -52,53 +51,6 @@
#define GOOD_PWR_GLIMIT_CCODE(ccode) ((ccode = ((ccode == 0x80) ? 0 : ccode)))
#define GOOD_ASSET_TAG_CCODE(ccode) ((ccode = (((ccode == 0x80) || (ccode == 0x81) || (ccode == 0x82) || (ccode == 0x83)) ? 0 : ccode)))
/* External Node Manager Configuration and Control Commands per spec 2.0 */
#define IPMI_NM_POLICY_CTL 0xC0
#define IPMI_NM_SET_POLICY 0xC1
#define IPMI_NM_GET_POLICY 0xC2
#define IPMI_NM_SET_ALERT_TH 0xC3
#define IPMI_NM_GET_ALERT_TH 0xC4
#define IPMI_NM_SET_SUSPEND 0xC5
#define IPMI_NM_GET_SUSPEND 0xC6
#define IPMI_NM_RESET_STATS 0xC7
#define IPMI_NM_GET_STATS 0xC8
#define IPMI_NM_GET_CAP 0xC9
#define IPMI_NM_GET_VERSION 0xCA
#define IPMI_NM_SET_POWER 0xCB
#define IPMI_NM_SET_ALERT_DS 0xCE
#define IPMI_NM_GET_ALERT_DS 0xCF
#define IPMI_NM_LIMITING 0xF2
/* Node Manager Policy Control Flags */
#define IPMI_NM_GLOBAL_ENABLE 0x01
#define IPMI_NM_DOMAIN_ENABLE 0x02
#define IPMI_NM_PER_POLICY_ENABLE 0x04
/* Node Manager Set Policy Enable */
#define IPMI_NM_POLICY_ENABLE 0x10
/* Node Manager Policy Trigger Codes */
#define IPMI_NM_NO_POLICY_TRIG 0x00
#define IPMI_NM_TEMP_TRIGGER 0x01
#define IPMI_NM_NO_READ_TRIG 0x02
#define IPMI_NM_RESET_TRIGGER 0x03
#define IPMI_NM_BOOT_TRIGGER 0x04
/* Policy Exception Actions flags */
#define IPMI_NM_POLICY_ALERT 0x01
#define IPMI_NM_POLICY_SHUT 0x02
/* Power Correction codes for Policy action */
#define IPMI_NM_PWR_AUTO_CORR 0x00
#define IPMI_NM_PWR_SOFT_CORR 0x01
#define IPMI_NM_PWR_AGGR_CORR 0x02
/* Set Threshold message size */
#define IPMI_NM_SET_THRESH_LEN 12
/* Number of Suspend Periods */
#define IPMI_NM_SUSPEND_PERIOD_MAX 5
struct dcmi_cmd {
uint16_t val;
@ -106,6 +58,13 @@ struct dcmi_cmd {
const char * desc;
};
/*
* This is a termination macro for all struct dcmi_cmd arrays,
* def argument is the default value returned by str2val2()
* when string is not found in the array
*/
#define DCMI_CMD_END(def) { (def), NULL, NULL }
/* make a struct for the return from the get limit command */
struct power_limit {
uint8_t grp_id; /* first byte: Group Extension ID */
@ -172,99 +131,11 @@ struct thermal_limit {
} __attribute__ ((packed));
int ipmi_dcmi_main(struct ipmi_intf * intf, int argc, char ** argv);
uint16_t dcmi_str2val(const char *str, const struct dcmi_cmd *vs);
const char *dcmi_val2str(uint16_t val, const struct dcmi_cmd *vs);
void dcmi_print_strs(const struct dcmi_cmd * vs,
const char * title,
int loglevel,
int verthorz);
/* Node Manager discover command */
struct nm_discover {
uint8_t intel_id[3]; /* Always returns 000157 */
uint8_t nm_version;
uint8_t ipmi_version;
uint8_t patch_version;
uint8_t major_rev;
uint8_t minor_rev;
} __attribute__ ((packed));
/* Node Manager get capabilities command */
struct nm_capability {
uint8_t intel_id[3];
uint8_t max_settings;
uint16_t max_value; /* max power/thermal/time after reset */
uint16_t min_value; /* min "" */
uint32_t min_corr; /* min correction time inmillesecs */
uint32_t max_corr;
uint16_t min_stats;
uint16_t max_stats;
uint8_t scope;
} __attribute__ ((packed));
/* Node Manager get statistics command */
struct nm_statistics {
uint8_t intel_id[3];
uint16_t curr_value;
uint16_t min_value;
uint16_t max_value;
uint16_t ave_value;
uint32_t time_stamp;
uint32_t stat_period;
uint8_t id_state;
} __attribute__ ((packed));
/* Node Manager set policy */
struct nm_policy {
uint8_t intel_id[3];
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
uint8_t policy_id;
uint8_t policy_type; /* 0:3 trigger type 4 = action 5:6 correction */
uint8_t policy_exception; /* exception actions */
uint16_t policy_limits;
uint32_t corr_time;
uint16_t trigger_limit;
uint16_t stats_period;
} __attribute__ ((packed));
/* Node Maager get policy */
struct nm_get_policy {
uint8_t intel_id[3];
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
uint8_t policy_type; /* 0:3 trigger type 4 = action 5:6 correction */
uint8_t policy_exception; /* exception actions */
uint16_t policy_limits;
uint32_t corr_time;
uint16_t trigger_limit;
uint16_t stats_period;
} __attribute__ ((packed));
/* Node Manager set alert destination */
struct nm_set_alert {
uint8_t intel_id[3];
uint8_t chan; /* 0:3 BMC chan, 4:6 reserved, bit 7=0 register alert receiver =1 invalidate */
uint8_t dest; /* lan destination */
uint8_t string; /* alert string selector */
} __attribute__ ((packed));
/* Node Manager set alert threshold */
struct nm_thresh {
uint8_t intel_id[3];
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
uint8_t policy_id;
uint8_t count;
uint16_t thresholds[3];
} __attribute__ ((packed));
/* Node Manager suspend period struct */
struct nm_period {
uint8_t start;
uint8_t stop;
uint8_t repeat;
} __attribute__ ((packed));
/* Node Manager set suspend period */
struct nm_suspend {
uint8_t intel_id[3];
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
uint8_t policy_id;
uint8_t count;
struct nm_period period[IPMI_NM_SUSPEND_PERIOD_MAX];
} __attribute__ ((packed));
int ipmi_nm_main(struct ipmi_intf * intf, int argc, char ** argv);
#endif /*IPMI_DCMI_H*/

202
include/ipmitool/ipmi_nm.h Normal file
View File

@ -0,0 +1,202 @@
/*
* Copyright (C) 2008 Intel Corporation.
* All rights reserved
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#pragma once
#include <ipmitool/ipmi.h>
#include <ipmitool/helper.h>
/* Configuration and control commands per
* Intel Intelligent Power Node Manager 2.0
* External Interface Specification Using IPMI
*/
#define IPMI_NM_POLICY_CTL 0xC0
#define IPMI_NM_SET_POLICY 0xC1
#define IPMI_NM_GET_POLICY 0xC2
#define IPMI_NM_SET_ALERT_TH 0xC3
#define IPMI_NM_GET_ALERT_TH 0xC4
#define IPMI_NM_SET_SUSPEND 0xC5
#define IPMI_NM_GET_SUSPEND 0xC6
#define IPMI_NM_RESET_STATS 0xC7
#define IPMI_NM_GET_STATS 0xC8
#define IPMI_NM_GET_CAP 0xC9
#define IPMI_NM_GET_VERSION 0xCA
#define IPMI_NM_SET_POWER 0xCB
#define IPMI_NM_SET_ALERT_DS 0xCE
#define IPMI_NM_GET_ALERT_DS 0xCF
#define IPMI_NM_LIMITING 0xF2
/* Node Manager identification */
#define IPMI_NM_ID 0x000157 /* Three bytes */
/* Node Manager Policy Control Flags */
#define IPMI_NM_GLOBAL_ENABLE 0x01
#define IPMI_NM_DOMAIN_ENABLE 0x02
#define IPMI_NM_PER_POLICY_ENABLE 0x04
/* Node Manager Set Policy Enable */
#define IPMI_NM_POLICY_ENABLE 0x10
/* Node Manager Policy Trigger Codes */
#define IPMI_NM_NO_POLICY_TRIG 0x00
#define IPMI_NM_TEMP_TRIGGER 0x01
#define IPMI_NM_NO_READ_TRIG 0x02
#define IPMI_NM_RESET_TRIGGER 0x03
#define IPMI_NM_BOOT_TRIGGER 0x04
/* Node Manager status codes, as per
* "Intel Intelligent Power Node Manager 3.0
* External Interface Specification using IPMI"
*/
#define IPMI_NM_CC_POLICY_ID_INVALID 0x80
#define IPMI_NM_CC_POLICY_DOMAIN_INVALID 0x81
#define IPMI_NM_CC_POLICY_TRIGGER_UNKNOWN 0x82
#define IPMI_NM_CC_POLICY_CORRECTION_RANGE 0x85
#define IPMI_NM_CC_POLICY_TRIGGER_RANGE 0x86
#define IPMI_NM_CC_POLICY_STATS_RANGE 0x89
#define IPMI_NM_CC_POLICY_LIMIT_NONE 0xA1
#define IPMI_NM_CC_POLICY_PARAM_BUSY 0xD5
#define IPMI_NM_CC_POLICY_DOMAIN_ERR 0xD6
#define IPMI_NM_CC_POLICY_VALUE_INVALID 0x8B
#define IPMI_NM_CC_STATS_MODE_INVALID 0x88
#define IPMI_NM_CC_POWER_LIMIT_RANGE 0x84
/* Policy Exception Actions flags */
#define IPMI_NM_POLICY_ALERT 0x01
#define IPMI_NM_POLICY_SHUT 0x02
/* Power Correction codes for Policy action */
#define IPMI_NM_PWR_AUTO_CORR 0x00
#define IPMI_NM_PWR_SOFT_CORR 0x01
#define IPMI_NM_PWR_AGGR_CORR 0x02
/* Set Threshold message size */
#define IPMI_NM_SET_THRESH_LEN 12
/* Number of Suspend Periods */
#define IPMI_NM_SUSPEND_PERIOD_MAX 5
/* Node Manager discover command */
struct nm_discover {
uint8_t intel_id[3]; /* Always returns 000157 */
uint8_t nm_version;
uint8_t ipmi_version;
uint8_t patch_version;
uint8_t major_rev;
uint8_t minor_rev;
} __attribute__ ((packed));
/* Node Manager get capabilities command */
struct nm_capability {
uint8_t intel_id[3];
uint8_t max_settings;
uint16_t max_value; /* max power/thermal/time after reset */
uint16_t min_value; /* min "" */
uint32_t min_corr; /* min correction time inmillesecs */
uint32_t max_corr;
uint16_t min_stats;
uint16_t max_stats;
uint8_t scope;
} __attribute__ ((packed));
/* Node Manager get statistics command */
struct nm_statistics {
uint8_t intel_id[3];
uint16_t curr_value;
uint16_t min_value;
uint16_t max_value;
uint16_t ave_value;
uint32_t time_stamp;
uint32_t stat_period;
uint8_t id_state;
} __attribute__ ((packed));
/* Node Manager set policy */
struct nm_policy {
uint8_t intel_id[3];
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
uint8_t policy_id;
uint8_t policy_type; /* 0:3 trigger type 4 = action 5:6 correction */
uint8_t policy_exception; /* exception actions */
uint16_t policy_limits;
uint32_t corr_time;
uint16_t trigger_limit;
uint16_t stats_period;
} __attribute__ ((packed));
/* Node Maager get policy */
struct nm_get_policy {
uint8_t intel_id[3];
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
uint8_t policy_type; /* 0:3 trigger type 4 = action 5:6 correction */
uint8_t policy_exception; /* exception actions */
uint16_t policy_limits;
uint32_t corr_time;
uint16_t trigger_limit;
uint16_t stats_period;
} __attribute__ ((packed));
/* Node Manager set alert destination */
struct nm_set_alert {
uint8_t intel_id[3];
uint8_t chan; /* 0:3 BMC chan
* 4:6 reserved
* 7 = 0 register alert receiver
* = 1 invalidate
*/
uint8_t dest; /* LAN destination */
uint8_t string; /* alert string selector */
} __attribute__ ((packed));
/* Node Manager set alert threshold */
struct nm_thresh {
uint8_t intel_id[3];
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
uint8_t policy_id;
uint8_t count;
uint16_t thresholds[3];
} __attribute__ ((packed));
/* Node Manager suspend period struct */
struct nm_period {
uint8_t start;
uint8_t stop;
uint8_t repeat;
} __attribute__ ((packed));
/* Node Manager set suspend period */
struct nm_suspend {
uint8_t intel_id[3];
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
uint8_t policy_id;
uint8_t count;
struct nm_period period[IPMI_NM_SUSPEND_PERIOD_MAX];
} __attribute__ ((packed));
int ipmi_nm_main(struct ipmi_intf *intf, int argc, char **argv);
static inline void nm_set_id(void *buf)
{
htoipmi24(IPMI_NM_ID, buf);
}
static inline bool nm_check_id(void *buf)
{
return IPMI_NM_ID == ipmi24toh(buf);
}

View File

@ -104,24 +104,6 @@ enum {
#define GET_SENSOR_READING 0x2d
#define GET_SENSOR_TYPE 0x2f
/*
* IPMI Specification limits the length of the ID string to 16 bytes for
* SDR records, although the ID type/length code may contain a number up
* to 31 (0x1F). See IPMI 2.0 Specification Tables 43-6 through 43-8.
*/
#define SDR_TYPECODE_LEN_MASK 0x1f
#define SDR_ID_STRING_MAX 16
#define SDR_ID_STRLEN_BYTYPE(typelen) \
((size_t)__max(typelen & SDR_TYPECODE_LEN_MASK, SDR_ID_STRING_MAX))
#define SDR_ID_STRLEN(sdr) SDR_ID_STRLEN_BYTYPE((sdr)->id_code)
#define SDR_ID_TO_CSTRING(cstring, sdr) \
do { \
memset((cstring), 0, sizeof(cstring)); \
snprintf((cstring), sizeof(cstring), "%.*s", \
SDR_ID_STRLEN(sdr), (sdr)->id_string); \
} while(0)
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
@ -484,7 +466,7 @@ struct sdr_record_compact_sensor {
uint8_t __reserved[3];
uint8_t oem; /* reserved for OEM use */
uint8_t id_code; /* sensor ID string type/length code */
uint8_t id_string[SDR_ID_STRING_MAX]; /* sensor ID string bytes */
uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
@ -535,7 +517,7 @@ struct sdr_record_eventonly_sensor {
uint8_t __reserved;
uint8_t oem; /* reserved for OEM use */
uint8_t id_code; /* sensor ID string type/length code */
uint8_t id_string[SDR_ID_STRING_MAX]; /* sensor ID string bytes */
uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
@ -605,7 +587,7 @@ struct sdr_record_full_sensor {
uint8_t __reserved[2];
uint8_t oem; /* reserved for OEM use */
uint8_t id_code; /* sensor ID string type/length code */
uint8_t id_string[SDR_ID_STRING_MAX]; /* sensor ID string bytes */
uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
@ -637,7 +619,7 @@ struct sdr_record_mc_locator {
struct entity_id entity;
uint8_t oem;
uint8_t id_code;
uint8_t id_string[SDR_ID_STRING_MAX];
uint8_t id_string[16];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
@ -670,7 +652,7 @@ struct sdr_record_fru_locator {
struct entity_id entity;
uint8_t oem;
uint8_t id_code;
uint8_t id_string[SDR_ID_STRING_MAX];
uint8_t id_string[16];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
@ -704,7 +686,7 @@ struct sdr_record_generic_locator {
struct entity_id entity;
uint8_t oem;
uint8_t id_code;
uint8_t id_string[SDR_ID_STRING_MAX];
uint8_t id_string[16];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
@ -818,12 +800,9 @@ struct sdr_record_list {
#define SENSOR_TYPE_MAX 0x2C
struct sensor_reading {
char s_id[SDR_ID_STRING_MAX + 1]; /* sensor name, null-terminated */
union {
struct sdr_record_full_sensor *full;
struct sdr_record_compact_sensor *compact;
void *raw;
};
char s_id[17]; /* name of the sensor */
struct sdr_record_full_sensor *full;
struct sdr_record_compact_sensor *compact;
uint8_t s_reading_valid; /* read value valididity */
uint8_t s_scanning_disabled; /* read of value disabled */
uint8_t s_reading_unavailable; /* read value unavailable */
@ -869,7 +848,7 @@ uint8_t *ipmi_sdr_get_record(struct ipmi_intf *intf, struct sdr_get_rs *header,
void ipmi_sdr_end(struct ipmi_sdr_iterator *i);
int ipmi_sdr_print_sdr(struct ipmi_intf *intf, uint8_t type);
int sdr_get_name_from_rawentry(uint8_t type, void *raw, char *buf, size_t len);
int ipmi_sdr_print_name_from_rawentry(uint16_t id, uint8_t type,uint8_t * raw);
int ipmi_sdr_print_rawentry(struct ipmi_intf *intf, uint8_t type, uint8_t * raw,
int len);
int ipmi_sdr_print_listentry(struct ipmi_intf *intf,

View File

@ -59,5 +59,17 @@ int log_level_get(void);
void lprintf(int level, const char * format, ...);
void lperror(int level, const char * format, ...);
/**
* @brief Print to log or to STDOUT depending on the \p ll argument.
* @param[in] ll Log level. Negative values meant "print to stdout".
* @param[in] fmt The printf format string. No '\n' is needed at the end.
*/
#define uprintf(ll, fmt, ...) do { \
if (ll < 0) \
printf(fmt "\n", ##__VA_ARGS__); \
else \
lprintf(ll, fmt, ##__VA_ARGS__); \
} while(0)
#endif /*IPMITOOL_LOG_H*/

View File

@ -40,7 +40,7 @@ libipmitool_la_SOURCES = helper.c ipmi_sdr.c ipmi_sel.c ipmi_sol.c ipmi_pef.c \
ipmi_oem.c ipmi_isol.c ipmi_sunoem.c ipmi_fwum.c ipmi_picmg.c \
ipmi_main.c ipmi_tsol.c ipmi_firewall.c ipmi_kontronoem.c \
ipmi_hpmfwupg.c ipmi_sdradd.c ipmi_ekanalyzer.c ipmi_gendev.c \
ipmi_ime.c ipmi_delloem.c ipmi_dcmi.c hpm2.c ipmi_vita.c \
ipmi_ime.c ipmi_delloem.c ipmi_dcmi.c ipmi_nm.c hpm2.c ipmi_vita.c \
ipmi_lanp6.c ipmi_cfgp.c ipmi_quantaoem.c ipmi_time.c \
../src/plugins/lan/md5.c ../src/plugins/lan/md5.h

View File

@ -1621,7 +1621,7 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
struct ipmi_rq req;
struct fru_info fru;
uint8_t *spd_data, msg_data[4];
uint32_t len, offset;
int len, offset;
msg_data[0] = id;
@ -1697,13 +1697,6 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
}
len = rsp->data[0];
if(rsp->data_len < 1
|| len > rsp->data_len - 1
|| len > fru.size - offset)
{
printf(" Not enough buffer size");
return -1;
}
memcpy(&spd_data[offset], rsp->data + 1, len);
offset += len;
} while (offset < fru.size);

View File

@ -669,38 +669,22 @@ print_valstr(const struct valstr * vs, const char * title, int loglevel)
return;
if (title) {
if (loglevel < 0)
printf("\n%s:\n\n", title);
else
lprintf(loglevel, "\n%s:\n", title);
uprintf(loglevel, "\n%s:\n", title);
}
if (loglevel < 0) {
printf(" VALUE\tHEX\tSTRING\n");
printf("==============================================\n");
} else {
lprintf(loglevel, " VAL\tHEX\tSTRING");
lprintf(loglevel, "==============================================");
}
uprintf(loglevel, " VALUE\tHEX\tSTRING");
uprintf(loglevel, "==============================================");
for (i = 0; vs[i].str; i++) {
if (loglevel < 0) {
if (vs[i].val < 256)
printf(" %d\t0x%02x\t%s\n", vs[i].val, vs[i].val, vs[i].str);
else
printf(" %d\t0x%04x\t%s\n", vs[i].val, vs[i].val, vs[i].str);
} else {
if (vs[i].val < 256)
lprintf(loglevel, " %d\t0x%02x\t%s", vs[i].val, vs[i].val, vs[i].str);
else
lprintf(loglevel, " %d\t0x%04x\t%s", vs[i].val, vs[i].val, vs[i].str);
}
if (vs[i].val < 256)
uprintf(loglevel, " %d\t0x%02x\t%s",
vs[i].val, vs[i].val, vs[i].str);
else
uprintf(loglevel, " %d\t0x%04x\t%s",
vs[i].val, vs[i].val, vs[i].str);
}
if (loglevel < 0)
printf("\n");
else
lprintf(loglevel, "");
uprintf(loglevel, "");
}
/* print_valstr_2col - print value string list in two columns to log or stdout
@ -718,37 +702,22 @@ print_valstr_2col(const struct valstr * vs, const char * title, int loglevel)
return;
if (title) {
if (loglevel < 0)
printf("\n%s:\n\n", title);
else
lprintf(loglevel, "\n%s:\n", title);
uprintf(loglevel, "\n%s:\n", title);
}
for (i = 0; vs[i].str; i++) {
if (!vs[i+1].str) {
/* last one */
if (loglevel < 0) {
printf(" %4d %-32s\n", vs[i].val, vs[i].str);
} else {
lprintf(loglevel, " %4d %-32s\n", vs[i].val, vs[i].str);
}
uprintf(loglevel, " %4d %-32s\n", vs[i].val, vs[i].str);
}
else {
if (loglevel < 0) {
printf(" %4d %-32s %4d %-32s\n",
vs[i].val, vs[i].str, vs[i+1].val, vs[i+1].str);
} else {
lprintf(loglevel, " %4d %-32s %4d %-32s\n",
vs[i].val, vs[i].str, vs[i+1].val, vs[i+1].str);
}
uprintf(loglevel, " %4d %-32s %4d %-32s\n",
vs[i].val, vs[i].str, vs[i+1].val, vs[i+1].str);
i++;
}
}
if (loglevel < 0)
printf("\n");
else
lprintf(loglevel, "");
uprintf(loglevel, ""); /* Empty spacer line */
}
/* ipmi_csum - calculate an ipmi checksum

View File

@ -498,10 +498,7 @@ ipmi_get_channel_cipher_suites(struct ipmi_intf *intf,
lprintf(LOG_ERR, "Unable to Get Channel Cipher Suites");
return -1;
}
if (rsp->ccode
|| rsp->data_len < 1
|| rsp->data_len > sizeof(uint8_t) + MAX_CIPHER_SUITE_DATA_LEN)
{
if (rsp->ccode || rsp->data_len < 1) {
lprintf(LOG_ERR, "Get Channel Cipher Suites failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;

View File

@ -53,96 +53,6 @@
#define CHASSIS_BOOT_MBOX_MAX_BLOCK 0xFF
#define CHASSIS_BOOT_MBOX_MAX_BLOCKS (CHASSIS_BOOT_MBOX_MAX_BLOCK + 1)
/* Get/Set system boot option boot flags bit definitions */
/* Boot flags byte 1 bits */
#define BF1_VALID_SHIFT 7
#define BF1_INVALID 0
#define BF1_VALID (1 << BF1_VALID_SHIFT)
#define BF1_VALID_MASK BF1_VALID
#define BF1_PERSIST_SHIFT 6
#define BF1_ONCE 0
#define BF1_PERSIST (1 << BF1_PERSIST_SHIFT)
#define BF1_PERSIST_MASK BF1_PERSIST
#define BF1_BOOT_TYPE_SHIFT 5
#define BF1_BOOT_TYPE_LEGACY 0
#define BF1_BOOT_TYPE_EFI (1 << BF1_BOOT_TYPE_SHIFT)
#define BF1_BOOT_TYPE_MASK BF1_BOOT_TYPE_EFI
/* Boot flags byte 2 bits */
#define BF2_CMOS_CLEAR_SHIFT 7
#define BF2_CMOS_CLEAR (1 << BF2_CMOS_CLEAR_SHIFT)
#define BF2_CMOS_CLEAR_MASK BF2_CMOS_CLEAR
#define BF2_KEYLOCK_SHIFT 6
#define BF2_KEYLOCK (1 << BF2_KEYLOCK_SHIFT)
#define BF2_KEYLOCK_MASK BF2_KEYLOCK
#define BF2_BOOTDEV_SHIFT 2
#define BF2_BOOTDEV_DEFAULT (0 << BF2_BOOTDEV_SHIFT)
#define BF2_BOOTDEV_PXE (1 << BF2_BOOTDEV_SHIFT)
#define BF2_BOOTDEV_HDD (2 << BF2_BOOTDEV_SHIFT)
#define BF2_BOOTDEV_HDD_SAFE (3 << BF2_BOOTDEV_SHIFT)
#define BF2_BOOTDEV_DIAG_PART (4 << BF2_BOOTDEV_SHIFT)
#define BF2_BOOTDEV_CDROM (5 << BF2_BOOTDEV_SHIFT)
#define BF2_BOOTDEV_SETUP (6 << BF2_BOOTDEV_SHIFT)
#define BF2_BOOTDEV_REMOTE_FDD (7 << BF2_BOOTDEV_SHIFT)
#define BF2_BOOTDEV_REMOTE_CDROM (8 << BF2_BOOTDEV_SHIFT)
#define BF2_BOOTDEV_REMOTE_PRIMARY_MEDIA (9 << BF2_BOOTDEV_SHIFT)
#define BF2_BOOTDEV_REMOTE_HDD (11 << BF2_BOOTDEV_SHIFT)
#define BF2_BOOTDEV_FDD (15 << BF2_BOOTDEV_SHIFT)
#define BF2_BOOTDEV_MASK (0xF << BF2_BOOTDEV_SHIFT)
#define BF2_BLANK_SCREEN_SHIFT 1
#define BF2_BLANK_SCREEN (1 << BF2_BLANK_SCREEN_SHIFT)
#define BF2_BLANK_SCREEN_MASK BF2_BLANK_SCREEN
#define BF2_RESET_LOCKOUT_SHIFT 0
#define BF2_RESET_LOCKOUT (1 << BF2_RESET_LOCKOUT_SHIFT)
#define BF2_RESET_LOCKOUT_MASK BF2_RESET_LOCKOUT
/* Boot flags byte 3 bits */
#define BF3_POWER_LOCKOUT_SHIFT 7
#define BF3_POWER_LOCKOUT (1 << BF3_POWER_LOCKOUT_SHIFT)
#define BF3_POWER_LOCKOUT_MASK BF3_POWER_LOCKOUT
#define BF3_VERBOSITY_SHIFT 5
#define BF3_VERBOSITY_DEFAULT (0 << BF3_VERBOSITY_SHIFT)
#define BF3_VERBOSITY_QUIET (1 << BF3_VERBOSITY_SHIFT)
#define BF3_VERBOSITY_VERBOSE (2 << BF3_VERBOSITY_SHIFT)
#define BF3_VERBOSITY_MASK (3 << BF3_VERBOSITY_SHIFT)
#define BF3_EVENT_TRAPS_SHIFT 4
#define BF3_EVENT_TRAPS (1 << BF3_EVENT_TRAPS_SHIFT)
#define BF3_EVENT_TRAPS_MASK BF3_EVENT_TRAPS
#define BF3_PASSWD_BYPASS_SHIFT 3
#define BF3_PASSWD_BYPASS (1 << BF3_PASSWD_BYPASS_SHIFT)
#define BF3_PASSWD_BYPASS_MASK BF3_PASSWD_BYPASS
#define BF3_SLEEP_LOCKOUT_SHIFT 2
#define BF3_SLEEP_LOCKOUT (1 << BF3_SLEEP_LOCKOUT_SHIFT)
#define BF3_SLEEP_LOCKOUT_MASK BF3_SLEEP_LOCKOUT
#define BF3_CONSOLE_REDIR_SHIFT 0
#define BF3_CONSOLE_REDIR_DEFAULT (0 << BF3_CONSOLE_REDIR_SHIFT)
#define BF3_CONSOLE_REDIR_SUPPRESS (1 << BF3_CONSOLE_REDIR_SHIFT)
#define BF3_CONSOLE_REDIR_ENABLE (2 << BF3_CONSOLE_REDIR_SHIFT)
#define BF3_CONSOLE_REDIR_MASK (3 << BF3_CONSOLE_REDIR_SHIFT)
/* Boot flags byte 4 bits */
#define BF4_SHARED_MODE_SHIFT 3
#define BF4_SHARED_MODE (1 << BF4_SHARED_MODE_SHIFT)
#define BF4_SHARED_MODE_MASK BF4_SHARED_MODE
#define BF4_BIOS_MUX_SHIFT 0
#define BF4_BIOS_MUX_DEFAULT (0 << BF4_BIOS_MUX_SHIFT)
#define BF4_BIOS_MUX_BMC (1 << BF4_BIOS_MUX_SHIFT)
#define BF4_BIOS_MUX_SYSTEM (2 << BF4_BIOS_MUX_SHIFT)
#define BF4_BIOS_MUX_MASK (7 << BF4_BIOS_MUX_SHIFT)
typedef struct {
uint8_t iana[CHASSIS_BOOT_MBOX_IANA_SZ];
uint8_t data[CHASSIS_BOOT_MBOX_BLOCK0_SZ];
@ -255,7 +165,7 @@ ipmi_chassis_identify(struct ipmi_intf * intf, char * arg)
req.msg.cmd = 0x4;
if (arg) {
if (!strcmp(arg, "force")) {
if (strncmp(arg, "force", 5) == 0) {
identify_data.force_on = 1;
} else {
if ( (rc = str2uchar(arg, &identify_data.interval)) != 0) {
@ -866,147 +776,79 @@ ipmi_chassis_get_bootparam(struct ipmi_intf * intf,
{
printf( " Boot Flags :\n");
if(rsp->data[2] & BF1_VALID)
if((rsp->data[2]&0x80) == 0x80)
printf(" - Boot Flag Valid\n");
else
printf(" - Boot Flag Invalid\n");
if(rsp->data[2] & BF1_PERSIST)
if((rsp->data[2]&0x40) == 0x40)
printf(" - Options apply to all future boots\n");
else
printf(" - Options apply to only next boot\n");
if(rsp->data[2] & BF1_BOOT_TYPE_EFI)
if((rsp->data[2]&0x20) == 0x20)
printf(" - BIOS EFI boot \n");
else
printf(" - BIOS PC Compatible (legacy) boot \n");
if(rsp->data[3] & BF2_CMOS_CLEAR)
if((rsp->data[3]&0x80) == 0x80)
printf(" - CMOS Clear\n");
if(rsp->data[3] & BF2_KEYLOCK)
if((rsp->data[3]&0x40) == 0x40)
printf(" - Lock Keyboard\n");
printf(" - Boot Device Selector : ");
switch(rsp->data[3] & BF2_BOOTDEV_MASK)
switch( ((rsp->data[3]>>2)&0x0f))
{
case BF2_BOOTDEV_DEFAULT:
printf("No override\n");
break;
case BF2_BOOTDEV_PXE:
printf("Force PXE\n");
break;
case BF2_BOOTDEV_HDD:
printf("Force Boot from default Hard-Drive\n");
break;
case BF2_BOOTDEV_HDD_SAFE:
printf("Force Boot from default Hard-Drive, "
"request Safe-Mode\n");
break;
case BF2_BOOTDEV_DIAG_PART:
printf("Force Boot from Diagnostic Partition\n");
break;
case BF2_BOOTDEV_CDROM:
printf("Force Boot from CD/DVD\n");
break;
case BF2_BOOTDEV_SETUP:
printf("Force Boot into BIOS Setup\n");
break;
case BF2_BOOTDEV_REMOTE_FDD:
printf("Force Boot from remotely connected "
"Floppy/primary removable media\n");
break;
case BF2_BOOTDEV_REMOTE_CDROM:
printf("Force Boot from remotely connected "
"CD/DVD\n");
break;
case BF2_BOOTDEV_REMOTE_PRIMARY_MEDIA:
printf("Force Boot from primary remote media\n");
break;
case BF2_BOOTDEV_REMOTE_HDD:
printf("Force Boot from remotely connected "
"Hard-Drive\n");
break;
case BF2_BOOTDEV_FDD:
printf("Force Boot from Floppy/primary "
"removable media\n");
break;
default:
printf("Flag error\n");
break;
case 0: printf("No override\n"); break;
case 1: printf("Force PXE\n"); break;
case 2: printf("Force Boot from default Hard-Drive\n"); break;
case 3: printf("Force Boot from default Hard-Drive, request Safe-Mode\n"); break;
case 4: printf("Force Boot from Diagnostic Partition\n"); break;
case 5: printf("Force Boot from CD/DVD\n"); break;
case 6: printf("Force Boot into BIOS Setup\n"); break;
case 15: printf("Force Boot from Floppy/primary removable media\n"); break;
default: printf("Flag error\n"); break;
}
if(rsp->data[3] & BF2_BLANK_SCREEN)
if((rsp->data[3]&0x02) == 0x02)
printf(" - Screen blank\n");
if(rsp->data[3] & BF2_RESET_LOCKOUT)
if((rsp->data[3]&0x01) == 0x01)
printf(" - Lock out Reset buttons\n");
if(rsp->data[4] & BF3_POWER_LOCKOUT)
printf(" - Lock out (power off/sleep "
"request) via Power Button\n");
printf(" - BIOS verbosity : ");
switch(rsp->data[4] & BF3_VERBOSITY_MASK)
{
case BF3_VERBOSITY_DEFAULT:
printf("System Default\n");
break;
case BF3_VERBOSITY_QUIET:
printf("Request Quiet Display\n");
break;
case BF3_VERBOSITY_VERBOSE:
printf("Request Verbose Display\n");
break;
default:
printf("Flag error\n");
break;
}
if(rsp->data[4] & BF3_EVENT_TRAPS)
printf(" - Force progress event traps\n");
if(rsp->data[4] & BF3_PASSWD_BYPASS)
printf(" - User password bypass\n");
if(rsp->data[4] & BF3_SLEEP_LOCKOUT)
printf(" - Lock Out Sleep Button\n");
if((rsp->data[4]&0x80) == 0x80)
printf(" - Lock out (power off/sleep request) vi Power Button\n");
printf(" - Console Redirection control : ");
switch(rsp->data[4] & BF3_CONSOLE_REDIR_MASK)
switch( ((rsp->data[4]>>5)&0x03))
{
case BF3_CONSOLE_REDIR_DEFAULT:
printf(
"Console redirection occurs per BIOS "
"configuration setting (default)\n");
break;
case BF3_CONSOLE_REDIR_SUPPRESS:
printf("Suppress (skip) console redirection "
"if enabled\n");
break;
case BF3_CONSOLE_REDIR_ENABLE:
printf("Request console redirection be "
"enabled\n");
break;
default:
printf("Flag error\n");
break;
case 0: printf("System Default\n"); break;
case 1: printf("Request Quiet Display\n"); break;
case 2: printf("Request Verbose Display\n"); break;
default: printf("Flag error\n"); break;
}
if((rsp->data[4]&0x10) == 0x10)
printf(" - Force progress event traps\n");
if((rsp->data[4]&0x08) == 0x08)
printf(" - User password bypass\n");
if((rsp->data[4]&0x04) == 0x04)
printf(" - Lock Out Sleep Button\n");
if((rsp->data[4]&0x02) == 0x02)
printf(" - Lock Out Sleep Button\n");
printf(" - BIOS verbosity : ");
switch( ((rsp->data[4]>>0)&0x03))
{
case 0: printf("Console redirection occurs per BIOS configuration setting (default)\n"); break;
case 1: printf("Suppress (skip) console redirection if enabled\n"); break;
case 2: printf("Request console redirection be enabled\n"); break;
default: printf("Flag error\n"); break;
}
if(rsp->data[5] & BF4_SHARED_MODE)
if((rsp->data[5]&0x08) == 0x08)
printf(" - BIOS Shared Mode Override\n");
printf(" - BIOS Mux Control Override : ");
switch (rsp->data[5] & BF4_BIOS_MUX_MASK) {
case BF4_BIOS_MUX_DEFAULT:
printf("BIOS uses recommended setting of the "
"mux at the end of POST\n");
break;
case BF4_BIOS_MUX_BMC:
printf(
"Requests BIOS to force mux to BMC at "
"conclusion of POST/start of OS boot\n");
break;
case BF4_BIOS_MUX_SYSTEM:
printf(
"Requests BIOS to force mux to system "
"at conclusion of POST/start of "
"OS boot\n");
break;
default:
printf("Flag error\n");
break;
switch( ((rsp->data[5]>>0)&0x07))
{
case 0: printf("BIOS uses recommended setting of the mux at the end of POST\n"); break;
case 1: printf("Requests BIOS to force mux to BMC at conclusion of POST/start of OS boot\n"); break;
case 2: printf("Requests BIOS to force mux to system at conclusion of POST/start of OS boot\n"); break;
default: printf("Flag error\n"); break;
}
}
break;
@ -1273,43 +1115,29 @@ ipmi_chassis_set_bootdev(struct ipmi_intf * intf, char * arg, uint8_t *iflags)
if (!arg)
flags[1] |= 0x00;
else if (!strcmp(arg, "none"))
else if (strncmp(arg, "none", 4) == 0)
flags[1] |= 0x00;
else if (!strcmp(arg, "pxe") ||
!strcmp(arg, "force_pxe"))
{
else if (strncmp(arg, "pxe", 3) == 0 ||
strncmp(arg, "force_pxe", 9) == 0)
flags[1] |= 0x04;
}
else if (!strcmp(arg, "disk") ||
!strcmp(arg, "force_disk"))
{
else if (strncmp(arg, "disk", 4) == 0 ||
strncmp(arg, "force_disk", 10) == 0)
flags[1] |= 0x08;
}
else if (!strcmp(arg, "safe") ||
!strcmp(arg, "force_safe"))
{
else if (strncmp(arg, "safe", 4) == 0 ||
strncmp(arg, "force_safe", 10) == 0)
flags[1] |= 0x0c;
}
else if (!strcmp(arg, "diag") ||
!strcmp(arg, "force_diag"))
{
else if (strncmp(arg, "diag", 4) == 0 ||
strncmp(arg, "force_diag", 10) == 0)
flags[1] |= 0x10;
}
else if (!strcmp(arg, "cdrom") ||
!strcmp(arg, "force_cdrom"))
{
else if (strncmp(arg, "cdrom", 5) == 0 ||
strncmp(arg, "force_cdrom", 11) == 0)
flags[1] |= 0x14;
}
else if (!strcmp(arg, "floppy") ||
!strcmp(arg, "force_floppy"))
{
else if (strncmp(arg, "floppy", 6) == 0 ||
strncmp(arg, "force_floppy", 12) == 0)
flags[1] |= 0x3c;
}
else if (!strcmp(arg, "bios") ||
!strcmp(arg, "force_bios"))
{
else if (strncmp(arg, "bios", 4) == 0 ||
strncmp(arg, "force_bios", 10) == 0)
flags[1] |= 0x18;
}
else {
lprintf(LOG_ERR, "Invalid argument: %s", arg);
rc = -1;
@ -1408,8 +1236,7 @@ chassis_set_bootmailbox(struct ipmi_intf *intf, int16_t block, bool use_text,
* We need to write all data, so calculate the data
* size in blocks and set the starting block to zero.
*/
blocks = CHASSIS_BOOT_MBOX_IANA_SZ;
blocks += datasize;
blocks = datasize;
blocks += CHASSIS_BOOT_MBOX_BLOCK_SZ - 1;
blocks /= CHASSIS_BOOT_MBOX_BLOCK_SZ;
@ -1681,25 +1508,25 @@ ipmi_power_main(struct ipmi_intf * intf, int argc, char ** argv)
int rc = 0;
uint8_t ctl = 0;
if (argc < 1 || !strcmp(argv[0], "help")) {
if ((argc < 1) || (strncmp(argv[0], "help", 4) == 0)) {
lprintf(LOG_NOTICE, "chassis power Commands: status, on, off, cycle, reset, diag, soft");
return 0;
}
if (!strcmp(argv[0], "status")) {
if (strncmp(argv[0], "status", 6) == 0) {
rc = ipmi_chassis_print_power_status(intf);
return rc;
}
if (!strcmp(argv[0], "up") || !strcmp(argv[0], "on"))
if ((strncmp(argv[0], "up", 2) == 0) || (strncmp(argv[0], "on", 2) == 0))
ctl = IPMI_CHASSIS_CTL_POWER_UP;
else if (!strcmp(argv[0], "down") || !strcmp(argv[0], "off"))
else if ((strncmp(argv[0], "down", 4) == 0) || (strncmp(argv[0], "off", 3) == 0))
ctl = IPMI_CHASSIS_CTL_POWER_DOWN;
else if (!strcmp(argv[0], "cycle"))
else if (strncmp(argv[0], "cycle", 5) == 0)
ctl = IPMI_CHASSIS_CTL_POWER_CYCLE;
else if (!strcmp(argv[0], "reset"))
else if (strncmp(argv[0], "reset", 5) == 0)
ctl = IPMI_CHASSIS_CTL_HARD_RESET;
else if (!strcmp(argv[0], "diag"))
else if (strncmp(argv[0], "diag", 4) == 0)
ctl = IPMI_CHASSIS_CTL_PULSE_DIAG;
else if (!strcmp(argv[0], "acpi") || !strcmp(argv[0], "soft"))
else if ((strncmp(argv[0], "acpi", 4) == 0) || (strncmp(argv[0], "soft", 4) == 0))
ctl = IPMI_CHASSIS_CTL_ACPI_SOFT;
else {
lprintf(LOG_ERR, "Invalid chassis power command: %s", argv[0]);
@ -1727,270 +1554,58 @@ ipmi_chassis_set_bootflag_help()
get_bootparam_options("options=help", &set_flag, &clr_flag);
}
/*
* Sugar. Macros for internal use by bootdev_parse_options() to make
* the structure initialization look better. Can't use scope-limited
* static consts for initializers with gcc5, alas.
*/
#define BF1_OFFSET 0
#define BF2_OFFSET 1
#define BF3_OFFSET 2
#define BF4_OFFSET 3
#define BF_BYTE_COUNT 5
/* A helper for ipmi_chassis_main() to parse bootdev options */
static
bool
bootdev_parse_options(char *optstring, uint8_t flags[])
{
char *token;
char *saveptr = NULL;
int optionError = 0;
static const struct bootdev_opt_s {
char *name;
off_t offset;
unsigned char mask;
unsigned char value;
char *desc;
} *op;
static const struct bootdev_opt_s options[] = {
/* data 1 */
{
"valid",
BF1_OFFSET,
BF1_VALID_MASK,
BF1_VALID,
"Boot flags valid"
},
{
"persistent",
BF1_OFFSET,
BF1_PERSIST_MASK,
BF1_PERSIST,
"Changes are persistent for "
"all future boots"
},
{
"efiboot",
BF1_OFFSET,
BF1_BOOT_TYPE_MASK,
BF1_BOOT_TYPE_EFI,
"Extensible Firmware Interface "
"Boot (EFI)"
},
/* data 2 */
{
"clear-cmos",
BF2_OFFSET,
BF2_CMOS_CLEAR_MASK,
BF2_CMOS_CLEAR,
"CMOS clear"
},
{
"lockkbd",
BF2_OFFSET,
BF2_KEYLOCK_MASK,
BF2_KEYLOCK,
"Lock Keyboard"
},
/* data2[5:2] is parsed elsewhere */
{
"screenblank",
BF2_OFFSET,
BF2_BLANK_SCREEN_MASK,
BF2_BLANK_SCREEN,
"Screen Blank"
},
{
"lockoutreset",
BF2_OFFSET,
BF2_RESET_LOCKOUT_MASK,
BF2_RESET_LOCKOUT,
"Lock out Reset buttons"
},
/* data 3 */
{
"lockout_power",
BF3_OFFSET,
BF3_POWER_LOCKOUT_MASK,
BF3_POWER_LOCKOUT,
"Lock out (power off/sleep "
"request) via Power Button"
},
{
"verbose=default",
BF3_OFFSET,
BF3_VERBOSITY_MASK,
BF3_VERBOSITY_DEFAULT,
"Request quiet BIOS display"
},
{
"verbose=no",
BF3_OFFSET,
BF3_VERBOSITY_MASK,
BF3_VERBOSITY_QUIET,
"Request quiet BIOS display"
},
{
"verbose=yes",
BF3_OFFSET,
BF3_VERBOSITY_MASK,
BF3_VERBOSITY_VERBOSE,
"Request verbose BIOS display"
},
{
"force_pet",
BF3_OFFSET,
BF3_EVENT_TRAPS_MASK,
BF3_EVENT_TRAPS,
"Force progress event traps"
},
{
"upw_bypass",
BF3_OFFSET,
BF3_PASSWD_BYPASS_MASK,
BF3_PASSWD_BYPASS,
"User password bypass"
},
{
"lockout_sleep",
BF3_OFFSET,
BF3_SLEEP_LOCKOUT_MASK,
BF3_SLEEP_LOCKOUT,
"Lock out the Sleep button"
},
{
"cons_redirect=default",
BF3_OFFSET,
BF3_CONSOLE_REDIR_MASK,
BF3_CONSOLE_REDIR_DEFAULT,
"Console redirection occurs per "
"BIOS configuration setting"
},
{
"cons_redirect=skip",
BF3_OFFSET,
BF3_CONSOLE_REDIR_MASK,
BF3_CONSOLE_REDIR_SUPPRESS,
"Suppress (skip) console "
"redirection if enabled"
},
{
"cons_redirect=enable",
BF3_OFFSET,
BF3_CONSOLE_REDIR_MASK,
BF3_CONSOLE_REDIR_ENABLE,
"Request console redirection "
"be enabled"
},
/* data 4 */
/* data4[7:4] reserved */
/* data4[3] BIOS Shared Mode Override, not implemented here */
/* data4[2:0] BIOS Mux Control Override, not implemented here */
/* data5 reserved */
{NULL} /* End marker */
};
memset(&flags[0], 0, BF_BYTE_COUNT);
token = strtok_r(optstring, ",", &saveptr);
while (token) {
if (strcmp(token, "help") == 0) {
optionError = 1;
break;
}
for (op = options; op->name; ++op) {
if (strcmp(token, op->name) == 0) {
flags[op->offset] &= ~(op->mask);
flags[op->offset] |= op->value;
break;
}
}
if (!op->name) {
/* Option not found */
optionError = 1;
lprintf(LOG_ERR, "Invalid option: %s", token);
}
token = strtok_r(NULL, ",", &saveptr);
}
if (optionError) {
lprintf(LOG_NOTICE, "Legal options settings are:");
lprintf(LOG_NOTICE, " %-22s: %s",
"help",
"print this message");
for (op = options; op->name; ++op) {
lprintf(LOG_NOTICE, " %-22s: %s", op->name, op->desc);
}
return false;
}
return true;
}
int
ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
{
int rc = -1;
int rc = 0;
if (!argc || !strcmp(argv[0], "help")) {
if ((argc == 0) || (strncmp(argv[0], "help", 4) == 0)) {
lprintf(LOG_NOTICE, "Chassis Commands:\n"
" status, power, policy, restart_cause\n"
" poh, identify, selftest,\n"
" bootdev, bootparam, bootmbox");
}
else if (!strcmp(argv[0], "status")) {
else if (strncmp(argv[0], "status", 6) == 0) {
rc = ipmi_chassis_status(intf);
}
else if (!strcmp(argv[0], "selftest")) {
else if (strncmp(argv[0], "selftest", 8) == 0) {
rc = ipmi_chassis_selftest(intf);
}
else if (!strcmp(argv[0], "power")) {
else if (strncmp(argv[0], "power", 5) == 0) {
uint8_t ctl = 0;
if (argc < 2 || !strcmp(argv[1], "help")) {
if ((argc < 2) || (strncmp(argv[1], "help", 4) == 0)) {
lprintf(LOG_NOTICE, "chassis power Commands: status, on, off, cycle, reset, diag, soft");
rc = 0;
goto out;
return 0;
}
if (!strcmp(argv[1], "status")) {
if (strncmp(argv[1], "status", 6) == 0) {
rc = ipmi_chassis_print_power_status(intf);
goto out;
return rc;
}
if (!strcmp(argv[1], "up") ||
!strcmp(argv[1], "on"))
{
if ((strncmp(argv[1], "up", 2) == 0) || (strncmp(argv[1], "on", 2) == 0))
ctl = IPMI_CHASSIS_CTL_POWER_UP;
}
else if (!strcmp(argv[1], "down") ||
!strcmp(argv[1], "off"))
{
else if ((strncmp(argv[1], "down", 4) == 0) || (strncmp(argv[1], "off", 3) == 0))
ctl = IPMI_CHASSIS_CTL_POWER_DOWN;
}
else if (!strcmp(argv[1], "cycle"))
else if (strncmp(argv[1], "cycle", 5) == 0)
ctl = IPMI_CHASSIS_CTL_POWER_CYCLE;
else if (!strcmp(argv[1], "reset"))
else if (strncmp(argv[1], "reset", 5) == 0)
ctl = IPMI_CHASSIS_CTL_HARD_RESET;
else if (!strcmp(argv[1], "diag"))
else if (strncmp(argv[1], "diag", 4) == 0)
ctl = IPMI_CHASSIS_CTL_PULSE_DIAG;
else if (!strcmp(argv[1], "acpi") ||
!strcmp(argv[1], "soft"))
{
else if ((strncmp(argv[1], "acpi", 4) == 0) || (strncmp(argv[1], "soft", 4) == 0))
ctl = IPMI_CHASSIS_CTL_ACPI_SOFT;
}
else {
lprintf(LOG_ERR, "Invalid chassis power command: %s", argv[1]);
goto out;
return -1;
}
rc = ipmi_chassis_power_control(intf, ctl);
}
else if (!strcmp(argv[0], "identify")) {
else if (strncmp(argv[0], "identify", 8) == 0) {
if (argc < 2) {
rc = ipmi_chassis_identify(intf, NULL);
}
else if (!strcmp(argv[1], "help")) {
else if (strncmp(argv[1], "help", 4) == 0) {
lprintf(LOG_NOTICE, "chassis identify <interval>");
lprintf(LOG_NOTICE, " default is 15 seconds");
lprintf(LOG_NOTICE, " 0 to turn off");
@ -1999,14 +1614,14 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
rc = ipmi_chassis_identify(intf, argv[1]);
}
}
else if (!strcmp(argv[0], "poh")) {
else if (strncmp(argv[0], "poh", 3) == 0) {
rc = ipmi_chassis_poh(intf);
}
else if (!strcmp(argv[0], "restart_cause")) {
else if (strncmp(argv[0], "restart_cause", 13) == 0) {
rc = ipmi_chassis_restart_cause(intf);
}
else if (!strcmp(argv[0], "policy")) {
if (argc < 2 || !strcmp(argv[1], "help")) {
else if (strncmp(argv[0], "policy", 4) == 0) {
if ((argc < 2) || (strncmp(argv[1], "help", 4) == 0)) {
lprintf(LOG_NOTICE, "chassis policy <state>");
lprintf(LOG_NOTICE, " list : return supported policies");
lprintf(LOG_NOTICE, " always-on : turn on when power is restored");
@ -2014,13 +1629,13 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_NOTICE, " always-off : stay off after power is restored");
} else {
uint8_t ctl;
if (!strcmp(argv[1], "list"))
if (strncmp(argv[1], "list", 4) == 0)
ctl = IPMI_CHASSIS_POLICY_NO_CHANGE;
else if (!strcmp(argv[1], "always-on"))
else if (strncmp(argv[1], "always-on", 9) == 0)
ctl = IPMI_CHASSIS_POLICY_ALWAYS_ON;
else if (!strcmp(argv[1], "previous"))
else if (strncmp(argv[1], "previous", 8) == 0)
ctl = IPMI_CHASSIS_POLICY_PREVIOUS;
else if (!strcmp(argv[1], "always-off"))
else if (strncmp(argv[1], "always-off", 10) == 0)
ctl = IPMI_CHASSIS_POLICY_ALWAYS_OFF;
else {
lprintf(LOG_ERR, "Invalid chassis policy: %s", argv[1]);
@ -2029,22 +1644,22 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
rc = ipmi_chassis_power_policy(intf, ctl);
}
}
else if (!strcmp(argv[0], "bootparam")) {
if (argc < 3 || !strcmp(argv[1], "help")) {
else if (strncmp(argv[0], "bootparam", 9) == 0) {
if ((argc < 3) || (strncmp(argv[1], "help", 4) == 0)) {
lprintf(LOG_NOTICE, "bootparam get <param #>");
ipmi_chassis_set_bootflag_help();
}
else {
if (!strcmp(argv[1], "get")) {
if (strncmp(argv[1], "get", 3) == 0) {
rc = ipmi_chassis_get_bootparam(intf,
argc - 2,
argv + 2,
0);
}
else if (!strcmp(argv[1], "set")) {
else if (strncmp(argv[1], "set", 3) == 0) {
unsigned char set_flag=0;
unsigned char clr_flag=0;
if (!strcmp(argv[2], "help") ||
if (strncmp(argv[2], "help", 4) == 0 ||
argc < 4 || (argc >= 4 &&
strncmp(argv[2], "bootflag", 8) != 0)) {
ipmi_chassis_set_bootflag_help();
@ -2062,8 +1677,8 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_NOTICE, "bootparam get|set <option> [value ...]");
}
}
else if (!strcmp(argv[0], "bootdev")) {
if (argc < 2 || !strcmp(argv[1], "help")) {
else if (strncmp(argv[0], "bootdev", 7) == 0) {
if ((argc < 2) || (strncmp(argv[1], "help", 4) == 0)) {
lprintf(LOG_NOTICE, "bootdev <device> [clear-cmos=yes|no]");
lprintf(LOG_NOTICE, "bootdev <device> [options=help,...]");
lprintf(LOG_NOTICE, " none : Do not change boot device order");
@ -2075,31 +1690,108 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_NOTICE, " bios : Force boot into BIOS Setup");
lprintf(LOG_NOTICE, " floppy: Force boot from Floppy/primary removable media");
} else {
static const char *kw = "options=";
static const int kw_len = 8;
char *optstr = NULL;
uint8_t flags[BF_BYTE_COUNT];
bool use_flags = false;
if (argc >= 3) {
if (!strcmp(argv[2], "clear-cmos=yes")) {
/* Exclusive clear-cmos, no other flags */
optstr = "clear-cmos";
}
else if (!strncmp(argv[2], kw, kw_len)) {
optstr = argv[2] + kw_len;
}
if (argc < 3)
rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
else if (strncmp(argv[2], "clear-cmos=", 11) == 0) {
if (strncmp(argv[2]+11, "yes", 3) == 0) {
uint8_t flags[5] = {0, (1<<7), 0, 0, 0};
rc = ipmi_chassis_set_bootdev(intf, argv[1], flags);
} else
rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
}
if (optstr) {
if (!bootdev_parse_options(optstr, flags))
goto out;
else if (strncmp(argv[2], "options=", 8) == 0) {
char *token;
char *saveptr = NULL;
int optionError = 0;
unsigned char flags[5];
static struct {
char *name;
int i;
unsigned char mask;
unsigned char value;
char *desc;
} options[] = {
/* data 1 */
{"valid", 0, (1<<7), (1<<7),
"Boot flags valid"},
{"persistent", 0, (1<<6), (1<<6),
"Changes are persistent for all future boots"},
{"efiboot", 0, (1<<5), (1<<5),
"Extensible Firmware Interface Boot (EFI)"},
/* data 2 */
{"clear-cmos", 1, (1<<7), (1<<7),
"CMOS clear"},
{"lockkbd", 1, (1<<6), (1<<6),
"Lock Keyboard"},
/* data2[5:2] is parsed elsewhere */
{"screenblank", 1, (1<<1), (1<<1),
"Screen Blank"},
{"lockoutreset", 1, (1<<0), (1<<0),
"Lock out Resetbuttons"},
/* data 3 */
{"lockout_power", 2, (1<<7), (1<<7),
"Lock out (power off/sleep request) via Power Button"},
{"verbose=default", 2, (3<<5), (0<<5),
"Request quiet BIOS display"},
{"verbose=no", 2, (3<<5), (1<<5),
"Request quiet BIOS display"},
{"verbose=yes", 2, (3<<5), (2<<5),
"Request verbose BIOS display"},
{"force_pet", 2, (1<<4), (1<<4),
"Force progress event traps"},
{"upw_bypass", 2, (1<<3), (1<<3),
"User password bypass"},
{"lockout_sleep", 2, (1<<2), (1<<2),
"Log Out Sleep Button"},
{"cons_redirect=default", 2, (3<<0), (0<<0),
"Console redirection occurs per BIOS configuration setting"},
{"cons_redirect=skip", 2, (3<<0), (1<<0),
"Suppress (skip) console redirection if enabled"},
{"cons_redirect=enable", 2, (3<<0), (2<<0),
"Suppress (skip) console redirection if enabled"},
/* data 4 */
/* data4[7:4] reserved */
/* data4[3] BIOS Shared Mode Override, not implemented here */
/* data4[2:0] BIOS Mux Control Override, not implemented here */
use_flags = true;
/* data5 reserved */
{NULL} /* End marker */
}, *op;
memset(&flags[0], 0, sizeof(flags));
token = strtok_r(argv[2] + 8, ",", &saveptr);
while (token) {
if (strcmp(token, "help") == 0) {
optionError = 1;
break;
}
for (op = options; op->name; ++op) {
if (strcmp(token, op->name) == 0) {
flags[op->i] &= op->mask;
flags[op->i] |= op->value;
break;
}
}
if (!op->name) {
/* Option not found */
optionError = 1;
lprintf(LOG_ERR, "Invalid option: %s", token);
}
token = strtok_r(NULL, ",", &saveptr);
}
rc = ipmi_chassis_set_bootdev(intf, argv[1],
use_flags
? flags
: NULL);
if (optionError) {
lprintf(LOG_NOTICE, "Legal options settings are:");
lprintf(LOG_NOTICE, "\thelp:\tprint this message");
for (op = options; op->name; ++op) {
lprintf(LOG_NOTICE, "\t%s:\t%s", op->name, op->desc);
}
return (-1);
}
rc = ipmi_chassis_set_bootdev(intf, argv[1], flags);
}
else
rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
}
}
else if (!strcmp(argv[0], "bootmbox")) {
@ -2107,8 +1799,8 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
}
else {
lprintf(LOG_ERR, "Invalid chassis command: %s", argv[0]);
return -1;
}
out:
return rc;
}

File diff suppressed because it is too large Load Diff

View File

@ -663,10 +663,7 @@ int
read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
uint32_t offset, uint32_t length, uint8_t *frubuf)
{
uint32_t off = offset;
uint32_t tmp;
uint32_t finish;
uint32_t size_left_in_buffer;
uint32_t off = offset, tmp, finish;
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t msg_data[4];
@ -679,12 +676,10 @@ read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
finish = offset + length;
if (finish > fru->size) {
memset(frubuf + fru->size, 0, length - fru->size);
finish = fru->size;
lprintf(LOG_NOTICE, "Read FRU Area length %d too large, "
"Adjusting to %d",
offset + length, finish - offset);
length = finish - offset;
}
memset(&req, 0, sizeof(req));
@ -720,7 +715,6 @@ read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
}
}
size_left_in_buffer = length;
do {
tmp = fru->access ? off >> 1 : off;
msg_data[0] = id;
@ -762,18 +756,9 @@ read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
}
tmp = fru->access ? rsp->data[0] << 1 : rsp->data[0];
if(rsp->data_len < 1
|| tmp > rsp->data_len - 1
|| tmp > size_left_in_buffer)
{
printf(" Not enough buffer size");
return -1;
}
memcpy(frubuf, rsp->data + 1, tmp);
off += tmp;
frubuf += tmp;
size_left_in_buffer -= tmp;
/* sometimes the size returned in the Info command
* is too large. return 0 so higher level function
* still attempts to parse what was returned */
@ -806,9 +791,7 @@ read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
uint32_t offset, uint32_t length, uint8_t *frubuf)
{
static uint32_t fru_data_rqst_size = 20;
uint32_t off = offset;
uint32_t tmp, finish;
uint32_t size_left_in_buffer;
uint32_t off = offset, tmp, finish;
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t msg_data[4];
@ -821,12 +804,10 @@ read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
finish = offset + length;
if (finish > fru->size) {
memset(frubuf + fru->size, 0, length - fru->size);
finish = fru->size;
lprintf(LOG_NOTICE, "Read FRU Area length %d too large, "
"Adjusting to %d",
offset + length, finish - offset);
length = finish - offset;
}
memset(&req, 0, sizeof(req));
@ -841,8 +822,6 @@ read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
if (fru->access && fru_data_rqst_size > 16)
#endif
fru_data_rqst_size = 16;
size_left_in_buffer = length;
do {
tmp = fru->access ? off >> 1 : off;
msg_data[0] = id;
@ -874,16 +853,8 @@ read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
}
tmp = fru->access ? rsp->data[0] << 1 : rsp->data[0];
if(rsp->data_len < 1
|| tmp > rsp->data_len - 1
|| tmp > size_left_in_buffer)
{
printf(" Not enough buffer size");
return -1;
}
memcpy((frubuf + off)-offset, rsp->data + 1, tmp);
off += tmp;
size_left_in_buffer -= tmp;
/* sometimes the size returned in the Info command
* is too large. return 0 so higher level function
@ -3042,6 +3013,7 @@ __ipmi_fru_print(struct ipmi_intf * intf, uint8_t id)
int
ipmi_fru_print(struct ipmi_intf * intf, struct sdr_record_fru_locator * fru)
{
char desc[17];
uint8_t bridged_request = 0;
uint32_t save_addr;
uint32_t save_channel;
@ -3076,10 +3048,10 @@ ipmi_fru_print(struct ipmi_intf * intf, struct sdr_record_fru_locator * fru)
fru->device_id == 0)
return 0;
printf("FRU Device Description : %.*s (ID %d)\n"
, SDR_ID_STRLEN(fru)
, fru->id_string
, fru->device_id);
memset(desc, 0, sizeof(desc));
memcpy(desc, fru->id_string, fru->id_code & 0x01f);
desc[fru->id_code & 0x01f] = 0;
printf("FRU Device Description : %s (ID %d)\n", desc, fru->device_id);
switch (fru->dev_type_modifier) {
case 0x00:
@ -3191,9 +3163,7 @@ ipmi_fru_print_all(struct ipmi_intf * intf)
/* set new target address to satellite controller */
intf->target_addr = mc->dev_slave_addr;
printf("FRU Device Description : %.*s\n"
, SDR_ID_STRLEN(fru)
, fru->id_string);
printf("FRU Device Description : %-16s\n", mc->id_string);
/* print the FRU by issuing FRU commands to the satellite */
/* controller. */

View File

@ -1260,7 +1260,7 @@ ipmi_lan_set_vlan_id(struct ipmi_intf *intf, uint8_t chan, char *string)
rc = 0;
goto out;
}
if (!IPMI_LANP_IS_VLAN_VALID(id)) {
if (IPMI_LANP_IS_VLAN_VALID(id)) {
lprintf(LOG_ERR,
"Retrieved VLAN ID %i is out of "
"range <%d..%d>.",
@ -1285,7 +1285,7 @@ ipmi_lan_set_vlan_id(struct ipmi_intf *intf, uint8_t chan, char *string)
goto out;
}
if (!IPMI_LANP_IS_VLAN_VALID(id)) {
if (IPMI_LANP_IS_VLAN_VALID(id)) {
lprintf(LOG_NOTICE,
"VLAN ID must be between %d and %d.",
IPMI_LANP_VLAN_ID_MIN,
@ -1865,7 +1865,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
if (!p) {
return (-1);
}
memcpy(data, p->data, __min(p->data_len, sizeof(data)));
memcpy(data, p->data, p->data_len);
/* set new ipaddr */
memcpy(data+3, temp, 4);
printf("Setting LAN Alert %d IP Address to %d.%d.%d.%d\n", alert,
@ -1880,7 +1880,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
if (!p) {
return (-1);
}
memcpy(data, p->data, __min(p->data_len, sizeof(data)));
memcpy(data, p->data, p->data_len);
/* set new macaddr */
memcpy(data+7, temp, 6);
printf("Setting LAN Alert %d MAC Address to "
@ -1894,7 +1894,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
if (!p) {
return (-1);
}
memcpy(data, p->data, __min(p->data_len, sizeof(data)));
memcpy(data, p->data, p->data_len);
if (strncasecmp(argv[1], "def", 3) == 0 ||
strncasecmp(argv[1], "default", 7) == 0) {
@ -1920,7 +1920,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
if (!p) {
return (-1);
}
memcpy(data, p->data, __min(p->data_len, sizeof(data)));
memcpy(data, p->data, p->data_len);
if (strncasecmp(argv[1], "on", 2) == 0 ||
strncasecmp(argv[1], "yes", 3) == 0) {
@ -1945,7 +1945,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
if (!p) {
return (-1);
}
memcpy(data, p->data, __min(p->data_len, sizeof(data)));
memcpy(data, p->data, p->data_len);
if (strncasecmp(argv[1], "pet", 3) == 0) {
printf("Setting LAN Alert %d destination to PET Trap\n", alert);
@ -1973,7 +1973,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
if (!p) {
return (-1);
}
memcpy(data, p->data, __min(p->data_len, sizeof(data)));
memcpy(data, p->data, p->data_len);
if (str2uchar(argv[1], &data[2]) != 0) {
lprintf(LOG_ERR, "Invalid time: %s", argv[1]);
@ -1989,7 +1989,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
if (!p) {
return (-1);
}
memcpy(data, p->data, __min(p->data_len, sizeof(data)));
memcpy(data, p->data, p->data_len);
if (str2uchar(argv[1], &data[3]) != 0) {
lprintf(LOG_ERR, "Invalid retry: %s", argv[1]);

1899
lib/ipmi_nm.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1574,14 +1574,22 @@ ipmi_sdr_read_sensor_value(struct ipmi_intf *intf,
/* Initialize to reading valid value of zero */
memset(&sr, 0, sizeof(sr));
sr.raw = sensor;
switch (sdr_record_type) {
case SDR_RECORD_TYPE_FULL_SENSOR:
SDR_ID_TO_CSTRING(sr.s_id, sr.full);
unsigned int idlen;
case (SDR_RECORD_TYPE_FULL_SENSOR):
sr.full = (struct sdr_record_full_sensor *)sensor;
idlen = sr.full->id_code & 0x1f;
idlen = idlen < sizeof(sr.s_id) ?
idlen : sizeof(sr.s_id) - 1;
memcpy(sr.s_id, sr.full->id_string, idlen);
break;
case SDR_RECORD_TYPE_COMPACT_SENSOR:
SDR_ID_TO_CSTRING(sr.s_id, sr.compact);
sr.compact = (struct sdr_record_compact_sensor *)sensor;
idlen = sr.compact->id_code & 0x1f;
idlen = idlen < sizeof(sr.s_id) ?
idlen : sizeof(sr.s_id) - 1;
memcpy(sr.s_id, sr.compact->id_string, idlen);
break;
default:
return NULL;
@ -2240,12 +2248,13 @@ int
ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf,
struct sdr_record_eventonly_sensor *sensor)
{
char desc[SDR_ID_STRING_MAX + 1];
char desc[17];
if (!sensor)
return -1;
SDR_ID_TO_CSTRING(desc, sensor);
memset(desc, 0, sizeof (desc));
snprintf(desc, (sensor->id_code & 0x1f) + 1, "%s", sensor->id_string);
if (verbose) {
printf("Sensor ID : %s (0x%x)\n",
@ -2288,12 +2297,13 @@ ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf,
int
ipmi_sdr_print_sensor_mc_locator(struct sdr_record_mc_locator *mc)
{
char desc[SDR_ID_STRING_MAX + 1];
char desc[17];
if (!mc)
return -1;
SDR_ID_TO_CSTRING(desc, mc);
memset(desc, 0, sizeof (desc));
snprintf(desc, (mc->id_code & 0x1f) + 1, "%s", mc->id_string);
if (verbose == 0) {
if (csv_output)
@ -2381,12 +2391,10 @@ ipmi_sdr_print_sensor_mc_locator(struct sdr_record_mc_locator *mc)
int
ipmi_sdr_print_sensor_generic_locator(struct sdr_record_generic_locator *dev)
{
char desc[SDR_ID_STRING_MAX + 1];
char desc[17];
if (!dev)
return -1;
SDR_ID_TO_CSTRING(desc, dev);
memset(desc, 0, sizeof (desc));
snprintf(desc, (dev->id_code & 0x1f) + 1, "%s", dev->id_string);
if (!verbose) {
if (csv_output)
@ -2438,12 +2446,10 @@ ipmi_sdr_print_sensor_generic_locator(struct sdr_record_generic_locator *dev)
int
ipmi_sdr_print_sensor_fru_locator(struct sdr_record_fru_locator *fru)
{
char desc[SDR_ID_STRING_MAX + 1];
char desc[17];
if (!fru)
return -1;
SDR_ID_TO_CSTRING(desc, fru);
memset(desc, 0, sizeof (desc));
snprintf(desc, (fru->id_code & 0x1f) + 1, "%s", fru->id_string);
if (!verbose) {
if (csv_output)
@ -2603,20 +2609,17 @@ ipmi_sdr_print_sensor_oem(struct sdr_record_oem *oem)
return rc;
}
/**
* Get SDR record name from raw data
/* ipmi_sdr_print_name_from_rawentry - Print SDR name from raw data
*
* @param[in] type SDR record type
* @param[in] raw raw SDR record data
* @param[out] buf The SDR record description target buffer
* @param[in] len The length of the target buffer
* @type: sensor type
* @raw: raw sensor data
*
* @returns Error status
* @retval 0 Success
* @retval -1 Error
* returns 0 on success
* returns -1 on error
*/
int
sdr_get_name_from_rawentry(uint8_t type, void *raw, char *buf, size_t len)
ipmi_sdr_print_name_from_rawentry(uint16_t id,
uint8_t type, uint8_t *raw)
{
union {
struct sdr_record_full_sensor *full;
@ -2627,50 +2630,39 @@ sdr_get_name_from_rawentry(uint8_t type, void *raw, char *buf, size_t len)
struct sdr_record_mc_locator *mcloc;
struct sdr_record_entity_assoc *entassoc;
struct sdr_record_oem *oem;
void *raw;
} record;
int rc =0;
char desc[SDR_ID_STRING_MAX + 1] = { 0 };
record.raw = raw;
char desc[17];
memset(desc, ' ', sizeof (desc));
switch ( type) {
/* Sensor records */
case SDR_RECORD_TYPE_FULL_SENSOR:
SDR_ID_TO_CSTRING(desc, record.full);
record.full = (struct sdr_record_full_sensor *) raw;
snprintf(desc, (record.full->id_code & 0x1f) +1, "%s",
(const char *)record.full->id_string);
break;
case SDR_RECORD_TYPE_COMPACT_SENSOR:
SDR_ID_TO_CSTRING(desc, record.compact);
record.compact = (struct sdr_record_compact_sensor *) raw ;
snprintf(desc, (record.compact->id_code & 0x1f) +1, "%s",
(const char *)record.compact->id_string);
break;
case SDR_RECORD_TYPE_EVENTONLY_SENSOR:
SDR_ID_TO_CSTRING(desc, record.eventonly);
break;
/* Device locator records */
case SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR:
SDR_ID_TO_CSTRING(desc, record.genloc);
break;
case SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR:
SDR_ID_TO_CSTRING(desc, record.fruloc);
break;
record.eventonly = (struct sdr_record_eventonly_sensor *) raw ;
snprintf(desc, (record.eventonly->id_code & 0x1f) +1, "%s",
(const char *)record.eventonly->id_string);
break;
case SDR_RECORD_TYPE_MC_DEVICE_LOCATOR:
SDR_ID_TO_CSTRING(desc, record.mcloc);
record.mcloc = (struct sdr_record_mc_locator *) raw ;
snprintf(desc, (record.mcloc->id_code & 0x1f) +1, "%s",
(const char *)record.mcloc->id_string);
break;
/* All other records don't have the id_string field */
default:
rc = -1;
}
memcpy(buf, desc, __min(sizeof(buf), len));
break;
}
lprintf(LOG_INFO, "ID: 0x%04x , NAME: %-16s", id, desc);
return rc;
}

View File

@ -250,7 +250,6 @@ sdrr_get_records(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr,
while ((header = ipmi_sdr_get_next_header(intf, itr))) {
struct sdr_record_list *sdrr;
char desc[SDR_ID_STRING_MAX + 1];
sdrr = malloc(sizeof (struct sdr_record_list));
if (!sdrr) {
@ -264,8 +263,7 @@ sdrr_get_records(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr,
sdrr->type = header->type;
sdrr->length = header->length;
sdrr->raw = ipmi_sdr_get_record(intf, header, itr);
(void)sdr_get_name_from_rawentry(sdrr->type, sdrr->raw, desc, sizeof(desc));
lprintf(LOG_INFO, "ID: 0x%04x , NAME: %s", sdrr->id, desc);
(void)ipmi_sdr_print_name_from_rawentry(sdrr->id, sdrr->type,sdrr->raw);
/* put in the record queue */
if (!queue->head)

View File

@ -2743,7 +2743,6 @@ ipmi_sel_set_time(struct ipmi_intf * intf, const char * time_string)
struct ipmi_rs *rsp;
struct ipmi_rq req;
struct tm tm = {0};
uint8_t msg_data[4] = {0};
time_t t;
const char *time_format = "%x %X"; /* Use locale-defined format */
@ -2788,9 +2787,8 @@ ipmi_sel_set_time(struct ipmi_intf * intf, const char * time_string)
* At this point `t` is UTC. Convert it to LE and send.
*/
req.msg.data = msg_data;
htoipmi32(t, req.msg.data);
req.msg.data_len = sizeof(msg_data);
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
if (!rsp || rsp->ccode) {

View File

@ -309,10 +309,8 @@ ipmi_get_session_info(struct ipmi_intf * intf,
}
else
{
memcpy(&session_info, rsp->data,
__min(rsp->data_len, sizeof(session_info)));
print_session_info(&session_info,
__min(rsp->data_len, sizeof(session_info)));
memcpy(&session_info, rsp->data, rsp->data_len);
print_session_info(&session_info, rsp->data_len);
}
break;
@ -343,10 +341,8 @@ ipmi_get_session_info(struct ipmi_intf * intf,
break;
}
memcpy(&session_info, rsp->data,
__min(rsp->data_len, sizeof(session_info)));
print_session_info(&session_info,
__min(rsp->data_len, sizeof(session_info)));
memcpy(&session_info, rsp->data, rsp->data_len);
print_session_info(&session_info, rsp->data_len);
} while (i <= session_info.session_slot_count);
break;

View File

@ -269,663 +269,7 @@ const struct oemvalstr ipmi_oem_product_info[] = {
{ IPMI_OEM_ADLINK_24339, 0x0410, "MXN-0410" },
{ IPMI_OEM_ADLINK_24339, 0x2600, "MCN-2600" },
{ IPMI_OEM_ADLINK_24339, 0x1500, "MCN-1500" },
/* Supermicro */
{ IPMI_OEM_SUPERMICRO, 0x0001, "X8DT3/i/-LN4" },
{ IPMI_OEM_SUPERMICRO, 0x0002, "C2SLM-OC012" },
{ IPMI_OEM_SUPERMICRO, 0x0003, "X8DTW-3/i/-LN4" },
{ IPMI_OEM_SUPERMICRO, 0x0006, "X8DTL-3/i" },
{ IPMI_OEM_SUPERMICRO, 0x0007, "X8DTT-IBX" },
{ IPMI_OEM_SUPERMICRO, 0x0008, "X8DTT-B-SG" },
{ IPMI_OEM_SUPERMICRO, 0x0009, "X8STi-3/-LN4" },
{ IPMI_OEM_SUPERMICRO, 0x000A, "B8DT3" },
{ IPMI_OEM_SUPERMICRO, 0x0100, "X8DAH+" },
{ IPMI_OEM_SUPERMICRO, 0x0101, "B8DTL" },
{ IPMI_OEM_SUPERMICRO, 0x0400, "X8DTH-6/i" },
{ IPMI_OEM_SUPERMICRO, 0x0401, "X8DTH-RC014" },
{ IPMI_OEM_SUPERMICRO, 0x0403, "X8DA6/i-X" },
{ IPMI_OEM_SUPERMICRO, 0x0404, "X8DT6/E" },
{ IPMI_OEM_SUPERMICRO, 0x0409, "H8QI6/E(+)(-F)" },
{ IPMI_OEM_SUPERMICRO, 0x040B, "X8DTW-6+/i+" },
{ IPMI_OEM_SUPERMICRO, 0x040D, "X8SII/X8SI6" },
{ IPMI_OEM_SUPERMICRO, 0x0410, "X8DTL-6/L" },
{ IPMI_OEM_SUPERMICRO, 0x0600, "X8DTU" },
{ IPMI_OEM_SUPERMICRO, 0x0601, "X8DAL-3/i" },
{ IPMI_OEM_SUPERMICRO, 0x0602, "X7SLA" },
{ IPMI_OEM_SUPERMICRO, 0x0603, "C2SEM-Q" },
{ IPMI_OEM_SUPERMICRO, 0x0604, "winbond IPMI (Aten)" },
{ IPMI_OEM_SUPERMICRO, 0x0605, "X8SIL" },
{ IPMI_OEM_SUPERMICRO, 0x0606, "X8DTG-4" },
{ IPMI_OEM_SUPERMICRO, 0x0607, "C2G41" },
{ IPMI_OEM_SUPERMICRO, 0x0608, "X8DTG-DF" },
{ IPMI_OEM_SUPERMICRO, 0x0609, "X8DTS" },
{ IPMI_OEM_SUPERMICRO, 0x060A, "X7SPA" },
{ IPMI_OEM_SUPERMICRO, 0x060B, "X8SIA" },
{ IPMI_OEM_SUPERMICRO, 0x060C, "X8DTU+" },
{ IPMI_OEM_SUPERMICRO, 0x060C, "X8DTU-LN4F+" },
{ IPMI_OEM_SUPERMICRO, 0x060D, "X8DTU-6TF+" },
{ IPMI_OEM_SUPERMICRO, 0x060E, "X8SIT" },
{ IPMI_OEM_SUPERMICRO, 0x060F, "X8DTN+-F" },
{ IPMI_OEM_SUPERMICRO, 0x0610, "X8QB6/E" },
{ IPMI_OEM_SUPERMICRO, 0x0611, "AOC-STGN-I2S" },
{ IPMI_OEM_SUPERMICRO, 0x0612, "B8DTT" },
{ IPMI_OEM_SUPERMICRO, 0x0613, "X8DTT-C-SG007" },
{ IPMI_OEM_SUPERMICRO, 0x0614, "X8DTU-F-AI034" },
{ IPMI_OEM_SUPERMICRO, 0x061A, "X8SIU" },
{ IPMI_OEM_SUPERMICRO, 0x061B, "X8DTT-HA" },
{ IPMI_OEM_SUPERMICRO, 0x061C, "B8DT6-AI034" },
{ IPMI_OEM_SUPERMICRO, 0x061D, "C7SIA" },
{ IPMI_OEM_SUPERMICRO, 0x061E, "B8DTT-AI034" },
{ IPMI_OEM_SUPERMICRO, 0x061E, "X9SCL" },
{ IPMI_OEM_SUPERMICRO, 0x061F, "B8DTP" },
{ IPMI_OEM_SUPERMICRO, 0x0620, "B8DTG" },
{ IPMI_OEM_SUPERMICRO, 0x0621, "X8OBN" },
{ IPMI_OEM_SUPERMICRO, 0x0622, "C7P67" },
{ IPMI_OEM_SUPERMICRO, 0x0623, "C7Q67" },
{ IPMI_OEM_SUPERMICRO, 0x0624, "X9SCM" },
{ IPMI_OEM_SUPERMICRO, 0x0625, "B9DRi" },
{ IPMI_OEM_SUPERMICRO, 0x0626, "X9DR3-LN4F+" },
{ IPMI_OEM_SUPERMICRO, 0x0627, "X7SPT-DF-D525" },
{ IPMI_OEM_SUPERMICRO, 0x0628, "X9DR3/i-F" },
{ IPMI_OEM_SUPERMICRO, 0x0629, "X9SRT-F" },
{ IPMI_OEM_SUPERMICRO, 0x062A, "X9SRA" },
{ IPMI_OEM_SUPERMICRO, 0x062B, "X9SRi" },
{ IPMI_OEM_SUPERMICRO, 0x062C, "X9DAi" },
{ IPMI_OEM_SUPERMICRO, 0x062D, "X8SIL-SIOM-FI005" },
{ IPMI_OEM_SUPERMICRO, 0x062E, "X8STE-DS018" },
{ IPMI_OEM_SUPERMICRO, 0x062F, "X9DRT-HF" },
{ IPMI_OEM_SUPERMICRO, 0x0630, "X9DRW-3TF+" },
{ IPMI_OEM_SUPERMICRO, 0x0631, "X9SCA/X9SCI" },
{ IPMI_OEM_SUPERMICRO, 0x0632, "X8DTG-QF+" },
{ IPMI_OEM_SUPERMICRO, 0x0633, "X9SCV-Q" },
{ IPMI_OEM_SUPERMICRO, 0x0634, "X9SCD" },
{ IPMI_OEM_SUPERMICRO, 0x0635, "X9DAL-6/i" },
{ IPMI_OEM_SUPERMICRO, 0x0636, "X9DRW-3F" },
{ IPMI_OEM_SUPERMICRO, 0x0637, "X9DBU-3F" },
{ IPMI_OEM_SUPERMICRO, 0x0638, "X8QB6-LF" },
{ IPMI_OEM_SUPERMICRO, 0x0640, "X9SCL/SCM-II" },
{ IPMI_OEM_SUPERMICRO, 0x0641, "X9SCV-LN4F+" },
{ IPMI_OEM_SUPERMICRO, 0x0642, "C7Q67-H" },
{ IPMI_OEM_SUPERMICRO, 0x0644, "X9SAE" },
{ IPMI_OEM_SUPERMICRO, 0x0645, "C7H61" },
{ IPMI_OEM_SUPERMICRO, 0x0646, "X9SCFF" },
{ IPMI_OEM_SUPERMICRO, 0x0647, "X9SCAA" },
{ IPMI_OEM_SUPERMICRO, 0x0647, "X9SCE-F" },
{ IPMI_OEM_SUPERMICRO, 0x0648, "C7B75" },
{ IPMI_OEM_SUPERMICRO, 0x0650, "X9SPV-M4" },
{ IPMI_OEM_SUPERMICRO, 0x0651, "X9SBAA" },
{ IPMI_OEM_SUPERMICRO, 0x0652, "AOC-CGP-i2" },
{ IPMI_OEM_SUPERMICRO, 0x0653, "C7Z87" },
{ IPMI_OEM_SUPERMICRO, 0x0654, "C7Q87" },
{ IPMI_OEM_SUPERMICRO, 0x0655, "AOC-XEH-IN2" },
{ IPMI_OEM_SUPERMICRO, 0x0656, "AOC-SGP-i2" },
{ IPMI_OEM_SUPERMICRO, 0x0657, "C7Z87-OCE" },
{ IPMI_OEM_SUPERMICRO, 0x0658, "AOC-STG-B4S" },
{ IPMI_OEM_SUPERMICRO, 0x0659, "AOC-STGN-I1S" },
{ IPMI_OEM_SUPERMICRO, 0x0660, "X9DRD-3/iF" },
{ IPMI_OEM_SUPERMICRO, 0x0661, "B1SA4-F" },
{ IPMI_OEM_SUPERMICRO, 0x0661, "X9SRG" },
{ IPMI_OEM_SUPERMICRO, 0x0662, "X9DRG-QF+" },
{ IPMI_OEM_SUPERMICRO, 0x0663, "X9SRW" },
{ IPMI_OEM_SUPERMICRO, 0x0664, "X9DRH-7F" },
{ IPMI_OEM_SUPERMICRO, 0x0665, "X9DRG-QF" },
{ IPMI_OEM_SUPERMICRO, 0x0666, "X9DRT-D-SG007" },
{ IPMI_OEM_SUPERMICRO, 0x0667, "X9DRL-3/iF" },
{ IPMI_OEM_SUPERMICRO, 0x0668, "X9SRD" },
{ IPMI_OEM_SUPERMICRO, 0x0669, "X9DRX+-F" },
{ IPMI_OEM_SUPERMICRO, 0x066A, "B9DRT" },
{ IPMI_OEM_SUPERMICRO, 0x066B, "X9SRL-F" },
{ IPMI_OEM_SUPERMICRO, 0x066C, "B9DRG" },
{ IPMI_OEM_SUPERMICRO, 0x066D, "X9DR6+-F-AI034" },
{ IPMI_OEM_SUPERMICRO, 0x066E, "X9DR6-LN4F+-AI034" },
{ IPMI_OEM_SUPERMICRO, 0x066F, "X9DRW-LN4F+-AI034" },
{ IPMI_OEM_SUPERMICRO, 0x0690, "2208" },
{ IPMI_OEM_SUPERMICRO, 0x0691, "2308" },
{ IPMI_OEM_SUPERMICRO, 0x0700, "X9DRT-HF-AI034" },
{ IPMI_OEM_SUPERMICRO, 0x0701, "X9DRT-HIBQF-AI034" },
{ IPMI_OEM_SUPERMICRO, 0x0702, "X9DRD-7LN4F" },
{ IPMI_OEM_SUPERMICRO, 0x0703, "X9DBL-6F" },
{ IPMI_OEM_SUPERMICRO, 0x0704, "X9DR7/E-TF+" },
{ IPMI_OEM_SUPERMICRO, 0x0705, "X9DR7/E-LN4F" },
{ IPMI_OEM_SUPERMICRO, 0x0706, "X9DRT-HF+" },
{ IPMI_OEM_SUPERMICRO, 0x0707, "X9QR7-TF+" },
{ IPMI_OEM_SUPERMICRO, 0x0708, "X9DRT-F" },
{ IPMI_OEM_SUPERMICRO, 0x0709, "X9DA7/E" },
{ IPMI_OEM_SUPERMICRO, 0x070A, "X9DRF-F" },
{ IPMI_OEM_SUPERMICRO, 0x070B, "X9SRL-CF" },
{ IPMI_OEM_SUPERMICRO, 0x070C, "X9SRD-CD" },
{ IPMI_OEM_SUPERMICRO, 0x070D, "B9DR7" },
{ IPMI_OEM_SUPERMICRO, 0x070E, "X9DAX-7" },
{ IPMI_OEM_SUPERMICRO, 0x070F, "X9QR7-TF" },
{ IPMI_OEM_SUPERMICRO, 0x0710, "X9SRE" },
{ IPMI_OEM_SUPERMICRO, 0x0711, "X9DRG-HTF+" },
{ IPMI_OEM_SUPERMICRO, 0x0712, "B9DRG-X" },
{ IPMI_OEM_SUPERMICRO, 0x0713, "X9DRFF-7" },
{ IPMI_OEM_SUPERMICRO, 0x0714, "X9SRH-7F" },
{ IPMI_OEM_SUPERMICRO, 0x0715, "X9DRW-7TPF" },
{ IPMI_OEM_SUPERMICRO, 0x0716, "X9DBU-3F-AI034" },
{ IPMI_OEM_SUPERMICRO, 0x0717, "X9DRFF-7+/i+" },
{ IPMI_OEM_SUPERMICRO, 0x0718, "X9DRFF-7G+" },
{ IPMI_OEM_SUPERMICRO, 0x0719, "B9DRP" },
{ IPMI_OEM_SUPERMICRO, 0x0720, "X9DRW-7TPF+" },
{ IPMI_OEM_SUPERMICRO, 0x0721, "X9DBS-F" },
{ IPMI_OEM_SUPERMICRO, 0x0722, "X9DB3-TPF" },
{ IPMI_OEM_SUPERMICRO, 0x0723, "X9DRL-7F/EF" },
{ IPMI_OEM_SUPERMICRO, 0x0724, "X9DRH-if-NV" },
{ IPMI_OEM_SUPERMICRO, 0x0725, "X9DRG+HF+II" },
{ IPMI_OEM_SUPERMICRO, 0x0726, "X10QBi" },
{ IPMI_OEM_SUPERMICRO, 0x0727, "X9DRW-CF31/CTF31" },
{ IPMI_OEM_SUPERMICRO, 0x0728, "X10DRI/T" },
{ IPMI_OEM_SUPERMICRO, 0x0729, "B9DRG-E" },
{ IPMI_OEM_SUPERMICRO, 0x0730, "X9DAX-HFT" },
{ IPMI_OEM_SUPERMICRO, 0x0731, "X9DRT-P" },
{ IPMI_OEM_SUPERMICRO, 0x0732, "X9DRG-OF" },
{ IPMI_OEM_SUPERMICRO, 0x0733, "X9DB3-CPU-AI026" },
{ IPMI_OEM_SUPERMICRO, 0x0734, "AOC-STG-I2T" },
{ IPMI_OEM_SUPERMICRO, 0x0743, "X9SPU" },
{ IPMI_OEM_SUPERMICRO, 0x0801, "X10SLL" },
{ IPMI_OEM_SUPERMICRO, 0x0802, "X10SLA" },
{ IPMI_OEM_SUPERMICRO, 0x0803, "X10SLH" },
{ IPMI_OEM_SUPERMICRO, 0x0804, "X10SL7-F" },
{ IPMI_OEM_SUPERMICRO, 0x0805, "X10SAE" },
{ IPMI_OEM_SUPERMICRO, 0x0806, "X10SLM-LN4F" },
{ IPMI_OEM_SUPERMICRO, 0x0807, "X10SLE" },
{ IPMI_OEM_SUPERMICRO, 0x0808, "LSI3008" },
{ IPMI_OEM_SUPERMICRO, 0x0809, "LSI3108" },
{ IPMI_OEM_SUPERMICRO, 0x0810, "X10SLD" },
{ IPMI_OEM_SUPERMICRO, 0x0811, "X10SLM-F" },
{ IPMI_OEM_SUPERMICRO, 0x0812, "X10SLL+-F" },
{ IPMI_OEM_SUPERMICRO, 0x0813, "X10SEAA-LN4F" },
{ IPMI_OEM_SUPERMICRO, 0x0814, "X10SLX-TF" },
{ IPMI_OEM_SUPERMICRO, 0x0815, "X10SLV" },
{ IPMI_OEM_SUPERMICRO, 0x0816, "X10SBA" },
{ IPMI_OEM_SUPERMICRO, 0x0817, "X10SLE-DF" },
{ IPMI_OEM_SUPERMICRO, 0x0818, "X10SAT" },
{ IPMI_OEM_SUPERMICRO, 0x0819, "X10SLV-Q" },
{ IPMI_OEM_SUPERMICRO, 0x0820, "A1SAM" },
{ IPMI_OEM_SUPERMICRO, 0x0820, "X9SKV" },
{ IPMI_OEM_SUPERMICRO, 0x0821, "X10DRW-i(T)" },
{ IPMI_OEM_SUPERMICRO, 0x0822, "X10DRFF(-C)" },
{ IPMI_OEM_SUPERMICRO, 0x0823, "AOC-CTG-I1S" },
{ IPMI_OEM_SUPERMICRO, 0x0824, "X10DRT-P" },
{ IPMI_OEM_SUPERMICRO, 0x0825, "X10SRE-DS018" },
{ IPMI_OEM_SUPERMICRO, 0x0826, "X10SRE-EXP-SI030" },
{ IPMI_OEM_SUPERMICRO, 0x0827, "X9QRH-TF" },
{ IPMI_OEM_SUPERMICRO, 0x0828, "A1SA2-2750F" },
{ IPMI_OEM_SUPERMICRO, 0x0829, "C7Z97-OCE" },
{ IPMI_OEM_SUPERMICRO, 0x0830, "X10DRFR" },
{ IPMI_OEM_SUPERMICRO, 0x0831, "X10DRL-i" },
{ IPMI_OEM_SUPERMICRO, 0x0832, "X10SRL" },
{ IPMI_OEM_SUPERMICRO, 0x0833, "X10SRW-F" },
{ IPMI_OEM_SUPERMICRO, 0x0834, "X10SRI" },
{ IPMI_OEM_SUPERMICRO, 0x0835, "X10DRC/i-LN4+/T4+" },
{ IPMI_OEM_SUPERMICRO, 0x0836, "X10DAi" },
{ IPMI_OEM_SUPERMICRO, 0x0837, "X10DRT-D-SG007" },
{ IPMI_OEM_SUPERMICRO, 0x0838, "X10SRH-F" },
{ IPMI_OEM_SUPERMICRO, 0x0839, "AOC-SLG3-2E4" },
{ IPMI_OEM_SUPERMICRO, 0x083A, "X10DBT-T" },
{ IPMI_OEM_SUPERMICRO, 0x083B, "X10DDW-iT" },
{ IPMI_OEM_SUPERMICRO, 0x083C, "A1SA7-2750F" },
{ IPMI_OEM_SUPERMICRO, 0x083D, "LSI 2116" },
{ IPMI_OEM_SUPERMICRO, 0x083E, "B10DRi" },
{ IPMI_OEM_SUPERMICRO, 0x083F, "B9QR7" },
{ IPMI_OEM_SUPERMICRO, 0x0840, "B9DRG-3M" },
{ IPMI_OEM_SUPERMICRO, 0x0841, "X9DRD-iT+" },
{ IPMI_OEM_SUPERMICRO, 0x0842, "X10SLH-N6-ST031" },
{ IPMI_OEM_SUPERMICRO, 0x0843, "X10DRG-H(T)" },
{ IPMI_OEM_SUPERMICRO, 0x0844, "X10DRU-i+" },
{ IPMI_OEM_SUPERMICRO, 0x0845, "X10DDW-iN" },
{ IPMI_OEM_SUPERMICRO, 0x0846, "B1DRi" },
{ IPMI_OEM_SUPERMICRO, 0x0847, "AOC-UR-i4XT" },
{ IPMI_OEM_SUPERMICRO, 0x0848, "AOC-2UR68-i4G" },
{ IPMI_OEM_SUPERMICRO, 0x0849, "AOC-UR-i4G" },
{ IPMI_OEM_SUPERMICRO, 0x084A, "AOC-S40G-i2Q" },
{ IPMI_OEM_SUPERMICRO, 0x084B, "X10SRG" },
{ IPMI_OEM_SUPERMICRO, 0x084C, "C7Z97" },
{ IPMI_OEM_SUPERMICRO, 0x084C, "C7Z97-MF" },
{ IPMI_OEM_SUPERMICRO, 0x084D, "AOC-STGN-i1SF" },
{ IPMI_OEM_SUPERMICRO, 0x084F, "AOC-STGN-i2SF" },
{ IPMI_OEM_SUPERMICRO, 0x0850, "AOC-PG-i4M" },
{ IPMI_OEM_SUPERMICRO, 0x0851, "PMC PM8076" },
{ IPMI_OEM_SUPERMICRO, 0x0852, "X10DRG-Q" },
{ IPMI_OEM_SUPERMICRO, 0x0853, "X10QBL" },
{ IPMI_OEM_SUPERMICRO, 0x0854, "X10DRU-X" },
{ IPMI_OEM_SUPERMICRO, 0x0855, "H9SKV-420" },
{ IPMI_OEM_SUPERMICRO, 0x0856, "C7X99" },
{ IPMI_OEM_SUPERMICRO, 0x0857, "X10SRA" },
{ IPMI_OEM_SUPERMICRO, 0x0858, "X10DRT-H" },
{ IPMI_OEM_SUPERMICRO, 0x0859, "X10DRH-C" },
{ IPMI_OEM_SUPERMICRO, 0x085A, "A1SRM-LN7F" },
{ IPMI_OEM_SUPERMICRO, 0x085A, "A1SRM-LN7F" },
{ IPMI_OEM_SUPERMICRO, 0x085B, "X10DRT-HA/HB-SG007" },
{ IPMI_OEM_SUPERMICRO, 0x085C, "X10DRU-XLL" },
{ IPMI_OEM_SUPERMICRO, 0x085D, "AOC-UR-i2XT" },
{ IPMI_OEM_SUPERMICRO, 0x085E, "AOC-2UR6-i4XT" },
{ IPMI_OEM_SUPERMICRO, 0x085F, "AOC-2UR68-i2XT" },
{ IPMI_OEM_SUPERMICRO, 0x0860, "X10DRL-C/CT" },
{ IPMI_OEM_SUPERMICRO, 0x0861, "B10DRT" },
{ IPMI_OEM_SUPERMICRO, 0x0862, "B1SL1-F" },
{ IPMI_OEM_SUPERMICRO, 0x0863, "RSC-W2-66" },
{ IPMI_OEM_SUPERMICRO, 0x0864, "X10DRW-E/NT" },
{ IPMI_OEM_SUPERMICRO, 0x0865, "X10DRD-i/LTP" },
{ IPMI_OEM_SUPERMICRO, 0x0866, "AOC-SLG3-2E4R" },
{ IPMI_OEM_SUPERMICRO, 0x0867, "AOC-SLG3-4E4R" },
{ IPMI_OEM_SUPERMICRO, 0x0868, "AOC-SLG3-2E4" },
{ IPMI_OEM_SUPERMICRO, 0x0869, "AOC-URN2-i4XT" },
{ IPMI_OEM_SUPERMICRO, 0x086A, "AOC-URN2-i2XT" },
{ IPMI_OEM_SUPERMICRO, 0x086B, "X10DRS" },
{ IPMI_OEM_SUPERMICRO, 0x086C, "X10DAL-i" },
{ IPMI_OEM_SUPERMICRO, 0x086D, "X10SDV-TLN4F" },
{ IPMI_OEM_SUPERMICRO, 0x086E, "X10DDW-iN" },
{ IPMI_OEM_SUPERMICRO, 0x086F, "X10DRT-L" },
{ IPMI_OEM_SUPERMICRO, 0x0870, "AOC-URN2-ii2SX" },
{ IPMI_OEM_SUPERMICRO, 0x0871, "AOC-2UR68-i2XS" },
{ IPMI_OEM_SUPERMICRO, 0x0872, "X10QRH+" },
{ IPMI_OEM_SUPERMICRO, 0x0873, "AOC-2URN4-i4XT" },
{ IPMI_OEM_SUPERMICRO, 0x0874, "AOC-2UR8N4-i2XT" },
{ IPMI_OEM_SUPERMICRO, 0x0875, "AOC-2UR66-i4G" },
{ IPMI_OEM_SUPERMICRO, 0x0876, "A2SCL-IN001" },
{ IPMI_OEM_SUPERMICRO, 0x0877, "X10DRT-HB-SG007" },
{ IPMI_OEM_SUPERMICRO, 0x0878, "RSC-S2-88" },
{ IPMI_OEM_SUPERMICRO, 0x0879, "X10DRD-I/L/NT" },
{ IPMI_OEM_SUPERMICRO, 0x087A, "B1SD2-TF" },
{ IPMI_OEM_SUPERMICRO, 0x087B, "AOC-XEH-i2M" },
{ IPMI_OEM_SUPERMICRO, 0x087C, "AOC-XEH-i4M" },
{ IPMI_OEM_SUPERMICRO, 0x087D, "X10SRD-F" },
{ IPMI_OEM_SUPERMICRO, 0x087E, "AOC-STG-i4S" },
{ IPMI_OEM_SUPERMICRO, 0x087F, "X10DRFF-iG" },
{ IPMI_OEM_SUPERMICRO, 0x0880, "X10DRT-XA-SG007" },
{ IPMI_OEM_SUPERMICRO, 0x0881, "X10DRT-XB-SG007" },
{ IPMI_OEM_SUPERMICRO, 0x0882, "X10DRX" },
{ IPMI_OEM_SUPERMICRO, 0x0883, "K1SPI" },
{ IPMI_OEM_SUPERMICRO, 0x0884, "X11SSH-F/-LN4F" },
{ IPMI_OEM_SUPERMICRO, 0x0885, "X11SSL-CF/-NF" },
{ IPMI_OEM_SUPERMICRO, 0x0886, "X11SSA(-F)/X11SSi-LN4(F)" },
{ IPMI_OEM_SUPERMICRO, 0x0887, "AOC-S8076L-L16e" },
{ IPMI_OEM_SUPERMICRO, 0x0888, "X11SSZ" },
{ IPMI_OEM_SUPERMICRO, 0x0889, "B10DRG" },
{ IPMI_OEM_SUPERMICRO, 0x088A, "AOC-URN6-i2XT" },
{ IPMI_OEM_SUPERMICRO, 0x088B, "C7Z170-SQ" },
{ IPMI_OEM_SUPERMICRO, 0x088C, "AOM-S3108-H8S-SB" },
{ IPMI_OEM_SUPERMICRO, 0x088D, "AOC-S100G-i2C" },
{ IPMI_OEM_SUPERMICRO, 0x088E, "AOC-PIO-i2G" },
{ IPMI_OEM_SUPERMICRO, 0x088F, "AOM-PIO-i2XT" },
{ IPMI_OEM_SUPERMICRO, 0x0890, "X11SSQ" },
{ IPMI_OEM_SUPERMICRO, 0x0891, "X11SBA" },
{ IPMI_OEM_SUPERMICRO, 0x0892, "X10DRG-O+-CPU" },
{ IPMI_OEM_SUPERMICRO, 0x0893, "X10DGQ" },
{ IPMI_OEM_SUPERMICRO, 0x0894, "X11SSV-Q" },
{ IPMI_OEM_SUPERMICRO, 0x0895, "X11SAE" },
{ IPMI_OEM_SUPERMICRO, 0x0896, "X11SSL/M-F" },
{ IPMI_OEM_SUPERMICRO, 0x0897, "B1SD1-TF" },
{ IPMI_OEM_SUPERMICRO, 0x0898, "X11SSE" },
{ IPMI_OEM_SUPERMICRO, 0x0899, "X10DRH" },
{ IPMI_OEM_SUPERMICRO, 0x089A, "X11SLL" },
{ IPMI_OEM_SUPERMICRO, 0x089B, "X11SSW-F" },
{ IPMI_OEM_SUPERMICRO, 0x089C, "X11SSH-CTF" },
{ IPMI_OEM_SUPERMICRO, 0x089D, "X10DSC+" },
{ IPMI_OEM_SUPERMICRO, 0x089E, "AOC-URN2-i4GXS" },
{ IPMI_OEM_SUPERMICRO, 0x089F, "X11SAE-M" },
{ IPMI_OEM_SUPERMICRO, 0x0901, "X11SSM" },
{ IPMI_OEM_SUPERMICRO, 0x0902, "C7Z170-OCE" },
{ IPMI_OEM_SUPERMICRO, 0x0903, "AOC-CTGS-i2T" },
{ IPMI_OEM_SUPERMICRO, 0x0904, "AOC-2UR6N4-i4XT" },
{ IPMI_OEM_SUPERMICRO, 0x0905, "K1SPI-KA-SG007" },
{ IPMI_OEM_SUPERMICRO, 0x0906, "K1SPi-KB-SG007" },
{ IPMI_OEM_SUPERMICRO, 0x0907, "X11SAT(-F)" },
{ IPMI_OEM_SUPERMICRO, 0x0908, "B2SS2" },
{ IPMI_OEM_SUPERMICRO, 0x0909, "X11SSD-F" },
{ IPMI_OEM_SUPERMICRO, 0x090A, "AOC-SLG3-4E4" },
{ IPMI_OEM_SUPERMICRO, 0x090B, "AOC-MTG-i4S" },
{ IPMI_OEM_SUPERMICRO, 0x090C, "AOC-MTG-I2s" },
{ IPMI_OEM_SUPERMICRO, 0x090D, "X11SRE-DS018" },
{ IPMI_OEM_SUPERMICRO, 0x090E, "K1SPE(-T)" },
{ IPMI_OEM_SUPERMICRO, 0x090F, "A2SDi" },
{ IPMI_OEM_SUPERMICRO, 0x0910, "A2SDi-H" },
{ IPMI_OEM_SUPERMICRO, 0x0911, "X10DRT-PS" },
{ IPMI_OEM_SUPERMICRO, 0x0912, "AOC-MG-i2" },
{ IPMI_OEM_SUPERMICRO, 0x0913, "AOC-MG-i4" },
{ IPMI_OEM_SUPERMICRO, 0x0914, "AOC-STGS-i1T" },
{ IPMI_OEM_SUPERMICRO, 0x0915, "AOC-STGS-i2T" },
{ IPMI_OEM_SUPERMICRO, 0x0916, "X10DSC-TP4S" },
{ IPMI_OEM_SUPERMICRO, 0x0917, "X11DPi-N(T)" },
{ IPMI_OEM_SUPERMICRO, 0x0918, "AOC-UR-i4GXS" },
{ IPMI_OEM_SUPERMICRO, 0x0919, "X10SDD-F" },
{ IPMI_OEM_SUPERMICRO, 0x091A, "AOC-2UR6-i4xT+" },
{ IPMI_OEM_SUPERMICRO, 0x091B, "AOC-UR-i4XT+" },
{ IPMI_OEM_SUPERMICRO, 0x091C, "X11DPU" },
{ IPMI_OEM_SUPERMICRO, 0x091D, "X11SSW-LN4F" },
{ IPMI_OEM_SUPERMICRO, 0x091E, "X10SD7-AC107" },
{ IPMI_OEM_SUPERMICRO, 0x091F, "AOC-MTG-i4T" },
{ IPMI_OEM_SUPERMICRO, 0x0920, "AOC-MTG-i2T" },
{ IPMI_OEM_SUPERMICRO, 0x0921, "X10SDV-7TP8F" },
{ IPMI_OEM_SUPERMICRO, 0x0922, "X10SRW-LN4F" },
{ IPMI_OEM_SUPERMICRO, 0x0923, "AOM-X10OBI-PCH" },
{ IPMI_OEM_SUPERMICRO, 0x0924, "X10SRM-(T)F" },
{ IPMI_OEM_SUPERMICRO, 0x0925, "AOC-MHIBF-2QG" },
{ IPMI_OEM_SUPERMICRO, 0x0926, "AOC-MHIBF-1QG" },
{ IPMI_OEM_SUPERMICRO, 0x0927, "X11DPT-PS" },
{ IPMI_OEM_SUPERMICRO, 0x0928, "AOC-S25G-b2S" },
{ IPMI_OEM_SUPERMICRO, 0x0929, "AOC-2UR66-i4XTF" },
{ IPMI_OEM_SUPERMICRO, 0x092A, "AOC-M25G-b2S" },
{ IPMI_OEM_SUPERMICRO, 0x092B, "X10DSN-TS" },
{ IPMI_OEM_SUPERMICRO, 0x092C, "AOC-S8069L-16xR" },
{ IPMI_OEM_SUPERMICRO, 0x092D, "X10SDE-DF" },
{ IPMI_OEM_SUPERMICRO, 0x092E, "AOC-2UR68-B2TS" },
{ IPMI_OEM_SUPERMICRO, 0x092F, "AOC-S40G-i1Q" },
{ IPMI_OEM_SUPERMICRO, 0x0930, "X11SSQ-L" },
{ IPMI_OEM_SUPERMICRO, 0x0931, "B2SS1-CF" },
{ IPMI_OEM_SUPERMICRO, 0x0932, "X10DRL-LN4" },
{ IPMI_OEM_SUPERMICRO, 0x0933, "P8DTU" },
{ IPMI_OEM_SUPERMICRO, 0x0934, "AOC-MHFI-i1C" },
{ IPMI_OEM_SUPERMICRO, 0x0935, "AOC-STG-i4T" },
{ IPMI_OEM_SUPERMICRO, 0x0936, "AOC-UR-i4XTF" },
{ IPMI_OEM_SUPERMICRO, 0x0937, "X11DPT" },
{ IPMI_OEM_SUPERMICRO, 0x0938, "X11DPT" },
{ IPMI_OEM_SUPERMICRO, 0x0939, "X11SSV-M4" },
{ IPMI_OEM_SUPERMICRO, 0x093A, "X11SSV-M4F" },
{ IPMI_OEM_SUPERMICRO, 0x093B, "AOC-STGF-i2S" },
{ IPMI_OEM_SUPERMICRO, 0x093C, "A2SAV" },
{ IPMI_OEM_SUPERMICRO, 0x093D, "AOC-S3216L-L16iT" },
{ IPMI_OEM_SUPERMICRO, 0x093E, "X10DRT-B+" },
{ IPMI_OEM_SUPERMICRO, 0x093F, "C7Z270-CG-L" },
{ IPMI_OEM_SUPERMICRO, 0x0940, "C7Z270-CG" },
{ IPMI_OEM_SUPERMICRO, 0x0941, "X11SPi-TF" },
{ IPMI_OEM_SUPERMICRO, 0x0942, "K1SPE" },
{ IPMI_OEM_SUPERMICRO, 0x0943, "C7Z270-PG" },
{ IPMI_OEM_SUPERMICRO, 0x0944, "C7H270-CG-ML" },
{ IPMI_OEM_SUPERMICRO, 0x0945, "C7Q270-CB-ML" },
{ IPMI_OEM_SUPERMICRO, 0x0946, "X10SDV" },
{ IPMI_OEM_SUPERMICRO, 0x0947, "A2SAN" },
{ IPMI_OEM_SUPERMICRO, 0x0948, "AOC-C25G-m2S" },
{ IPMI_OEM_SUPERMICRO, 0x0949, "AOC-MH25G-m2S2T" },
{ IPMI_OEM_SUPERMICRO, 0x094A, "AOC-2UR68-m2TS" },
{ IPMI_OEM_SUPERMICRO, 0x094B, "AOC-S100G-m2C" },
{ IPMI_OEM_SUPERMICRO, 0x094C, "AOC-S25G-m2S" },
{ IPMI_OEM_SUPERMICRO, 0x094D, "AOC-MHIBF" },
{ IPMI_OEM_SUPERMICRO, 0x094E, "AOC-MH25G-b2S2G" },
{ IPMI_OEM_SUPERMICRO, 0x094F, "P8DNU" },
{ IPMI_OEM_SUPERMICRO, 0x0950, "X10DRW-SE" },
{ IPMI_OEM_SUPERMICRO, 0x0951, "B2SS1(2)-MTF" },
{ IPMI_OEM_SUPERMICRO, 0x0952, "X11SPX-TF" },
{ IPMI_OEM_SUPERMICRO, 0x0953, "X11SPW-(c)TF" },
{ IPMI_OEM_SUPERMICRO, 0x0954, "AOC-C25G-m1S" },
{ IPMI_OEM_SUPERMICRO, 0x0955, "X11SSW" },
{ IPMI_OEM_SUPERMICRO, 0x0956, "AOC-MHIBF-m1Q2G" },
{ IPMI_OEM_SUPERMICRO, 0x0957, "AOC-MHIBF-m2Q2G" },
{ IPMI_OEM_SUPERMICRO, 0x0958, "X11SSH" },
{ IPMI_OEM_SUPERMICRO, 0x0959, "R10SR2" },
{ IPMI_OEM_SUPERMICRO, 0x095A, "X10DGO" },
{ IPMI_OEM_SUPERMICRO, 0x095B, "X11DPU-XLL" },
{ IPMI_OEM_SUPERMICRO, 0x095C, "X11DPU-X" },
{ IPMI_OEM_SUPERMICRO, 0x095D, "X11SPM-T(P)F" },
{ IPMI_OEM_SUPERMICRO, 0x095E, "X11SPH-NCTPF" },
{ IPMI_OEM_SUPERMICRO, 0x095F, "X11SAA" },
{ IPMI_OEM_SUPERMICRO, 0x0960, "X11SAN" },
{ IPMI_OEM_SUPERMICRO, 0x0961, "P9DSC" },
{ IPMI_OEM_SUPERMICRO, 0x0962, "X11DPT-B+" },
{ IPMI_OEM_SUPERMICRO, 0x0963, "H11DSU-i" },
{ IPMI_OEM_SUPERMICRO, 0x0964, "H11DSi-NT" },
{ IPMI_OEM_SUPERMICRO, 0x0965, "C7B250-CB-ML" },
{ IPMI_OEM_SUPERMICRO, 0x0966, "B11DPT" },
{ IPMI_OEM_SUPERMICRO, 0x0967, "X11DDW" },
{ IPMI_OEM_SUPERMICRO, 0x0968, "X11DPL-i" },
{ IPMI_OEM_SUPERMICRO, 0x0969, "A2SDi-HLN4F" },
{ IPMI_OEM_SUPERMICRO, 0x096A, "C7C232-CB-ML" },
{ IPMI_OEM_SUPERMICRO, 0x096B, "X11DPT-P-SG007" },
{ IPMI_OEM_SUPERMICRO, 0x096C, "X11DPU-Z+" },
{ IPMI_OEM_SUPERMICRO, 0x096D, "X11DPG-Qt" },
{ IPMI_OEM_SUPERMICRO, 0x096E, "X11SPL-F" },
{ IPMI_OEM_SUPERMICRO, 0x096F, "AOC-IBH-X4ED" },
{ IPMI_OEM_SUPERMICRO, 0x0970, "C7Z270-CG-M" },
{ IPMI_OEM_SUPERMICRO, 0x0971, "X11SRE-EXP-SI030" },
{ IPMI_OEM_SUPERMICRO, 0x0972, "SAS3216" },
{ IPMI_OEM_SUPERMICRO, 0x0973, "SAS3508" },
{ IPMI_OEM_SUPERMICRO, 0x0974, "SAS3516" },
{ IPMI_OEM_SUPERMICRO, 0x0975, "SAS3316" },
{ IPMI_OEM_SUPERMICRO, 0x0976, "SAS3324" },
{ IPMI_OEM_SUPERMICRO, 0x0977, "X11DPFR-SN" },
{ IPMI_OEM_SUPERMICRO, 0x0978, "AOC-S25G-i2S" },
{ IPMI_OEM_SUPERMICRO, 0x0979, "BMB-IBD-E3616" },
{ IPMI_OEM_SUPERMICRO, 0x097A, "X11DAI-N" },
{ IPMI_OEM_SUPERMICRO, 0x097B, "C7X299" },
{ IPMI_OEM_SUPERMICRO, 0x097C, "AOC-IBH_X4ES" },
{ IPMI_OEM_SUPERMICRO, 0x097D, "C7B250-CB-i" },
{ IPMI_OEM_SUPERMICRO, 0x097E, "X11SPG-F" },
{ IPMI_OEM_SUPERMICRO, 0x097F, "X11QPH+" },
{ IPMI_OEM_SUPERMICRO, 0x0980, "X11OPi" },
{ IPMI_OEM_SUPERMICRO, 0x0981, "X11DPH-i" },
{ IPMI_OEM_SUPERMICRO, 0x0982, "A2SDV-TLN5F" },
{ IPMI_OEM_SUPERMICRO, 0x0983, "AOC-M25G-m4S" },
{ IPMI_OEM_SUPERMICRO, 0x0984, "X11SRM-(V)F" },
{ IPMI_OEM_SUPERMICRO, 0x0985, "P9DSU-C" },
{ IPMI_OEM_SUPERMICRO, 0x0986, "X11SDV" },
{ IPMI_OEM_SUPERMICRO, 0x0987, "X11SDV-TLN2F" },
{ IPMI_OEM_SUPERMICRO, 0x0988, "X11DGQ" },
{ IPMI_OEM_SUPERMICRO, 0x0989, "B10DRE" },
{ IPMI_OEM_SUPERMICRO, 0x098A, "H11DST-B" },
{ IPMI_OEM_SUPERMICRO, 0x098B, "X11SSN" },
{ IPMI_OEM_SUPERMICRO, 0x098C, "X11DPX-T" },
{ IPMI_OEM_SUPERMICRO, 0x098D, "A2SAP-H/E/L" },
{ IPMI_OEM_SUPERMICRO, 0x098E, "X11SRA-R/F" },
{ IPMI_OEM_SUPERMICRO, 0x098F, "B11QPi" },
{ IPMI_OEM_SUPERMICRO, 0x0991, "C7Z370-CG-L" },
{ IPMI_OEM_SUPERMICRO, 0x0992, "B11SPi-CPU-TF" },
{ IPMI_OEM_SUPERMICRO, 0x0993, "AOC-URN4-i2TS" },
{ IPMI_OEM_SUPERMICRO, 0x0994, "AOC-B25G-M2S" },
{ IPMI_OEM_SUPERMICRO, 0x0995, "X11DPG-SN" },
{ IPMI_OEM_SUPERMICRO, 0x0996, "AOC-MTG-b2T" },
{ IPMI_OEM_SUPERMICRO, 0x0997, "B11DPE" },
{ IPMI_OEM_SUPERMICRO, 0x0998, "C7Z370-CG-iW" },
{ IPMI_OEM_SUPERMICRO, 0x0999, "AOC-MHIBE-m1CG" },
{ IPMI_OEM_SUPERMICRO, 0x099A, "X11DPS-R" },
{ IPMI_OEM_SUPERMICRO, 0x099B, "AOC-OPH-WFR" },
{ IPMI_OEM_SUPERMICRO, 0x099C, "SAS 3616" },
{ IPMI_OEM_SUPERMICRO, 0x099C, "SAS 3616" },
{ IPMI_OEM_SUPERMICRO, 0x099D, "X11DSC+" },
{ IPMI_OEM_SUPERMICRO, 0x099E, "C7Z390-PGW" },
{ IPMI_OEM_SUPERMICRO, 0x099F, "C7Z390-CG-IW" },
{ IPMI_OEM_SUPERMICRO, 0x1111, "H8DCR-3" },
{ IPMI_OEM_SUPERMICRO, 0x1211, "H8DC8" },
{ IPMI_OEM_SUPERMICRO, 0x1311, "H8QM8-2" },
{ IPMI_OEM_SUPERMICRO, 0x1411, "H8DA8-2" },
{ IPMI_OEM_SUPERMICRO, 0x1511, "H8DMR-82" },
{ IPMI_OEM_SUPERMICRO, 0x1611, "H8DM8-2" },
{ IPMI_OEM_SUPERMICRO, 0x1711, "H8SMI-2" },
{ IPMI_OEM_SUPERMICRO, 0x1811, "H8SSL-I2" },
{ IPMI_OEM_SUPERMICRO, 0x1911, "H8DMU" },
{ IPMI_OEM_SUPERMICRO, 0x1A01, "C7B360-CB-M" },
{ IPMI_OEM_SUPERMICRO, 0x1A02, "C7C242-CB-M" },
{ IPMI_OEM_SUPERMICRO, 0x1A03, "H11SSL-i/c/nc" },
{ IPMI_OEM_SUPERMICRO, 0x1A04, "B10KNM" },
{ IPMI_OEM_SUPERMICRO, 0x1A05, "AOM-M25G-i2S" },
{ IPMI_OEM_SUPERMICRO, 0x1A06, "X11DPG-OT-CPU" },
{ IPMI_OEM_SUPERMICRO, 0x1A07, "B11SPE-CPU-TF/25G" },
{ IPMI_OEM_SUPERMICRO, 0x1A08, "AOC-STG-b2T" },
{ IPMI_OEM_SUPERMICRO, 0x1A09, "AOC-URN4-b2XT" },
{ IPMI_OEM_SUPERMICRO, 0x1A1A, "A2SD1-3750F/3955F" },
{ IPMI_OEM_SUPERMICRO, 0x1A1B, "X11SCE-F" },
{ IPMI_OEM_SUPERMICRO, 0x1A1C, "X11DSF" },
{ IPMI_OEM_SUPERMICRO, 0x1A1D, "X11SCA-F/W" },
{ IPMI_OEM_SUPERMICRO, 0x1A1E, "X11DAC" },
{ IPMI_OEM_SUPERMICRO, 0x1A1F, "X11SCL-F" },
{ IPMI_OEM_SUPERMICRO, 0x1B01, "X11DSN-TS" },
{ IPMI_OEM_SUPERMICRO, 0x1B02, "X11DGO-T" },
{ IPMI_OEM_SUPERMICRO, 0x1B03, "AOC-2UR688-i4XTF" },
{ IPMI_OEM_SUPERMICRO, 0x1B04, "X11DPT-LC019" },
{ IPMI_OEM_SUPERMICRO, 0x1B05, "X11SCQ" },
{ IPMI_OEM_SUPERMICRO, 0x1B06, "X11SCQ-L" },
{ IPMI_OEM_SUPERMICRO, 0x1B07, "X11SCW-F" },
{ IPMI_OEM_SUPERMICRO, 0x1B08, "C9X299-PG300" },
{ IPMI_OEM_SUPERMICRO, 0x1B09, "X11SCZ-F" },
{ IPMI_OEM_SUPERMICRO, 0x1B0A, "B10DRT-IBF2" },
{ IPMI_OEM_SUPERMICRO, 0x1B0B, "AOC-STG-b2T" },
{ IPMI_OEM_SUPERMICRO, 0x1B0C, "AOC-B25G-6X4D" },
{ IPMI_OEM_SUPERMICRO, 0x1B0D, "X11SCV-Q/L" },
{ IPMI_OEM_SUPERMICRO, 0x1B0E, "X11SCL-IF" },
{ IPMI_OEM_SUPERMICRO, 0x1B0F, "X11SCM" },
{ IPMI_OEM_SUPERMICRO, 0x1B10, "A2SDV-LN8F/LN10PF" },
{ IPMI_OEM_SUPERMICRO, 0x1B11, "X11SCH-LN4F" },
{ IPMI_OEM_SUPERMICRO, 0x1B12, "AOC-SGP-i4" },
{ IPMI_OEM_SUPERMICRO, 0x1B13, "AOC-4UR66-i4XTF" },
{ IPMI_OEM_SUPERMICRO, 0x1B14, "C9X299-PG300F" },
{ IPMI_OEM_SUPERMICRO, 0x1B15, "X11SCL-LN4F" },
{ IPMI_OEM_SUPERMICRO, 0x1B16, "AOM-PICO-3L" },
{ IPMI_OEM_SUPERMICRO, 0x1B17, "X11DPFF-SN" },
{ IPMI_OEM_SUPERMICRO, 0x1B18, "C7B360-CB-ML" },
{ IPMI_OEM_SUPERMICRO, 0x1B19, "H11SSW-NT/iN" },
{ IPMI_OEM_SUPERMICRO, 0x1B1A, "C9Z390-CG(W)" },
{ IPMI_OEM_SUPERMICRO, 0x1B1B, "AOC-CTG-i2S" },
{ IPMI_OEM_SUPERMICRO, 0x1B1C, "X11SDD" },
{ IPMI_OEM_SUPERMICRO, 0x1B1D, "X11DPT-L" },
{ IPMI_OEM_SUPERMICRO, 0x1B1E, "AOC-URN4-B2ts" },
{ IPMI_OEM_SUPERMICRO, 0x1B1F, "X11DPG-HGX2" },
{ IPMI_OEM_SUPERMICRO, 0x1B20, "AOC-SLG2-2TM2" },
{ IPMI_OEM_SUPERMICRO, 0x1B21, "AOC-SLG2-4TM2" },
{ IPMI_OEM_SUPERMICRO, 0x1B22, "AOC-SMG2-2TM2" },
{ IPMI_OEM_SUPERMICRO, 0x1B23, "RSC-UM2R-8+-NI22" },
{ IPMI_OEM_SUPERMICRO, 0x1B24, "BPN-6S3008S6" },
{ IPMI_OEM_SUPERMICRO, 0x1B25, "X11DPU-ZE+" },
{ IPMI_OEM_SUPERMICRO, 0x1B26, "AOC-2UR68-b2TS" },
{ IPMI_OEM_SUPERMICRO, 0x1B27, "AOC-S100G-b1C" },
{ IPMI_OEM_SUPERMICRO, 0x1B28, "X11SPA-TF" },
{ IPMI_OEM_SUPERMICRO, 0x1B29, "B2SC1" },
{ IPMI_OEM_SUPERMICRO, 0x1B2A, "AOC-2MG-i8" },
{ IPMI_OEM_SUPERMICRO, 0x1B2B, "H12SSW-iN" },
{ IPMI_OEM_SUPERMICRO, 0x1B2C, "H12SSW-NT" },
{ IPMI_OEM_SUPERMICRO, 0x1B2D, "M11SDV" },
{ IPMI_OEM_SUPERMICRO, 0x1B2E, "AOC-MG-b2" },
{ IPMI_OEM_SUPERMICRO, 0x1B2F, "AOM-SMF-TP4F" },
{ IPMI_OEM_SUPERMICRO, 0x1B31, "AOC-M25G-m2S" },
{ IPMI_OEM_SUPERMICRO, 0x1B32, "B11SRE-CPU" },
{ IPMI_OEM_SUPERMICRO, 0x1B33, "B11SRE" },
{ IPMI_OEM_SUPERMICRO, 0x1B34, "X11SPA-T" },
{ IPMI_OEM_SUPERMICRO, 0x1B35, "X11SDW" },
{ IPMI_OEM_SUPERMICRO, 0x1B36, "X11SCD-F" },
{ IPMI_OEM_SUPERMICRO, 0x1B37, "X11DPU-V" },
{ IPMI_OEM_SUPERMICRO, 0x1B38, "X11DPT-BV" },
{ IPMI_OEM_SUPERMICRO, 0x1B39, "B11SCG-ZTF" },
{ IPMI_OEM_SUPERMICRO, 0x1B3A, "H12DST-B" },
{ IPMI_OEM_SUPERMICRO, 0x1B3B, "X11SDS-8C" },
{ IPMI_OEM_SUPERMICRO, 0x1B3C, "AOM-SDW-B16X2" },
{ IPMI_OEM_SUPERMICRO, 0x1B3D, "B11SCG-CTF" },
{ IPMI_OEM_SUPERMICRO, 0x1B3E, "AOC-S100G-b2C" },
{ IPMI_OEM_SUPERMICRO, 0x1B3F, "X11SPD-F" },
{ IPMI_OEM_SUPERMICRO, 0x1B41, "X11SRL-F" },
{ IPMI_OEM_SUPERMICRO, 0x2011, "H8SMU" },
{ IPMI_OEM_SUPERMICRO, 0x2111, "M8QME" },
{ IPMI_OEM_SUPERMICRO, 0x2211, "H8DMT" },
{ IPMI_OEM_SUPERMICRO, 0x2311, "BHDME" },
{ IPMI_OEM_SUPERMICRO, 0x2411, "H8DMT-IBX" },
{ IPMI_OEM_SUPERMICRO, 0x2511, "H8DME-2-LS006" },
{ IPMI_OEM_SUPERMICRO, 0x8080, "X7DB8" },
{ IPMI_OEM_SUPERMICRO, 0x8180, "X7DA8" },
{ IPMI_OEM_SUPERMICRO, 0x8280, "PDSMI-LN4" },
{ IPMI_OEM_SUPERMICRO, 0x8380, "X7DBP-X" },
{ IPMI_OEM_SUPERMICRO, 0x8480, "X7DBR-8+" },
{ IPMI_OEM_SUPERMICRO, 0x8580, "PDSML" },
{ IPMI_OEM_SUPERMICRO, 0x8680, "X7DVL" },
{ IPMI_OEM_SUPERMICRO, 0x8780, "PDSBA" },
{ IPMI_OEM_SUPERMICRO, 0x8880, "X7DBX" },
{ IPMI_OEM_SUPERMICRO, 0x8980, "X7DBP-8" },
{ IPMI_OEM_SUPERMICRO, 0x9080, "X7DB8-X" },
{ IPMI_OEM_SUPERMICRO, 0x9180, "PDSME+" },
{ IPMI_OEM_SUPERMICRO, 0x9280, "X7DBR-3" },
{ IPMI_OEM_SUPERMICRO, 0x9380, "PDSLM" },
{ IPMI_OEM_SUPERMICRO, 0x9480, "X7DAL-E" },
{ IPMI_OEM_SUPERMICRO, 0x9580, "X6QT8" },
{ IPMI_OEM_SUPERMICRO, 0x9680, "X7DBN" },
{ IPMI_OEM_SUPERMICRO, 0x9780, "X7DBU" },
{ IPMI_OEM_SUPERMICRO, 0x9880, "PDSMU+" },
{ IPMI_OEM_SUPERMICRO, 0x9980, "X7DBT" },
{ IPMI_OEM_SUPERMICRO, 0xA011, "H8DM3-2" },
{ IPMI_OEM_SUPERMICRO, 0xA080, "X7DVL-3" },
{ IPMI_OEM_SUPERMICRO, 0xA111, "H8DA3-2" },
{ IPMI_OEM_SUPERMICRO, 0xA211, "H8QM3-2" },
{ IPMI_OEM_SUPERMICRO, 0xA280, "X7DW3+" },
{ IPMI_OEM_SUPERMICRO, 0xA311, "H8QM3-EX" },
{ IPMI_OEM_SUPERMICRO, 0xA380, "X7QC3" },
{ IPMI_OEM_SUPERMICRO, 0xA480, "X7DCL-3" },
{ IPMI_OEM_SUPERMICRO, 0xA511, "H8DI3+" },
{ IPMI_OEM_SUPERMICRO, 0xA580, "AOC-USAS-L8I" },
{ IPMI_OEM_SUPERMICRO, 0xA611, "BHQIE" },
{ IPMI_OEM_SUPERMICRO, 0xA680, "X7DCA-3/i" },
{ IPMI_OEM_SUPERMICRO, 0xA711, "H8SGL" },
{ IPMI_OEM_SUPERMICRO, 0xA780, "B7DC3" },
{ IPMI_OEM_SUPERMICRO, 0xA811, "H8DGU" },
{ IPMI_OEM_SUPERMICRO, 0xA811, "H8DGU" },
{ IPMI_OEM_SUPERMICRO, 0xA880, "X8DA3/i" },
{ IPMI_OEM_SUPERMICRO, 0xA911, "H8DGG-QF" },
{ IPMI_OEM_SUPERMICRO, 0xA980, "X7SB3" },
{ IPMI_OEM_SUPERMICRO, 0xAA11, "H8DGT" },
{ IPMI_OEM_SUPERMICRO, 0xAA80, "X7DWT-C-SG007" },
{ IPMI_OEM_SUPERMICRO, 0xAA80, "X7SBL-LN1/LN2" },
{ IPMI_OEM_SUPERMICRO, 0xAB11, "H8QG6" },
{ IPMI_OEM_SUPERMICRO, 0xAB80, "C2SBM-Q" },
{ IPMI_OEM_SUPERMICRO, 0xAC11, "H8DGU-LN4" },
{ IPMI_OEM_SUPERMICRO, 0xAC80, "X7DWU" },
{ IPMI_OEM_SUPERMICRO, 0xAD11, "BHQME" },
{ IPMI_OEM_SUPERMICRO, 0xAD11, "H8DGT-HIBQF-AI034" },
{ IPMI_OEM_SUPERMICRO, 0xAE11, "H8QGI-F-AI034" },
{ IPMI_OEM_SUPERMICRO, 0xAE80, "PDSMP-JN001" },
{ IPMI_OEM_SUPERMICRO, 0xAF11, "H8DGU-LN4F+-AI034" },
{ IPMI_OEM_SUPERMICRO, 0xAF80, "AOC-UTG-I2" },
{ IPMI_OEM_SUPERMICRO, 0xB080, "B7DBE" },
{ IPMI_OEM_SUPERMICRO, 0xB180, "X7DBI+" },
{ IPMI_OEM_SUPERMICRO, 0xB280, "X7DVL-L" },
{ IPMI_OEM_SUPERMICRO, 0xB380, "X7DWN" },
{ IPMI_OEM_SUPERMICRO, 0xB480, "AOC-UG-i4" },
{ IPMI_OEM_SUPERMICRO, 0xB580, "PDSBM-LN2" },
{ IPMI_OEM_SUPERMICRO, 0xB680, "X7DGT-ATOKAP" },
{ IPMI_OEM_SUPERMICRO, 0xB780, "C2SBA" },
{ IPMI_OEM_SUPERMICRO, 0xB780, "X7DWT-CD-SG007" },
{ IPMI_OEM_SUPERMICRO, 0xB880, "C2SEA" },
{ IPMI_OEM_SUPERMICRO, 0xB980, "Winbond IPMI (AMI)" },
{ IPMI_OEM_SUPERMICRO, 0xBA11, "H8SCM-F" },
{ IPMI_OEM_SUPERMICRO, 0xBA80, "C2SBX" },
{ IPMI_OEM_SUPERMICRO, 0xBA80, "X7SLM-L" },
{ IPMI_OEM_SUPERMICRO, 0xBB11, "BHDGT" },
{ IPMI_OEM_SUPERMICRO, 0xBB80, "B7DCE" },
{ IPMI_OEM_SUPERMICRO, 0xBC11, "BHQG6/E" },
{ IPMI_OEM_SUPERMICRO, 0xBC11, "H8DG6/i-F" },
{ IPMI_OEM_SUPERMICRO, 0xBC80, "X7DWT/-INF" },
{ IPMI_OEM_SUPERMICRO, 0xBD11, "H8DCT-IBQF" },
{ IPMI_OEM_SUPERMICRO, 0xBD11, "H8DGT-C" },
{ IPMI_OEM_SUPERMICRO, 0xBD80, "C2SBM" },
{ IPMI_OEM_SUPERMICRO, 0xBE11, "H8DCT" },
{ IPMI_OEM_SUPERMICRO, 0xBE80, "C2SBC" },
{ IPMI_OEM_SUPERMICRO, 0xBE80, "C2SBC" },
{ IPMI_OEM_SUPERMICRO, 0xBF11, "H8DME-EX-LS006" },
{ IPMI_OEM_SUPERMICRO, 0xBF80, "C2SBi" },
{ IPMI_OEM_SUPERMICRO, 0xC080, "AOC-USAS-H4i" },
{ IPMI_OEM_SUPERMICRO, 0xC180, "AOC-USAS-H8i" },
{ IPMI_OEM_SUPERMICRO, 0xC280, "B7DW3" },
{ IPMI_OEM_SUPERMICRO, 0xC380, "AOC-USASLP-H8iR" },
{ IPMI_OEM_SUPERMICRO, 0xCA11, "H8QGL" },
{ IPMI_OEM_SUPERMICRO, 0xCB11, "H8DGT-CM" },
{ IPMI_OEM_SUPERMICRO, 0xCD11, "H8DCL-6F" },
{ IPMI_OEM_SUPERMICRO, 0xCE11, "H8DCT-HLN4F" },
{ IPMI_OEM_SUPERMICRO, 0xCF11, "H8SML-7/i(F)" },
{ IPMI_OEM_SUPERMICRO, 0xD011, "H8QG7" },
{ IPMI_OEM_SUPERMICRO, 0xD080, "X7DWP" },
{ IPMI_OEM_SUPERMICRO, 0xD111, "H8SME-F" },
{ IPMI_OEM_SUPERMICRO, 0xD180, "X7SBi" },
{ IPMI_OEM_SUPERMICRO, 0xD280, "X7SB4/E" },
{ IPMI_OEM_SUPERMICRO, 0xD380, "X7SBA" },
{ IPMI_OEM_SUPERMICRO, 0xD480, "X7SBi-LN4" },
{ IPMI_OEM_SUPERMICRO, 0xD580, "X7SBF" },
{ IPMI_OEM_SUPERMICRO, 0xD680, "X7DCA-3/i" },
{ IPMI_OEM_SUPERMICRO, 0xDA80, "C2SBM-Q" },
{ IPMI_OEM_SUPERMICRO, 0xDB80, "X7DCU" },
{ IPMI_OEM_SUPERMICRO, 0xDC80, "X7DCA-L" },
{ IPMI_OEM_SUPERMICRO, 0xDD80, "X7SBX" },
{ IPMI_OEM_SUPERMICRO, 0xDE80, "X7DCT-10G" },
{ IPMI_OEM_SUPERMICRO, 0xDF80, "X7DWE" },
{ IPMI_OEM_SUPERMICRO, 0xF080, "X7SBT" },
{ IPMI_OEM_SUPERMICRO, 0xF180, "X7SBU" },
{ IPMI_OEM_SUPERMICRO, 0xF280, "X8DTN+" },
{ IPMI_OEM_SUPERMICRO, 0xF380, "X8SAX" },
{ IPMI_OEM_SUPERMICRO, 0xF480, "X7DCX" },
{ IPMI_OEM_SUPERMICRO, 0xF580, "X8ST3" },
/* YADRO */
{ IPMI_OEM_YADRO, 0x0001, "VESNIN BMC" },
{ IPMI_OEM_YADRO, 0x000A, "TATLIN Storage Controller BMC" },

View File

@ -434,7 +434,7 @@ print_user_usage(void)
lprintf(LOG_NOTICE,
" set name <user id> <username>");
lprintf(LOG_NOTICE,
" set password <user id> [<password> [<16|20>]]");
" set password <user id> [<password> <16|20>]");
lprintf(LOG_NOTICE,
" disable <user id>");
lprintf(LOG_NOTICE,
@ -626,17 +626,12 @@ ipmi_user_mod(struct ipmi_intf *intf, int argc, char **argv)
return 0;
}
#define USER_PW_IPMI15_LEN 16 /* IPMI 1.5 only allowed for 16 bytes */
#define USER_PW_IPMI20_LEN 20 /* IPMI 2.0 allows for 20 bytes */
#define USER_PW_MAX_LEN USER_PW_IPMI20_LEN
int
ipmi_user_password(struct ipmi_intf *intf, int argc, char **argv)
{
char *password = NULL;
int ccode = 0;
uint8_t password_type = USER_PW_IPMI15_LEN;
size_t password_len;
uint8_t password_type = 16;
uint8_t user_id = 0;
if (is_ipmi_user_id(argv[2], &user_id)) {
return (-1);
@ -645,63 +640,52 @@ ipmi_user_password(struct ipmi_intf *intf, int argc, char **argv)
if (argc == 3) {
/* We need to prompt for a password */
char *tmp;
size_t tmplen;
password = ask_password(user_id);
if (!password) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return (-1);
}
tmp = ask_password(user_id);
tmplen = strnlen(tmp, USER_PW_MAX_LEN + 1);
if (!tmp) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return (-1);
}
if (strncmp(password, tmp, tmplen)) {
lprintf(LOG_ERR, "Passwords do not match or are "
"longer than %d", USER_PW_MAX_LEN);
if (strlen(password) != strlen(tmp)
|| strncmp(password, tmp, strlen(tmp))) {
lprintf(LOG_ERR, "Passwords do not match.");
return (-1);
}
} else {
password = argv[3];
if (argc > 4) {
if ((str2uchar(argv[4], &password_type) != 0)
|| (password_type != 16 && password_type != 20)) {
lprintf(LOG_ERR, "Invalid password length '%s'", argv[4]);
return (-1);
}
} else {
password_type = 16;
}
}
if (!password) {
lprintf(LOG_ERR, "Unable to parse password argument.");
return (-1);
}
password_len = strnlen(password, USER_PW_MAX_LEN + 1);
if (argc > 4) {
if ((str2uchar(argv[4], &password_type) != 0)
|| (password_type != USER_PW_IPMI15_LEN
&& password_type != USER_PW_IPMI20_LEN))
{
lprintf(LOG_ERR, "Invalid password length '%s'",
argv[4]);
return (-1);
}
} else if (password_len > USER_PW_IPMI15_LEN) {
password_type = USER_PW_IPMI20_LEN;
}
if (password_len > password_type) {
lprintf(LOG_ERR, "Password is too long (> %d bytes)",
password_type);
} else if (strlen(password) > 20) {
lprintf(LOG_ERR, "Password is too long (> 20 bytes)");
return (-1);
}
ccode = _ipmi_set_user_password(intf, user_id,
IPMI_PASSWORD_SET_PASSWORD, password,
password_type > USER_PW_IPMI15_LEN);
IPMI_PASSWORD_SET_PASSWORD, password,
password_type > 16);
if (eval_ccode(ccode) != 0) {
lprintf(LOG_ERR, "Set User Password command failed (user %d)",
user_id);
user_id);
return (-1);
} else {
printf("Set User Password command successful (user %d)\n",
user_id);
user_id);
return 0;
}
}

View File

@ -65,6 +65,7 @@
#include <ipmitool/ipmi_ekanalyzer.h>
#include <ipmitool/ipmi_ime.h>
#include <ipmitool/ipmi_dcmi.h>
#include <ipmitool/ipmi_nm.h>
#include <ipmitool/ipmi_vita.h>
#include <ipmitool/ipmi_quantaoem.h>