Don't make assumptions of the actual value of PCI_PMCSR_STATE_D0.

Problem noted by John Hawkinson.
This commit is contained in:
tron 2000-07-17 18:12:00 +00:00
parent cfae3184d8
commit 5446d3c92e
2 changed files with 10 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_epic_pci.c,v 1.13 2000/07/17 17:53:44 tron Exp $ */
/* $NetBSD: if_epic_pci.c,v 1.14 2000/07/17 18:12:00 tron Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -173,7 +173,8 @@ epic_pci_attach(parent, self, aux)
printf(": waking up from power state D%d\n%s",
reg & PCI_PMCSR_STATE_MASK, sc->sc_dev.dv_xname);
pci_conf_write(pc, pa->pa_tag, pmreg + 4,
reg & ~PCI_PMCSR_STATE_MASK);
(reg & ~PCI_PMCSR_STATE_MASK) |
PCI_PMCSR_STATE_D0);
break;
case PCI_PMCSR_STATE_D3:
/*
@ -183,7 +184,8 @@ epic_pci_attach(parent, self, aux)
printf(": unable to wake up from power state D3, "
"reboot required.\n");
pci_conf_write(pc, pa->pa_tag, pmreg + 4,
reg & ~PCI_PMCSR_STATE_MASK);
(reg & ~PCI_PMCSR_STATE_MASK) |
PCI_PMCSR_STATE_D0);
return;
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_tlp_pci.c,v 1.44 2000/07/17 17:53:44 tron Exp $ */
/* $NetBSD: if_tlp_pci.c,v 1.45 2000/07/17 18:12:00 tron Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@ -489,7 +489,8 @@ tlp_pci_attach(parent, self, aux)
printf(": waking up from power state D%d\n%s",
reg & PCI_PMCSR_STATE_MASK, sc->sc_dev.dv_xname);
pci_conf_write(pc, pa->pa_tag, pmreg + 4,
reg & ~PCI_PMCSR_STATE_MASK);
(reg & ~PCI_PMCSR_STATE_MASK) |
PCI_PMCSR_STATE_D0);
break;
case PCI_PMCSR_STATE_D3:
/*
@ -499,7 +500,8 @@ tlp_pci_attach(parent, self, aux)
printf(": unable to wake up from power state D3, "
"reboot required.\n");
pci_conf_write(pc, pa->pa_tag, pmreg + 4,
reg & ~PCI_PMCSR_STATE_MASK);
(reg & ~PCI_PMCSR_STATE_MASK) |
PCI_PMCSR_STATE_D0);
return;
}
}