aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2010-11-24 10:01:16 +0000
committerGabor Juhos <juhosg@openwrt.org>2010-11-24 10:01:16 +0000
commit00bd3f47c481d4568792c3a09ba2197f1f4b230a (patch)
treef5782facd1236f3d094d3756cf91514df79b8649
parent77a769e423d7105565a4775f498c01ec6965adc3 (diff)
downloadmaster-187ad058-00bd3f47c481d4568792c3a09ba2197f1f4b230a.tar.gz
master-187ad058-00bd3f47c481d4568792c3a09ba2197f1f4b230a.tar.bz2
master-187ad058-00bd3f47c481d4568792c3a09ba2197f1f4b230a.zip
ramips: DMA map the correct RX skb size
The skb_reserve call prior to DMA mapping the RX skb reduced the skb data len by 2. To not allow DMA to write behind the skb we should pass the correct skb data len to the device. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@24123 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/ramips/files/drivers/net/ramips.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target/linux/ramips/files/drivers/net/ramips.c b/target/linux/ramips/files/drivers/net/ramips.c
index e3c4f13d46..1f3c35aa9d 100644
--- a/target/linux/ramips/files/drivers/net/ramips.c
+++ b/target/linux/ramips/files/drivers/net/ramips.c
@@ -177,7 +177,7 @@ ramips_alloc_dma(struct raeth_priv *re)
skb_reserve(new_skb, 2);
re->rx[i].rxd1 = dma_map_single(NULL,
new_skb->data,
- MAX_RX_LENGTH + 2,
+ MAX_RX_LENGTH,
DMA_FROM_DEVICE);
re->rx[i].rxd2 |= RX_DMA_LSO;
re->rx_skb[i] = new_skb;
@@ -288,7 +288,7 @@ ramips_eth_rx_hw(unsigned long ptr)
skb_reserve(new_skb, 2);
priv->rx[rx].rxd1 = dma_map_single(NULL,
new_skb->data,
- MAX_RX_LENGTH + 2,
+ MAX_RX_LENGTH,
DMA_FROM_DEVICE);
}