aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2014-05-15 17:33:52 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-16 16:41:40 -0400
commitb1ff53e9fd26a11ede97fcad5ff2e9be00b61bf8 (patch)
treeb22bb1dce1a0d697f2ed42369a8f36867dacd063
parentbd508065749fcaa99f6eca927530d0d7e019224f (diff)
net: systemport: fix dma_unmap_single() len
dma_unmap_single() was called with dma_unmap_len(cb, dma_len), unfortunately we failed to assign this length field in bcm_sysport_rx_refill() or bcm_sysport_alloc_rx_bufs() using dma_unmap_len_set(). This causes packet contents corruption because are we not invoking the cache invalidation routines with the proper length. Fix this by using the full RX buffer size (RX_BUF_LENGTH) because the mappings for the RX bufers are created with that size. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/bcmsysport.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index 8edc0980cdf5..26030d67518b 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -479,7 +479,7 @@ static unsigned int bcm_sysport_desc_rx(struct bcm_sysport_priv *priv,
479 cb = &priv->rx_cbs[priv->rx_read_ptr]; 479 cb = &priv->rx_cbs[priv->rx_read_ptr];
480 skb = cb->skb; 480 skb = cb->skb;
481 dma_unmap_single(kdev, dma_unmap_addr(cb, dma_addr), 481 dma_unmap_single(kdev, dma_unmap_addr(cb, dma_addr),
482 dma_unmap_len(cb, dma_len), DMA_FROM_DEVICE); 482 RX_BUF_LENGTH, DMA_FROM_DEVICE);
483 483
484 /* Extract the Receive Status Block prepended */ 484 /* Extract the Receive Status Block prepended */
485 rsb = (struct rsb *)skb->data; 485 rsb = (struct rsb *)skb->data;