summaryrefslogtreecommitdiff
path: root/drivers/misc/mei/mei_dev.h
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2012-12-25 19:06:10 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-07 10:31:29 -0800
commite46f187487a8c28e64417e51ba628746a5397838 (patch)
tree484cc0102c738d7aae646822baabd71ad715eaf9 /drivers/misc/mei/mei_dev.h
parentcd51ed649fa4bd55c6a78db52b57260797ed56b4 (diff)
mei: use structured buffer for the write buffer
We can drop useless castings and use proper types. We remove the casting in mei_hbm_hdr function and add new function mei_hbm_stop_request_prepare that utilize the new structure Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/mei_dev.h')
-rw-r--r--drivers/misc/mei/mei_dev.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h
index 107a820a6ba4..1ea331ac2463 100644
--- a/drivers/misc/mei/mei_dev.h
+++ b/drivers/misc/mei/mei_dev.h
@@ -265,7 +265,13 @@ struct mei_device {
unsigned char rd_msg_buf[MEI_RD_MSG_BUF_SIZE]; /* control messages */
u32 rd_msg_hdr;
- u32 wr_msg_buf[128]; /* used for control messages */
+
+ /* used for control messages */
+ struct {
+ struct mei_msg_hdr hdr;
+ unsigned char data[128];
+ } wr_msg;
+
struct {
struct mei_msg_hdr hdr;
unsigned char data[4]; /* All HBM messages are 4 bytes */
@@ -459,15 +465,13 @@ void mei_disable_interrupts(struct mei_device *dev);
void mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr);
-static inline struct mei_msg_hdr *mei_hbm_hdr(u32 *buf, size_t length)
+static inline void mei_hbm_hdr(struct mei_msg_hdr *hdr, size_t length)
{
- struct mei_msg_hdr *hdr = (struct mei_msg_hdr *)buf;
hdr->host_addr = 0;
hdr->me_addr = 0;
hdr->length = length;
hdr->msg_complete = 1;
hdr->reserved = 0;
- return hdr;
}
#define MEI_HDR_FMT "hdr:host=%02d me=%02d len=%d comp=%1d"