Remove the setting of the pci config variables on power state changes.
The bus does this now.
This commit is contained in:
parent
dc0d070947
commit
61364cc869
@ -428,11 +428,6 @@ fwohci_pci_resume(device_t dev)
|
||||
{
|
||||
fwohci_softc_t *sc = device_get_softc(dev);
|
||||
|
||||
#ifndef BURN_BRIDGES
|
||||
device_printf(dev, "fwohci_pci_resume: power_state = 0x%08x\n",
|
||||
pci_get_powerstate(dev));
|
||||
pci_set_powerstate(dev, PCI_POWERSTATE_D0);
|
||||
#endif
|
||||
fwohci_pci_init(dev);
|
||||
fwohci_resume(sc, dev);
|
||||
return 0;
|
||||
|
@ -210,9 +210,6 @@ static void fxp_intr_body(struct fxp_softc *sc, struct ifnet *ifp,
|
||||
static void fxp_init(void *xsc);
|
||||
static void fxp_init_body(struct fxp_softc *sc);
|
||||
static void fxp_tick(void *xsc);
|
||||
#ifndef BURN_BRIDGES
|
||||
static void fxp_powerstate_d0(device_t dev);
|
||||
#endif
|
||||
static void fxp_start(struct ifnet *ifp);
|
||||
static void fxp_start_body(struct ifnet *ifp);
|
||||
static void fxp_stop(struct fxp_softc *sc);
|
||||
@ -350,34 +347,6 @@ fxp_probe(device_t dev)
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
#ifndef BURN_BRIDGES
|
||||
static void
|
||||
fxp_powerstate_d0(device_t dev)
|
||||
{
|
||||
#if __FreeBSD_version >= 430002
|
||||
u_int32_t iobase, membase, irq;
|
||||
|
||||
if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
|
||||
/* Save important PCI config data. */
|
||||
iobase = pci_read_config(dev, FXP_PCI_IOBA, 4);
|
||||
membase = pci_read_config(dev, FXP_PCI_MMBA, 4);
|
||||
irq = pci_read_config(dev, PCIR_INTLINE, 4);
|
||||
|
||||
/* Reset the power state. */
|
||||
device_printf(dev, "chip is in D%d power mode "
|
||||
"-- setting to D0\n", pci_get_powerstate(dev));
|
||||
|
||||
pci_set_powerstate(dev, PCI_POWERSTATE_D0);
|
||||
|
||||
/* Restore PCI config data. */
|
||||
pci_write_config(dev, FXP_PCI_IOBA, iobase, 4);
|
||||
pci_write_config(dev, FXP_PCI_MMBA, membase, 4);
|
||||
pci_write_config(dev, PCIR_INTLINE, irq, 4);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
fxp_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error)
|
||||
{
|
||||
@ -417,9 +386,7 @@ fxp_attach(device_t dev)
|
||||
*/
|
||||
pci_enable_busmaster(dev);
|
||||
val = pci_read_config(dev, PCIR_COMMAND, 2);
|
||||
#ifndef BURN_BRIDGES
|
||||
fxp_powerstate_d0(dev);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Figure out which we should try first - memory mapping or i/o mapping?
|
||||
* We default to memory mapping. Then we accept an override from the
|
||||
@ -1023,9 +990,7 @@ fxp_resume(device_t dev)
|
||||
|
||||
FXP_LOCK(sc);
|
||||
s = splimp();
|
||||
#ifndef BURN_BRIDGES
|
||||
fxp_powerstate_d0(dev);
|
||||
#endif
|
||||
|
||||
/* better way to do this? */
|
||||
for (i = 0; i < 5; i++)
|
||||
pci_write_config(dev, PCIR_BAR(i), sc->saved_maps[i], 4);
|
||||
|
@ -473,30 +473,6 @@ lge_attach(dev)
|
||||
sc = device_get_softc(dev);
|
||||
unit = device_get_unit(dev);
|
||||
bzero(sc, sizeof(struct lge_softc));
|
||||
#ifndef BURN_BRIDGES
|
||||
/*
|
||||
* Handle power management nonsense.
|
||||
*/
|
||||
if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
|
||||
u_int32_t iobase, membase, irq;
|
||||
|
||||
/* Save important PCI config data. */
|
||||
iobase = pci_read_config(dev, LGE_PCI_LOIO, 4);
|
||||
membase = pci_read_config(dev, LGE_PCI_LOMEM, 4);
|
||||
irq = pci_read_config(dev, LGE_PCI_INTLINE, 4);
|
||||
|
||||
/* Reset the power state. */
|
||||
printf("lge%d: chip is in D%d power mode "
|
||||
"-- setting to D0\n", unit,
|
||||
pci_get_powerstate(dev));
|
||||
pci_set_powerstate(dev, PCI_POWERSTATE_D0);
|
||||
|
||||
/* Restore PCI config data. */
|
||||
pci_write_config(dev, LGE_PCI_LOIO, iobase, 4);
|
||||
pci_write_config(dev, LGE_PCI_LOMEM, membase, 4);
|
||||
pci_write_config(dev, LGE_PCI_INTLINE, irq, 4);
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Map control/status registers.
|
||||
*/
|
||||
|
@ -806,30 +806,6 @@ nge_attach(dev)
|
||||
|
||||
mtx_init(&sc->nge_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
|
||||
MTX_DEF | MTX_RECURSE);
|
||||
#ifndef BURN_BRIDGES
|
||||
/*
|
||||
* Handle power management nonsense.
|
||||
*/
|
||||
if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
|
||||
u_int32_t iobase, membase, irq;
|
||||
|
||||
/* Save important PCI config data. */
|
||||
iobase = pci_read_config(dev, NGE_PCI_LOIO, 4);
|
||||
membase = pci_read_config(dev, NGE_PCI_LOMEM, 4);
|
||||
irq = pci_read_config(dev, NGE_PCI_INTLINE, 4);
|
||||
|
||||
/* Reset the power state. */
|
||||
printf("nge%d: chip is in D%d power mode "
|
||||
"-- setting to D0\n", unit,
|
||||
pci_get_powerstate(dev));
|
||||
pci_set_powerstate(dev, PCI_POWERSTATE_D0);
|
||||
|
||||
/* Restore PCI config data. */
|
||||
pci_write_config(dev, NGE_PCI_LOIO, iobase, 4);
|
||||
pci_write_config(dev, NGE_PCI_LOMEM, membase, 4);
|
||||
pci_write_config(dev, NGE_PCI_INTLINE, irq, 4);
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Map control/status registers.
|
||||
*/
|
||||
|
@ -227,29 +227,6 @@ txp_attach(dev)
|
||||
|
||||
mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
|
||||
MTX_DEF | MTX_RECURSE);
|
||||
#ifndef BURN_BRIDGES
|
||||
/*
|
||||
* Handle power management nonsense.
|
||||
*/
|
||||
if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
|
||||
u_int32_t iobase, membase, irq;
|
||||
|
||||
/* Save important PCI config data. */
|
||||
iobase = pci_read_config(dev, TXP_PCI_LOIO, 4);
|
||||
membase = pci_read_config(dev, TXP_PCI_LOMEM, 4);
|
||||
irq = pci_read_config(dev, TXP_PCI_INTLINE, 4);
|
||||
|
||||
/* Reset the power state. */
|
||||
device_printf(dev, "chip is in D%d power mode "
|
||||
"-- setting to D0\n", pci_get_powerstate(dev));
|
||||
pci_set_powerstate(dev, PCI_POWERSTATE_D0);
|
||||
|
||||
/* Restore PCI config data. */
|
||||
pci_write_config(dev, TXP_PCI_LOIO, iobase, 4);
|
||||
pci_write_config(dev, TXP_PCI_LOMEM, membase, 4);
|
||||
pci_write_config(dev, TXP_PCI_INTLINE, irq, 4);
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Map control/status registers.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user