Sat Oct 14 06:59:43 2023 UTC ()
Pull up following revision(s) (requested by riastradh in ticket #414):

	sys/dev/pci/if_rge.c: revision 1.27

rge(4): callout_stop can't be right here; just do callout_halt.


(martin)
diff -r1.24.4.1 -r1.24.4.2 src/sys/dev/pci/if_rge.c

cvs diff -r1.24.4.1 -r1.24.4.2 src/sys/dev/pci/if_rge.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_rge.c 2022/12/21 09:36:42 1.24.4.1
+++ src/sys/dev/pci/if_rge.c 2023/10/14 06:59:43 1.24.4.2
@@ -1,34 +1,34 @@ @@ -1,34 +1,34 @@
1/* $NetBSD: if_rge.c,v 1.24.4.1 2022/12/21 09:36:42 martin Exp $ */ 1/* $NetBSD: if_rge.c,v 1.24.4.2 2023/10/14 06:59:43 martin Exp $ */
2/* $OpenBSD: if_rge.c,v 1.9 2020/12/12 11:48:53 jan Exp $ */ 2/* $OpenBSD: if_rge.c,v 1.9 2020/12/12 11:48:53 jan Exp $ */
3 3
4/* 4/*
5 * Copyright (c) 2019, 2020 Kevin Lo <kevlo@openbsd.org> 5 * Copyright (c) 2019, 2020 Kevin Lo <kevlo@openbsd.org>
6 * 6 *
7 * Permission to use, copy, modify, and distribute this software for any 7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above 8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies. 9 * copyright notice and this permission notice appear in all copies.
10 * 10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */ 18 */
19 19
20#include <sys/cdefs.h> 20#include <sys/cdefs.h>
21__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.24.4.1 2022/12/21 09:36:42 martin Exp $"); 21__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.24.4.2 2023/10/14 06:59:43 martin Exp $");
22 22
23#include <sys/types.h> 23#include <sys/types.h>
24 24
25#include <sys/param.h> 25#include <sys/param.h>
26#include <sys/systm.h> 26#include <sys/systm.h>
27#include <sys/sockio.h> 27#include <sys/sockio.h>
28#include <sys/mbuf.h> 28#include <sys/mbuf.h>
29#include <sys/kernel.h> 29#include <sys/kernel.h>
30#include <sys/socket.h> 30#include <sys/socket.h>
31#include <sys/device.h> 31#include <sys/device.h>
32#include <sys/endian.h> 32#include <sys/endian.h>
33#include <sys/callout.h> 33#include <sys/callout.h>
34#include <sys/workqueue.h> 34#include <sys/workqueue.h>
@@ -828,30 +828,27 @@ rge_init(struct ifnet *ifp) @@ -828,30 +828,27 @@ rge_init(struct ifnet *ifp)
828 828
829 return (0); 829 return (0);
830} 830}
831 831
832/* 832/*
833 * Stop the adapter and free any mbufs allocated to the RX and TX lists. 833 * Stop the adapter and free any mbufs allocated to the RX and TX lists.
834 */ 834 */
835void 835void
836rge_stop(struct ifnet *ifp, int disable) 836rge_stop(struct ifnet *ifp, int disable)
837{ 837{
838 struct rge_softc *sc = ifp->if_softc; 838 struct rge_softc *sc = ifp->if_softc;
839 int i; 839 int i;
840 840
841 if (disable) { 841 callout_halt(&sc->sc_timeout, NULL);
842 callout_halt(&sc->sc_timeout, NULL); 
843 } else 
844 callout_stop(&sc->sc_timeout); 
845 842
846 ifp->if_timer = 0; 843 ifp->if_timer = 0;
847 ifp->if_flags &= ~IFF_RUNNING; 844 ifp->if_flags &= ~IFF_RUNNING;
848 sc->rge_timerintr = 0; 845 sc->rge_timerintr = 0;
849 846
850 RGE_CLRBIT_4(sc, RGE_RXCFG, RGE_RXCFG_ALLPHYS | RGE_RXCFG_INDIV | 847 RGE_CLRBIT_4(sc, RGE_RXCFG, RGE_RXCFG_ALLPHYS | RGE_RXCFG_INDIV |
851 RGE_RXCFG_MULTI | RGE_RXCFG_BROAD | RGE_RXCFG_RUNT | 848 RGE_RXCFG_MULTI | RGE_RXCFG_BROAD | RGE_RXCFG_RUNT |
852 RGE_RXCFG_ERRPKT); 849 RGE_RXCFG_ERRPKT);
853 850
854 RGE_WRITE_4(sc, RGE_IMR, 0); 851 RGE_WRITE_4(sc, RGE_IMR, 0);
855 852
856 /* Clear timer interrupts. */ 853 /* Clear timer interrupts. */
857 RGE_WRITE_4(sc, RGE_TIMERINT0, 0); 854 RGE_WRITE_4(sc, RGE_TIMERINT0, 0);