diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2012-02-19 06:48:36 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2012-02-22 16:36:00 -0500 |
commit | 8408dc1c14c113face77f6f967af98f76999989f (patch) | |
tree | 988695127b32317c85787e545ad00eda4c4bb1c2 /drivers/firewire/net.c | |
parent | 59759ff6f151dab70cc227c337fc54da221cf8d7 (diff) |
firewire: net: use dev_printk API
Change the log line prefix from "firewire_net: " to "net firewire0: "
etc. for the case that several RFC 2734 interfaces are being used in the
same machine.
Note, the netdev_printk API is not very useful to firewire-net.
netdev_notice(net, "abc\n") would result in irritating messages like
"firewire_ohci 0000:0a:00.0: firewire0: abc". Nor would a dev_printk on
the fw_unit.device to which firewire-net is being bound be useful,
because there are generally multiple ones of those per interface (from
all RFC 2734 peers on the bus, the local node being only one of them).
In the initialization message of each interface, log the PCI device
name of the card which is parent of the netdevice instead of the GUID
of the peer which was semi-randomly used to establish the netdevice.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/net.c')
-rw-r--r-- | drivers/firewire/net.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index fa305187f468..08c674957af8 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c | |||
@@ -256,8 +256,8 @@ static int fwnet_header_rebuild(struct sk_buff *skb) | |||
256 | if (get_unaligned_be16(&h->h_proto) == ETH_P_IP) | 256 | if (get_unaligned_be16(&h->h_proto) == ETH_P_IP) |
257 | return arp_find((unsigned char *)&h->h_dest, skb); | 257 | return arp_find((unsigned char *)&h->h_dest, skb); |
258 | 258 | ||
259 | fw_notify("%s: unable to resolve type %04x addresses\n", | 259 | dev_notice(&skb->dev->dev, "unable to resolve type %04x addresses\n", |
260 | skb->dev->name, be16_to_cpu(h->h_proto)); | 260 | be16_to_cpu(h->h_proto)); |
261 | return 0; | 261 | return 0; |
262 | } | 262 | } |
263 | 263 | ||
@@ -369,7 +369,7 @@ static struct fwnet_fragment_info *fwnet_frag_new( | |||
369 | 369 | ||
370 | new = kmalloc(sizeof(*new), GFP_ATOMIC); | 370 | new = kmalloc(sizeof(*new), GFP_ATOMIC); |
371 | if (!new) { | 371 | if (!new) { |
372 | fw_error("out of memory\n"); | 372 | dev_err(&pd->skb->dev->dev, "out of memory\n"); |
373 | return NULL; | 373 | return NULL; |
374 | } | 374 | } |
375 | 375 | ||
@@ -414,7 +414,7 @@ fail_w_fi: | |||
414 | fail_w_new: | 414 | fail_w_new: |
415 | kfree(new); | 415 | kfree(new); |
416 | fail: | 416 | fail: |
417 | fw_error("out of memory\n"); | 417 | dev_err(&net->dev, "out of memory\n"); |
418 | 418 | ||
419 | return NULL; | 419 | return NULL; |
420 | } | 420 | } |
@@ -554,7 +554,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net, | |||
554 | sspd = arp1394->sspd; | 554 | sspd = arp1394->sspd; |
555 | /* Sanity check. OS X 10.3 PPC reportedly sends 131. */ | 555 | /* Sanity check. OS X 10.3 PPC reportedly sends 131. */ |
556 | if (sspd > SCODE_3200) { | 556 | if (sspd > SCODE_3200) { |
557 | fw_notify("sspd %x out of range\n", sspd); | 557 | dev_notice(&net->dev, "sspd %x out of range\n", sspd); |
558 | sspd = SCODE_3200; | 558 | sspd = SCODE_3200; |
559 | } | 559 | } |
560 | max_payload = fwnet_max_payload(arp1394->max_rec, sspd); | 560 | max_payload = fwnet_max_payload(arp1394->max_rec, sspd); |
@@ -574,8 +574,9 @@ static int fwnet_finish_incoming_packet(struct net_device *net, | |||
574 | spin_unlock_irqrestore(&dev->lock, flags); | 574 | spin_unlock_irqrestore(&dev->lock, flags); |
575 | 575 | ||
576 | if (!peer) { | 576 | if (!peer) { |
577 | fw_notify("No peer for ARP packet from %016llx\n", | 577 | dev_notice(&net->dev, |
578 | (unsigned long long)peer_guid); | 578 | "no peer for ARP packet from %016llx\n", |
579 | (unsigned long long)peer_guid); | ||
579 | goto no_peer; | 580 | goto no_peer; |
580 | } | 581 | } |
581 | 582 | ||
@@ -691,7 +692,7 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len, | |||
691 | 692 | ||
692 | skb = dev_alloc_skb(len + net->hard_header_len + 15); | 693 | skb = dev_alloc_skb(len + net->hard_header_len + 15); |
693 | if (unlikely(!skb)) { | 694 | if (unlikely(!skb)) { |
694 | fw_error("out of memory\n"); | 695 | dev_err(&net->dev, "out of memory\n"); |
695 | net->stats.rx_dropped++; | 696 | net->stats.rx_dropped++; |
696 | 697 | ||
697 | return -ENOMEM; | 698 | return -ENOMEM; |
@@ -814,7 +815,7 @@ static void fwnet_receive_packet(struct fw_card *card, struct fw_request *r, | |||
814 | rcode = RCODE_TYPE_ERROR; | 815 | rcode = RCODE_TYPE_ERROR; |
815 | else if (fwnet_incoming_packet(dev, payload, length, | 816 | else if (fwnet_incoming_packet(dev, payload, length, |
816 | source, generation, false) != 0) { | 817 | source, generation, false) != 0) { |
817 | fw_error("Incoming packet failure\n"); | 818 | dev_err(&dev->netdev->dev, "incoming packet failure\n"); |
818 | rcode = RCODE_CONFLICT_ERROR; | 819 | rcode = RCODE_CONFLICT_ERROR; |
819 | } else | 820 | } else |
820 | rcode = RCODE_COMPLETE; | 821 | rcode = RCODE_COMPLETE; |
@@ -881,7 +882,7 @@ static void fwnet_receive_broadcast(struct fw_iso_context *context, | |||
881 | if (retval >= 0) | 882 | if (retval >= 0) |
882 | fw_iso_context_queue_flush(dev->broadcast_rcv_context); | 883 | fw_iso_context_queue_flush(dev->broadcast_rcv_context); |
883 | else | 884 | else |
884 | fw_error("requeue failed\n"); | 885 | dev_err(&dev->netdev->dev, "requeue failed\n"); |
885 | } | 886 | } |
886 | 887 | ||
887 | static struct kmem_cache *fwnet_packet_task_cache; | 888 | static struct kmem_cache *fwnet_packet_task_cache; |
@@ -936,9 +937,10 @@ static void fwnet_transmit_packet_done(struct fwnet_packet_task *ptask) | |||
936 | case RFC2374_HDR_LASTFRAG: | 937 | case RFC2374_HDR_LASTFRAG: |
937 | case RFC2374_HDR_UNFRAG: | 938 | case RFC2374_HDR_UNFRAG: |
938 | default: | 939 | default: |
939 | fw_error("Outstanding packet %x lf %x, header %x,%x\n", | 940 | dev_err(&dev->netdev->dev, |
940 | ptask->outstanding_pkts, lf, ptask->hdr.w0, | 941 | "outstanding packet %x lf %x, header %x,%x\n", |
941 | ptask->hdr.w1); | 942 | ptask->outstanding_pkts, lf, ptask->hdr.w0, |
943 | ptask->hdr.w1); | ||
942 | BUG(); | 944 | BUG(); |
943 | 945 | ||
944 | case RFC2374_HDR_FIRSTFRAG: | 946 | case RFC2374_HDR_FIRSTFRAG: |
@@ -1010,8 +1012,9 @@ static void fwnet_write_complete(struct fw_card *card, int rcode, | |||
1010 | fwnet_transmit_packet_failed(ptask); | 1012 | fwnet_transmit_packet_failed(ptask); |
1011 | 1013 | ||
1012 | if (printk_timed_ratelimit(&j, 1000) || rcode != last_rcode) { | 1014 | if (printk_timed_ratelimit(&j, 1000) || rcode != last_rcode) { |
1013 | fw_error("fwnet_write_complete: " | 1015 | dev_err(&ptask->dev->netdev->dev, |
1014 | "failed: %x (skipped %d)\n", rcode, errors_skipped); | 1016 | "fwnet_write_complete failed: %x (skipped %d)\n", |
1017 | rcode, errors_skipped); | ||
1015 | 1018 | ||
1016 | errors_skipped = 0; | 1019 | errors_skipped = 0; |
1017 | last_rcode = rcode; | 1020 | last_rcode = rcode; |
@@ -1539,14 +1542,12 @@ static int fwnet_probe(struct device *_dev) | |||
1539 | put_unaligned_be64(card->guid, net->dev_addr); | 1542 | put_unaligned_be64(card->guid, net->dev_addr); |
1540 | put_unaligned_be64(~0ULL, net->broadcast); | 1543 | put_unaligned_be64(~0ULL, net->broadcast); |
1541 | ret = register_netdev(net); | 1544 | ret = register_netdev(net); |
1542 | if (ret) { | 1545 | if (ret) |
1543 | fw_error("Cannot register the driver\n"); | ||
1544 | goto out; | 1546 | goto out; |
1545 | } | ||
1546 | 1547 | ||
1547 | list_add_tail(&dev->dev_link, &fwnet_device_list); | 1548 | list_add_tail(&dev->dev_link, &fwnet_device_list); |
1548 | fw_notify("%s: IPv4 over FireWire on device %016llx\n", | 1549 | dev_notice(&net->dev, "IPv4 over IEEE 1394 on card %s\n", |
1549 | net->name, (unsigned long long)card->guid); | 1550 | dev_name(card->device)); |
1550 | have_dev: | 1551 | have_dev: |
1551 | ret = fwnet_add_peer(dev, unit, device); | 1552 | ret = fwnet_add_peer(dev, unit, device); |
1552 | if (ret && allocated_netdev) { | 1553 | if (ret && allocated_netdev) { |