diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2011-07-08 18:56:48 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2011-07-08 18:56:48 +0000 |
commit | 3ba347c2305c46d04415a82bb7fa3e6736027042 (patch) | |
tree | daea9640e39683a6d3cd2c8c5f38095dd5bcf3a9 /sys/dev/ic | |
parent | 1ff79293deb8c64da65610ee35f8102123c898fc (diff) |
Fix WoL support in xl(4). Now works with my hardware (3Com 3c905C).
ok deraadt
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/xl.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/sys/dev/ic/xl.c b/sys/dev/ic/xl.c index 912db1867fa..d3631653e61 100644 --- a/sys/dev/ic/xl.c +++ b/sys/dev/ic/xl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xl.c,v 1.102 2011/06/21 16:52:45 tedu Exp $ */ +/* $OpenBSD: xl.c,v 1.103 2011/07/08 18:56:47 stsp Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -193,6 +193,7 @@ void xl_miibus_writereg(struct device *, int, int, int); void xl_miibus_statchg(struct device *); #ifndef SMALL_KERNEL int xl_wol(struct ifnet *, int); +void xl_wol_power(struct xl_softc *); #endif int @@ -204,6 +205,9 @@ xl_activate(struct device *self, int act) switch (act) { case DVACT_QUIESCE: +#ifndef SMALL_KERNEL + xl_wol_power(sc); +#endif rv = config_activate_children(self, act); break; case DVACT_SUSPEND: @@ -2371,12 +2375,23 @@ xl_stop(struct xl_softc *sc) xl_freetxrx(sc); #ifndef SMALL_KERNEL - /* Call upper layer WOL power routine if WOL is enabled. */ - if ((sc->xl_flags & XL_FLAG_WOL) && sc->wol_power) - sc->wol_power(sc->wol_power_arg); + xl_wol_power(sc); #endif } +#ifndef SMALL_KERNEL +void +xl_wol_power(struct xl_softc *sc) +{ + /* Re-enable RX and call upper layer WOL power routine + * if WOL is enabled. */ + if ((sc->xl_flags & XL_FLAG_WOL) && sc->wol_power) { + CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_ENABLE); + sc->wol_power(sc->wol_power_arg); + } +} +#endif + void xl_attach(struct xl_softc *sc) { |