diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-04-01 20:24:27 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-04-29 18:00:32 -0400 |
commit | fdc0092bfd68cedfb9929256957f64c2c2760b5c (patch) | |
tree | 5b63e524b6777dfab10cbd97465c95c3478a58dc | |
parent | 53f374e76c2b37835966382b27efb6bb3715f9d8 (diff) |
ieee1394: eth1394: correct return codes in hard_start_xmit
This patch actually doesn't change anything because there was always 0
== NETDEV_TX_OK returned before.
TODO: Return NETDEV_TX_BUSY in error case and test in different error
conditions.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
-rw-r--r-- | drivers/ieee1394/eth1394.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index b5cd10786f7e..1c26322c25af 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c | |||
@@ -1527,7 +1527,6 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) | |||
1527 | unsigned long flags; | 1527 | unsigned long flags; |
1528 | nodeid_t dest_node; | 1528 | nodeid_t dest_node; |
1529 | eth1394_tx_type tx_type; | 1529 | eth1394_tx_type tx_type; |
1530 | int ret = 0; | ||
1531 | unsigned int tx_len; | 1530 | unsigned int tx_len; |
1532 | unsigned int max_payload; | 1531 | unsigned int max_payload; |
1533 | u16 dg_size; | 1532 | u16 dg_size; |
@@ -1537,26 +1536,20 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) | |||
1537 | struct eth1394_node_info *node_info = NULL; | 1536 | struct eth1394_node_info *node_info = NULL; |
1538 | 1537 | ||
1539 | ptask = kmem_cache_alloc(packet_task_cache, GFP_ATOMIC); | 1538 | ptask = kmem_cache_alloc(packet_task_cache, GFP_ATOMIC); |
1540 | if (ptask == NULL) { | 1539 | if (ptask == NULL) |
1541 | ret = -ENOMEM; | ||
1542 | goto fail; | 1540 | goto fail; |
1543 | } | ||
1544 | 1541 | ||
1545 | /* XXX Ignore this for now. Noticed that when MacOSX is the IRM, | 1542 | /* XXX Ignore this for now. Noticed that when MacOSX is the IRM, |
1546 | * it does not set our validity bit. We need to compensate for | 1543 | * it does not set our validity bit. We need to compensate for |
1547 | * that somewhere else, but not in eth1394. */ | 1544 | * that somewhere else, but not in eth1394. */ |
1548 | #if 0 | 1545 | #if 0 |
1549 | if ((priv->host->csr.broadcast_channel & 0xc0000000) != 0xc0000000) { | 1546 | if ((priv->host->csr.broadcast_channel & 0xc0000000) != 0xc0000000) |
1550 | ret = -EAGAIN; | ||
1551 | goto fail; | 1547 | goto fail; |
1552 | } | ||
1553 | #endif | 1548 | #endif |
1554 | 1549 | ||
1555 | skb = skb_share_check(skb, GFP_ATOMIC); | 1550 | skb = skb_share_check(skb, GFP_ATOMIC); |
1556 | if (!skb) { | 1551 | if (!skb) |
1557 | ret = -ENOMEM; | ||
1558 | goto fail; | 1552 | goto fail; |
1559 | } | ||
1560 | 1553 | ||
1561 | /* Get rid of the fake eth1394 header, but save a pointer */ | 1554 | /* Get rid of the fake eth1394 header, but save a pointer */ |
1562 | eth = (struct eth1394hdr *)skb->data; | 1555 | eth = (struct eth1394hdr *)skb->data; |
@@ -1583,16 +1576,13 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) | |||
1583 | 1576 | ||
1584 | node = eth1394_find_node_guid(&priv->ip_node_list, | 1577 | node = eth1394_find_node_guid(&priv->ip_node_list, |
1585 | be64_to_cpu(guid)); | 1578 | be64_to_cpu(guid)); |
1586 | if (!node) { | 1579 | if (!node) |
1587 | ret = -EAGAIN; | ||
1588 | goto fail; | 1580 | goto fail; |
1589 | } | 1581 | |
1590 | node_info = | 1582 | node_info = |
1591 | (struct eth1394_node_info *)node->ud->device.driver_data; | 1583 | (struct eth1394_node_info *)node->ud->device.driver_data; |
1592 | if (node_info->fifo == CSR1212_INVALID_ADDR_SPACE) { | 1584 | if (node_info->fifo == CSR1212_INVALID_ADDR_SPACE) |
1593 | ret = -EAGAIN; | ||
1594 | goto fail; | 1585 | goto fail; |
1595 | } | ||
1596 | 1586 | ||
1597 | dest_node = node->ud->ne->nodeid; | 1587 | dest_node = node->ud->ne->nodeid; |
1598 | max_payload = node_info->maxpayload; | 1588 | max_payload = node_info->maxpayload; |
@@ -1639,7 +1629,7 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) | |||
1639 | goto fail; | 1629 | goto fail; |
1640 | 1630 | ||
1641 | netif_wake_queue(dev); | 1631 | netif_wake_queue(dev); |
1642 | return 0; | 1632 | return NETDEV_TX_OK; |
1643 | fail: | 1633 | fail: |
1644 | if (ptask) | 1634 | if (ptask) |
1645 | kmem_cache_free(packet_task_cache, ptask); | 1635 | kmem_cache_free(packet_task_cache, ptask); |
@@ -1655,7 +1645,15 @@ fail: | |||
1655 | if (netif_queue_stopped(dev)) | 1645 | if (netif_queue_stopped(dev)) |
1656 | netif_wake_queue(dev); | 1646 | netif_wake_queue(dev); |
1657 | 1647 | ||
1658 | return 0; /* returning non-zero causes serious problems */ | 1648 | /* |
1649 | * FIXME: According to a patch from 2003-02-26, "returning non-zero | ||
1650 | * causes serious problems" here, allegedly. Before that patch, | ||
1651 | * -ERRNO was returned which is not appropriate under Linux 2.6. | ||
1652 | * Perhaps more needs to be done? Stop the queue in serious | ||
1653 | * conditions and restart it elsewhere? | ||
1654 | */ | ||
1655 | /* return NETDEV_TX_BUSY; */ | ||
1656 | return NETDEV_TX_OK; | ||
1659 | } | 1657 | } |
1660 | 1658 | ||
1661 | static void ether1394_get_drvinfo(struct net_device *dev, | 1659 | static void ether1394_get_drvinfo(struct net_device *dev, |