Commit fdc0092b authored by Stefan Richter's avatar Stefan Richter

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: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
parent 53f374e7
...@@ -1527,7 +1527,6 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -1527,7 +1527,6 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
unsigned long flags; unsigned long flags;
nodeid_t dest_node; nodeid_t dest_node;
eth1394_tx_type tx_type; eth1394_tx_type tx_type;
int ret = 0;
unsigned int tx_len; unsigned int tx_len;
unsigned int max_payload; unsigned int max_payload;
u16 dg_size; u16 dg_size;
...@@ -1537,26 +1536,20 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -1537,26 +1536,20 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
struct eth1394_node_info *node_info = NULL; struct eth1394_node_info *node_info = NULL;
ptask = kmem_cache_alloc(packet_task_cache, GFP_ATOMIC); ptask = kmem_cache_alloc(packet_task_cache, GFP_ATOMIC);
if (ptask == NULL) { if (ptask == NULL)
ret = -ENOMEM;
goto fail; goto fail;
}
/* XXX Ignore this for now. Noticed that when MacOSX is the IRM, /* XXX Ignore this for now. Noticed that when MacOSX is the IRM,
* it does not set our validity bit. We need to compensate for * it does not set our validity bit. We need to compensate for
* that somewhere else, but not in eth1394. */ * that somewhere else, but not in eth1394. */
#if 0 #if 0
if ((priv->host->csr.broadcast_channel & 0xc0000000) != 0xc0000000) { if ((priv->host->csr.broadcast_channel & 0xc0000000) != 0xc0000000)
ret = -EAGAIN;
goto fail; goto fail;
}
#endif #endif
skb = skb_share_check(skb, GFP_ATOMIC); skb = skb_share_check(skb, GFP_ATOMIC);
if (!skb) { if (!skb)
ret = -ENOMEM;
goto fail; goto fail;
}
/* Get rid of the fake eth1394 header, but save a pointer */ /* Get rid of the fake eth1394 header, but save a pointer */
eth = (struct eth1394hdr *)skb->data; eth = (struct eth1394hdr *)skb->data;
...@@ -1583,16 +1576,13 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -1583,16 +1576,13 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
node = eth1394_find_node_guid(&priv->ip_node_list, node = eth1394_find_node_guid(&priv->ip_node_list,
be64_to_cpu(guid)); be64_to_cpu(guid));
if (!node) { if (!node)
ret = -EAGAIN;
goto fail; goto fail;
}
node_info = node_info =
(struct eth1394_node_info *)node->ud->device.driver_data; (struct eth1394_node_info *)node->ud->device.driver_data;
if (node_info->fifo == CSR1212_INVALID_ADDR_SPACE) { if (node_info->fifo == CSR1212_INVALID_ADDR_SPACE)
ret = -EAGAIN;
goto fail; goto fail;
}
dest_node = node->ud->ne->nodeid; dest_node = node->ud->ne->nodeid;
max_payload = node_info->maxpayload; max_payload = node_info->maxpayload;
...@@ -1639,7 +1629,7 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -1639,7 +1629,7 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
goto fail; goto fail;
netif_wake_queue(dev); netif_wake_queue(dev);
return 0; return NETDEV_TX_OK;
fail: fail:
if (ptask) if (ptask)
kmem_cache_free(packet_task_cache, ptask); kmem_cache_free(packet_task_cache, ptask);
...@@ -1655,7 +1645,15 @@ fail: ...@@ -1655,7 +1645,15 @@ fail:
if (netif_queue_stopped(dev)) if (netif_queue_stopped(dev))
netif_wake_queue(dev); netif_wake_queue(dev);
return 0; /* returning non-zero causes serious problems */ /*
* FIXME: According to a patch from 2003-02-26, "returning non-zero
* causes serious problems" here, allegedly. Before that patch,
* -ERRNO was returned which is not appropriate under Linux 2.6.
* Perhaps more needs to be done? Stop the queue in serious
* conditions and restart it elsewhere?
*/
/* return NETDEV_TX_BUSY; */
return NETDEV_TX_OK;
} }
static void ether1394_get_drvinfo(struct net_device *dev, static void ether1394_get_drvinfo(struct net_device *dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment