| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ralink_eth.c,v 1.22 2021/08/17 22:00:30 andvar Exp $ */ | | 1 | /* $NetBSD: ralink_eth.c,v 1.23 2022/03/16 10:08:02 andvar Exp $ */ |
2 | /*- | | 2 | /*- |
3 | * Copyright (c) 2011 CradlePoint Technology, Inc. | | 3 | * Copyright (c) 2011 CradlePoint Technology, Inc. |
4 | * All rights reserved. | | 4 | * All rights reserved. |
5 | * | | 5 | * |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -19,27 +19,27 @@ | | | @@ -19,27 +19,27 @@ |
19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS | | 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS |
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
26 | * POSSIBILITY OF SUCH DAMAGE. | | 26 | * POSSIBILITY OF SUCH DAMAGE. |
27 | */ | | 27 | */ |
28 | | | 28 | |
29 | /* ralink_eth.c -- Ralink Ethernet Driver */ | | 29 | /* ralink_eth.c -- Ralink Ethernet Driver */ |
30 | | | 30 | |
31 | #include <sys/cdefs.h> | | 31 | #include <sys/cdefs.h> |
32 | __KERNEL_RCSID(0, "$NetBSD: ralink_eth.c,v 1.22 2021/08/17 22:00:30 andvar Exp $"); | | 32 | __KERNEL_RCSID(0, "$NetBSD: ralink_eth.c,v 1.23 2022/03/16 10:08:02 andvar Exp $"); |
33 | | | 33 | |
34 | #include <sys/param.h> | | 34 | #include <sys/param.h> |
35 | #include <sys/bus.h> | | 35 | #include <sys/bus.h> |
36 | #include <sys/callout.h> | | 36 | #include <sys/callout.h> |
37 | #include <sys/device.h> | | 37 | #include <sys/device.h> |
38 | #include <sys/endian.h> | | 38 | #include <sys/endian.h> |
39 | #include <sys/errno.h> | | 39 | #include <sys/errno.h> |
40 | #include <sys/ioctl.h> | | 40 | #include <sys/ioctl.h> |
41 | #include <sys/intr.h> | | 41 | #include <sys/intr.h> |
42 | #include <sys/kernel.h> | | 42 | #include <sys/kernel.h> |
43 | #include <sys/malloc.h> | | 43 | #include <sys/malloc.h> |
44 | #include <sys/mbuf.h> | | 44 | #include <sys/mbuf.h> |
45 | #include <sys/socket.h> | | 45 | #include <sys/socket.h> |
| @@ -1315,27 +1315,27 @@ ralink_eth_watchdog(struct ifnet *ifp) | | | @@ -1315,27 +1315,27 @@ ralink_eth_watchdog(struct ifnet *ifp) |
1315 | ralink_eth_softc_t * const sc = ifp->if_softc; | | 1315 | ralink_eth_softc_t * const sc = ifp->if_softc; |
1316 | bool doing_transmit; | | 1316 | bool doing_transmit; |
1317 | | | 1317 | |
1318 | sc->sc_evcnt_watchdog.ev_count++; | | 1318 | sc->sc_evcnt_watchdog.ev_count++; |
1319 | doing_transmit = !SIMPLEQ_EMPTY(&sc->sc_txdirtyq); | | 1319 | doing_transmit = !SIMPLEQ_EMPTY(&sc->sc_txdirtyq); |
1320 | | | 1320 | |
1321 | if (doing_transmit) { | | 1321 | if (doing_transmit) { |
1322 | RALINK_DEBUG(RALINK_DEBUG_ERROR, "%s: transmit timeout\n", | | 1322 | RALINK_DEBUG(RALINK_DEBUG_ERROR, "%s: transmit timeout\n", |
1323 | ifp->if_xname); | | 1323 | ifp->if_xname); |
1324 | if_statinc(ifp, if_oerrors); | | 1324 | if_statinc(ifp, if_oerrors); |
1325 | sc->sc_evcnt_wd_tx.ev_count++; | | 1325 | sc->sc_evcnt_wd_tx.ev_count++; |
1326 | } else { | | 1326 | } else { |
1327 | RALINK_DEBUG(RALINK_DEBUG_ERROR, | | 1327 | RALINK_DEBUG(RALINK_DEBUG_ERROR, |
1328 | "%s: spurious watchog timeout\n", ifp->if_xname); | | 1328 | "%s: spurious watchdog timeout\n", ifp->if_xname); |
1329 | sc->sc_evcnt_wd_spurious.ev_count++; | | 1329 | sc->sc_evcnt_wd_spurious.ev_count++; |
1330 | return; | | 1330 | return; |
1331 | } | | 1331 | } |
1332 | | | 1332 | |
1333 | sc->sc_evcnt_wd_reactivate.ev_count++; | | 1333 | sc->sc_evcnt_wd_reactivate.ev_count++; |
1334 | const int s = splnet(); | | 1334 | const int s = splnet(); |
1335 | /* deactive the active partitions, retaining the active information */ | | 1335 | /* deactive the active partitions, retaining the active information */ |
1336 | ralink_eth_disable(sc); | | 1336 | ralink_eth_disable(sc); |
1337 | ralink_eth_enable(sc); | | 1337 | ralink_eth_enable(sc); |
1338 | splx(s); | | 1338 | splx(s); |
1339 | | | 1339 | |
1340 | /* Try to get more packets going. */ | | 1340 | /* Try to get more packets going. */ |
1341 | ralink_eth_start(ifp); | | 1341 | ralink_eth_start(ifp); |