r6040 endianness fixes
authorAl Viro <viro@ftp.linux.org.uk>
Sun, 16 Mar 2008 22:43:06 +0000 (22:43 +0000)
committerJeff Garzik <jeff@garzik.org>
Mon, 17 Mar 2008 11:56:27 +0000 (07:56 -0400)
pci_unmap_single() on little-endian address

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/r6040.c

index 19184e486ae97bf418f2521b174d769d6d8c9241..169edc154928305e154ccba45796b0cd52ec3c92 100644 (file)
@@ -239,7 +239,8 @@ static void r6040_free_txbufs(struct net_device *dev)
 
        for (i = 0; i < TX_DCNT; i++) {
                if (lp->tx_insert_ptr->skb_ptr) {
-                       pci_unmap_single(lp->pdev, lp->tx_insert_ptr->buf,
+                       pci_unmap_single(lp->pdev,
+                               le32_to_cpu(lp->tx_insert_ptr->buf),
                                MAX_BUF_SIZE, PCI_DMA_TODEVICE);
                        dev_kfree_skb(lp->tx_insert_ptr->skb_ptr);
                        lp->rx_insert_ptr->skb_ptr = NULL;
@@ -255,7 +256,8 @@ static void r6040_free_rxbufs(struct net_device *dev)
 
        for (i = 0; i < RX_DCNT; i++) {
                if (lp->rx_insert_ptr->skb_ptr) {
-                       pci_unmap_single(lp->pdev, lp->rx_insert_ptr->buf,
+                       pci_unmap_single(lp->pdev,
+                               le32_to_cpu(lp->rx_insert_ptr->buf),
                                MAX_BUF_SIZE, PCI_DMA_FROMDEVICE);
                        dev_kfree_skb(lp->rx_insert_ptr->skb_ptr);
                        lp->rx_insert_ptr->skb_ptr = NULL;
@@ -542,7 +544,7 @@ static int r6040_rx(struct net_device *dev, int limit)
                        skb_ptr->dev = priv->dev;
                        /* Do not count the CRC */
                        skb_put(skb_ptr, descptr->len - 4);
-                       pci_unmap_single(priv->pdev, descptr->buf,
+                       pci_unmap_single(priv->pdev, le32_to_cpu(descptr->buf),
                                MAX_BUF_SIZE, PCI_DMA_FROMDEVICE);
                        skb_ptr->protocol = eth_type_trans(skb_ptr, priv->dev);
                        /* Send to upper layer */
@@ -585,7 +587,7 @@ static void r6040_tx(struct net_device *dev)
                if (descptr->status & 0x8000)
                        break; /* Not complete */
                skb_ptr = descptr->skb_ptr;
-               pci_unmap_single(priv->pdev, descptr->buf,
+               pci_unmap_single(priv->pdev, le32_to_cpu(descptr->buf),
                        skb_ptr->len, PCI_DMA_TODEVICE);
                /* Free buffer */
                dev_kfree_skb_irq(skb_ptr);