Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Jul 2001 07:30:31 +1000 (EST)
From:      peter.jeremy@alcatel.com.au
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/29235: VLAN support for SMC EtherPower II (tx)
Message-ID:  <200107252130.f6PLUVj73023@gsmx07.alcatel.com.au>

next in thread | raw e-mail | index | archive | help

>Number:         29235
>Category:       kern
>Synopsis:       VLAN support for SMC EtherPower II (tx)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 25 14:40:27 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Peter Jeremy
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Alcatel Australia Limited
>Environment:
System: FreeBSD gsmx07.alcatel.com.au 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Thu Jan 18 05:05:46 EST 2001 root@gsmx07.alcatel.com.au:/usr/obj/3.0/cvs/src/sys/gsmx i386

>Description:
	The attached patch adds 802.1Q VLAN support for the SMC
	EtherPower III (SMC9432TX) NIC - tx(4).  I have not tested
	the module version, but building it into the kernel works
	well.

>How-To-Repeat:
	Apply patch, attach tx NIC to VLAN trunk, configure and play.

>Fix:
Index: modules/tx/Makefile
===================================================================
RCS file: /home/CVSROOT/src/sys/modules/tx/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- modules/tx/Makefile	2001/01/06 14:00:32	1.5
+++ modules/tx/Makefile	2001/01/07 21:03:07
@@ -1,9 +1,12 @@
 # $FreeBSD: src/sys/modules/tx/Makefile,v 1.5 2001/01/06 14:00:32 obrien Exp $
 
 .PATH: ${.CURDIR}/../../pci
-
 KMOD=	if_tx
-SRCS=	if_tx.c opt_bdg.h device_if.h bus_if.h pci_if.h
+SRCS=	if_tx.c opt_bdg.h device_if.h bus_if.h pci_if.h vlan.h
 SRCS+=	miibus_if.h
+CLEANFILES= vlan.h
+
+vlan.h:
+	touch vlan.h
 
 .include <bsd.kmod.mk>
Index: pci/if_tx.c
===================================================================
RCS file: /home/CVSROOT/src/sys/pci/if_tx.c,v
retrieving revision 1.46
diff -u -r1.46 if_tx.c
--- pci/if_tx.c	2001/06/23 19:30:26	1.46
+++ pci/if_tx.c	2001/07/02 15:17:59
@@ -54,13 +54,21 @@
 #if defined(__FreeBSD__)
 #define NBPFILTER	1
 
+#include "vlan.h"
+
 #include <net/if.h>
 #include <net/if_arp.h>
 #include <net/ethernet.h>
 #include <net/if_media.h>
 
+#if NBPF > 0
 #include <net/bpf.h>
+#endif
 
+#if NVLAN > 0
+#include <net/if_vlan_var.h>
+#endif
+
 #include <vm/vm.h>              /* for vtophys */
 #include <vm/pmap.h>            /* for vtophys */
 #include <machine/bus_memio.h>
@@ -85,6 +93,8 @@
 #else /* __OpenBSD__ */
 #include "bpfilter.h"
 
+#define	NVLAN	0	/* not sure if/how OpenBSD supports VLANs */
+
 #include <sys/device.h>
 
 #include <net/if.h>
@@ -555,6 +565,9 @@
 
 	/* Attach to OS's managers */
 	ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
+#if NVLAN > 0
+	ifp->if_hdrlen = sizeof(struct ether_vlan_header);
+#endif
 	callout_handle_init(&sc->stat_ch);
 
 fail:
@@ -1745,8 +1758,11 @@
 			return -1;
 		}
 		desc->bufaddr = vtophys( mtod(buf->mbuf,caddr_t) );
-
+#if NVLAN > 0
+		desc->buflength = ETHER_MAX_FRAME_LEN + EVL_ENCAPLEN;
+#else
 		desc->buflength = ETHER_MAX_FRAME_LEN;
+#endif
 		desc->status = 0x8000;			/* Give to EPIC */
 
 	}
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107252130.f6PLUVj73023>