Skip to content

Commit

Permalink
[PATCH] ieee1394: fix for debug output
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jody McIntyre authored and Linus Torvalds committed Sep 30, 2005
1 parent e31a127 commit db2fd66
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions drivers/ieee1394/ieee1394_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,23 @@ const char *hpsb_speedto_str[] = { "S100", "S200", "S400", "S800", "S1600", "S32
struct class *hpsb_protocol_class;

#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
static void dump_packet(const char *text, quadlet_t *data, int size)
static void dump_packet(const char *text, quadlet_t *data, int size, int speed)
{
int i;

size /= 4;
size = (size > 4 ? 4 : size);

printk(KERN_DEBUG "ieee1394: %s", text);
if (speed > -1 && speed < 6)
printk(" at %s", hpsb_speedto_str[speed]);
printk(":");
for (i = 0; i < size; i++)
printk(" %08x", data[i]);
printk("\n");
}
#else
#define dump_packet(x,y,z)
#define dump_packet(a,b,c,d)
#endif

static void abort_requests(struct hpsb_host *host);
Expand Down Expand Up @@ -544,8 +547,7 @@ int hpsb_send_packet(struct hpsb_packet *packet)
if (packet->data_size)
memcpy(((u8*)data) + packet->header_size, packet->data, packet->data_size);

dump_packet("send packet local:", packet->header,
packet->header_size);
dump_packet("send packet local", packet->header, packet->header_size, -1);

hpsb_packet_sent(host, packet, packet->expect_response ? ACK_PENDING : ACK_COMPLETE);
hpsb_packet_received(host, data, size, 0);
Expand All @@ -561,21 +563,7 @@ int hpsb_send_packet(struct hpsb_packet *packet)
+ NODEID_TO_NODE(packet->node_id)];
}

#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
switch (packet->speed_code) {
case 2:
dump_packet("send packet 400:", packet->header,
packet->header_size);
break;
case 1:
dump_packet("send packet 200:", packet->header,
packet->header_size);
break;
default:
dump_packet("send packet 100:", packet->header,
packet->header_size);
}
#endif
dump_packet("send packet", packet->header, packet->header_size, packet->speed_code);

return host->driver->transmit_packet(host, packet);
}
Expand Down Expand Up @@ -636,7 +624,7 @@ static void handle_packet_response(struct hpsb_host *host, int tcode,

if (packet == NULL) {
HPSB_DEBUG("unsolicited response packet received - no tlabel match");
dump_packet("contents:", data, 16);
dump_packet("contents", data, 16, -1);
spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
return;
}
Expand Down Expand Up @@ -677,7 +665,7 @@ static void handle_packet_response(struct hpsb_host *host, int tcode,
if (!tcode_match) {
spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
HPSB_INFO("unsolicited response packet received - tcode mismatch");
dump_packet("contents:", data, 16);
dump_packet("contents", data, 16, -1);
return;
}

Expand Down Expand Up @@ -914,7 +902,7 @@ void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size,
return;
}

dump_packet("received packet:", data, size);
dump_packet("received packet", data, size, -1);

tcode = (data[0] >> 4) & 0xf;

Expand Down

0 comments on commit db2fd66

Please sign in to comment.