From 479b23b772bd9d871d0214433798bbe509e06aee Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Mon, 30 Jan 2006 13:45:55 +0000 Subject: [PATCH] This driver can do hardware VLAN tagging + checksum offloading. In collaboration with: Mihail Balikov --- sys/dev/bge/if_bge.c | 3 ++- sys/dev/em/if_em.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 403dbb5f3ee9..b56e099df979 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -2194,7 +2194,7 @@ bge_attach(dev) IFQ_SET_READY(&ifp->if_snd); ifp->if_hwassist = BGE_CSUM_FEATURES; ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING | - IFCAP_VLAN_MTU; + IFCAP_VLAN_MTU | IFCAP_VLAN_HWCSUM; ifp->if_capenable = ifp->if_capabilities; #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; @@ -3519,6 +3519,7 @@ bge_ioctl(ifp, command, data) ifp->if_hwassist = BGE_CSUM_FEATURES; else ifp->if_hwassist = 0; + VLAN_CAPABILITIES(ifp); } break; default: diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c index ab6e5b591144..6a24365b28f4 100644 --- a/sys/dev/em/if_em.c +++ b/sys/dev/em/if_em.c @@ -854,6 +854,7 @@ em_ioctl(struct ifnet *ifp, u_long command, caddr_t data) } if (reinit && (ifp->if_drv_flags & IFF_DRV_RUNNING)) em_init(adapter); + VLAN_CAPABILITIES(ifp); break; } default: @@ -2193,8 +2194,8 @@ em_setup_interface(device_t dev, struct adapter * adapter) ifp->if_capabilities = ifp->if_capenable = 0; if (adapter->hw.mac_type >= em_82543) { - ifp->if_capabilities |= IFCAP_HWCSUM; - ifp->if_capenable |= IFCAP_HWCSUM; + ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM; + ifp->if_capenable |= IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM; } /*