[PATCH 05/11] rrunner: fix DMA sync_single length error

Stephen Hemminger
2010-01-20T21:22:55Z

[-- Attachment #1: rrunner-dma.patch --]
[-- Type: text/plain, Size: 855 bytes --]

The DMA api requires that the full mapping be sync'd when
copying frame. First found by Jarek on sky2.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/drivers/net/rrunner.c 2010-01-20 11:32:54.859390177 -0800
+++ b/drivers/net/rrunner.c 2010-01-20 11:37:40.431004646 -0800
@@ -971,7 +971,7 @@ static void rx_int(struct net_device *de
} else {
pci_dma_sync_single_for_cpu(rrpriv->pci_dev,
desc->addr.addrlo,
- pkt_len,
+ dev->mtu + HIPPI_HLEN,
PCI_DMA_FROMDEVICE);

memcpy(skb_put(skb, pkt_len),
@@ -979,7 +979,7 @@ static void rx_int(struct net_device *de

pci_dma_sync_single_for_device(rrpriv->pci_dev,
desc->addr.addrlo,
- pkt_len,
+ dev->mtu + HIPPI_HLEN,
PCI_DMA_FROMDEVICE);
}
}else{

--