Editor implementation update for VPD-Manager app.
This commit updates the implementaion logic of reading VPD file
for vpd keyword update using VPD-Manager app.
In order to improve the efficiency, full vpd file will be read
in a single call instead of multiple blocks using multiple call.
Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com>
Change-Id: Ibf4c6ba1cfb1b098a542be7ade7f0046e444abbe
diff --git a/vpd-manager/editor_impl.hpp b/vpd-manager/editor_impl.hpp
index 997bf85..70596a4 100644
--- a/vpd-manager/editor_impl.hpp
+++ b/vpd-manager/editor_impl.hpp
@@ -70,18 +70,19 @@
void readVTOC();
/** @brief validate ecc data for the VTOC record
- * @param[in] tocRecData - VTOC record data
- * @param[in] tocECCData - VTOC ECC data
- * @param[in] recLength - Lenght of VTOC record
- * @param[in] eccLength - Length of ECC record
+ * @param[in] iterator to VTOC record data
+ * @param[in] iterator to VTOC ECC data
+ * @param[in] Lenght of VTOC record
+ * @param[in] Length of ECC record
*/
- void checkECC(const Binary& tocRecData, const Binary& tocECCData,
+ void checkECC(Binary::const_iterator& itrToRecData,
+ Binary::const_iterator& itrToECCData,
openpower::vpd::constants::RecordLength recLength,
openpower::vpd::constants::ECCLength eccLength);
/** @brief reads value at the given offset
* @param[in] offset - offset value
- * @return[out] - value at that offset in bigendian
+ * @return value at that offset in bigendian
*/
auto getValue(openpower::vpd::constants::offsets::Offsets offset);
@@ -98,7 +99,7 @@
/** @brief update data for given keyword
* @param[in] kwdData- data to be updated
*/
- void updateData(Binary kwdData);
+ void updateData(const Binary& kwdData);
/** @brief update record ECC
*/
@@ -113,8 +114,7 @@
// structure to hold info about record to edit
struct RecInfo
{
- Binary recData;
- Binary recEccData;
+ Binary kwdUpdatedData; // need access to it in case encoding is needed
const std::string& recName;
const std::string& recKWd;
openpower::vpd::constants::RecordOffset recOffset;
@@ -122,15 +122,17 @@
std::size_t recECCLength;
std::size_t kwdDataLength;
openpower::vpd::constants::RecordSize recSize;
-
+ openpower::vpd::constants::DataOffset kwDataOffset;
// constructor
RecInfo(const std::string& rec, const std::string& kwd) :
recName(rec), recKWd(kwd), recOffset(0), recECCoffset(0),
- recECCLength(0), kwdDataLength(0), recSize(0)
+ recECCLength(0), kwdDataLength(0), recSize(0), kwDataOffset(0)
{
}
} thisRecord;
+ Binary vpdFile;
+
}; // class EditorImpl
} // namespace editor