Commit 5713113c authored by Roger Luethi's avatar Roger Luethi Committed by Jeff Garzik

[PATCH] via-rhine: USE_MEM, USE_IO -> USE_MMIO

Replace USE_MEM and USE_IO with USE_MMIO define.
parent a9227ffd
...@@ -222,9 +222,8 @@ static char shortname[] = DRV_NAME; ...@@ -222,9 +222,8 @@ static char shortname[] = DRV_NAME;
/* This driver was written to use PCI memory space, however most versions /* This driver was written to use PCI memory space, however most versions
of the Rhine only work correctly with I/O space accesses. */ of the Rhine only work correctly with I/O space accesses. */
#ifdef CONFIG_VIA_RHINE_MMIO #ifdef CONFIG_VIA_RHINE_MMIO
#define USE_MEM #define USE_MMIO
#else #else
#define USE_IO
#undef readb #undef readb
#undef readw #undef readw
#undef readl #undef readl
...@@ -380,7 +379,7 @@ enum chip_capability_flags { ...@@ -380,7 +379,7 @@ enum chip_capability_flags {
ReqTxAlign=0x10, HasWOL=0x20, ReqTxAlign=0x10, HasWOL=0x20,
}; };
#ifdef USE_MEM #ifdef USE_MMIO
#define RHINE_IOTYPE (PCI_USES_MEM | PCI_USES_MASTER | PCI_ADDR1) #define RHINE_IOTYPE (PCI_USES_MEM | PCI_USES_MASTER | PCI_ADDR1)
#else #else
#define RHINE_IOTYPE (PCI_USES_IO | PCI_USES_MASTER | PCI_ADDR0) #define RHINE_IOTYPE (PCI_USES_IO | PCI_USES_MASTER | PCI_ADDR0)
...@@ -432,7 +431,7 @@ enum backoff_bits { ...@@ -432,7 +431,7 @@ enum backoff_bits {
BackCaptureEffect=0x04, BackRandom=0x08 BackCaptureEffect=0x04, BackRandom=0x08
}; };
#ifdef USE_MEM #ifdef USE_MMIO
/* Registers we check that mmio and reg are the same. */ /* Registers we check that mmio and reg are the same. */
int mmio_verify_registers[] = { int mmio_verify_registers[] = {
RxConfig, TxConfig, IntrEnable, ConfigA, ConfigB, ConfigC, ConfigD, RxConfig, TxConfig, IntrEnable, ConfigA, ConfigB, ConfigC, ConfigD,
...@@ -590,7 +589,7 @@ static void wait_for_reset(struct net_device *dev, int chip_id, char *name) ...@@ -590,7 +589,7 @@ static void wait_for_reset(struct net_device *dev, int chip_id, char *name)
boguscnt ? "succeeded" : "failed"); boguscnt ? "succeeded" : "failed");
} }
#ifdef USE_MEM #ifdef USE_MMIO
static void __devinit enable_mmio(long ioaddr, int chip_id) static void __devinit enable_mmio(long ioaddr, int chip_id)
{ {
int n; int n;
...@@ -636,7 +635,7 @@ static int __devinit rhine_init_one(struct pci_dev *pdev, ...@@ -636,7 +635,7 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
long memaddr; long memaddr;
int io_size; int io_size;
int pci_flags; int pci_flags;
#ifdef USE_MEM #ifdef USE_MMIO
long ioaddr0; long ioaddr0;
#endif #endif
...@@ -687,7 +686,7 @@ static int __devinit rhine_init_one(struct pci_dev *pdev, ...@@ -687,7 +686,7 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
if (pci_request_regions(pdev, shortname)) if (pci_request_regions(pdev, shortname))
goto err_out_free_netdev; goto err_out_free_netdev;
#ifdef USE_MEM #ifdef USE_MMIO
ioaddr0 = ioaddr; ioaddr0 = ioaddr;
enable_mmio(ioaddr0, chip_id); enable_mmio(ioaddr0, chip_id);
...@@ -710,7 +709,7 @@ static int __devinit rhine_init_one(struct pci_dev *pdev, ...@@ -710,7 +709,7 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
goto err_out_unmap; goto err_out_unmap;
} }
} }
#endif #endif /* USE_MMIO */
/* D-Link provided reset code (with comment additions) */ /* D-Link provided reset code (with comment additions) */
if (rhine_chip_info[chip_id].drv_flags & HasWOL) { if (rhine_chip_info[chip_id].drv_flags & HasWOL) {
...@@ -737,14 +736,14 @@ static int __devinit rhine_init_one(struct pci_dev *pdev, ...@@ -737,14 +736,14 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
wait_for_reset(dev, chip_id, shortname); wait_for_reset(dev, chip_id, shortname);
/* Reload the station address from the EEPROM. */ /* Reload the station address from the EEPROM. */
#ifdef USE_IO #ifdef USE_MMIO
reload_eeprom(ioaddr);
#else
reload_eeprom(ioaddr0); reload_eeprom(ioaddr0);
/* Reloading from eeprom overwrites cfgA-D, so we must re-enable MMIO. /* 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 If reload_eeprom() was done first this could be avoided, but it is
not known if that still works with the "win98-reboot" problem. */ not known if that still works with the "win98-reboot" problem. */
enable_mmio(ioaddr0, chip_id); enable_mmio(ioaddr0, chip_id);
#else
reload_eeprom(ioaddr);
#endif #endif
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
...@@ -880,7 +879,7 @@ static int __devinit rhine_init_one(struct pci_dev *pdev, ...@@ -880,7 +879,7 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
return 0; return 0;
err_out_unmap: err_out_unmap:
#ifdef USE_MEM #ifdef USE_MMIO
iounmap((void *)ioaddr); iounmap((void *)ioaddr);
err_out_free_res: err_out_free_res:
#endif #endif
...@@ -1933,7 +1932,7 @@ static void __devexit rhine_remove_one(struct pci_dev *pdev) ...@@ -1933,7 +1932,7 @@ static void __devexit rhine_remove_one(struct pci_dev *pdev)
pci_release_regions(pdev); pci_release_regions(pdev);
#ifdef USE_MEM #ifdef USE_MMIO
iounmap((char *)(dev->base_addr)); iounmap((char *)(dev->base_addr));
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment