]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] hamachi PCI DMA fix from 2.4
authorDave Jones <davej@codemonkey.org.uk>
Sun, 25 May 2003 19:23:27 +0000 (15:23 -0400)
committerJeff Garzik <jgarzik@redhat.com>
Sun, 25 May 2003 19:23:27 +0000 (15:23 -0400)
Maintainer fix that went into 2.4 last August with the comments
"Get hamachi net driver RX working again.
 Apparently the PCI DMA conversion still has a bug or two left in it..."

drivers/net/hamachi.c

index 93b6f7f4d4c6f46b36e460a90a63d780f5aff7bc..6f6c735325d5a554fbc00372202896800ed9fc7e 100644 (file)
@@ -207,8 +207,10 @@ KERN_INFO "   Further modifications by Keith Underwood <keithu@parl.clemson.edu>
 /* Condensed bus+endian portability operations. */
 #if ADDRLEN == 64
 #define cpu_to_leXX(addr)      cpu_to_le64(addr)
+#define desc_to_virt(addr) bus_to_virt(le64_to_cpu(addr))
 #else 
 #define cpu_to_leXX(addr)      cpu_to_le32(addr)
+#define desc_to_virt(addr) bus_to_virt(le32_to_cpu(addr))
 #endif   
 
 
@@ -1498,7 +1500,7 @@ static int hamachi_rx(struct net_device *dev)
                        break;
                pci_dma_sync_single(hmp->pci_dev, desc->addr, hmp->rx_buf_sz, 
                        PCI_DMA_FROMDEVICE);
-               buf_addr = (u8 *)hmp->rx_ring + entry*sizeof(*desc);
+               buf_addr = desc_to_virt(desc->addr);
                frame_status = le32_to_cpu(get_unaligned((s32*)&(buf_addr[data_size - 12])));
                if (hamachi_debug > 4)
                        printk(KERN_DEBUG "  hamachi_rx() status was %8.8x.\n",