Tue Jun 11 10:07:09 2013 UTC ()
The wm_linkintr_gmii() function is called from interrupt, so call
mii_pollstat() instead of mii_tick().


(msaitoh)
diff -r1.253 -r1.254 src/sys/dev/pci/if_wm.c

cvs diff -r1.253 -r1.254 src/sys/dev/pci/if_wm.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_wm.c 2013/06/04 16:55:07 1.253
+++ src/sys/dev/pci/if_wm.c 2013/06/11 10:07:09 1.254
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_wm.c,v 1.253 2013/06/04 16:55:07 msaitoh Exp $ */ 1/* $NetBSD: if_wm.c,v 1.254 2013/06/11 10:07:09 msaitoh Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. 4 * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -66,27 +66,27 @@ @@ -66,27 +66,27 @@
66 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 66 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
67 POSSIBILITY OF SUCH DAMAGE. 67 POSSIBILITY OF SUCH DAMAGE.
68 68
69*******************************************************************************/ 69*******************************************************************************/
70/* 70/*
71 * Device driver for the Intel i8254x family of Gigabit Ethernet chips. 71 * Device driver for the Intel i8254x family of Gigabit Ethernet chips.
72 * 72 *
73 * TODO (in order of importance): 73 * TODO (in order of importance):
74 * 74 *
75 * - Rework how parameters are loaded from the EEPROM. 75 * - Rework how parameters are loaded from the EEPROM.
76 */ 76 */
77 77
78#include <sys/cdefs.h> 78#include <sys/cdefs.h>
79__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.253 2013/06/04 16:55:07 msaitoh Exp $"); 79__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.254 2013/06/11 10:07:09 msaitoh Exp $");
80 80
81#include <sys/param.h> 81#include <sys/param.h>
82#include <sys/systm.h> 82#include <sys/systm.h>
83#include <sys/callout.h> 83#include <sys/callout.h>
84#include <sys/mbuf.h> 84#include <sys/mbuf.h>
85#include <sys/malloc.h> 85#include <sys/malloc.h>
86#include <sys/kernel.h> 86#include <sys/kernel.h>
87#include <sys/socket.h> 87#include <sys/socket.h>
88#include <sys/ioctl.h> 88#include <sys/ioctl.h>
89#include <sys/errno.h> 89#include <sys/errno.h>
90#include <sys/device.h> 90#include <sys/device.h>
91#include <sys/queue.h> 91#include <sys/queue.h>
92#include <sys/syslog.h> 92#include <sys/syslog.h>
@@ -3810,29 +3810,29 @@ wm_rxintr(struct wm_softc *sc) @@ -3810,29 +3810,29 @@ wm_rxintr(struct wm_softc *sc)
3810 * wm_linkintr_gmii: 3810 * wm_linkintr_gmii:
3811 * 3811 *
3812 * Helper; handle link interrupts for GMII. 3812 * Helper; handle link interrupts for GMII.
3813 */ 3813 */
3814static void 3814static void
3815wm_linkintr_gmii(struct wm_softc *sc, uint32_t icr) 3815wm_linkintr_gmii(struct wm_softc *sc, uint32_t icr)
3816{ 3816{
3817 3817
3818 DPRINTF(WM_DEBUG_LINK, ("%s: %s:\n", device_xname(sc->sc_dev), 3818 DPRINTF(WM_DEBUG_LINK, ("%s: %s:\n", device_xname(sc->sc_dev),
3819 __func__)); 3819 __func__));
3820 3820
3821 if (icr & ICR_LSC) { 3821 if (icr & ICR_LSC) {
3822 DPRINTF(WM_DEBUG_LINK, 3822 DPRINTF(WM_DEBUG_LINK,
3823 ("%s: LINK: LSC -> mii_tick\n", 3823 ("%s: LINK: LSC -> mii_pollstat\n",
3824 device_xname(sc->sc_dev))); 3824 device_xname(sc->sc_dev)));
3825 mii_tick(&sc->sc_mii); 3825 mii_pollstat(&sc->sc_mii);
3826 if (sc->sc_type == WM_T_82543) { 3826 if (sc->sc_type == WM_T_82543) {
3827 int miistatus, active; 3827 int miistatus, active;
3828 3828
3829 /* 3829 /*
3830 * With 82543, we need to force speed and 3830 * With 82543, we need to force speed and
3831 * duplex on the MAC equal to what the PHY 3831 * duplex on the MAC equal to what the PHY
3832 * speed and duplex configuration is. 3832 * speed and duplex configuration is.
3833 */ 3833 */
3834 miistatus = sc->sc_mii.mii_media_status; 3834 miistatus = sc->sc_mii.mii_media_status;
3835 3835
3836 if (miistatus & IFM_ACTIVE) { 3836 if (miistatus & IFM_ACTIVE) {
3837 active = sc->sc_mii.mii_media_active; 3837 active = sc->sc_mii.mii_media_active;
3838 sc->sc_ctrl &= ~(CTRL_SPEED_MASK | CTRL_FD); 3838 sc->sc_ctrl &= ~(CTRL_SPEED_MASK | CTRL_FD);