diff options
Diffstat (limited to 'sys/dev/pci/if_nge.c')
-rw-r--r-- | sys/dev/pci/if_nge.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/sys/dev/pci/if_nge.c b/sys/dev/pci/if_nge.c index d85594f779b..d806adf868a 100644 --- a/sys/dev/pci/if_nge.c +++ b/sys/dev/pci/if_nge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nge.c,v 1.71 2011/06/22 16:44:27 tedu Exp $ */ +/* $OpenBSD: if_nge.c,v 1.72 2012/10/18 21:44:21 deraadt Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 @@ -729,42 +729,13 @@ nge_attach(parent, self, aux) bus_dmamap_t dmamap; int rseg; u_char eaddr[ETHER_ADDR_LEN]; - pcireg_t command; #ifndef NGE_USEIOSPACE pcireg_t memtype; #endif struct ifnet *ifp; caddr_t kva; - /* - * Handle power management nonsense. - */ - DPRINTFN(5, ("%s: preparing for conf read\n", sc->sc_dv.dv_xname)); - command = pci_conf_read(pc, pa->pa_tag, NGE_PCI_CAPID) & 0x000000FF; - if (command == 0x01) { - command = pci_conf_read(pc, pa->pa_tag, NGE_PCI_PWRMGMTCTRL); - if (command & NGE_PSTATE_MASK) { - pcireg_t iobase, membase, irq; - - /* Save important PCI config data. */ - iobase = pci_conf_read(pc, pa->pa_tag, NGE_PCI_LOIO); - membase = pci_conf_read(pc, pa->pa_tag, NGE_PCI_LOMEM); - irq = pci_conf_read(pc, pa->pa_tag, NGE_PCI_INTLINE); - - /* Reset the power state. */ - printf("%s: chip is in D%d power mode " - "-- setting to D0\n", sc->sc_dv.dv_xname, - command & NGE_PSTATE_MASK); - command &= 0xFFFFFFFC; - pci_conf_write(pc, pa->pa_tag, - NGE_PCI_PWRMGMTCTRL, command); - - /* Restore PCI config data. */ - pci_conf_write(pc, pa->pa_tag, NGE_PCI_LOIO, iobase); - pci_conf_write(pc, pa->pa_tag, NGE_PCI_LOMEM, membase); - pci_conf_write(pc, pa->pa_tag, NGE_PCI_INTLINE, irq); - } - } + pci_set_powerstate(pa->pa_pc, pa->pa_tag, PCI_PMCSR_STATE_D0); /* * Map control/status registers. |