Follow Linux by unconditionally stripping the RX vlan tag from incoming

packets. It turns out that all firmware versions insert it, whether or not
they support VLAN tagging.

Submitted by:	glevand <geoffrey.levand at mail dot ru>
This commit is contained in:
Nathan Whitehorn 2011-07-05 15:00:55 +00:00
parent a1068a7d47
commit 534c6b8916

View File

@ -178,7 +178,7 @@ glc_attach(device_t dev)
}
bus_setup_intr(dev, sc->sc_irq,
INTR_TYPE_MISC | INTR_MPSAFE | INTR_ENTROPY,
INTR_TYPE_NET | INTR_MPSAFE | INTR_ENTROPY,
glc_intr_filter, glc_intr, sc, &sc->sc_irqctx);
sc->sc_hwirq_status = (uint64_t *)contigmalloc(8, M_GLC, M_ZERO, 0,
BUS_SPACE_MAXADDR_32BIT, 8, PAGE_SIZE);
@ -755,7 +755,10 @@ glc_rxintr(struct glc_softc *sc)
m->m_len = sc->sc_rxdmadesc[i].valid_size;
m->m_pkthdr.len = m->m_len;
if (sc->sc_rx_vlan >= 0)
/*
* Remove VLAN tag. Even on early firmwares that do not allow
* multiple VLANs, the VLAN tag is still in place here.
*/
m_adj(m, 2);
mtx_unlock(&sc->sc_mtx);