summaryrefslogtreecommitdiffstats
path: root/sys/dev/mxge/if_mxge.c
diff options
context:
space:
mode:
authorgallatin <gallatin@FreeBSD.org>2011-04-06 15:45:32 +0000
committergallatin <gallatin@FreeBSD.org>2011-04-06 15:45:32 +0000
commit2634e2269f31fe64a28b03dddc844bd7960b8ef6 (patch)
treecfbcacbf2861dc658c4e9e19a22e7935658b5d66 /sys/dev/mxge/if_mxge.c
parent63a1889bd7d9633d4d14df6de61e23ddf9ac7d12 (diff)
downloadFreeBSD-src-2634e2269f31fe64a28b03dddc844bd7960b8ef6.zip
FreeBSD-src-2634e2269f31fe64a28b03dddc844bd7960b8ef6.tar.gz
Implement mxge_init()
This fixes a long standing bug in mxge(4) where "ifconfig mxge0 $IP" did not bring the interface into a RUNNING state, like it does on most (all?) other FreeBSD NIC drivers. Thanks to gnn for mentioning the bug, and yongari for pointing out that ether_ioctl() invokes ifp->if_init() in SIOCSIFADDR. MFC after: 7 days
Diffstat (limited to 'sys/dev/mxge/if_mxge.c')
-rw-r--r--sys/dev/mxge/if_mxge.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/mxge/if_mxge.c b/sys/dev/mxge/if_mxge.c
index 6e6d649..f6164d0 100644
--- a/sys/dev/mxge/if_mxge.c
+++ b/sys/dev/mxge/if_mxge.c
@@ -3054,6 +3054,14 @@ mxge_intr(void *arg)
static void
mxge_init(void *arg)
{
+ mxge_softc_t *sc = arg;
+ struct ifnet *ifp = sc->ifp;
+
+
+ mtx_lock(&sc->driver_mtx);
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+ (void) mxge_open(sc);
+ mtx_unlock(&sc->driver_mtx);
}
OpenPOWER on IntegriCloud