summaryrefslogtreecommitdiffstats
path: root/src/usr/vpd
diff options
context:
space:
mode:
authorBill Hoffa <wghoffa@us.ibm.com>2014-12-01 11:48:01 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-12-14 17:34:09 -0600
commit8f0edf314a9c9198d95b0c7598e269cf8b7f232a (patch)
treeb6e09d66845e500bbaf036a40874aea461691044 /src/usr/vpd
parent9b53fb2a9083e62380f7bf2fb041378ef4de96ee (diff)
downloadtalos-hostboot-8f0edf314a9c9198d95b0c7598e269cf8b7f232a.tar.gz
talos-hostboot-8f0edf314a9c9198d95b0c7598e269cf8b7f232a.zip
IPMI Fru Inventory Record Creation
Change-Id: I9339e267ff7d2e2edbf4305d8c2d57f73f0c5eeb RTC:108829 Depends-on:I3c0c4c7c14521f1b64af37d62e57a5947602ed11 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14666 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/vpd')
-rw-r--r--src/usr/vpd/cvpd.H2
-rw-r--r--src/usr/vpd/spd.C12
-rwxr-xr-xsrc/usr/vpd/test/spdtest.H10
3 files changed, 21 insertions, 3 deletions
diff --git a/src/usr/vpd/cvpd.H b/src/usr/vpd/cvpd.H
index f7b2b120a..b71b98008 100644
--- a/src/usr/vpd/cvpd.H
+++ b/src/usr/vpd/cvpd.H
@@ -115,7 +115,7 @@ namespace CVPD
{ VD, "VD" },
{ VN, "VN" },
{ VP, "VP" },
- { SV, "SV" },
+ { VS, "VS" },
{ M0, "M0" },
{ M1, "M1" },
{ M2, "M2" },
diff --git a/src/usr/vpd/spd.C b/src/usr/vpd/spd.C
index 0f5c9866b..27b34f643 100644
--- a/src/usr/vpd/spd.C
+++ b/src/usr/vpd/spd.C
@@ -213,7 +213,10 @@ errlHndl_t spdGetKeywordValue ( DeviceFW::OperationType i_opType,
if( BASIC_MEMORY_TYPE == keyword )
{
io_buflen = MEM_TYPE_SZ;
- memcpy( io_buffer, &memType, io_buflen );
+ if (io_buffer != NULL)
+ {
+ memcpy( io_buffer, &memType, io_buflen );
+ }
break;
}
@@ -658,6 +661,13 @@ errlHndl_t spdGetValue ( VPD::vpdKeyword i_keyword,
break;
}
+ // Support passing in NULL buffer to return VPD field size
+ if ( NULL == io_buffer )
+ {
+ io_buflen = (*entry).length;
+ break;
+ }
+
// Check io_buflen versus size in table
err = spdCheckSize( io_buflen,
(*entry).length,
diff --git a/src/usr/vpd/test/spdtest.H b/src/usr/vpd/test/spdtest.H
index 83de74c7f..c94e8af98 100755
--- a/src/usr/vpd/test/spdtest.H
+++ b/src/usr/vpd/test/spdtest.H
@@ -736,7 +736,9 @@ class SPDTest: public CxxTest::TestSuite
// Test on first DIMM only.
theTarget = dimmList[0];
- uint8_t * theData = NULL;
+ //If theData is NULL, deviceRead will return the size
+ // need to give this an arbitrary size so test is still valid`
+ uint8_t * theData = static_cast<uint8_t*>(malloc( 0x1 ));
size_t theSize = 0x0; // Invalid size of 0x0
cmds++;
@@ -745,6 +747,12 @@ class SPDTest: public CxxTest::TestSuite
theSize,
DEVICE_SPD_ADDRESS( SPD::SPD_FIRST_NORM_KEYWORD ) );
+ // clean up the data
+ if( NULL != theData )
+ {
+ delete theData;
+ theData = NULL;
+ }
if( NULL == err )
{
fails++;
OpenPOWER on IntegriCloud