summaryrefslogtreecommitdiffstats
path: root/src/usr/hdat/hdatvpd.C
diff options
context:
space:
mode:
authornagurram-in <nagendra.g@in.ibm.com>2017-01-31 23:50:35 -0600
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2017-02-06 17:17:25 -0500
commitb9fd10a99329adb4093c453bf9f80b05a6f31fa3 (patch)
tree3ce90083966c9d815ba05777a3969dbc011f873a /src/usr/hdat/hdatvpd.C
parentfea19a9fce4bb79622ce1bd927ce8bc8e0e2f20a (diff)
downloadtalos-hostboot-b9fd10a99329adb4093c453bf9f80b05a6f31fa3.tar.gz
talos-hostboot-b9fd10a99329adb4093c453bf9f80b05a6f31fa3.zip
Dumping full vpd into HDAT
Change-Id: I34f5ce9d702818254d44a0dd979b277b75ebc861 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35711 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Dean Sanner <dsanner@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/hdat/hdatvpd.C')
-rwxr-xr-xsrc/usr/hdat/hdatvpd.C97
1 files changed, 96 insertions, 1 deletions
diff --git a/src/usr/hdat/hdatvpd.C b/src/usr/hdat/hdatvpd.C
index cc453f111..a07996921 100755
--- a/src/usr/hdat/hdatvpd.C
+++ b/src/usr/hdat/hdatvpd.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -167,6 +167,101 @@ iv_kwdSize(0), iv_kwd(NULL)
}
+
+/** @brief See the prologue in hdatvpd.H
+ */
+HdatVpd::HdatVpd(errlHndl_t &o_errlHndl,
+ uint32_t i_resourceId,
+ TARGETING::Target * i_target,
+ const char *i_eyeCatcher,
+ uint32_t i_index,
+ vpdType i_vpdType,
+ const IpVpdFacade::recordInfo i_fetchVpd[],
+ uint32_t i_num)
+: HdatHdif(o_errlHndl, i_eyeCatcher, HDAT_VPD_LAST,i_index,HDAT_NO_CHILD,
+ HDAT_VPD_VERSION),
+iv_kwdSize(0), iv_kwd(NULL)
+{
+ HDAT_ENTER();
+ o_errlHndl = NULL;
+ uint32_t l_slcaIdx = 0;
+ TARGETING::Target * l_target=i_target;
+ i_target->tryGetAttr<TARGETING::ATTR_SLCA_INDEX>(l_slcaIdx);
+
+ //overriding target for BP vpd
+ if ( FRU_SV == (i_resourceId >> 8 ) )
+ {
+ TARGETING::TargetHandleList l_targList;
+ PredicateCTM predNode(TARGETING::CLASS_ENC, TARGETING::TYPE_NODE);
+ PredicateHwas predFunctional;
+ predFunctional.functional(true);
+ PredicatePostfixExpr nodeCheckExpr;
+ nodeCheckExpr.push(&predNode).push(&predFunctional).And();
+
+ targetService().getAssociated(l_targList, i_target,
+ TargetService::CHILD, TargetService::IMMEDIATE,
+ &nodeCheckExpr);
+ l_target = l_targList[0];
+ }
+
+ //@TODO:RTC 149382(Method to get VPD collected status for Targets)
+ GARD_FunctionalState l_functional = GARD_Functional;
+ GARD_UsedState l_used = GARD_Used;
+
+ if (GARD_Functional == l_functional ||
+ GARD_PartialFunctional == l_functional)
+ {
+ iv_status.hdatFlags = HDAT_VPD_FRU_FUNCTIONAL;
+ }
+ if (GARD_Used == l_used)
+ {
+ iv_status.hdatFlags |= HDAT_VPD_REDUNDANT_FRU_USED;
+ }
+
+ iv_fru.hdatResourceId = i_resourceId;
+ size_t theSize[i_num];
+ //get the SLCA index and the keyword for the RID
+ o_errlHndl = hdatGetFullRecords(l_target,iv_kwdSize,iv_kwd,i_vpdType,
+ i_fetchVpd,i_num,theSize);
+
+ HDAT_DBG("hdatGetAsciiKwd returned kwd size =%d",iv_kwdSize);
+
+ if(strcmp(i_eyeCatcher,"IO KID")==0)
+ {
+ using namespace TARGETING;
+ // Get Target Service, and the system target.
+ TARGETING::TargetService& l_targetService = targetService();
+ TARGETING::Target* l_sysTarget = NULL;
+ (void) l_targetService.getTopLevelTarget(l_sysTarget);
+
+ assert(l_sysTarget != NULL);
+
+ //fetching lx data
+ uint64_t l_LXvalue = l_sysTarget->getAttr<ATTR_ASCII_VPD_LX_KEYWORD>();
+ char *temp_kwd = new char [iv_kwdSize];
+ uint32_t temp_kwdSize = iv_kwdSize;
+ memcpy(temp_kwd, iv_kwd,iv_kwdSize);
+ delete[] iv_kwd;
+ iv_kwdSize +=sizeof(uint64_t);
+ iv_kwd = new char [iv_kwdSize];
+ memcpy(iv_kwd,temp_kwd,temp_kwdSize);
+ memcpy((void *)(iv_kwd+temp_kwdSize),&l_LXvalue,sizeof(uint64_t));
+ theSize[i_num-1] = sizeof(uint64_t);
+ delete[] temp_kwd;
+ }
+ if (NULL == o_errlHndl)
+ {
+ iv_fru.hdatSlcaIdx = l_slcaIdx;
+ this->addData(HDAT_VPD_FRU_ID, sizeof(hdatFruId_t));
+ this->addData(HDAT_VPD_OP_STATUS, sizeof(hdatFruOpStatus_t));
+ //Padding the size
+ this->addData(HDAT_VPD_KWD, iv_kwdSize+1);
+ this->align();
+ }
+ HDAT_EXIT();
+}
+
+
/** @brief See the prologue in hdatvpd.H
*/
HdatVpd::~HdatVpd()
OpenPOWER on IntegriCloud