diff options
author | yongari <yongari@FreeBSD.org> | 2008-03-23 04:59:13 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2008-03-23 04:59:13 +0000 |
commit | fd413d352f75c321c300654fb2b8d7a5762a9f7f (patch) | |
tree | 36ae3b626d107846b37d5de93edc801938334064 /sys/dev/re | |
parent | 6691d369412f7287c49420f2f5c84f1f9aa5d2f6 (diff) | |
download | FreeBSD-src-fd413d352f75c321c300654fb2b8d7a5762a9f7f.zip FreeBSD-src-fd413d352f75c321c300654fb2b8d7a5762a9f7f.tar.gz |
Always honor configured VLAN/checksum offload capabilities.
Previously re(4) used to blindly enable VLAN hardware tag stripping
and Rx checksum offload regardless of enabled optional features of
interface.
Diffstat (limited to 'sys/dev/re')
-rw-r--r-- | sys/dev/re/if_re.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 6613282..0b8757a 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -2410,6 +2410,7 @@ re_init_locked(sc) struct ifnet *ifp = sc->rl_ifp; struct mii_data *mii; u_int32_t rxcfg = 0; + uint16_t cfg; union { uint32_t align_dummy; u_char eaddr[ETHER_ADDR_LEN]; @@ -2429,9 +2430,13 @@ re_init_locked(sc) * RX checksum offload. We must configure the C+ register * before all others. */ - CSR_WRITE_2(sc, RL_CPLUS_CMD, RL_CPLUSCMD_RXENB| - RL_CPLUSCMD_TXENB|RL_CPLUSCMD_PCI_MRW| - RL_CPLUSCMD_VLANSTRIP|RL_CPLUSCMD_RXCSUM_ENB); + cfg = RL_CPLUSCMD_PCI_MRW; + if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) + cfg |= RL_CPLUSCMD_RXCSUM_ENB; + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) + cfg |= RL_CPLUSCMD_VLANSTRIP; + CSR_WRITE_2(sc, RL_CPLUS_CMD, + cfg | RL_CPLUSCMD_RXENB | RL_CPLUSCMD_TXENB); /* * Init our MAC address. Even though the chipset |