mirror of https://github.com/hak5/openwrt-owl.git
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> SVN-Revision: 24123owl
parent
f833e399f2
commit
624cfc5c91
|
@ -177,7 +177,7 @@ ramips_alloc_dma(struct raeth_priv *re)
|
||||||
skb_reserve(new_skb, 2);
|
skb_reserve(new_skb, 2);
|
||||||
re->rx[i].rxd1 = dma_map_single(NULL,
|
re->rx[i].rxd1 = dma_map_single(NULL,
|
||||||
new_skb->data,
|
new_skb->data,
|
||||||
MAX_RX_LENGTH + 2,
|
MAX_RX_LENGTH,
|
||||||
DMA_FROM_DEVICE);
|
DMA_FROM_DEVICE);
|
||||||
re->rx[i].rxd2 |= RX_DMA_LSO;
|
re->rx[i].rxd2 |= RX_DMA_LSO;
|
||||||
re->rx_skb[i] = new_skb;
|
re->rx_skb[i] = new_skb;
|
||||||
|
@ -288,7 +288,7 @@ ramips_eth_rx_hw(unsigned long ptr)
|
||||||
skb_reserve(new_skb, 2);
|
skb_reserve(new_skb, 2);
|
||||||
priv->rx[rx].rxd1 = dma_map_single(NULL,
|
priv->rx[rx].rxd1 = dma_map_single(NULL,
|
||||||
new_skb->data,
|
new_skb->data,
|
||||||
MAX_RX_LENGTH + 2,
|
MAX_RX_LENGTH,
|
||||||
DMA_FROM_DEVICE);
|
DMA_FROM_DEVICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue