diff options
author | yongari <yongari@FreeBSD.org> | 2007-02-15 06:21:34 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2007-02-15 06:21:34 +0000 |
commit | 6449cfa01d3f6ff51bd43cb8dbd1163389c80e78 (patch) | |
tree | 342da5accf962b711c053c377bef0ddaca93ef8a /sys/dev/msk | |
parent | 3e7d1b7ebd5855848ef2b1db847372eb38b16fd5 (diff) | |
download | FreeBSD-src-6449cfa01d3f6ff51bd43cb8dbd1163389c80e78.zip FreeBSD-src-6449cfa01d3f6ff51bd43cb8dbd1163389c80e78.tar.gz |
Unbreak non-H/W VLAN extraction case.
Unlike other GigEs Yukon II always set VLAN bit when it detects VLAN
tagged packet regardless of H/W VLAN processing configuration state.
So it need to check IFCAP_VLAN_HWTAGGING bit to know whether driver
is configured to take advantage of H/W VLAN processing. If H/W VLAN
processing was disabled don't adjust received packet length such that
subsequent validation logic works for software VLAN processing.
Reported by: bms
Tested by: bms
Diffstat (limited to 'sys/dev/msk')
-rw-r--r-- | sys/dev/msk/if_msk.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c index 644a132..d6b10bff 100644 --- a/sys/dev/msk/if_msk.c +++ b/sys/dev/msk/if_msk.c @@ -3029,7 +3029,8 @@ msk_rxeof(struct msk_if_softc *sc_if, uint32_t status, int len) cons = sc_if->msk_cdata.msk_rx_cons; do { rxlen = status >> 16; - if ((status & GMR_FS_VLAN) != 0) + if ((status & GMR_FS_VLAN) != 0 && + (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) rxlen -= ETHER_VLAN_ENCAP_LEN; if (len > sc_if->msk_framesize || ((status & GMR_FS_ANY_ERR) != 0) || @@ -3081,7 +3082,8 @@ msk_jumbo_rxeof(struct msk_if_softc *sc_if, uint32_t status, int len) cons = sc_if->msk_cdata.msk_rx_cons; do { rxlen = status >> 16; - if ((status & GMR_FS_VLAN) != 0) + if ((status & GMR_FS_VLAN) != 0 && + (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) rxlen -= ETHER_VLAN_ENCAP_LEN; if (len > sc_if->msk_framesize || ((status & GMR_FS_ANY_ERR) != 0) || |