blob: 011dae758ee928a7607c6cd05a2c061346f4e2e2 [file] [log] [blame]
Andrew Geisslerb790d772015-03-01 21:21:35 -06001From 94cd1249c46be945efa92f09c41e27bfaacc9405 Mon Sep 17 00:00:00 2001
2From: Dan Crowell <dcrowell@us.ibm.com>
3Date: Sun, 1 Mar 2015 12:32:24 -0600
4Subject: [PATCH 1/4] Runtime fixes for IPMI
5
6-initialize trace buffer in IPMI runtime code
7-fix buffer mixup
8-fix netfn format for opal call
9
10Change-Id: I612431f81d40f1698b585353da9c245adf1447e1
11(cherry picked from commit f4998cabf6ff541de0624532a5fa46bdf96419d1)
12---
13 src/usr/ipmi/runtime/rt_ipmirp.C | 12 ++++++++----
14 1 files changed, 8 insertions(+), 4 deletions(-)
15
16diff --git a/src/usr/ipmi/runtime/rt_ipmirp.C b/src/usr/ipmi/runtime/rt_ipmirp.C
17index f99723a..846e068 100644
18--- a/src/usr/ipmi/runtime/rt_ipmirp.C
19+++ b/src/usr/ipmi/runtime/rt_ipmirp.C
20@@ -49,6 +49,8 @@
21 #include <runtime/interface.h>
22
23 trace_desc_t * g_trac_ipmi;
24+TRAC_INIT(&g_trac_ipmi, IPMI_COMP_NAME, 6*KILOBYTE, TRACE::BUFFER_SLOW);
25+
26 #define IPMI_TRAC(printf_string,args...) \
27 TRACFCOMP(g_trac_ipmi,"rt: "printf_string,##args)
28
29@@ -89,8 +91,9 @@ namespace IPMI
30 // if the buffer is too large this is a programming error.
31 assert(io_len <= max_buffer());
32
33+ uint8_t netfn = i_cmd.first >> 2; //remove embedded LUN
34 IPMI_TRAC("calling sync %x:%x len=%d",
35- i_cmd.first, i_cmd.second, io_len);
36+ netfn, i_cmd.second, io_len);
37
38 if(g_hostInterfaces && g_hostInterfaces->ipmi_msg)
39 {
40@@ -98,7 +101,7 @@ namespace IPMI
41 uint8_t *l_data = new uint8_t[l_len];
42
43 rc = g_hostInterfaces->ipmi_msg(
44- i_cmd.first, i_cmd.second,
45+ netfn, i_cmd.second,
46 io_data, io_len,
47 l_data, &l_len);
48
49@@ -124,7 +127,7 @@ namespace IPMI
50 IPMI::MOD_IPMIRT,
51 IPMI::RC_INVALID_SENDRECV,
52 TWO_UINT32_TO_UINT64(rc,
53- TWO_UINT16_TO_UINT32(i_cmd.first, i_cmd.second)),
54+ TWO_UINT16_TO_UINT32(netfn, i_cmd.second)),
55 io_len,
56 true);
57 err->collectTrace(IPMI_COMP_NAME);
58@@ -135,7 +138,8 @@ namespace IPMI
59 else
60 {
61 // clean up the memory for the caller
62- o_completion_code = static_cast<IPMI::completion_code>(io_data[0]);
63+ o_completion_code =
64+ static_cast<IPMI::completion_code>(l_data[0]);
65
66 // now need to create the buffer to return
67 io_len = l_len - 1; // get rid of the completion_code
68--
691.7.4.1
70