Commit 15d4acc5 authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

mei: use unified format for printing mei message header

Introduce MEI_HDR_FMT and MEI_HDR_PRM macros.
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 438763f3
...@@ -457,8 +457,7 @@ int mei_amthif_irq_write_complete(struct mei_device *dev, s32 *slots, ...@@ -457,8 +457,7 @@ int mei_amthif_irq_write_complete(struct mei_device *dev, s32 *slots,
return 0; return 0;
} }
dev_dbg(&dev->pdev->dev, "msg: len = %d complete = %d\n", dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(mei_hdr));
mei_hdr->length, mei_hdr->msg_complete);
*slots -= msg_slots; *slots -= msg_slots;
if (mei_write_message(dev, mei_hdr, if (mei_write_message(dev, mei_hdr,
......
...@@ -127,9 +127,7 @@ int mei_write_message(struct mei_device *dev, struct mei_msg_hdr *header, ...@@ -127,9 +127,7 @@ int mei_write_message(struct mei_device *dev, struct mei_msg_hdr *header,
int i; int i;
int empty_slots; int empty_slots;
dev_dbg(&dev->pdev->dev, dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(header));
"mei_write_message header=%08x.\n",
*((u32 *) header));
empty_slots = mei_hbuf_empty_slots(dev); empty_slots = mei_hbuf_empty_slots(dev);
dev_dbg(&dev->pdev->dev, "empty slots = %hu.\n", empty_slots); dev_dbg(&dev->pdev->dev, "empty slots = %hu.\n", empty_slots);
......
...@@ -150,8 +150,8 @@ static int mei_irq_thread_read_client_message(struct mei_cl_cb *complete_list, ...@@ -150,8 +150,8 @@ static int mei_irq_thread_read_client_message(struct mei_cl_cb *complete_list,
dev_dbg(&dev->pdev->dev, "message read\n"); dev_dbg(&dev->pdev->dev, "message read\n");
if (!buffer) { if (!buffer) {
mei_read_slots(dev, dev->rd_msg_buf, mei_hdr->length); mei_read_slots(dev, dev->rd_msg_buf, mei_hdr->length);
dev_dbg(&dev->pdev->dev, "discarding message, header =%08x.\n", dev_dbg(&dev->pdev->dev, "discarding message " MEI_HDR_FMT "\n",
*(u32 *) dev->rd_msg_buf); MEI_HDR_PRM(mei_hdr));
} }
return 0; return 0;
...@@ -742,8 +742,7 @@ static int mei_irq_thread_write_complete(struct mei_device *dev, s32 *slots, ...@@ -742,8 +742,7 @@ static int mei_irq_thread_write_complete(struct mei_device *dev, s32 *slots,
dev_dbg(&dev->pdev->dev, "buf: size = %d idx = %lu\n", dev_dbg(&dev->pdev->dev, "buf: size = %d idx = %lu\n",
cb->request_buffer.size, cb->buf_idx); cb->request_buffer.size, cb->buf_idx);
dev_dbg(&dev->pdev->dev, "msg: len = %d complete = %d\n", dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(mei_hdr));
mei_hdr->length, mei_hdr->msg_complete);
*slots -= msg_slots; *slots -= msg_slots;
if (mei_write_message(dev, mei_hdr, if (mei_write_message(dev, mei_hdr,
...@@ -790,7 +789,7 @@ static int mei_irq_thread_read_handler(struct mei_cl_cb *cmpl_list, ...@@ -790,7 +789,7 @@ static int mei_irq_thread_read_handler(struct mei_cl_cb *cmpl_list,
dev_dbg(&dev->pdev->dev, "slots =%08x.\n", *slots); dev_dbg(&dev->pdev->dev, "slots =%08x.\n", *slots);
} }
mei_hdr = (struct mei_msg_hdr *) &dev->rd_msg_hdr; mei_hdr = (struct mei_msg_hdr *) &dev->rd_msg_hdr;
dev_dbg(&dev->pdev->dev, "mei_hdr->length =%d\n", mei_hdr->length); dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(mei_hdr));
if (mei_hdr->reserved || !dev->rd_msg_hdr) { if (mei_hdr->reserved || !dev->rd_msg_hdr) {
dev_dbg(&dev->pdev->dev, "corrupted message header.\n"); dev_dbg(&dev->pdev->dev, "corrupted message header.\n");
...@@ -835,13 +834,12 @@ static int mei_irq_thread_read_handler(struct mei_cl_cb *cmpl_list, ...@@ -835,13 +834,12 @@ static int mei_irq_thread_read_handler(struct mei_cl_cb *cmpl_list,
(MEI_FILE_CONNECTED == dev->iamthif_cl.state) && (MEI_FILE_CONNECTED == dev->iamthif_cl.state) &&
(dev->iamthif_state == MEI_IAMTHIF_READING)) { (dev->iamthif_state == MEI_IAMTHIF_READING)) {
dev_dbg(&dev->pdev->dev, "call mei_irq_thread_read_iamthif_message.\n"); dev_dbg(&dev->pdev->dev, "call mei_irq_thread_read_iamthif_message.\n");
dev_dbg(&dev->pdev->dev, "mei_hdr->length =%d\n",
mei_hdr->length); dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(mei_hdr));
ret = mei_amthif_irq_read_message(cmpl_list, dev, mei_hdr); ret = mei_amthif_irq_read_message(cmpl_list, dev, mei_hdr);
if (ret) if (ret)
goto end; goto end;
} else { } else {
dev_dbg(&dev->pdev->dev, "call mei_irq_thread_read_client_message.\n"); dev_dbg(&dev->pdev->dev, "call mei_irq_thread_read_client_message.\n");
ret = mei_irq_thread_read_client_message(cmpl_list, ret = mei_irq_thread_read_client_message(cmpl_list,
......
...@@ -552,8 +552,9 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf, ...@@ -552,8 +552,9 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
mei_hdr.host_addr = cl->host_client_id; mei_hdr.host_addr = cl->host_client_id;
mei_hdr.me_addr = cl->me_client_id; mei_hdr.me_addr = cl->me_client_id;
mei_hdr.reserved = 0; mei_hdr.reserved = 0;
dev_dbg(&dev->pdev->dev, "call mei_write_message header=%08x.\n",
*((u32 *) &mei_hdr)); dev_dbg(&dev->pdev->dev, "write " MEI_HDR_FMT "\n",
MEI_HDR_PRM(&mei_hdr));
if (mei_write_message(dev, &mei_hdr, write_cb->request_buffer.data)) { if (mei_write_message(dev, &mei_hdr, write_cb->request_buffer.data)) {
rets = -ENODEV; rets = -ENODEV;
goto err; goto err;
......
...@@ -506,4 +506,9 @@ static inline struct mei_msg_hdr *mei_hbm_hdr(u32 *buf, size_t length) ...@@ -506,4 +506,9 @@ static inline struct mei_msg_hdr *mei_hbm_hdr(u32 *buf, size_t length)
return hdr; return hdr;
} }
#define MEI_HDR_FMT "hdr:host=%02d me=%02d len=%d comp=%1d"
#define MEI_HDR_PRM(hdr) \
(hdr)->host_addr, (hdr)->me_addr, \
(hdr)->length, (hdr)->msg_complete
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment