From owner-freebsd-bugs Wed Jul 25 14:40:43 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E385D37B406 for ; Wed, 25 Jul 2001 14:40:28 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f6PLeS292274; Wed, 25 Jul 2001 14:40:28 -0700 (PDT) (envelope-from gnats) Received: from netau1.alcanet.com.au (ntp.alcanet.com.au [203.62.196.27]) by hub.freebsd.org (Postfix) with ESMTP id 45B2237B405 for ; Wed, 25 Jul 2001 14:30:36 -0700 (PDT) (envelope-from jeremyp@gsmx07.alcatel.com.au) Received: from mfg1.cim.alcatel.com.au (mfg1.cim.alcatel.com.au [139.188.23.1]) by netau1.alcanet.com.au (8.9.3 (PHNE_22672)/8.9.3) with ESMTP id HAA05751 for ; Thu, 26 Jul 2001 07:30:33 +1000 (EST) Received: from gsmx07.alcatel.com.au by cim.alcatel.com.au (PMDF V5.2-32 #37641) with ESMTP id <01K6DNB4Z928VFBMAP@cim.alcatel.com.au> for FreeBSD-gnats-submit@freebsd.org; Thu, 26 Jul 2001 07:30:29 +1000 Received: (from jeremyp@localhost) by gsmx07.alcatel.com.au (8.11.1/8.11.1) id f6PLUVj73023; Thu, 26 Jul 2001 07:30:31 +1000 (EST envelope-from jeremyp) Message-Id: <200107252130.f6PLUVj73023@gsmx07.alcatel.com.au> Date: Thu, 26 Jul 2001 07:30:31 +1000 (EST) From: peter.jeremy@alcatel.com.au Reply-To: peter.jeremy@alcatel.com.au To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: kern/29235: VLAN support for SMC EtherPower II (tx) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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 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 #include #include #include +#if NBPF > 0 #include +#endif +#if NVLAN > 0 +#include +#endif + #include /* for vtophys */ #include /* for vtophys */ #include @@ -85,6 +93,8 @@ #else /* __OpenBSD__ */ #include "bpfilter.h" +#define NVLAN 0 /* not sure if/how OpenBSD supports VLANs */ + #include #include @@ -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