diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/forcedeth.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index d3f4bcaa9692..7a018027fcc0 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -1388,11 +1388,9 @@ static int nv_alloc_rx(struct net_device *dev) | |||
1388 | np->put_rx_ctx->skb = skb; | 1388 | np->put_rx_ctx->skb = skb; |
1389 | np->put_rx_ctx->dma = pci_map_single(np->pci_dev, | 1389 | np->put_rx_ctx->dma = pci_map_single(np->pci_dev, |
1390 | skb->data, | 1390 | skb->data, |
1391 | (skb_end_pointer(skb) - | 1391 | skb_tailroom(skb), |
1392 | skb->data), | ||
1393 | PCI_DMA_FROMDEVICE); | 1392 | PCI_DMA_FROMDEVICE); |
1394 | np->put_rx_ctx->dma_len = (skb_end_pointer(skb) - | 1393 | np->put_rx_ctx->dma_len = skb_tailroom(skb); |
1395 | skb->data); | ||
1396 | np->put_rx.orig->buf = cpu_to_le32(np->put_rx_ctx->dma); | 1394 | np->put_rx.orig->buf = cpu_to_le32(np->put_rx_ctx->dma); |
1397 | wmb(); | 1395 | wmb(); |
1398 | np->put_rx.orig->flaglen = cpu_to_le32(np->rx_buf_sz | NV_RX_AVAIL); | 1396 | np->put_rx.orig->flaglen = cpu_to_le32(np->rx_buf_sz | NV_RX_AVAIL); |
@@ -1422,11 +1420,9 @@ static int nv_alloc_rx_optimized(struct net_device *dev) | |||
1422 | np->put_rx_ctx->skb = skb; | 1420 | np->put_rx_ctx->skb = skb; |
1423 | np->put_rx_ctx->dma = pci_map_single(np->pci_dev, | 1421 | np->put_rx_ctx->dma = pci_map_single(np->pci_dev, |
1424 | skb->data, | 1422 | skb->data, |
1425 | (skb_end_pointer(skb) - | 1423 | skb_tailroom(skb), |
1426 | skb->data), | ||
1427 | PCI_DMA_FROMDEVICE); | 1424 | PCI_DMA_FROMDEVICE); |
1428 | np->put_rx_ctx->dma_len = (skb_end_pointer(skb) - | 1425 | np->put_rx_ctx->dma_len = skb_tailroom(skb); |
1429 | skb->data); | ||
1430 | np->put_rx.ex->bufhigh = cpu_to_le64(np->put_rx_ctx->dma) >> 32; | 1426 | np->put_rx.ex->bufhigh = cpu_to_le64(np->put_rx_ctx->dma) >> 32; |
1431 | np->put_rx.ex->buflow = cpu_to_le64(np->put_rx_ctx->dma) & 0x0FFFFFFFF; | 1427 | np->put_rx.ex->buflow = cpu_to_le64(np->put_rx_ctx->dma) & 0x0FFFFFFFF; |
1432 | wmb(); | 1428 | wmb(); |
@@ -4383,12 +4379,12 @@ static int nv_loopback_test(struct net_device *dev) | |||
4383 | ret = 0; | 4379 | ret = 0; |
4384 | goto out; | 4380 | goto out; |
4385 | } | 4381 | } |
4382 | test_dma_addr = pci_map_single(np->pci_dev, tx_skb->data, | ||
4383 | skb_tailroom(tx_skb), | ||
4384 | PCI_DMA_FROMDEVICE); | ||
4386 | pkt_data = skb_put(tx_skb, pkt_len); | 4385 | pkt_data = skb_put(tx_skb, pkt_len); |
4387 | for (i = 0; i < pkt_len; i++) | 4386 | for (i = 0; i < pkt_len; i++) |
4388 | pkt_data[i] = (u8)(i & 0xff); | 4387 | pkt_data[i] = (u8)(i & 0xff); |
4389 | test_dma_addr = pci_map_single(np->pci_dev, tx_skb->data, | ||
4390 | (skb_end_pointer(tx_skb) - | ||
4391 | tx_skb->data), PCI_DMA_FROMDEVICE); | ||
4392 | 4388 | ||
4393 | if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) { | 4389 | if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) { |
4394 | np->tx_ring.orig[0].buf = cpu_to_le32(test_dma_addr); | 4390 | np->tx_ring.orig[0].buf = cpu_to_le32(test_dma_addr); |