mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 10:37:22 +00:00
ID:320 - Add VITA 46.11 support
Commit adds support for VITA 46.11 by Dmitry Bazhenov.
This commit is contained in:
parent
d5c2e976d4
commit
f1c6118c72
@ -38,5 +38,5 @@ noinst_HEADERS = log.h bswap.h hpm2.h helper.h ipmi.h ipmi_cc.h ipmi_intf.h \
|
||||
ipmi_oem.h ipmi_sdradd.h ipmi_isol.h ipmi_sunoem.h ipmi_picmg.h \
|
||||
ipmi_fwum.h ipmi_main.h ipmi_tsol.h ipmi_firewall.h \
|
||||
ipmi_kontronoem.h ipmi_ekanalyzer.h ipmi_gendev.h ipmi_ime.h \
|
||||
ipmi_delloem.h ipmi_dcmi.h
|
||||
ipmi_delloem.h ipmi_dcmi.h ipmi_vita.h
|
||||
|
||||
|
@ -168,6 +168,7 @@ struct ipmi_intf {
|
||||
int abort;
|
||||
int noanswer;
|
||||
int picmg_avail;
|
||||
int vita_avail;
|
||||
IPMI_OEM manufacturer_id;
|
||||
|
||||
struct ipmi_session * session;
|
||||
|
49
include/ipmitool/ipmi_vita.h
Normal file
49
include/ipmitool/ipmi_vita.h
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) Pigeon Point Systems. All right reserved
|
||||
*/
|
||||
|
||||
#ifndef _IPMI_VITA_H_
|
||||
#define _IPMI_VITA_H_
|
||||
|
||||
/* VITA 46.11 commands */
|
||||
#define VITA_GET_VSO_CAPABILITIES_CMD 0x00
|
||||
#define VITA_FRU_CONTROL_CMD 0x04
|
||||
#define VITA_GET_FRU_LED_PROPERTIES_CMD 0x05
|
||||
#define VITA_GET_LED_COLOR_CAPABILITIES_CMD 0x06
|
||||
#define VITA_SET_FRU_LED_STATE_CMD 0x07
|
||||
#define VITA_GET_FRU_LED_STATE_CMD 0x08
|
||||
#define VITA_SET_FRU_STATE_POLICY_BITS_CMD 0x0A
|
||||
#define VITA_GET_FRU_STATE_POLICY_BITS_CMD 0x0B
|
||||
#define VITA_SET_FRU_ACTIVATION_CMD 0x0C
|
||||
#define VITA_GET_FRU_ADDRESS_INFO_CMD 0x40
|
||||
|
||||
/* VITA 46.11 site types */
|
||||
#define VITA_FRONT_VPX_MODULE 0x00
|
||||
#define VITA_POWER_ENTRY 0x01
|
||||
#define VITA_CHASSIS_FRU 0x02
|
||||
#define VITA_DEDICATED_CHMC 0x03
|
||||
#define VITA_FAN_TRAY 0x04
|
||||
#define VITA_FAN_TRAY_FILTER 0x05
|
||||
#define VITA_ALARM_PANEL 0x06
|
||||
#define VITA_XMC 0x07
|
||||
#define VITA_VPX_RTM 0x09
|
||||
#define VITA_FRONT_VME_MODULE 0x0A
|
||||
#define VITA_FRONT_VXS_MODULE 0x0B
|
||||
#define VITA_POWER_SUPPLY 0x0C
|
||||
#define VITA_FRONT_VITA62_MODULE 0x0D
|
||||
#define VITA_71_MODULE 0x0E
|
||||
#define VITA_FMC 0x0F
|
||||
|
||||
|
||||
#define GROUP_EXT_VITA 0x03
|
||||
|
||||
extern uint8_t
|
||||
vita_discover(struct ipmi_intf *intf);
|
||||
|
||||
extern uint8_t
|
||||
ipmi_vita_ipmb_address(struct ipmi_intf *intf);
|
||||
|
||||
extern int
|
||||
ipmi_vita_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
|
||||
#endif /* _IPMI_VITA_H_ */
|
@ -39,7 +39,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_ime.c ipmi_delloem.c ipmi_dcmi.c hpm2.c ipmi_vita.c \
|
||||
../src/plugins/lan/md5.c ../src/plugins/lan/md5.h
|
||||
|
||||
libipmitool_la_LDFLAGS = -export-dynamic
|
||||
|
@ -344,6 +344,18 @@ ipmi_parse_hex(const char *str)
|
||||
return out;
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
ipmi_acquire_ipmb_address(struct ipmi_intf * intf)
|
||||
{
|
||||
if (intf->picmg_avail) {
|
||||
return ipmi_picmg_ipmb_address(intf);
|
||||
} else if (intf->vita_avail) {
|
||||
return ipmi_vita_ipmb_address(intf);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* ipmi_parse_options - helper function to handle parsing command line options
|
||||
*
|
||||
* @argc: count of options
|
||||
@ -907,14 +919,22 @@ ipmi_main(int argc, char ** argv,
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Attempt picmg discovery of the actual interface address unless
|
||||
* Attempt picmg/vita discovery of the actual interface address unless
|
||||
* the users specified an address.
|
||||
* Address specification always overrides discovery
|
||||
*/
|
||||
if (picmg_discover(ipmi_main_intf) && !arg_addr) {
|
||||
lprintf(LOG_DEBUG, "Running PICMG Get Address Info");
|
||||
addr = ipmi_picmg_ipmb_address(ipmi_main_intf);
|
||||
lprintf(LOG_INFO, "Discovered IPMB-0 address 0x%x", addr);
|
||||
if (picmg_discover(ipmi_main_intf)) {
|
||||
ipmi_main_intf->picmg_avail = 1;
|
||||
} else if (vita_discover(ipmi_main_intf)) {
|
||||
ipmi_main_intf->vita_avail = 1;
|
||||
}
|
||||
|
||||
if (arg_addr) {
|
||||
addr = arg_addr;
|
||||
} else {
|
||||
lprintf(LOG_DEBUG, "Acquire IPMB address");
|
||||
addr = ipmi_acquire_ipmb_address(ipmi_main_intf);
|
||||
lprintf(LOG_INFO, "Discovered IPMB address 0x%x", addr);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -956,7 +976,7 @@ ipmi_main(int argc, char ** argv,
|
||||
ipmi_intf_session_set_privlvl(ipmi_main_intf, IPMI_SESSION_PRIV_ADMIN);
|
||||
/* Get the ipmb address of the targeted entity */
|
||||
ipmi_main_intf->target_ipmb_addr =
|
||||
ipmi_picmg_ipmb_address(ipmi_main_intf);
|
||||
ipmi_acquire_ipmb_address(ipmi_main_intf);
|
||||
lprintf(LOG_DEBUG, "Specified addressing Target %#x:%#x Transit %#x:%#x",
|
||||
ipmi_main_intf->target_addr,
|
||||
ipmi_main_intf->target_channel,
|
||||
|
@ -2325,37 +2325,39 @@ picmg_discover(struct ipmi_intf *intf) {
|
||||
struct ipmi_rq req;
|
||||
struct ipmi_rs *rsp;
|
||||
char msg_data;
|
||||
uint8_t picmg_avail = 0;
|
||||
|
||||
if (intf->picmg_avail == 0) {
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_PICMG;
|
||||
req.msg.cmd = PICMG_GET_PICMG_PROPERTIES_CMD;
|
||||
msg_data = 0x00;
|
||||
req.msg.data = &msg_data;
|
||||
req.msg.data_len = 1;
|
||||
msg_data = 0;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_PICMG;
|
||||
req.msg.cmd = PICMG_GET_PICMG_PROPERTIES_CMD;
|
||||
msg_data = 0x00;
|
||||
req.msg.data = &msg_data;
|
||||
req.msg.data_len = 1;
|
||||
msg_data = 0;
|
||||
|
||||
lprintf(LOG_DEBUG, "Running Get PICMG Properties my_addr %#x, transit %#x, target %#x",
|
||||
intf->my_addr, intf->transit_addr, intf->target_addr);
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp && !rsp->ccode) {
|
||||
if ( (rsp->data[0] == 0) &&
|
||||
((rsp->data[1] & 0x0F) == PICMG_ATCA_MAJOR_VERSION
|
||||
|| (rsp->data[1] & 0x0F) == PICMG_AMC_MAJOR_VERSION) ) {
|
||||
intf->picmg_avail = 1;
|
||||
lprintf(LOG_DEBUG, "Discovered PICMG Extension %d.%d",
|
||||
(rsp->data[1] & 0x0f), (rsp->data[1] >> 4));
|
||||
}
|
||||
} else {
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_DEBUG,"No Response from Get PICMG Properties");
|
||||
} else {
|
||||
lprintf(LOG_DEBUG,"Error Response %#x from Get PICMG Properities", rsp->ccode);
|
||||
}
|
||||
}
|
||||
lprintf(LOG_INFO, "Running Get PICMG Properties my_addr %#x, transit %#x, target %#x",
|
||||
intf->my_addr, intf->transit_addr, intf->target_addr);
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_INFO,"No response from Get PICMG Properties");
|
||||
} else if (rsp->ccode != 0) {
|
||||
lprintf(LOG_INFO,"Error response %#x from Get PICMG Properities",
|
||||
rsp->ccode);
|
||||
} else if (rsp->data_len < 4) {
|
||||
lprintf(LOG_INFO,"Invalid Get PICMG Properties response length %d",
|
||||
rsp->data_len);
|
||||
} else if (rsp->data[0] != 0) {
|
||||
lprintf(LOG_INFO,"Invalid Get PICMG Properties group extension %#x",
|
||||
rsp->data[0]);
|
||||
} else if ((rsp->data[1] & 0x0F) != PICMG_ATCA_MAJOR_VERSION
|
||||
&& (rsp->data[1] & 0x0F) != PICMG_AMC_MAJOR_VERSION) {
|
||||
lprintf(LOG_INFO,"Unknown PICMG Extension Version %d.%d",
|
||||
(rsp->data[1] & 0x0F), (rsp->data[1] >> 4));
|
||||
} else {
|
||||
picmg_avail = 1;
|
||||
lprintf(LOG_INFO, "Discovered PICMG Extension Version %d.%d",
|
||||
(rsp->data[1] & 0x0f), (rsp->data[1] >> 4));
|
||||
}
|
||||
if (intf->picmg_avail == 0) {
|
||||
lprintf(LOG_DEBUG, "No PICMG Extenstion discovered");
|
||||
}
|
||||
return intf->picmg_avail;
|
||||
|
||||
return picmg_avail;
|
||||
}
|
||||
|
1006
lib/ipmi_vita.c
Normal file
1006
lib/ipmi_vita.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -65,6 +65,7 @@
|
||||
#include <ipmitool/ipmi_ekanalyzer.h>
|
||||
#include <ipmitool/ipmi_ime.h>
|
||||
#include <ipmitool/ipmi_dcmi.h>
|
||||
#include <ipmitool/ipmi_vita.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
@ -120,6 +121,7 @@ struct ipmi_cmd ipmitool_cmd_list[] = {
|
||||
{ ipmi_hpmfwupg_main,"hpm", "Update HPM components using PICMG HPM.1 file"},
|
||||
{ ipmi_ekanalyzer_main,"ekanalyzer", "run FRU-Ekeying analyzer using FRU files"},
|
||||
{ ipmi_ime_main, "ime", "Update Intel Manageability Engine Firmware"},
|
||||
{ ipmi_vita_main, "vita", "Run a VITA 46.11 extended cmd"},
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user