Commit c351d4b5 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] padto - fix ariadne using skb_padto

parent 5bb682b7
...@@ -574,6 +574,7 @@ static int ariadne_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -574,6 +574,7 @@ static int ariadne_start_xmit(struct sk_buff *skb, struct net_device *dev)
volatile struct Am79C960 *lance = (struct Am79C960*)dev->base_addr; volatile struct Am79C960 *lance = (struct Am79C960*)dev->base_addr;
int entry; int entry;
unsigned long flags; unsigned long flags;
int len = skb->len;
#if 0 #if 0
if (ariadne_debug > 3) { if (ariadne_debug > 3) {
...@@ -584,6 +585,15 @@ static int ariadne_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -584,6 +585,15 @@ static int ariadne_start_xmit(struct sk_buff *skb, struct net_device *dev)
} }
#endif #endif
/* FIXME: is the 79C960 new enough to do its own padding right ? */
if (skb->len < ETH_ZLEN)
{
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL)
return 0;
len = ETH_ZLEN;
}
/* Fill in a Tx ring entry */ /* Fill in a Tx ring entry */
#if 0 #if 0
...@@ -613,8 +623,7 @@ static int ariadne_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -613,8 +623,7 @@ static int ariadne_start_xmit(struct sk_buff *skb, struct net_device *dev)
priv->tx_ring[entry]->TMD2 = swapw((u_short)-skb->len); priv->tx_ring[entry]->TMD2 = swapw((u_short)-skb->len);
priv->tx_ring[entry]->TMD3 = 0x0000; priv->tx_ring[entry]->TMD3 = 0x0000;
memcpyw(priv->tx_buff[entry], (u_short *)skb->data, memcpyw(priv->tx_buff[entry], (u_short *)skb->data, len);
skb->len <= ETH_ZLEN ? ETH_ZLEN : skb->len);
#if 0 #if 0
{ {
......
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