Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Feb 2001 10:05:50 -0800
From:      Nick Sayer <nsayer@quack.kfu.com>
To:        freebsd-hackers@freebsd.org
Subject:   802.1q vlan patches for if_fxp
Message-ID:  <3A9A9AFE.1080504@quack.kfu.com>

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

A colleague of mine has reported the necessity of adding this patch to 
if_fxp.c to support 802.1q vlans. I must admit that I am not familiar 
enough with the vlan code to understand what good this does. This patch 
is against 4.1-RELEASE. If it is a good thing, I would like to add it to 
-current and MFC it back in time for 4.3. If it isn't, I'd like to tell 
my friend why. Thanks in advance.


------------------------------------------------------------------------
*** pci/if_fxp.c.orig	Wed Jul 19 09:36:36 2000
--- pci/if_fxp.c	Tue Aug  8 23:18:37 2000
***************
*** 52,57 ****
--- 52,65 ----
  
  #include <net/bpf.h>
  
+ #include "vlan.h"
+ #if NVLAN > 0
+ #include <net/if_types.h>
+ #include <net/if_arp.h>
+ #include <net/ethernet.h>
+ #include <net/if_vlan_var.h>
+ #endif
+ 
  #if defined(__NetBSD__)
  
  #include <sys/ioctl.h>
***************
*** 417,422 ****
--- 425,433 ----
  	ether_ifattach(ifp, enaddr);
  	bpfattach(&sc->sc_ethercom.ec_if.if_bpf, ifp, DLT_EN10MB,
  	    sizeof(struct ether_header));
+ #if NVLAN > 0
+ 	ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
+ #endif
  
  	/*
  	 * Add shutdown hook so that DMA is disabled prior to reboot. Not
***************
*** 599,604 ****
--- 610,618 ----
  	 * Attach the interface.
  	 */
  	ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
+ #if NVLAN > 0
+ 	ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
+ #endif
  	/*
  	 * Let the system queue as many packets as we have available
  	 * TX descriptors.
*** modules/fxp/Makefile.orig	Fri Jan 28 05:26:29 2000
--- modules/fxp/Makefile	Tue Aug  8 23:28:25 2000
***************
*** 2,7 ****
  
  .PATH:	${.CURDIR}/../../pci
  KMOD	= if_fxp
! SRCS	= if_fxp.c opt_bdg.h device_if.h bus_if.h pci_if.h
  
  .include <bsd.kmod.mk>
--- 2,11 ----
  
  .PATH:	${.CURDIR}/../../pci
  KMOD	= if_fxp
! SRCS	= if_fxp.c opt_bdg.h vlan.h device_if.h bus_if.h pci_if.h
! CLEANFILES	= vlan.h
! 
! vlan.h:
! 	touch vlan.h
  
  .include <bsd.kmod.mk>


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




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