From 1e03bfbedc46ab7792f0fc4617df28e49af11cff Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Tue, 19 May 2015 17:05:38 +0800 Subject: prd: Don't expose full opal_prd_msg to kernel The kernel is only accessing part of struct opal_prd_msg, and doesn't need to know about the rest. This change moves the "internal" parts of opal_prd_msg to a separate header. In order for the kernel to pass full messages between userspace and firmware, it needs the total size of the struct. We put this in the header for the kernel to access. Signed-off-by: Jeremy Kerr Signed-off-by: Stewart Smith --- include/opal-api.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/opal-api.h b/include/opal-api.h index 1698311..5be548c 100644 --- a/include/opal-api.h +++ b/include/opal-api.h @@ -847,16 +847,21 @@ typedef struct oppanel_line { enum opal_prd_msg_type { OPAL_PRD_MSG_TYPE_INIT = 0, /* HBRT --> OPAL */ - OPAL_PRD_MSG_TYPE_FINI, /* HBRT --> OPAL */ + OPAL_PRD_MSG_TYPE_FINI, /* HBRT/kernel --> OPAL */ OPAL_PRD_MSG_TYPE_ATTN, /* HBRT <-- OPAL */ OPAL_PRD_MSG_TYPE_ATTN_ACK, /* HBRT --> OPAL */ OPAL_PRD_MSG_TYPE_OCC_ERROR, /* HBRT <-- OPAL */ OPAL_PRD_MSG_TYPE_OCC_RESET, /* HBRT <-- OPAL */ }; -struct opal_prd_msg { +struct opal_prd_msg_header { uint8_t type; - uint8_t pad[3]; + uint8_t pad[1]; + __be16 size; +}; + +struct opal_prd_msg { + struct opal_prd_msg_header hdr; __be32 token; union { struct { -- cgit v1.1