From 0d857d9bf6eff24311b6958f0727c21593f46973 Mon Sep 17 00:00:00 2001 From: yar Date: Fri, 21 May 2004 20:34:04 +0000 Subject: [PATCH] Cosmetic: Set capability bits in a consistent way. Add a comment on why the VLAN_MTU stuff comes after ether_ifattach(). --- sys/dev/fxp/if_fxp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index d0b6467b5434..b5c772521578 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -797,11 +797,13 @@ fxp_attach(device_t dev) ifp->if_start = fxp_start; ifp->if_watchdog = fxp_watchdog; + ifp->if_capabilities = ifp->if_capenable = 0; + /* Enable checksum offload for 82550 or better chips */ if (sc->flags & FXP_FLAG_EXT_RFA) { ifp->if_hwassist = FXP_CSUM_FEATURES; - ifp->if_capabilities = IFCAP_HWCSUM; - ifp->if_capenable = ifp->if_capabilities; + ifp->if_capabilities |= IFCAP_HWCSUM; + ifp->if_capenable |= IFCAP_HWCSUM; } #ifdef DEVICE_POLLING @@ -817,6 +819,8 @@ fxp_attach(device_t dev) /* * Tell the upper layer(s) we support long frames. + * Must appear after the call to ether_ifattach() because + * ether_ifattach() sets ifi_hdrlen to the default value. */ ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); ifp->if_capabilities |= IFCAP_VLAN_MTU;