[Skiboot] [PATCH 3/4] IPMI: Move MAX_PEL_SIZE to ipmi.h

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Thu Aug 20 17:03:33 AEST 2015


We want to use MAX_PEL_SIZE in other code (like attention) as well.
Hence move this to ipmi.h.

Also rename MAX_PEL_SIZE as IPMI_MAX_PEL_SIZE to reflect its IPMI
specific macro.

Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 hw/ipmi/ipmi-sel.c | 12 +++---------
 include/ipmi.h     |  7 +++++++
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/hw/ipmi/ipmi-sel.c b/hw/ipmi/ipmi-sel.c
index 343ca02..0ee9d86 100644
--- a/hw/ipmi/ipmi-sel.c
+++ b/hw/ipmi/ipmi-sel.c
@@ -125,13 +125,6 @@ struct oem_sel {
 	uint8_t data[4];
 };
 
-/* As far as I can tell the size of PEL record is unbounded (due to
- * the possible presence of the user defined section). We chose this
- * size because it's what hostboot also uses and most of the OPAL logs
- * are few hundred bytes.
- */
-#define MAX_PEL_SIZE 0x800
-
 #define ESEL_HDR_SIZE 7
 
 
@@ -261,7 +254,7 @@ static void ipmi_log_sel_event(uint8_t event_severity, uint16_t esel_record_id)
 static void ipmi_elog_poll(struct ipmi_msg *msg)
 {
 	static bool first = false;
-	static char pel_buf[MAX_PEL_SIZE];
+	static char pel_buf[IPMI_MAX_PEL_SIZE];
 	static size_t pel_size;
 	static size_t esel_size;
 	static int esel_index = 0;
@@ -287,7 +280,8 @@ static void ipmi_elog_poll(struct ipmi_msg *msg)
 			return;
 		}
 
-		pel_size = create_pel_log(elog_buf, pel_buf, MAX_PEL_SIZE);
+		pel_size = create_pel_log(elog_buf,
+					  pel_buf, IPMI_MAX_PEL_SIZE);
 		esel_size = pel_size + sizeof(struct sel_record);
 		esel_index = 0;
 		record_id = 0;
diff --git a/include/ipmi.h b/include/ipmi.h
index 54c415b..d1532ba 100644
--- a/include/ipmi.h
+++ b/include/ipmi.h
@@ -144,6 +144,13 @@
 #define IPMI_MAX_REQ_SIZE		60
 #define IPMI_MAX_RESP_SIZE		60
 
+/* As far as I can tell the size of PEL record is unbounded (due to
+ * the possible presence of the user defined section). We chose this
+ * size because it's what hostboot also uses and most of the OPAL logs
+ * are few hundred bytes.
+ */
+#define IPMI_MAX_PEL_SIZE		0x800
+
 struct ipmi_backend;
 struct ipmi_msg {
 	/* Can be used by command implementations to track requests */
-- 
2.1.0



More information about the Skiboot mailing list