oem-ibm: make DMA max size configurable

Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Change-Id: I3dd6f30db4bbf7b6290362b32a4e6e42ef993705
diff --git a/meson.build b/meson.build
index 6c8ef3a..923197a 100644
--- a/meson.build
+++ b/meson.build
@@ -22,6 +22,7 @@
   conf_data.set_quoted('FILE_TABLE_JSON', '/usr/share/pldm/fileTable.json')
   conf_data.set_quoted('LID_PERM_DIR', '/usr/share/host-fw')
   conf_data.set_quoted('LID_TEMP_DIR', '/usr/share/host-fw')
+  conf_data.set('DMA_MAXSIZE', get_option('oem-ibm-dma-maxsize'))
   add_global_arguments('-DOEM_IBM', language : 'c')
   add_global_arguments('-DOEM_IBM', language : 'cpp')
 endif
diff --git a/meson_options.txt b/meson_options.txt
index 00ef185..aaacf38 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -5,3 +5,4 @@
 option('utilities', type: 'feature', description: 'Enable debug utilities', value: 'enabled')
 
 option('libpldm-only', type: 'feature', description: 'Only build libpldm', value: 'disabled')
+option('oem-ibm-dma-maxsize', type: 'integer', description: 'OEM-IBM: max DMA size', value: 16773120) #16MB - 4K
diff --git a/oem/ibm/libpldmresponder/file_io.hpp b/oem/ibm/libpldmresponder/file_io.hpp
index 3a504bf..4e0cad4 100644
--- a/oem/ibm/libpldmresponder/file_io.hpp
+++ b/oem/ibm/libpldmresponder/file_io.hpp
@@ -1,5 +1,7 @@
 #pragma once
 
+#include "config.h"
+
 #include "handler.hpp"
 #include "utils.hpp"
 
@@ -26,8 +28,7 @@
 // The minimum data size of dma transfer in bytes
 constexpr uint32_t minSize = 16;
 
-// 16MB - 4096B (16773120 bytes) is the maximum data size of DMA transfer
-constexpr size_t maxSize = (16 * 1024 * 1024) - 4096;
+constexpr size_t maxSize = DMA_MAXSIZE;
 
 namespace fs = std::filesystem;