diff options
author | 2014-12-08 10:58:45 +0000 | |
---|---|---|
committer | 2014-12-08 10:58:45 +0000 | |
commit | 5de6e4dce78f649dcb610ed5fe81a45573921b1a (patch) | |
tree | a24629774ff511cac5251db3018059d3d9170e0a /sys/dev/pci/if_sis.c | |
parent | Do not use a "struct route" when a "struct rtentry" is enough. (diff) | |
download | wireguard-openbsd-5de6e4dce78f649dcb610ed5fe81a45573921b1a.tar.xz wireguard-openbsd-5de6e4dce78f649dcb610ed5fe81a45573921b1a.zip |
Have foo_init() call foo_reset() to reset the chip to a known state
as is the case for a lot of the other drivers. Remove some redundant
calls to foo_stop() and foo_reset() before foo_init().
Tested with DP83815, 3c905C, 8139 and ST201.
Mostly from FreeBSD.
Diffstat (limited to 'sys/dev/pci/if_sis.c')
-rw-r--r-- | sys/dev/pci/if_sis.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c index 87ecf789e3b..2524b9d8bea 100644 --- a/sys/dev/pci/if_sis.c +++ b/sys/dev/pci/if_sis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sis.c,v 1.118 2014/11/24 10:33:37 brad Exp $ */ +/* $OpenBSD: if_sis.c,v 1.119 2014/12/08 10:58:45 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. @@ -1552,10 +1552,8 @@ sis_intr(void *arg) sis_rx_list[sc->sis_cdata.sis_rx_cons])); } - if (status & SIS_ISR_SYSERR) { - sis_reset(sc); + if (status & SIS_ISR_SYSERR) sis_init(sc); - } /* * XXX: Re-enable RX engine every time otherwise it occasionally @@ -1697,6 +1695,11 @@ sis_init(void *xsc) */ sis_stop(sc); + /* + * Reset the chip to a known state. + */ + sis_reset(sc); + #if NS_IHR_DELAY > 0 /* Configure interrupt holdoff register. */ if (sc->sis_type == SIS_TYPE_83815 && sc->sis_srr == NS_SRR_16A) @@ -1926,8 +1929,6 @@ sis_watchdog(struct ifnet *ifp) printf("%s: watchdog timeout\n", sc->sc_dev.dv_xname); s = splnet(); - sis_stop(sc); - sis_reset(sc); sis_init(sc); if (!IFQ_IS_EMPTY(&ifp->if_snd)) |