mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: davej@codemonkey.org.uk
To: jgarzik@pobox.com
Cc: linux-kernel@vger.kernel.org
Subject: hamachi PCI DMA fix from 2.4
Date: Thu, 15 May 2003 04:31:08 +0100	[thread overview]
Message-ID: <200305150331.h4F3V8eJ000641@deviant.impure.org.uk> (raw)

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..."

diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/net/hamachi.c linux-2.5/drivers/net/hamachi.c
--- bk-linus/drivers/net/hamachi.c	2003-04-22 00:40:42.000000000 +0100
+++ linux-2.5/drivers/net/hamachi.c	2003-04-22 01:23:14.000000000 +0100
@@ -207,8 +207,10 @@ KERN_INFO "   Further modifications by K
 /* 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   
 
 
@@ -1497,7 +1499,7 @@ static int hamachi_rx(struct net_device 
 			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",

                 reply	other threads:[~2003-05-15  3:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200305150331.h4F3V8eJ000641@deviant.impure.org.uk \
    --to=davej@codemonkey.org.uk \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®