diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2012-12-25 12:06:00 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-07 13:31:28 -0500 |
commit | 15d4acc57f23b6e02e587b773458a7c0e23e501d (patch) | |
tree | df97d1e6c202ffce113adba34cb504e446e95b15 | |
parent | 438763f37eb9664b6372bdfee990f8c33acdc63c (diff) |
mei: use unified format for printing mei message header
Introduce MEI_HDR_FMT and MEI_HDR_PRM macros.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/misc/mei/amthif.c | 3 | ||||
-rw-r--r-- | drivers/misc/mei/interface.c | 4 | ||||
-rw-r--r-- | drivers/misc/mei/interrupt.c | 14 | ||||
-rw-r--r-- | drivers/misc/mei/main.c | 5 | ||||
-rw-r--r-- | drivers/misc/mei/mei_dev.h | 5 |
5 files changed, 16 insertions, 15 deletions
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c index 8a9313a1ee7b..77acd2349b1b 100644 --- a/drivers/misc/mei/amthif.c +++ b/drivers/misc/mei/amthif.c | |||
@@ -457,8 +457,7 @@ int mei_amthif_irq_write_complete(struct mei_device *dev, s32 *slots, | |||
457 | return 0; | 457 | return 0; |
458 | } | 458 | } |
459 | 459 | ||
460 | dev_dbg(&dev->pdev->dev, "msg: len = %d complete = %d\n", | 460 | dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(mei_hdr)); |
461 | mei_hdr->length, mei_hdr->msg_complete); | ||
462 | 461 | ||
463 | *slots -= msg_slots; | 462 | *slots -= msg_slots; |
464 | if (mei_write_message(dev, mei_hdr, | 463 | if (mei_write_message(dev, mei_hdr, |
diff --git a/drivers/misc/mei/interface.c b/drivers/misc/mei/interface.c index 21ccbe6f7162..17d93f71d6bf 100644 --- a/drivers/misc/mei/interface.c +++ b/drivers/misc/mei/interface.c | |||
@@ -127,9 +127,7 @@ int mei_write_message(struct mei_device *dev, struct mei_msg_hdr *header, | |||
127 | int i; | 127 | int i; |
128 | int empty_slots; | 128 | int empty_slots; |
129 | 129 | ||
130 | dev_dbg(&dev->pdev->dev, | 130 | dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(header)); |
131 | "mei_write_message header=%08x.\n", | ||
132 | *((u32 *) header)); | ||
133 | 131 | ||
134 | empty_slots = mei_hbuf_empty_slots(dev); | 132 | empty_slots = mei_hbuf_empty_slots(dev); |
135 | dev_dbg(&dev->pdev->dev, "empty slots = %hu.\n", empty_slots); | 133 | dev_dbg(&dev->pdev->dev, "empty slots = %hu.\n", empty_slots); |
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index b72fa8196ddb..fe93d1c9c242 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c | |||
@@ -150,8 +150,8 @@ quit: | |||
150 | dev_dbg(&dev->pdev->dev, "message read\n"); | 150 | dev_dbg(&dev->pdev->dev, "message read\n"); |
151 | if (!buffer) { | 151 | if (!buffer) { |
152 | mei_read_slots(dev, dev->rd_msg_buf, mei_hdr->length); | 152 | mei_read_slots(dev, dev->rd_msg_buf, mei_hdr->length); |
153 | dev_dbg(&dev->pdev->dev, "discarding message, header =%08x.\n", | 153 | dev_dbg(&dev->pdev->dev, "discarding message " MEI_HDR_FMT "\n", |
154 | *(u32 *) dev->rd_msg_buf); | 154 | MEI_HDR_PRM(mei_hdr)); |
155 | } | 155 | } |
156 | 156 | ||
157 | return 0; | 157 | return 0; |
@@ -742,8 +742,7 @@ static int mei_irq_thread_write_complete(struct mei_device *dev, s32 *slots, | |||
742 | 742 | ||
743 | dev_dbg(&dev->pdev->dev, "buf: size = %d idx = %lu\n", | 743 | dev_dbg(&dev->pdev->dev, "buf: size = %d idx = %lu\n", |
744 | cb->request_buffer.size, cb->buf_idx); | 744 | cb->request_buffer.size, cb->buf_idx); |
745 | dev_dbg(&dev->pdev->dev, "msg: len = %d complete = %d\n", | 745 | dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(mei_hdr)); |
746 | mei_hdr->length, mei_hdr->msg_complete); | ||
747 | 746 | ||
748 | *slots -= msg_slots; | 747 | *slots -= msg_slots; |
749 | if (mei_write_message(dev, mei_hdr, | 748 | 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 | dev_dbg(&dev->pdev->dev, "slots =%08x.\n", *slots); | 789 | dev_dbg(&dev->pdev->dev, "slots =%08x.\n", *slots); |
791 | } | 790 | } |
792 | mei_hdr = (struct mei_msg_hdr *) &dev->rd_msg_hdr; | 791 | mei_hdr = (struct mei_msg_hdr *) &dev->rd_msg_hdr; |
793 | dev_dbg(&dev->pdev->dev, "mei_hdr->length =%d\n", mei_hdr->length); | 792 | dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(mei_hdr)); |
794 | 793 | ||
795 | if (mei_hdr->reserved || !dev->rd_msg_hdr) { | 794 | if (mei_hdr->reserved || !dev->rd_msg_hdr) { |
796 | dev_dbg(&dev->pdev->dev, "corrupted message header.\n"); | 795 | 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 | (MEI_FILE_CONNECTED == dev->iamthif_cl.state) && | 834 | (MEI_FILE_CONNECTED == dev->iamthif_cl.state) && |
836 | (dev->iamthif_state == MEI_IAMTHIF_READING)) { | 835 | (dev->iamthif_state == MEI_IAMTHIF_READING)) { |
837 | dev_dbg(&dev->pdev->dev, "call mei_irq_thread_read_iamthif_message.\n"); | 836 | dev_dbg(&dev->pdev->dev, "call mei_irq_thread_read_iamthif_message.\n"); |
838 | dev_dbg(&dev->pdev->dev, "mei_hdr->length =%d\n", | 837 | |
839 | mei_hdr->length); | 838 | dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(mei_hdr)); |
840 | 839 | ||
841 | ret = mei_amthif_irq_read_message(cmpl_list, dev, mei_hdr); | 840 | ret = mei_amthif_irq_read_message(cmpl_list, dev, mei_hdr); |
842 | if (ret) | 841 | if (ret) |
843 | goto end; | 842 | goto end; |
844 | |||
845 | } else { | 843 | } else { |
846 | dev_dbg(&dev->pdev->dev, "call mei_irq_thread_read_client_message.\n"); | 844 | dev_dbg(&dev->pdev->dev, "call mei_irq_thread_read_client_message.\n"); |
847 | ret = mei_irq_thread_read_client_message(cmpl_list, | 845 | ret = mei_irq_thread_read_client_message(cmpl_list, |
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index b281c235d898..7751b58540ac 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c | |||
@@ -552,8 +552,9 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf, | |||
552 | mei_hdr.host_addr = cl->host_client_id; | 552 | mei_hdr.host_addr = cl->host_client_id; |
553 | mei_hdr.me_addr = cl->me_client_id; | 553 | mei_hdr.me_addr = cl->me_client_id; |
554 | mei_hdr.reserved = 0; | 554 | mei_hdr.reserved = 0; |
555 | dev_dbg(&dev->pdev->dev, "call mei_write_message header=%08x.\n", | 555 | |
556 | *((u32 *) &mei_hdr)); | 556 | dev_dbg(&dev->pdev->dev, "write " MEI_HDR_FMT "\n", |
557 | MEI_HDR_PRM(&mei_hdr)); | ||
557 | if (mei_write_message(dev, &mei_hdr, write_cb->request_buffer.data)) { | 558 | if (mei_write_message(dev, &mei_hdr, write_cb->request_buffer.data)) { |
558 | rets = -ENODEV; | 559 | rets = -ENODEV; |
559 | goto err; | 560 | goto err; |
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h index 25da04549d04..da0980531c62 100644 --- a/drivers/misc/mei/mei_dev.h +++ b/drivers/misc/mei/mei_dev.h | |||
@@ -506,4 +506,9 @@ static inline struct mei_msg_hdr *mei_hbm_hdr(u32 *buf, size_t length) | |||
506 | return hdr; | 506 | return hdr; |
507 | } | 507 | } |
508 | 508 | ||
509 | #define MEI_HDR_FMT "hdr:host=%02d me=%02d len=%d comp=%1d" | ||
510 | #define MEI_HDR_PRM(hdr) \ | ||
511 | (hdr)->host_addr, (hdr)->me_addr, \ | ||
512 | (hdr)->length, (hdr)->msg_complete | ||
513 | |||
509 | #endif | 514 | #endif |