Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci new version from David Boggs.



details:   https://anonhg.NetBSD.org/src/rev/368453316c38
branches:  trunk
changeset: 588209:368453316c38
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Feb 11 23:00:06 2006 +0000

description:
new version from David Boggs.

diffstat:

 sys/dev/pci/if_lmc.c |  8722 +++++++++++++++++++++++++++----------------------
 sys/dev/pci/if_lmc.h |  1018 +++--
 2 files changed, 5259 insertions(+), 4481 deletions(-)

diffs (truncated from 12144 to 300 lines):

diff -r 0755acbc125b -r 368453316c38 sys/dev/pci/if_lmc.c
--- a/sys/dev/pci/if_lmc.c      Sat Feb 11 20:59:49 2006 +0000
+++ b/sys/dev/pci/if_lmc.c      Sat Feb 11 23:00:06 2006 +0000
@@ -1,7 +1,7 @@
 /*-
- * $NetBSD: if_lmc.c,v 1.23 2005/12/06 03:01:45 christos Exp $
+ * $NetSBD$
  *
- * Copyright (c) 2002-2004 David Boggs. <boggs%boggs.palo-alto.ca.us@localhost>
+ * Copyright (c) 2002-2006 David Boggs. <boggs%boggs.palo-alto.ca.us@localhost>
  * All rights reserved.
  *
  * BSD License:
@@ -29,28 +29,29 @@
  *
  * GNU General Public License:
  *
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of the GNU General Public License as published by the Free 
- * Software Foundation; either version 2 of the License, or (at your option) 
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
  * any later version.
- * 
- * This program is distributed in the hope that it will be useful, but WITHOUT 
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 
+ * this program; if not, write to the Free Software Foundation, Inc., 59
  * Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
  * Description:
  *
  * This is an open-source Unix device driver for PCI-bus WAN interface cards.
  * It sends and receives packets in HDLC frames over synchronous links.
- * A generic PC plus Unix plus some SBE/LMC cards makes an OPEN router.
+ * A generic PC plus Unix plus some LMC cards makes an OPEN router.
  * This driver works with FreeBSD, NetBSD, OpenBSD, BSD/OS and Linux.
- * It has been tested on i386 (32-bit little-end), Sparc (64-bit big-end),
- * and Alpha (64-bit little-end) architectures.
+ * It has been tested on i386 (32-bit little-end), PowerPC (32-bit
+ * big-end), Sparc (64-bit big-end), and Alpha (64-bit little-end)
+ * architectures.
  *
  * History and Authors:
  *
@@ -71,28 +72,25 @@
  *
  * Send bug reports and improvements to <boggs%boggs.palo-alto.ca.us@localhost>.
  */
-#if __FreeBSD__
+#if defined(__FreeBSD__)
 # include <sys/param.h>        /* OS version */
-# define  IFNET 1
 # include "opt_inet.h" /* INET */
 # include "opt_inet6.h"        /* INET6 */
 # include "opt_netgraph.h" /* NETGRAPH */
-# ifdef HAVE_KERNEL_OPTION_HEADERS
+# if defined(HAVE_KERNEL_OPTION_HEADERS)
 #  include "opt_device_polling.h" /* DEVICE_POLLING */
 # else
 #  include "opt_global.h" /* ALTQ, DEVICE_POLLING */
 # endif
-# if (__FreeBSD_version >= 500000)
-#  define  NSPPP 1     /* No count devices in FreeBSD 5 */
-#  include "opt_bpf.h" /* DEV_BPF */
-#  define NBPFILTER DEV_BPF
-# else  /* FreeBSD-4 */
-#  include "sppp.h"    /* NSPPP */
-#  include "bpf.h"     /* NBPF */
-#  define NBPFILTER NBPF
-# endif
-# define  P2P 0                /* not in FreeBSD */
-# define  GEN_HDLC 0   /* not in FreeBSD */
+# include "opt_bpf.h"  /* DEV_BPF */
+# define  NBPFILTER DEV_BPF
+# define  IFNET 1
+# define  NETDEV 0
+# define  NAPI 0
+# define  SPPP 1
+# define  P2P 0
+# define  GEN_HDLC 0
+# define  SYNC_PPP 0
 #
 # include <sys/systm.h>
 # include <sys/kernel.h>
