diff options
author | brooks <brooks@FreeBSD.org> | 2001-09-05 21:10:28 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2001-09-05 21:10:28 +0000 |
commit | 7da2447808dd5233fae946a91d1cbc895d9ed346 (patch) | |
tree | db9a1b36fca844efd89c94c81d0a7b9fb126f325 /sys/dev/txp | |
parent | 06023d7a89677d7f21d97275f61ba4e8a4d4cf69 (diff) | |
download | FreeBSD-src-7da2447808dd5233fae946a91d1cbc895d9ed346.zip FreeBSD-src-7da2447808dd5233fae946a91d1cbc895d9ed346.tar.gz |
Make vlan(4) loadable, unloadable, and clonable. As a side effect,
interfaces must now always enable VLAN support.
Reviewed by: jlemon
MFC after: 3 weeks
Diffstat (limited to 'sys/dev/txp')
-rw-r--r-- | sys/dev/txp/if_txp.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/sys/dev/txp/if_txp.c b/sys/dev/txp/if_txp.c index f5e72b1..d9aa0b7 100644 --- a/sys/dev/txp/if_txp.c +++ b/sys/dev/txp/if_txp.c @@ -39,8 +39,6 @@ * Driver for 3c990 (Typhoon) Ethernet ASIC */ -#include "vlan.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/sockio.h> @@ -54,6 +52,7 @@ #include <net/ethernet.h> #include <net/if_dl.h> #include <net/if_types.h> +#include <net/if_vlan_var.h> #include <netinet/in.h> #include <netinet/in_systm.h> @@ -66,10 +65,6 @@ #include <net/bpf.h> -#if NVLAN > 0 -#include <net/if_vlan_var.h> -#endif - #include <vm/vm.h> /* for vtophys */ #include <vm/pmap.h> /* for vtophys */ #include <machine/clock.h> /* for DELAY */ @@ -809,14 +804,11 @@ txp_rx_reclaim(sc, r) /* Remove header from mbuf and pass it on. */ m_adj(m, sizeof(struct ether_header)); -#if NVLAN > 0 if (rxd->rx_stat & RX_STAT_VLAN) { - if (vlan_input_tag(eh, m, - htons(rxd->rx_vlan >> 16)) < 0) - ifp->if_noproto++; + VLAN_INPUT_TAG(ifp, eh, m, htons(rxd->rx_vlan >> 16)); goto next; } -#endif + ether_input(ifp, eh, m); next: @@ -1317,9 +1309,7 @@ txp_start(ifp) struct mbuf *m, *m0; struct txp_swdesc *sd; u_int32_t firstprod, firstcnt, prod, cnt; -#if NVLAN > 0 struct ifvlan *ifv; -#endif if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING) return; @@ -1356,14 +1346,13 @@ txp_start(ifp) if (++cnt >= (TX_ENTRIES - 4)) goto oactive; -#if NVLAN > 0 if ((m->m_flags & (M_PROTO1|M_PKTHDR)) == (M_PROTO1|M_PKTHDR) && m->m_pkthdr.rcvif != NULL) { ifv = m->m_pkthdr.rcvif->if_softc; txd->tx_pflags = TX_PFLAGS_VLAN | (htons(ifv->ifv_tag) << TX_PFLAGS_VLANTAG_S); } -#endif + if (m->m_pkthdr.csum_flags & CSUM_IP) txd->tx_pflags |= TX_PFLAGS_IPCKSUM; @@ -1879,12 +1868,10 @@ txp_capabilities(sc) sc->sc_tx_capability = ext->ext_1 & OFFLOAD_MASK; sc->sc_rx_capability = ext->ext_2 & OFFLOAD_MASK; -#if NVLAN > 0 if (rsp->rsp_par2 & rsp->rsp_par3 & OFFLOAD_VLAN) { sc->sc_tx_capability |= OFFLOAD_VLAN; sc->sc_rx_capability |= OFFLOAD_VLAN; } -#endif #if 0 /* not ready yet */ |