Commit 2ca5a4c5 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] move de4x5 to new pci api

parent 87430400
...@@ -874,6 +874,7 @@ static struct de4x5_bus_type { ...@@ -874,6 +874,7 @@ static struct de4x5_bus_type {
struct de4x5_srom srom; struct de4x5_srom srom;
int autosense; int autosense;
int useSROM; int useSROM;
struct pci_dev *pdev;
} bus; } bus;
/* /*
...@@ -1151,8 +1152,7 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct pci_dev *pdev) ...@@ -1151,8 +1152,7 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct pci_dev *pdev)
if (lp->bus == EISA) { if (lp->bus == EISA) {
outb(WAKEUP, PCI_CFPM); outb(WAKEUP, PCI_CFPM);
} else { } else {
pcibios_write_config_byte(lp->bus_num, lp->device << 3, pci_write_config_byte(lp->pdev, PCI_CFDA_PSM, WAKEUP);
PCI_CFDA_PSM, WAKEUP);
} }
mdelay(10); mdelay(10);
...@@ -2222,11 +2222,12 @@ pci_probe(struct net_device *dev, u_long ioaddr) ...@@ -2222,11 +2222,12 @@ pci_probe(struct net_device *dev, u_long ioaddr)
} }
/* Get the chip configuration revision register */ /* Get the chip configuration revision register */
pcibios_read_config_dword(pb, pdev->devfn, PCI_REVISION_ID, &cfrv); pci_read_config_dword(pdev, PCI_REVISION_ID, &cfrv);
/* Set the device number information */ /* Set the device number information */
lp->device = dev_num; lp->device = dev_num;
lp->bus_num = pb; lp->bus_num = pb;
lp->pdev = pdev;
/* Set the chipset information */ /* Set the chipset information */
if (is_DC2114x) { if (is_DC2114x) {
...@@ -2242,27 +2243,27 @@ pci_probe(struct net_device *dev, u_long ioaddr) ...@@ -2242,27 +2243,27 @@ pci_probe(struct net_device *dev, u_long ioaddr)
if ((irq == 0) || (irq == 0xff) || ((int)irq == -1)) continue; if ((irq == 0) || (irq == 0xff) || ((int)irq == -1)) continue;
/* Check if I/O accesses and Bus Mastering are enabled */ /* Check if I/O accesses and Bus Mastering are enabled */
pcibios_read_config_word(pb, pdev->devfn, PCI_COMMAND, &status); pci_read_config_word(pdev, PCI_COMMAND, &status);
#ifdef __powerpc__ #ifdef __powerpc__
if (!(status & PCI_COMMAND_IO)) { if (!(status & PCI_COMMAND_IO)) {
status |= PCI_COMMAND_IO; status |= PCI_COMMAND_IO;
pcibios_write_config_word(pb, pdev->devfn, PCI_COMMAND, status); pci_write_config_word(pdev, PCI_COMMAND, status);
pcibios_read_config_word(pb, pdev->devfn, PCI_COMMAND, &status); pci_read_config_word(pdev, PCI_COMMAND, &status);
} }
#endif /* __powerpc__ */ #endif /* __powerpc__ */
if (!(status & PCI_COMMAND_IO)) continue; if (!(status & PCI_COMMAND_IO)) continue;
if (!(status & PCI_COMMAND_MASTER)) { if (!(status & PCI_COMMAND_MASTER)) {
status |= PCI_COMMAND_MASTER; status |= PCI_COMMAND_MASTER;
pcibios_write_config_word(pb, pdev->devfn, PCI_COMMAND, status); pci_write_config_word(pdev, PCI_COMMAND, status);
pcibios_read_config_word(pb, pdev->devfn, PCI_COMMAND, &status); pci_read_config_word(pdev, PCI_COMMAND, &status);
} }
if (!(status & PCI_COMMAND_MASTER)) continue; if (!(status & PCI_COMMAND_MASTER)) continue;
/* Check the latency timer for values >= 0x60 */ /* Check the latency timer for values >= 0x60 */
pcibios_read_config_byte(pb, pdev->devfn, PCI_LATENCY_TIMER, &timer); pci_read_config_byte(pdev, PCI_LATENCY_TIMER, &timer);
if (timer < 0x60) { if (timer < 0x60) {
pcibios_write_config_byte(pb, pdev->devfn, PCI_LATENCY_TIMER, 0x60); pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x60);
} }
DevicePresent(DE4X5_APROM); DevicePresent(DE4X5_APROM);
...@@ -2314,7 +2315,7 @@ srom_search(struct pci_dev *dev) ...@@ -2314,7 +2315,7 @@ srom_search(struct pci_dev *dev)
/* Get the chip configuration revision register */ /* Get the chip configuration revision register */
pb = this_dev->bus->number; pb = this_dev->bus->number;
pcibios_read_config_dword(pb, this_dev->devfn, PCI_REVISION_ID, &cfrv); pci_read_config_dword(this_dev, PCI_REVISION_ID, &cfrv);
/* Set the device number information */ /* Set the device number information */
lp->device = PCI_SLOT(this_dev->devfn); lp->device = PCI_SLOT(this_dev->devfn);
...@@ -2334,7 +2335,7 @@ srom_search(struct pci_dev *dev) ...@@ -2334,7 +2335,7 @@ srom_search(struct pci_dev *dev)
if ((irq == 0) || (irq == 0xff) || ((int)irq == -1)) continue; if ((irq == 0) || (irq == 0xff) || ((int)irq == -1)) continue;
/* Check if I/O accesses are enabled */ /* Check if I/O accesses are enabled */
pcibios_read_config_word(pb, this_dev->devfn, PCI_COMMAND, &status); pci_read_config_word(this_dev, PCI_COMMAND, &status);
if (!(status & PCI_COMMAND_IO)) continue; if (!(status & PCI_COMMAND_IO)) continue;
/* Search for a valid SROM attached to this DECchip */ /* Search for a valid SROM attached to this DECchip */
...@@ -5325,20 +5326,17 @@ yawn(struct net_device *dev, int state) ...@@ -5325,20 +5326,17 @@ yawn(struct net_device *dev, int state)
} else { } else {
switch(state) { switch(state) {
case WAKEUP: case WAKEUP:
pcibios_write_config_byte(lp->bus_num, lp->device << 3, pci_write_config_byte(lp->pdev, PCI_CFDA_PSM, WAKEUP);
PCI_CFDA_PSM, WAKEUP);
mdelay(10); mdelay(10);
break; break;
case SNOOZE: case SNOOZE:
pcibios_write_config_byte(lp->bus_num, lp->device << 3, pci_write_config_byte(lp->pdev, PCI_CFDA_PSM, SNOOZE);
PCI_CFDA_PSM, SNOOZE);
break; break;
case SLEEP: case SLEEP:
outl(0, DE4X5_SICR); outl(0, DE4X5_SICR);
pcibios_write_config_byte(lp->bus_num, lp->device << 3, pci_write_config_byte(lp->pdev, PCI_CFDA_PSM, SLEEP);
PCI_CFDA_PSM, SLEEP);
break; break;
} }
} }
......
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