@@ -100,9 +98,10 @@
 # include <sys/mbuf.h>
 # include <sys/socket.h>
 # include <sys/sockio.h>
+# include <sys/lock.h>
+# include <sys/mutex.h>
 # include <sys/module.h>
 # include <sys/bus.h>
-# include <sys/lock.h>
 # include <net/if.h>
 # include <net/if_types.h>
 # include <net/if_media.h>
@@ -113,22 +112,16 @@
 # include <sys/rman.h>
 # include <vm/vm.h>
 # include <vm/pmap.h>
-# if (__FreeBSD_version >= 500000)
-#  include <sys/mutex.h>
-#  include <dev/pci/pcivar.h>
-# else /* FreeBSD-4 */
-#  include <sys/proc.h>
-#  include <pci/pcivar.h>
-# endif
+# include <dev/pci/pcivar.h>
 # if NETGRAPH
 #  include <netgraph/ng_message.h>
 #  include <netgraph/netgraph.h>
 # endif
-# if (INET || INET6)
+# if INET || INET6
 #  include <netinet/in.h>
 #  include <netinet/in_var.h>
 # endif
-# if NSPPP
+# if SPPP
 #  include <net/if_sppp.h>
 # endif
 # if NBPFILTER
@@ -147,17 +140,20 @@
 # include <dev/lmc/if_lmc.h>
 #endif /*__FreeBSD__*/
 
-#if __NetBSD__
+#if defined(__NetBSD__)
 # include <sys/param.h>        /* OS version */
-# define  IFNET 1
 # include "opt_inet.h" /* INET6, INET */
-# define  NETGRAPH 0   /* not in NetBSD */
-# define  DEVICE_POLLING 0 /* not in NetBSD */
-# define  NSPPP 1      /* No count devices */
-# define  P2P 0                /* not in NetBSD */
 # include "opt_altq_enabled.h" /* ALTQ */
 # include "bpfilter.h" /* NBPFILTER */
-# define  GEN_HDLC 0   /* not in NetBSD */
+# define  IFNET 1
+# define  NETDEV 0
+# define  NAPI 0
+# define  SPPP 1
+# define  P2P 0
+# define  GEN_HDLC 0
+# define  SYNC_PPP 0
+# define  NETGRAPH 0
+# define  DEVICE_POLLING 0
 #
 # include <sys/systm.h>
 # include <sys/kernel.h>
@@ -166,6 +162,7 @@
 # include <sys/socket.h>
 # include <sys/sockio.h>
 # include <sys/device.h>
+# include <sys/reboot.h>
 # include <sys/lock.h>
 # include <net/if.h>
 # include <net/if_types.h>
@@ -174,21 +171,13 @@
 # include <machine/bus.h>
 # include <machine/intr.h>
 # include <dev/pci/pcivar.h>
-# if (__NetBSD_Version__ >= 106000000)
-#  include <uvm/uvm_extern.h>
-# else
-#  include <vm/vm.h>
-# endif
-# if (INET || INET6)
+# include <uvm/uvm_extern.h>
+# if INET || INET6
 #  include <netinet/in.h>
 #  include <netinet/in_var.h>
 # endif
-# if NSPPP
-#  if (__NetBSD_Version__ >= 106000000)
-#   include <net/if_spppvar.h>
-#  else
-#   include <net/if_sppp.h>
-#  endif
+# if SPPP
+#  include <net/if_spppvar.h>
 # endif
 # if NBPFILTER
 #  include <net/bpf.h>
