summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/ps3
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2011-07-05 15:00:55 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2011-07-05 15:00:55 +0000
commit8bd12d5b1edecd460e700a6defada9c7a58cc475 (patch)
treebc8e8ac7f40f81d4853b90386a3a9a9a736ec995 /sys/powerpc/ps3
parentab457ece63e390d3a0f0d21dc83ca6e5aa51f8c8 (diff)
downloadFreeBSD-src-8bd12d5b1edecd460e700a6defada9c7a58cc475.zip
FreeBSD-src-8bd12d5b1edecd460e700a6defada9c7a58cc475.tar.gz
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>
Diffstat (limited to 'sys/powerpc/ps3')
-rw-r--r--sys/powerpc/ps3/if_glc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/powerpc/ps3/if_glc.c b/sys/powerpc/ps3/if_glc.c
index d87383d..ab5c172 100644
--- a/sys/powerpc/ps3/if_glc.c
+++ b/sys/powerpc/ps3/if_glc.c
@@ -155,7 +155,7 @@ glc_attach(device_t dev)
lv1_net_control(sc->sc_bus, sc->sc_dev, GELIC_GET_MAC_ADDRESS,
0, 0, 0, &mac64, &junk);
memcpy(sc->sc_enaddr, &((uint8_t *)&mac64)[2], sizeof(sc->sc_enaddr));
- sc->sc_tx_vlan = sc->sc_rx_vlan = -1;
+ sc->sc_tx_vlan = sc->sc_rx_vlan = -1;
err = lv1_net_control(sc->sc_bus, sc->sc_dev, GELIC_GET_VLAN_ID,
GELIC_VLAN_TX_ETHERNET, 0, 0, &val, &junk);
if (err == 0)
@@ -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,8 +755,11 @@ 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)
- m_adj(m, 2);
+ /*
+ * 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);
(*ifp->if_input)(ifp, m);
OpenPOWER on IntegriCloud