summaryrefslogtreecommitdiffstats
path: root/src/usr/ipmi
diff options
context:
space:
mode:
authorPrasad Bg Ranganath <prasadbgr@in.ibm.com>2015-11-23 05:48:53 -0600
committerStephen Cprek <smcprek@us.ibm.com>2016-07-18 15:32:38 -0500
commitb3f6347ef52994c4d37ac5f361b21fe4d4658462 (patch)
tree0611424ce648e024d82b9edad34b780035d82b16 /src/usr/ipmi
parent99bd8d04615d1a633a9adaaf64a58787ad753527 (diff)
downloadtalos-hostboot-b3f6347ef52994c4d37ac5f361b21fe4d4658462.tar.gz
talos-hostboot-b3f6347ef52994c4d37ac5f361b21fe4d4658462.zip
Avoid visible errors during SBE update
RTC: 135822 Backport: yes Change-Id: I9581abc5f1d0cb4812743190c9914b11c63c0089 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/764 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/ipmi')
-rw-r--r--src/usr/ipmi/ipmichassiscontrol.C81
-rw-r--r--src/usr/ipmi/makefile3
2 files changed, 83 insertions, 1 deletions
diff --git a/src/usr/ipmi/ipmichassiscontrol.C b/src/usr/ipmi/ipmichassiscontrol.C
new file mode 100644
index 000000000..1d17c366e
--- /dev/null
+++ b/src/usr/ipmi/ipmichassiscontrol.C
@@ -0,0 +1,81 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/ipmi/ipmichassiscontrol.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2014,2016 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * @file ipmichassiscontrol.C
+ *
+ * Ipmi send chassis control command
+ *
+ */
+
+/******************************************************************************/
+// Includes
+/******************************************************************************/
+#include <stdint.h>
+#include <errl/errlentry.H>
+#include <ipmi/ipmichassiscontrol.H>
+#include <ipmi/ipmiif.H>
+
+/******************************************************************************/
+// Globals/Constants
+/******************************************************************************/
+// Defined in ipmidd.C
+extern trace_desc_t * g_trac_ipmi;
+#define IPMI_TRAC(printf_string,args...) \
+ TRACFCOMP(g_trac_ipmi,"cc: " printf_string,##args)
+
+namespace IPMI
+{
+
+/******************************************************************************/
+// Functions
+/******************************************************************************/
+
+errlHndl_t chassisControl(const uint8_t i_chassisControlState )
+{
+ errlHndl_t err_ipmi = NULL;
+
+ size_t len = 1; // IPMI spec has request data at 1 bytes
+
+ //create request data buffer
+ uint8_t* data = new uint8_t[len];
+
+ IPMI::completion_code cc = IPMI::CC_UNKBAD;
+
+ data[0] = i_chassisControlState;
+
+ err_ipmi = IPMI::sendrecv(IPMI::chassis_power_off(), cc, len, data);
+
+ //cleanup buffer
+ delete[] data;
+
+ if(cc != IPMI::CC_OK)
+ {
+ IPMI_TRAC("Chassis control : BMC returned not ok CC[%x]",cc);
+ }
+
+ return err_ipmi;
+}
+} // namespace
+
diff --git a/src/usr/ipmi/makefile b/src/usr/ipmi/makefile
index 9447bad37..50638b522 100644
--- a/src/usr/ipmi/makefile
+++ b/src/usr/ipmi/makefile
@@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2011,2015
+# Contributors Listed Below - COPYRIGHT 2011,2016
# [+] International Business Machines Corp.
#
#
@@ -38,6 +38,7 @@ OBJS += ipmiwatchdog.o
OBJS += ipmifruinv.o
OBJS += ipmipowerstate.o
OBJS += ipmiselrecord.o
+OBJS += ipmichassiscontrol.o
SUBDIRS += runtime.d
#SUBDIRS += test.d
OpenPOWER on IntegriCloud