svn commit: r228297 - head/sys/dev/et

Pyun YongHyeon yongari at FreeBSD.org
Tue Dec 6 00:18:38 UTC 2011


Author: yongari
Date: Tue Dec  6 00:18:37 2011
New Revision: 228297
URL: http://svn.freebsd.org/changeset/base/228297

Log:
  et(4) supports VLAN oversized frame so correctly set header length.
  While I'm here remove initializing if_mtu, it is set by
  ether_ifattach(9).  Also move callout_init_mtx(9) to the right below
  driver lock initialization.

Modified:
  head/sys/dev/et/if_et.c

Modified: head/sys/dev/et/if_et.c
==============================================================================
--- head/sys/dev/et/if_et.c	Tue Dec  6 00:13:40 2011	(r228296)
+++ head/sys/dev/et/if_et.c	Tue Dec  6 00:18:37 2011	(r228297)
@@ -244,6 +244,7 @@ et_attach(device_t dev)
 	sc->dev = dev;
 	mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
 	    MTX_DEF);
+	callout_init_mtx(&sc->sc_tick, &sc->sc_mtx, 0);
 
 	ifp = sc->ifp = if_alloc(IFT_ETHER);
 	if (ifp == NULL) {
@@ -335,7 +336,6 @@ et_attach(device_t dev)
 	ifp->if_init = et_init;
 	ifp->if_ioctl = et_ioctl;
 	ifp->if_start = et_start;
-	ifp->if_mtu = ETHERMTU;
 	ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_VLAN_MTU;
 	ifp->if_capenable = ifp->if_capabilities;
 	ifp->if_snd.ifq_drv_maxlen = ET_TX_NDESC - 1;
@@ -352,7 +352,9 @@ et_attach(device_t dev)
 	}
 
 	ether_ifattach(ifp, eaddr);
-	callout_init_mtx(&sc->sc_tick, &sc->sc_mtx, 0);
+
+	/* Tell the upper layer(s) we support long frames. */
+	ifp->if_hdrlen = sizeof(struct ether_vlan_header);
 
 	error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_NET | INTR_MPSAFE,
 	    NULL, et_intr, sc, &sc->sc_irq_handle);


More information about the svn-src-all mailing list