diff options
author | yongari <yongari@FreeBSD.org> | 2011-12-06 00:18:37 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2011-12-06 00:18:37 +0000 |
commit | 34f19f4f468ebbf3f4f8b2303e4c773218d00ccf (patch) | |
tree | 7ea741794fc6807bbaab4a0efb1a35f8865bc17f /sys/dev | |
parent | 30ed24b5a9194e21eedb4b1a2652577d964fedcc (diff) | |
download | FreeBSD-src-34f19f4f468ebbf3f4f8b2303e4c773218d00ccf.zip FreeBSD-src-34f19f4f468ebbf3f4f8b2303e4c773218d00ccf.tar.gz |
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.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/et/if_et.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/et/if_et.c b/sys/dev/et/if_et.c index 8138d90..dac78b8 100644 --- a/sys/dev/et/if_et.c +++ b/sys/dev/et/if_et.c @@ -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); |