diff options
Diffstat (limited to 'drivers/net/sunhme.c')
-rw-r--r-- | drivers/net/sunhme.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index 1f842a78acd1..0970e1774d13 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c | |||
@@ -1226,10 +1226,16 @@ static void happy_meal_clean_rings(struct happy_meal *hp) | |||
1226 | for (frag = 0; frag <= skb_shinfo(skb)->nr_frags; frag++) { | 1226 | for (frag = 0; frag <= skb_shinfo(skb)->nr_frags; frag++) { |
1227 | txd = &hp->happy_block->happy_meal_txd[i]; | 1227 | txd = &hp->happy_block->happy_meal_txd[i]; |
1228 | dma_addr = hme_read_desc32(hp, &txd->tx_addr); | 1228 | dma_addr = hme_read_desc32(hp, &txd->tx_addr); |
1229 | dma_unmap_single(hp->dma_dev, dma_addr, | 1229 | if (!frag) |
1230 | (hme_read_desc32(hp, &txd->tx_flags) | 1230 | dma_unmap_single(hp->dma_dev, dma_addr, |
1231 | & TXFLAG_SIZE), | 1231 | (hme_read_desc32(hp, &txd->tx_flags) |
1232 | DMA_TO_DEVICE); | 1232 | & TXFLAG_SIZE), |
1233 | DMA_TO_DEVICE); | ||
1234 | else | ||
1235 | dma_unmap_page(hp->dma_dev, dma_addr, | ||
1236 | (hme_read_desc32(hp, &txd->tx_flags) | ||
1237 | & TXFLAG_SIZE), | ||
1238 | DMA_TO_DEVICE); | ||
1233 | 1239 | ||
1234 | if (frag != skb_shinfo(skb)->nr_frags) | 1240 | if (frag != skb_shinfo(skb)->nr_frags) |
1235 | i++; | 1241 | i++; |
@@ -1953,7 +1959,10 @@ static void happy_meal_tx(struct happy_meal *hp) | |||
1953 | dma_len = hme_read_desc32(hp, &this->tx_flags); | 1959 | dma_len = hme_read_desc32(hp, &this->tx_flags); |
1954 | 1960 | ||
1955 | dma_len &= TXFLAG_SIZE; | 1961 | dma_len &= TXFLAG_SIZE; |
1956 | dma_unmap_single(hp->dma_dev, dma_addr, dma_len, DMA_TO_DEVICE); | 1962 | if (!frag) |
1963 | dma_unmap_single(hp->dma_dev, dma_addr, dma_len, DMA_TO_DEVICE); | ||
1964 | else | ||
1965 | dma_unmap_page(hp->dma_dev, dma_addr, dma_len, DMA_TO_DEVICE); | ||
1957 | 1966 | ||
1958 | elem = NEXT_TX(elem); | 1967 | elem = NEXT_TX(elem); |
1959 | this = &txbase[elem]; | 1968 | this = &txbase[elem]; |