Commit 53168dd6 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] fix padding on 8390 based devices

parent 4783c646
...@@ -270,6 +270,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -270,6 +270,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct ei_device *ei_local = (struct ei_device *) dev->priv; struct ei_device *ei_local = (struct ei_device *) dev->priv;
int length, send_length, output_page; int length, send_length, output_page;
unsigned long flags; unsigned long flags;
char scratch[ETH_ZLEN];
length = skb->len; length = skb->len;
...@@ -340,8 +341,15 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -340,8 +341,15 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
* isn't already sending. If it is busy, the interrupt handler will * isn't already sending. If it is busy, the interrupt handler will
* trigger the send later, upon receiving a Tx done interrupt. * trigger the send later, upon receiving a Tx done interrupt.
*/ */
ei_block_output(dev, length, skb->data, output_page); if (length == send_length)
ei_block_output(dev, length, skb->data, output_page);
else {
memset(scratch, 0, ETH_ZLEN);
memcpy(scratch, skb->data, skb->len);
ei_block_output(dev, ETH_ZLEN, scratch, output_page);
}
if (! ei_local->txing) if (! ei_local->txing)
{ {
ei_local->txing = 1; ei_local->txing = 1;
...@@ -373,7 +381,13 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -373,7 +381,13 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
* reasonable hardware if you only use one Tx buffer. * reasonable hardware if you only use one Tx buffer.
*/ */
ei_block_output(dev, length, skb->data, ei_local->tx_start_page); if (length == send_length)
ei_block_output(dev, length, skb->data, ei_local->tx_start_page);
else {
memset(scratch, 0, ETH_ZLEN);
memcpy(scratch, skb->data, skb->len);
ei_block_output(dev, ETH_ZLEN, scratch, ei_local->tx_start_page);
}
ei_local->txing = 1; ei_local->txing = 1;
NS8390_trigger_send(dev, send_length, ei_local->tx_start_page); NS8390_trigger_send(dev, send_length, ei_local->tx_start_page);
dev->trans_start = jiffies; dev->trans_start = jiffies;
......
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