diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-04-01 20:15:53 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-04-29 18:00:31 -0400 |
commit | 5009d269610b4c89761dcae296d9717f2f48234b (patch) | |
tree | 7753da19305d143a9018ed07ab021898a869dc9c /drivers/ieee1394/eth1394.c | |
parent | 027611b84260cf3adf14e30d2480007795829e6e (diff) |
ieee1394: eth1394: shorter error messages
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394/eth1394.c')
-rw-r--r-- | drivers/ieee1394/eth1394.c | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 9521d8e241ad..049f095ddff9 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c | |||
@@ -196,9 +196,8 @@ static struct hpsb_highlevel eth1394_highlevel = { | |||
196 | .host_reset = ether1394_host_reset, | 196 | .host_reset = ether1394_host_reset, |
197 | }; | 197 | }; |
198 | 198 | ||
199 | static int ether1394_recv_init(struct net_device *dev) | 199 | static int ether1394_recv_init(struct eth1394_priv *priv) |
200 | { | 200 | { |
201 | struct eth1394_priv *priv = netdev_priv(dev); | ||
202 | unsigned int iso_buf_size; | 201 | unsigned int iso_buf_size; |
203 | 202 | ||
204 | /* FIXME: rawiso limits us to PAGE_SIZE */ | 203 | /* FIXME: rawiso limits us to PAGE_SIZE */ |
@@ -212,9 +211,7 @@ static int ether1394_recv_init(struct net_device *dev) | |||
212 | HPSB_ISO_DMA_PACKET_PER_BUFFER, | 211 | HPSB_ISO_DMA_PACKET_PER_BUFFER, |
213 | 1, ether1394_iso); | 212 | 1, ether1394_iso); |
214 | if (priv->iso == NULL) { | 213 | if (priv->iso == NULL) { |
215 | ETH1394_PRINT(KERN_ERR, dev->name, | 214 | ETH1394_PRINT_G(KERN_ERR, "Failed to allocate IR context\n"); |
216 | "Could not allocate isochronous receive " | ||
217 | "context for the broadcast channel\n"); | ||
218 | priv->bc_state = ETHER1394_BC_ERROR; | 215 | priv->bc_state = ETHER1394_BC_ERROR; |
219 | return -EAGAIN; | 216 | return -EAGAIN; |
220 | } | 217 | } |
@@ -233,7 +230,7 @@ static int ether1394_open(struct net_device *dev) | |||
233 | int ret; | 230 | int ret; |
234 | 231 | ||
235 | if (priv->bc_state == ETHER1394_BC_ERROR) { | 232 | if (priv->bc_state == ETHER1394_BC_ERROR) { |
236 | ret = ether1394_recv_init(dev); | 233 | ret = ether1394_recv_init(priv); |
237 | if (ret) | 234 | if (ret) |
238 | return ret; | 235 | return ret; |
239 | } | 236 | } |
@@ -560,9 +557,7 @@ static void ether1394_add_host(struct hpsb_host *host) | |||
560 | dev = alloc_etherdev(sizeof (struct eth1394_priv)); | 557 | dev = alloc_etherdev(sizeof (struct eth1394_priv)); |
561 | 558 | ||
562 | if (dev == NULL) { | 559 | if (dev == NULL) { |
563 | ETH1394_PRINT_G (KERN_ERR, "Out of memory trying to allocate " | 560 | ETH1394_PRINT_G(KERN_ERR, "Out of memory\n"); |
564 | "etherdevice for IEEE 1394 device %s-%d\n", | ||
565 | host->driver->name, host->id); | ||
566 | goto out; | 561 | goto out; |
567 | } | 562 | } |
568 | 563 | ||
@@ -583,21 +578,19 @@ static void ether1394_add_host(struct hpsb_host *host) | |||
583 | hi = hpsb_create_hostinfo(ð1394_highlevel, host, sizeof(*hi)); | 578 | hi = hpsb_create_hostinfo(ð1394_highlevel, host, sizeof(*hi)); |
584 | 579 | ||
585 | if (hi == NULL) { | 580 | if (hi == NULL) { |
586 | ETH1394_PRINT_G (KERN_ERR, "Out of memory trying to create " | 581 | ETH1394_PRINT_G(KERN_ERR, "Out of memory\n"); |
587 | "hostinfo for IEEE 1394 device %s-%d\n", | ||
588 | host->driver->name, host->id); | ||
589 | goto out; | 582 | goto out; |
590 | } | 583 | } |
591 | 584 | ||
592 | ether1394_init_dev(dev); | 585 | ether1394_init_dev(dev); |
593 | 586 | ||
594 | if (register_netdev (dev)) { | 587 | if (register_netdev(dev)) { |
595 | ETH1394_PRINT (KERN_ERR, dev->name, "Error registering network driver\n"); | 588 | ETH1394_PRINT_G(KERN_ERR, "Cannot register the driver\n"); |
596 | goto out; | 589 | goto out; |
597 | } | 590 | } |
598 | 591 | ||
599 | ETH1394_PRINT (KERN_INFO, dev->name, "IEEE-1394 IPv4 over 1394 Ethernet (fw-host%d)\n", | 592 | ETH1394_PRINT(KERN_INFO, dev->name, "IPv4 over IEEE 1394 (fw-host%d)\n", |
600 | host->id); | 593 | host->id); |
601 | 594 | ||
602 | hi->host = host; | 595 | hi->host = host; |
603 | hi->dev = dev; | 596 | hi->dev = dev; |
@@ -606,7 +599,7 @@ static void ether1394_add_host(struct hpsb_host *host) | |||
606 | * be checked when the eth device is opened. */ | 599 | * be checked when the eth device is opened. */ |
607 | priv->broadcast_channel = host->csr.broadcast_channel & 0x3f; | 600 | priv->broadcast_channel = host->csr.broadcast_channel & 0x3f; |
608 | 601 | ||
609 | ether1394_recv_init(dev); | 602 | ether1394_recv_init(priv); |
610 | return; | 603 | return; |
611 | out: | 604 | out: |
612 | if (dev) | 605 | if (dev) |
@@ -1084,7 +1077,7 @@ static int ether1394_data_handler(struct net_device *dev, int srcid, int destid, | |||
1084 | 1077 | ||
1085 | skb = dev_alloc_skb(len + dev->hard_header_len + 15); | 1078 | skb = dev_alloc_skb(len + dev->hard_header_len + 15); |
1086 | if (!skb) { | 1079 | if (!skb) { |
1087 | HPSB_PRINT (KERN_ERR, "ether1394 rx: low on mem\n"); | 1080 | ETH1394_PRINT_G(KERN_ERR, "Out of memory\n"); |
1088 | priv->stats.rx_dropped++; | 1081 | priv->stats.rx_dropped++; |
1089 | return -1; | 1082 | return -1; |
1090 | } | 1083 | } |
@@ -1239,8 +1232,8 @@ static int ether1394_write(struct hpsb_host *host, int srcid, int destid, | |||
1239 | 1232 | ||
1240 | hi = hpsb_get_hostinfo(ð1394_highlevel, host); | 1233 | hi = hpsb_get_hostinfo(ð1394_highlevel, host); |
1241 | if (hi == NULL) { | 1234 | if (hi == NULL) { |
1242 | ETH1394_PRINT_G(KERN_ERR, "Could not find net device for host %s\n", | 1235 | ETH1394_PRINT_G(KERN_ERR, "No net device at fw-host%d\n", |
1243 | host->driver->name); | 1236 | host->id); |
1244 | return RCODE_ADDRESS_ERROR; | 1237 | return RCODE_ADDRESS_ERROR; |
1245 | } | 1238 | } |
1246 | 1239 | ||
@@ -1265,8 +1258,8 @@ static void ether1394_iso(struct hpsb_iso *iso) | |||
1265 | 1258 | ||
1266 | hi = hpsb_get_hostinfo(ð1394_highlevel, iso->host); | 1259 | hi = hpsb_get_hostinfo(ð1394_highlevel, iso->host); |
1267 | if (hi == NULL) { | 1260 | if (hi == NULL) { |
1268 | ETH1394_PRINT_G(KERN_ERR, "Could not find net device for host %s\n", | 1261 | ETH1394_PRINT_G(KERN_ERR, "No net device at fw-host%d\n", |
1269 | iso->host->driver->name); | 1262 | iso->host->id); |
1270 | return; | 1263 | return; |
1271 | } | 1264 | } |
1272 | 1265 | ||
@@ -1426,8 +1419,7 @@ static int ether1394_prep_write_packet(struct hpsb_packet *p, | |||
1426 | p->expect_response = 1; | 1419 | p->expect_response = 1; |
1427 | 1420 | ||
1428 | if (hpsb_get_tlabel(p)) { | 1421 | if (hpsb_get_tlabel(p)) { |
1429 | ETH1394_PRINT_G(KERN_ERR, "No more tlabels left while sending " | 1422 | ETH1394_PRINT_G(KERN_ERR, "Out of tlabels\n"); |
1430 | "to node " NODE_BUS_FMT "\n", NODE_BUS_ARGS(host, node)); | ||
1431 | return -1; | 1423 | return -1; |
1432 | } | 1424 | } |
1433 | p->header[0] = | 1425 | p->header[0] = |