aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/r6040.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2008-03-16 18:43:06 -0400
committerJeff Garzik <jeff@garzik.org>2008-03-17 07:56:27 -0400
commited773b4ab1387a25b3be027d45c94daae3c8a607 (patch)
treeb5c5ee82f447e7ea410b49da9a84540f1d2046d2 /drivers/net/r6040.c
parentf1dd9c379cac7d5a76259e7dffcd5f8edc697d17 (diff)
r6040 endianness fixes
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>
Diffstat (limited to 'drivers/net/r6040.c')
-rw-r--r--drivers/net/r6040.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index 19184e486ae9..169edc154928 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -239,7 +239,8 @@ static void r6040_free_txbufs(struct net_device *dev)
239 239
240 for (i = 0; i < TX_DCNT; i++) { 240 for (i = 0; i < TX_DCNT; i++) {
241 if (lp->tx_insert_ptr->skb_ptr) { 241 if (lp->tx_insert_ptr->skb_ptr) {
242 pci_unmap_single(lp->pdev, lp->tx_insert_ptr->buf, 242 pci_unmap_single(lp->pdev,
243 le32_to_cpu(lp->tx_insert_ptr->buf),
243 MAX_BUF_SIZE, PCI_DMA_TODEVICE); 244 MAX_BUF_SIZE, PCI_DMA_TODEVICE);
244 dev_kfree_skb(lp->tx_insert_ptr->skb_ptr); 245 dev_kfree_skb(lp->tx_insert_ptr->skb_ptr);
245 lp->rx_insert_ptr->skb_ptr = NULL; 246 lp->rx_insert_ptr->skb_ptr = NULL;
@@ -255,7 +256,8 @@ static void r6040_free_rxbufs(struct net_device *dev)
255 256
256 for (i = 0; i < RX_DCNT; i++) { 257 for (i = 0; i < RX_DCNT; i++) {
257 if (lp->rx_insert_ptr->skb_ptr) { 258 if (lp->rx_insert_ptr->skb_ptr) {
258 pci_unmap_single(lp->pdev, lp->rx_insert_ptr->buf, 259 pci_unmap_single(lp->pdev,
260 le32_to_cpu(lp->rx_insert_ptr->buf),
259 MAX_BUF_SIZE, PCI_DMA_FROMDEVICE); 261 MAX_BUF_SIZE, PCI_DMA_FROMDEVICE);
260 dev_kfree_skb(lp->rx_insert_ptr->skb_ptr); 262 dev_kfree_skb(lp->rx_insert_ptr->skb_ptr);
261 lp->rx_insert_ptr->skb_ptr = NULL; 263 lp->rx_insert_ptr->skb_ptr = NULL;
@@ -542,7 +544,7 @@ static int r6040_rx(struct net_device *dev, int limit)
542 skb_ptr->dev = priv->dev; 544 skb_ptr->dev = priv->dev;
543 /* Do not count the CRC */ 545 /* Do not count the CRC */
544 skb_put(skb_ptr, descptr->len - 4); 546 skb_put(skb_ptr, descptr->len - 4);
545 pci_unmap_single(priv->pdev, descptr->buf, 547 pci_unmap_single(priv->pdev, le32_to_cpu(descptr->buf),
546 MAX_BUF_SIZE, PCI_DMA_FROMDEVICE); 548 MAX_BUF_SIZE, PCI_DMA_FROMDEVICE);
547 skb_ptr->protocol = eth_type_trans(skb_ptr, priv->dev); 549 skb_ptr->protocol = eth_type_trans(skb_ptr, priv->dev);
548 /* Send to upper layer */ 550 /* Send to upper layer */
@@ -585,7 +587,7 @@ static void r6040_tx(struct net_device *dev)
585 if (descptr->status & 0x8000) 587 if (descptr->status & 0x8000)
586 break; /* Not complete */ 588 break; /* Not complete */
587 skb_ptr = descptr->skb_ptr; 589 skb_ptr = descptr->skb_ptr;
588 pci_unmap_single(priv->pdev, descptr->buf, 590 pci_unmap_single(priv->pdev, le32_to_cpu(descptr->buf),
589 skb_ptr->len, PCI_DMA_TODEVICE); 591 skb_ptr->len, PCI_DMA_TODEVICE);
590 /* Free buffer */ 592 /* Free buffer */
591 dev_kfree_skb_irq(skb_ptr); 593 dev_kfree_skb_irq(skb_ptr);