Turn on hardware vlan tagging and vlan mtu for NICs which have these
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 26 Mar 2007 12:13:58 +0000 (12:13 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 26 Mar 2007 12:13:58 +0000 (12:13 +0000)
capabilities.

Submitted-by: Gary Allan <dragonfly@gallan.plus.com>
Reviewed-by: dillon@
sys/dev/netif/bge/if_bge.c
sys/dev/netif/gx/if_gx.c
sys/dev/netif/nge/if_nge.c
sys/dev/netif/ti/if_ti.c
sys/dev/netif/txp/if_txp.c

index 75137da..ea1b886 100644 (file)
@@ -31,7 +31,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/bge/if_bge.c,v 1.3.2.29 2003/12/01 21:06:59 ambrisko Exp $
- * $DragonFly: src/sys/dev/netif/bge/if_bge.c,v 1.59 2006/12/20 18:14:39 dillon Exp $
+ * $DragonFly: src/sys/dev/netif/bge/if_bge.c,v 1.60 2007/03/26 12:13:58 sephe Exp $
  *
  */
 
@@ -1665,7 +1665,8 @@ bge_attach(device_t dev)
        ifq_set_maxlen(&ifp->if_snd, BGE_TX_RING_CNT - 1);
        ifq_set_ready(&ifp->if_snd);
        ifp->if_hwassist = BGE_CSUM_FEATURES;
-       ifp->if_capabilities = IFCAP_HWCSUM;
+       ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING |
+           IFCAP_VLAN_MTU;
        ifp->if_capenable = ifp->if_capabilities;
 
        /*
index b73d4be..9d33eaf 100644 (file)
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/gx/if_gx.c,v 1.2.2.3 2001/12/14 19:51:39 jlemon Exp $
- * $DragonFly: src/sys/dev/netif/gx/Attic/if_gx.c,v 1.26 2006/12/22 23:26:20 swildner Exp $
+ * $DragonFly: src/sys/dev/netif/gx/Attic/if_gx.c,v 1.27 2007/03/26 12:13:58 sephe Exp $
  */
 
 #include <sys/param.h>
@@ -332,11 +332,12 @@ gx_attach(device_t dev)
        ifp->if_init = gx_init;
        ifp->if_mtu = ETHERMTU;
        ifq_set_maxlen(&ifp->if_snd, GX_TX_RING_CNT - 1);
+       ifp->if_capabilities = IFCAP_VLAN_HWTAGGING;
        ifq_set_ready(&ifp->if_snd);
 
        /* see if we can enable hardware checksumming */
        if (gx->gx_vflags & GXF_CSUM) {
-               ifp->if_capabilities = IFCAP_HWCSUM;
+               ifp->if_capabilities |= IFCAP_HWCSUM;
                ifp->if_capenable = ifp->if_capabilities;
        }
 
index 093c5b6..1c778dd 100644 (file)
@@ -31,7 +31,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/nge/if_nge.c,v 1.13.2.13 2003/02/05 22:03:57 mbr Exp $
- * $DragonFly: src/sys/dev/netif/nge/if_nge.c,v 1.41 2006/12/22 23:26:21 swildner Exp $
+ * $DragonFly: src/sys/dev/netif/nge/if_nge.c,v 1.42 2007/03/26 12:13:58 sephe Exp $
  */
 
 /*
@@ -847,7 +847,7 @@ nge_attach(device_t dev)
        ifq_set_maxlen(&ifp->if_snd, NGE_TX_LIST_CNT - 1);
        ifq_set_ready(&ifp->if_snd);
        ifp->if_hwassist = NGE_CSUM_FEATURES;
-       ifp->if_capabilities = IFCAP_HWCSUM;
+       ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING;
        ifp->if_capenable = ifp->if_capabilities;
 
        /*
index 0c24c3d..59c6029 100644 (file)
@@ -30,7 +30,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/pci/if_ti.c,v 1.25.2.14 2002/02/15 04:20:20 silby Exp $
- * $DragonFly: src/sys/dev/netif/ti/if_ti.c,v 1.43 2007/03/07 12:33:07 sephe Exp $
+ * $DragonFly: src/sys/dev/netif/ti/if_ti.c,v 1.44 2007/03/26 12:13:58 sephe Exp $
  */
 
 /*
@@ -1407,7 +1407,8 @@ ti_attach(device_t dev)
        sc = device_get_softc(dev);
        ifp = &sc->arpcom.ac_if;
        if_initname(ifp, device_get_name(dev), device_get_unit(dev));
-       ifp->if_capabilities = IFCAP_HWCSUM;
+       ifp->if_capabilities = IFCAP_HWCSUM |
+           IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU;
        ifp->if_capenable = ifp->if_capabilities;
 
        pci_enable_busmaster(dev);
index 5170a91..7f82f6a 100644 (file)
@@ -1,6 +1,6 @@
 /*     $OpenBSD: if_txp.c,v 1.48 2001/06/27 06:34:50 kjc Exp $ */
 /*     $FreeBSD: src/sys/dev/txp/if_txp.c,v 1.4.2.4 2001/12/14 19:50:43 jlemon Exp $ */
-/*     $DragonFly: src/sys/dev/netif/txp/if_txp.c,v 1.41 2006/12/22 23:26:22 swildner Exp $ */
+/*     $DragonFly: src/sys/dev/netif/txp/if_txp.c,v 1.42 2007/03/26 12:13:58 sephe Exp $ */
 
 /*
  * Copyright (c) 2001
@@ -1718,6 +1718,7 @@ txp_capabilities(struct txp_softc *sc)
        if (rsp->rsp_par2 & rsp->rsp_par3 & OFFLOAD_VLAN) {
                sc->sc_tx_capability |= OFFLOAD_VLAN;
                sc->sc_rx_capability |= OFFLOAD_VLAN;
+               ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING;
        }
 
 #if 0