Fix instance id in pldm response

The instance id that is sent on the pldm request message has to
be returned in the PLDM response message to the caller, this was
defaulted in the initial coding to zero and is fixed now

Tested :

Booted a hypervisor that sends PLDM commands.

Below is the transactions recorded in the journal
Jul 03 16:24:10 w70 pldmd[3209]: Buffer Data: 09 01 8b 3f 07 01 00 00
00 00 00 00 00 10 00 00 00 00 00 01 00 00 00 00 00
Jul 03 16:24:10 w70 pldmd[3209]: Sending Msg
Jul 03 16:24:10 w70 pldmd[3209]: Buffer Data: 09 01 0b 3f 07 00 10 00
00 00
Jul 03 16:24:11 w70 pldmd[3209]: Received Msg
Jul 03 16:24:11 w70 pldmd[3209]: Buffer Data: 09 01 8c 3f 07 00 00 00
00 00 00 02 00 00 10 00 00 00 10 01 00 00 00 00 00
Jul 03 16:24:11 w70 pldmd[3209]: Sending Msg
Jul 03 16:24:11 w70 pldmd[3209]: Buffer Data: 09 01 0c 3f 07 00 00 10
00 00
Jul 03 16:24:11 w70 pldmd[3209]: Received Msg
Jul 03 16:24:11 w70 pldmd[3209]: Buffer Data: 09 01 8d 3f 07 01 00 00
00 00 00 00 00 10 00 00 00 00 00 01 00 00 00 00 00
Jul 03 16:24:11 w70 pldmd[3209]: Sending Msg
Jul 03 16:24:11 w70 pldmd[3209]: Buffer Data: 09 01 0d 3f 07 00 10 00
00 00

Signed-off-by: Jinu Joy Thomas <jinu.joy.thomas@in.ibm.com>
Change-Id: I0e6c0d5582674bc6b0dd75ceb35dd41ed9127cd3
diff --git a/oem/ibm/libpldmresponder/file_io.hpp b/oem/ibm/libpldmresponder/file_io.hpp
index 6025fd7..30236ce 100644
--- a/oem/ibm/libpldmresponder/file_io.hpp
+++ b/oem/ibm/libpldmresponder/file_io.hpp
@@ -77,13 +77,14 @@
  * @param[in] address  - DMA address on the host
  * @param[in] upstream - indicates direction of the transfer; true indicates
  *                       transfer to the host
+ * @param[in] instanceId - Message's instance id
  * @return PLDM response message
  */
 
 template <class DMAInterface>
 Response transferAll(DMAInterface* intf, uint8_t command, fs::path& path,
                      uint32_t offset, uint32_t length, uint64_t address,
-                     bool upstream)
+                     bool upstream, uint8_t instanceId)
 {
     uint32_t origLength = length;
     Response response(sizeof(pldm_msg_hdr) + PLDM_RW_FILE_MEM_RESP_BYTES, 0);
@@ -95,7 +96,8 @@
                                          upstream);
         if (rc < 0)
         {
-            encode_rw_file_memory_resp(0, command, PLDM_ERROR, 0, responsePtr);
+            encode_rw_file_memory_resp(instanceId, command, PLDM_ERROR, 0,
+                                       responsePtr);
             return response;
         }
 
@@ -107,11 +109,12 @@
     auto rc = intf->transferDataHost(path, offset, length, address, upstream);
     if (rc < 0)
     {
-        encode_rw_file_memory_resp(0, command, PLDM_ERROR, 0, responsePtr);
+        encode_rw_file_memory_resp(instanceId, command, PLDM_ERROR, 0,
+                                   responsePtr);
         return response;
     }
 
-    encode_rw_file_memory_resp(0, command, PLDM_SUCCESS, origLength,
+    encode_rw_file_memory_resp(instanceId, command, PLDM_SUCCESS, origLength,
                                responsePtr);
     return response;
 }