Make sure to clear PMDR register by writing back power management
events. Just reading PMDR register was not enough to have fxp(4) immuninize against received magic packets during system boot. Tested by: Alexey Shuvaev < shuvaev <> physik DOT uni-wuerzburg DOT de >
This commit is contained in:
parent
e44730ed21
commit
af75b654d2
@ -857,7 +857,7 @@ fxp_attach(device_t dev)
|
||||
if ((sc->flags & FXP_FLAG_WOLCAP) != 0) {
|
||||
FXP_LOCK(sc);
|
||||
/* Clear wakeup events. */
|
||||
CSR_READ_1(sc, FXP_CSR_PMDR);
|
||||
CSR_WRITE_1(sc, FXP_CSR_PMDR, CSR_READ_1(sc, FXP_CSR_PMDR));
|
||||
fxp_init_body(sc);
|
||||
fxp_stop(sc);
|
||||
FXP_UNLOCK(sc);
|
||||
@ -1050,10 +1050,9 @@ fxp_resume(device_t dev)
|
||||
/* Disable PME and clear PME status. */
|
||||
pmstat &= ~PCIM_PSTAT_PMEENABLE;
|
||||
pci_write_config(sc->dev, pmc + PCIR_POWER_STATUS, pmstat, 2);
|
||||
if ((sc->flags & FXP_FLAG_WOLCAP) != 0) {
|
||||
/* Clear wakeup events. */
|
||||
CSR_READ_1(sc, FXP_CSR_PMDR);
|
||||
}
|
||||
if ((sc->flags & FXP_FLAG_WOLCAP) != 0)
|
||||
CSR_WRITE_1(sc, FXP_CSR_PMDR,
|
||||
CSR_READ_1(sc, FXP_CSR_PMDR));
|
||||
}
|
||||
|
||||
CSR_WRITE_4(sc, FXP_CSR_PORT, FXP_PORT_SELECTIVE_RESET);
|
||||
|
Loading…
x
Reference in New Issue
Block a user