diff options
author | Jody McIntyre <scjody@steamballoon.com> | 2005-09-30 14:59:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-30 15:41:19 -0400 |
commit | db2fd664f8ac3664dfd94d624c0a871bee937bd5 (patch) | |
tree | 8f05b4870baeabdb45d42ef3e81a8083f3cf498b | |
parent | e31a127c2f99b9cb9abc99a1ec22b75194890800 (diff) |
[PATCH] ieee1394: fix for debug output
Fix debug code so it prints the correct speed (was defaulting to 100, so
anything > 400 showed only 100).
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Ben Collins <bcollins@debian.org>
Signed-off-by: Jody McIntyre <scjody@steamballoon.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/ieee1394/ieee1394_core.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c index d633770fac8e..32a1e016c85e 100644 --- a/drivers/ieee1394/ieee1394_core.c +++ b/drivers/ieee1394/ieee1394_core.c | |||
@@ -70,7 +70,7 @@ const char *hpsb_speedto_str[] = { "S100", "S200", "S400", "S800", "S1600", "S32 | |||
70 | struct class *hpsb_protocol_class; | 70 | struct class *hpsb_protocol_class; |
71 | 71 | ||
72 | #ifdef CONFIG_IEEE1394_VERBOSEDEBUG | 72 | #ifdef CONFIG_IEEE1394_VERBOSEDEBUG |
73 | static void dump_packet(const char *text, quadlet_t *data, int size) | 73 | static void dump_packet(const char *text, quadlet_t *data, int size, int speed) |
74 | { | 74 | { |
75 | int i; | 75 | int i; |
76 | 76 | ||
@@ -78,12 +78,15 @@ static void dump_packet(const char *text, quadlet_t *data, int size) | |||
78 | size = (size > 4 ? 4 : size); | 78 | size = (size > 4 ? 4 : size); |
79 | 79 | ||
80 | printk(KERN_DEBUG "ieee1394: %s", text); | 80 | printk(KERN_DEBUG "ieee1394: %s", text); |
81 | if (speed > -1 && speed < 6) | ||
82 | printk(" at %s", hpsb_speedto_str[speed]); | ||
83 | printk(":"); | ||
81 | for (i = 0; i < size; i++) | 84 | for (i = 0; i < size; i++) |
82 | printk(" %08x", data[i]); | 85 | printk(" %08x", data[i]); |
83 | printk("\n"); | 86 | printk("\n"); |
84 | } | 87 | } |
85 | #else | 88 | #else |
86 | #define dump_packet(x,y,z) | 89 | #define dump_packet(a,b,c,d) |
87 | #endif | 90 | #endif |
88 | 91 | ||
89 | static void abort_requests(struct hpsb_host *host); | 92 | static void abort_requests(struct hpsb_host *host); |
@@ -544,8 +547,7 @@ int hpsb_send_packet(struct hpsb_packet *packet) | |||
544 | if (packet->data_size) | 547 | if (packet->data_size) |
545 | memcpy(((u8*)data) + packet->header_size, packet->data, packet->data_size); | 548 | memcpy(((u8*)data) + packet->header_size, packet->data, packet->data_size); |
546 | 549 | ||
547 | dump_packet("send packet local:", packet->header, | 550 | dump_packet("send packet local", packet->header, packet->header_size, -1); |
548 | packet->header_size); | ||
549 | 551 | ||
550 | hpsb_packet_sent(host, packet, packet->expect_response ? ACK_PENDING : ACK_COMPLETE); | 552 | hpsb_packet_sent(host, packet, packet->expect_response ? ACK_PENDING : ACK_COMPLETE); |
551 | hpsb_packet_received(host, data, size, 0); | 553 | hpsb_packet_received(host, data, size, 0); |
@@ -561,21 +563,7 @@ int hpsb_send_packet(struct hpsb_packet *packet) | |||
561 | + NODEID_TO_NODE(packet->node_id)]; | 563 | + NODEID_TO_NODE(packet->node_id)]; |
562 | } | 564 | } |
563 | 565 | ||
564 | #ifdef CONFIG_IEEE1394_VERBOSEDEBUG | 566 | dump_packet("send packet", packet->header, packet->header_size, packet->speed_code); |
565 | switch (packet->speed_code) { | ||
566 | case 2: | ||
567 | dump_packet("send packet 400:", packet->header, | ||
568 | packet->header_size); | ||
569 | break; | ||
570 | case 1: | ||
571 | dump_packet("send packet 200:", packet->header, | ||
572 | packet->header_size); | ||
573 | break; | ||
574 | default: | ||
575 | dump_packet("send packet 100:", packet->header, | ||
576 | packet->header_size); | ||
577 | } | ||
578 | #endif | ||
579 | 567 | ||
580 | return host->driver->transmit_packet(host, packet); | 568 | return host->driver->transmit_packet(host, packet); |
581 | } | 569 | } |
@@ -636,7 +624,7 @@ static void handle_packet_response(struct hpsb_host *host, int tcode, | |||
636 | 624 | ||
637 | if (packet == NULL) { | 625 | if (packet == NULL) { |
638 | HPSB_DEBUG("unsolicited response packet received - no tlabel match"); | 626 | HPSB_DEBUG("unsolicited response packet received - no tlabel match"); |
639 | dump_packet("contents:", data, 16); | 627 | dump_packet("contents", data, 16, -1); |
640 | spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags); | 628 | spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags); |
641 | return; | 629 | return; |
642 | } | 630 | } |
@@ -677,7 +665,7 @@ static void handle_packet_response(struct hpsb_host *host, int tcode, | |||
677 | if (!tcode_match) { | 665 | if (!tcode_match) { |
678 | spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags); | 666 | spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags); |
679 | HPSB_INFO("unsolicited response packet received - tcode mismatch"); | 667 | HPSB_INFO("unsolicited response packet received - tcode mismatch"); |
680 | dump_packet("contents:", data, 16); | 668 | dump_packet("contents", data, 16, -1); |
681 | return; | 669 | return; |
682 | } | 670 | } |
683 | 671 | ||
@@ -914,7 +902,7 @@ void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size, | |||
914 | return; | 902 | return; |
915 | } | 903 | } |
916 | 904 | ||
917 | dump_packet("received packet:", data, size); | 905 | dump_packet("received packet", data, size, -1); |
918 | 906 | ||
919 | tcode = (data[0] >> 4) & 0xf; | 907 | tcode = (data[0] >> 4) & 0xf; |
920 | 908 | ||