diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-02-11 15:12:05 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2012-02-11 15:12:05 +0000 |
commit | 49ec435276b6986979b47f1a719e3fff0061e775 (patch) | |
tree | 3bd32db503ecc84af4f4ef3ebf9f632af40eb0a4 /target/linux/ramips/files/drivers/net | |
parent | 03f6e838c1985ea22508ac47036760495b590538 (diff) | |
download | master-187ad058-49ec435276b6986979b47f1a719e3fff0061e775.tar.gz master-187ad058-49ec435276b6986979b47f1a719e3fff0061e775.tar.bz2 master-187ad058-49ec435276b6986979b47f1a719e3fff0061e775.zip |
ramips: raeth: cleanup DMA API usage in ramips_eth_hard_start_xmit
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30447 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips/files/drivers/net')
-rw-r--r-- | target/linux/ramips/files/drivers/net/ramips.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/target/linux/ramips/files/drivers/net/ramips.c b/target/linux/ramips/files/drivers/net/ramips.c index e44e6b6540..273c00dc2a 100644 --- a/target/linux/ramips/files/drivers/net/ramips.c +++ b/target/linux/ramips/files/drivers/net/ramips.c @@ -219,7 +219,7 @@ ramips_eth_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) struct raeth_priv *priv = netdev_priv(dev); unsigned long tx; unsigned int tx_next; - unsigned int mapped_addr; + dma_addr_t mapped_addr; if (priv->plat->min_pkt_len) { if (skb->len < priv->plat->min_pkt_len) { @@ -234,9 +234,8 @@ ramips_eth_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) } dev->trans_start = jiffies; - mapped_addr = (unsigned int) dma_map_single(NULL, skb->data, skb->len, - DMA_TO_DEVICE); - dma_sync_single_for_device(NULL, mapped_addr, skb->len, DMA_TO_DEVICE); + mapped_addr = dma_map_single(NULL, skb->data, skb->len, DMA_TO_DEVICE); + spin_lock(&priv->page_lock); tx = ramips_fe_rr(RAMIPS_TX_CTX_IDX0); tx_next = (tx + 1) % NUM_TX_DESC; @@ -246,7 +245,7 @@ ramips_eth_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) !(priv->tx[tx_next].txd2 & TX_DMA_DONE)) goto out; - priv->tx[tx].txd1 = mapped_addr; + priv->tx[tx].txd1 = (unsigned int) mapped_addr; priv->tx[tx].txd2 &= ~(TX_DMA_PLEN0_MASK | TX_DMA_DONE); priv->tx[tx].txd2 |= TX_DMA_PLEN0(skb->len); dev->stats.tx_packets++; |