@@ -200,18 +189,20 @@
 # include "if_lmc.h"
 #endif /*__NetBSD__*/
 
-#if __OpenBSD__
+#if defined(__OpenBSD__)
 # include <sys/param.h>        /* OS version */
-# define  IFNET 1
 /* -DINET  is passed on the compiler command line */
 /* -DINET6 is passed on the compiler command line */
-# define  NETGRAPH 0   /* not in OpenBSD */
-# define  DEVICE_POLLING 0 /* not in OpenBSD */
-# include "sppp.h"     /* NSPPP */
-# define  P2P 0                /* not in OpenBSD */
 /* -DALTQ  is passed on the compiler command line */
 # include "bpfilter.h" /* NBPFILTER */
-# define  GEN_HDLC 0   /* not in OpenBSD */
+# define  IFNET 1
+# define  NAPI 0
+# define  SPPP 1
+# define  P2P 0
+# define  GEN_HDLC 0
+# define  SYNC_PPP 0
+# define  NETGRAPH 0
+# define  DEVICE_POLLING 0
 #
 # include <sys/systm.h>
 # include <sys/kernel.h>
@@ -229,48 +220,49 @@
 # include <net/netisr.h>
 # include <machine/bus.h>
 # include <machine/intr.h>
+# include <uvm/uvm_extern.h>
 # include <dev/pci/pcivar.h>
-# if (OpenBSD >= 200206)
-#  include <uvm/uvm_extern.h>
-# else
-#  include <vm/vm.h>
-# endif
-# if (INET || INET6)
+# if INET || INET6
 #  include <netinet/in.h>
 #  include <netinet/in_var.h>
 # endif
-# if NSPPP
+# if SPPP
 #  include <net/if_sppp.h>
 # endif
 # if NBPFILTER
 #  include <net/bpf.h>
 # endif
-# ifndef ALTQ
+# ifndef  ALTQ
 #  define ALTQ 0
 # endif
+# undef   NETDEV
+# define  NETDEV 0
 /* and finally... */
 # include "if_lmc.h"
 #endif /*__OpenBSD__*/
 
-#if __bsdi__
+#if defined(__bsdi__)
 # include <sys/param.h>        /* OS version */
-# define  IFNET 1
 /* -DINET  is passed on the compiler command line */
 /* -DINET6 is passed on the compiler command line */
-# define  NETGRAPH 0   /* not in BSD/OS */
-# define  DEVICE_POLLING 0 /* not in BSD/OS */
-# define  NSPPP 0      /* not in BSD/OS */
 /* -DPPP   is passed on the compiler command line */
 /* -DCISCO_HDLC is passed on the compiler command line */
 /* -DFR    is passed on the compiler command line */
-# if (PPP || CISCO_HDLC || FR)
+# if PPP || CISCO_HDLC || FR
 #  define P2P 1
 # else
 #  define P2P 0
 # endif
-# define  ALTQ 0       /* not in BSD/OS */
 # include "bpfilter.h" /* NBPFILTER */
-# define  GEN_HDLC 0   /* not in BSD/OS */
+# define  IFNET 1
+# define  NETDEV 0
+# define  NAPI 0
+# define  ALTQ 0
+# define  SPPP 0
+# define  GEN_HDLC 0
+# define  SYNC_PPP 0
+# define  NETGRAPH 0
+# define  DEVICE_POLLING 0
 #
 # include <sys/kernel.h>
 # include <sys/malloc.h>
@@ -278,17 +270,19 @@
 # include <sys/socket.h>
 # include <sys/sockio.h>
 # include <sys/device.h>
+# include <sys/reboot.h>
 # include <sys/lock.h>
 # include <net/if.h>
 # include <net/if_types.h>
 # include <net/if_media.h>
 # include <net/netisr.h>
+# include <net/raw_cb.h>
 # include <vm/vm.h>



Home | Main Index | Thread Index | Old Index