|
@@ -2117,6 +2117,9 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev)
|
|
|
}
|
|
|
spin_unlock_irqrestore(&mdp->lock, flags);
|
|
|
|
|
|
+ if (skb_padto(skb, ETH_ZLEN))
|
|
|
+ return NETDEV_TX_OK;
|
|
|
+
|
|
|
entry = mdp->cur_tx % mdp->num_tx_ring;
|
|
|
mdp->tx_skbuff[entry] = skb;
|
|
|
txdesc = &mdp->tx_ring[entry];
|
|
@@ -2126,10 +2129,7 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev)
|
|
|
skb->len + 2);
|
|
|
txdesc->addr = dma_map_single(&ndev->dev, skb->data, skb->len,
|
|
|
DMA_TO_DEVICE);
|
|
|
- if (skb->len < ETH_ZLEN)
|
|
|
- txdesc->buffer_length = ETH_ZLEN;
|
|
|
- else
|
|
|
- txdesc->buffer_length = skb->len;
|
|
|
+ txdesc->buffer_length = skb->len;
|
|
|
|
|
|
if (entry >= mdp->num_tx_ring - 1)
|
|
|
txdesc->status |= cpu_to_edmac(mdp, TD_TACT | TD_TDLE);
|