diff options
| author | Brian Horton <brianh@linux.ibm.com> | 2015-02-18 15:07:08 -0600 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-02-25 22:57:37 -0600 |
| commit | de162b1fbbafc0d1f98eb2231b14c4d351b3171e (patch) | |
| tree | 9ed20c4caef4219670f7ac2f7e1931566f3695da /src/usr/ipmi/runtime | |
| parent | 84a672bd28630d9998fc2808df3659ddcf5a7eda (diff) | |
| download | talos-hostboot-de162b1fbbafc0d1f98eb2231b14c4d351b3171e.tar.gz talos-hostboot-de162b1fbbafc0d1f98eb2231b14c4d351b3171e.zip | |
attr for ipmi max_buffer for hbrt
pass the ipmi max_buffer size from hostboot during ipl to
hostboot runtime via targeting attribute
Change-Id: I5971333fd3950af65c66a2936b00a0d4ad907330
RTC: 124099
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15820
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/ipmi/runtime')
| -rw-r--r-- | src/usr/ipmi/runtime/makefile | 6 | ||||
| -rw-r--r-- | src/usr/ipmi/runtime/rt_ipmirp.C | 24 |
2 files changed, 22 insertions, 8 deletions
diff --git a/src/usr/ipmi/runtime/makefile b/src/usr/ipmi/runtime/makefile index 6fa93cc6d..6f49d9ef1 100644 --- a/src/usr/ipmi/runtime/makefile +++ b/src/usr/ipmi/runtime/makefile @@ -26,9 +26,9 @@ HOSTBOOT_RUNTIME = 1 ROOTPATH = ../../../.. MODULE = ipmi_rt -OBJS += ipmidcmi.o -OBJS += ipmisel.o -OBJS += ipmisensor.o +#include common ojects between hostboot and runtime hostboot +include ../ipmi.mk + OBJS += rt_ipmirp.o SUBDIRS += test.d diff --git a/src/usr/ipmi/runtime/rt_ipmirp.C b/src/usr/ipmi/runtime/rt_ipmirp.C index 7184c85f7..f99723adf 100644 --- a/src/usr/ipmi/runtime/rt_ipmirp.C +++ b/src/usr/ipmi/runtime/rt_ipmirp.C @@ -54,11 +54,25 @@ trace_desc_t * g_trac_ipmi; namespace IPMI { - // TODO RTC: 124099 move to a _hb attribute - // ATTR_IPMI_MAX_BUFFER_SEND_SIZE - static const size_t g_max_buffer = 61; + static size_t g_max_buffer = 0; size_t max_buffer(void) { + if (g_max_buffer == 0) + { + TARGETING::Target * sys = NULL; + TARGETING::targetService().getTopLevelTarget( sys ); + if (sys) + { + g_max_buffer = sys->getAttr + <TARGETING::ATTR_IPMI_MAX_BUFFER_SIZE>(); + IPMI_TRAC( INFO_MRK"getAttr(IPMI_MAX_BUFFER_SIZE) = %d", + g_max_buffer); + } + else + { + IPMI_TRAC( ERR_MRK"IPMI_MAX_BUFFER_SIZE not available" ); + } + } return g_max_buffer; } @@ -73,14 +87,14 @@ namespace IPMI int rc = 0; // if the buffer is too large this is a programming error. - assert(io_len <= g_max_buffer); + assert(io_len <= max_buffer()); IPMI_TRAC("calling sync %x:%x len=%d", i_cmd.first, i_cmd.second, io_len); if(g_hostInterfaces && g_hostInterfaces->ipmi_msg) { - size_t l_len = g_max_buffer; // max size the BMC can return + size_t l_len = max_buffer(); // max size the BMC can return uint8_t *l_data = new uint8_t[l_len]; rc = g_hostInterfaces->ipmi_msg( |

