From: Roger Luethi <rl@hellgate.ch>
To: Jeff Garzik <jgarzik@pobox.com>, Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com
Subject: [4/4][PATCH 2.6] via-rhine: USE_MEM, USE_IO -> USE_MMIO
Date: Sun, 23 May 2004 12:50:18 +0200 [thread overview]
Message-ID: <20040523105018.GA10472@k3.hellgate.ch> (raw)
In-Reply-To: <20040523104650.GA9979@k3.hellgate.ch>
[-- Attachment #1: Type: text/plain, Size: 49 bytes --]
Replace USE_MEM and USE_IO with USE_MMIO define.
[-- Attachment #2: via-rhine-2.6.6-4-defmem.diff --]
[-- Type: text/plain, Size: 2792 bytes --]
--- linux-2.6.6/drivers/net/via-rhine.c 2004-05-23 11:38:22.798939458 +0200
+++ linux-2.6.6-patch/drivers/net/via-rhine.c 2004-05-23 11:44:18.972292582 +0200
@@ -222,9 +222,8 @@ static char shortname[] = DRV_NAME;
/* This driver was written to use PCI memory space, however most versions
of the Rhine only work correctly with I/O space accesses. */
#ifdef CONFIG_VIA_RHINE_MMIO
-#define USE_MEM
+#define USE_MMIO
#else
-#define USE_IO
#undef readb
#undef readw
#undef readl
@@ -380,7 +379,7 @@ enum chip_capability_flags {
ReqTxAlign=0x10, HasWOL=0x20,
};
-#ifdef USE_MEM
+#ifdef USE_MMIO
#define RHINE_IOTYPE (PCI_USES_MEM | PCI_USES_MASTER | PCI_ADDR1)
#else
#define RHINE_IOTYPE (PCI_USES_IO | PCI_USES_MASTER | PCI_ADDR0)
@@ -432,7 +431,7 @@ enum backoff_bits {
BackCaptureEffect=0x04, BackRandom=0x08
};
-#ifdef USE_MEM
+#ifdef USE_MMIO
/* Registers we check that mmio and reg are the same. */
int mmio_verify_registers[] = {
RxConfig, TxConfig, IntrEnable, ConfigA, ConfigB, ConfigC, ConfigD,
@@ -590,7 +589,7 @@ static void wait_for_reset(struct net_de
boguscnt ? "succeeded" : "failed");
}
-#ifdef USE_MEM
+#ifdef USE_MMIO
static void __devinit enable_mmio(long ioaddr, int chip_id)
{
int n;
@@ -636,7 +635,7 @@ static int __devinit rhine_init_one(stru
long memaddr;
int io_size;
int pci_flags;
-#ifdef USE_MEM
+#ifdef USE_MMIO
long ioaddr0;
#endif
@@ -687,7 +686,7 @@ static int __devinit rhine_init_one(stru
if (pci_request_regions(pdev, shortname))
goto err_out_free_netdev;
-#ifdef USE_MEM
+#ifdef USE_MMIO
ioaddr0 = ioaddr;
enable_mmio(ioaddr0, chip_id);
@@ -710,7 +709,7 @@ static int __devinit rhine_init_one(stru
goto err_out_unmap;
}
}
-#endif
+#endif /* USE_MMIO */
/* D-Link provided reset code (with comment additions) */
if (rhine_chip_info[chip_id].drv_flags & HasWOL) {
@@ -737,14 +736,14 @@ static int __devinit rhine_init_one(stru
wait_for_reset(dev, chip_id, shortname);
/* Reload the station address from the EEPROM. */
-#ifdef USE_IO
- reload_eeprom(ioaddr);
-#else
+#ifdef USE_MMIO
reload_eeprom(ioaddr0);
/* Reloading from eeprom overwrites cfgA-D, so we must re-enable MMIO.
If reload_eeprom() was done first this could be avoided, but it is
not known if that still works with the "win98-reboot" problem. */
enable_mmio(ioaddr0, chip_id);
+#else
+ reload_eeprom(ioaddr);
#endif
for (i = 0; i < 6; i++)
@@ -880,7 +879,7 @@ static int __devinit rhine_init_one(stru
return 0;
err_out_unmap:
-#ifdef USE_MEM
+#ifdef USE_MMIO
iounmap((void *)ioaddr);
err_out_free_res:
#endif
@@ -1933,7 +1932,7 @@ static void __devexit rhine_remove_one(s
pci_release_regions(pdev);
-#ifdef USE_MEM
+#ifdef USE_MMIO
iounmap((char *)(dev->base_addr));
#endif
next prev parent reply other threads:[~2004-05-23 11:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-23 10:46 [0/4] via-rhine: clean-up for 2.6 Roger Luethi
2004-05-23 10:48 ` [1/4][PATCH 2.6] via-rhine: Fix force media Roger Luethi
2004-05-27 19:09 ` Jeff Garzik
2004-05-23 10:50 ` [2/4][PATCH 2.6] via-rhine: Rename some symbols Roger Luethi
2004-05-23 10:50 ` [3/4][PATCH 2.6] via-rhine: Whitespace clean-up Roger Luethi
2004-05-23 10:50 ` Roger Luethi [this message]
2004-05-23 14:52 ` [5/4][PATCH 2.6] via-rhine: netdev_priv() Roger Luethi
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=20040523105018.GA10472@k3.hellgate.ch \
--to=rl@hellgate.ch \
--cc=akpm@osdl.org \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@oss.sgi.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.