Source-Changes-HG archive

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

[src/netbsd-3]: src Pull up following revision(s) (requested by tron in ticke...



details:   https://anonhg.NetBSD.org/src/rev/20a9a17c90bb
branches:  netbsd-3
changeset: 577968:20a9a17c90bb
user:      snj <snj%NetBSD.org@localhost>
date:      Thu Apr 20 03:11:14 2006 +0000

description:
Pull up following revision(s) (requested by tron in ticket #1266):
        share/man/man4/Makefile: revision 1.377
        sys/dev/pci/if_nfe.c: revision 1.1
        sys/dev/pci/if_nfereg.h: revision 1.1
        share/man/man4/nfe.4: revision 1.1
        sys/dev/pci/if_nfevar.h: revision 1.1
        distrib/sets/lists/man/mi: revision 1.863
add nfe driver and manpage from OpenBSD.

diffstat:

 distrib/sets/lists/man/mi |     4 +-
 share/man/man4/Makefile   |     4 +-
 share/man/man4/nfe.4      |    84 ++
 sys/dev/pci/if_nfe.c      |  1781 +++++++++++++++++++++++++++++++++++++++++++++
 sys/dev/pci/if_nfereg.h   |   182 ++++
 sys/dev/pci/if_nfevar.h   |    93 ++
 6 files changed, 2145 insertions(+), 3 deletions(-)

diffs (truncated from 2199 to 300 lines):

diff -r 00002c25b53b -r 20a9a17c90bb distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Thu Apr 20 03:06:16 2006 +0000
+++ b/distrib/sets/lists/man/mi Thu Apr 20 03:11:14 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.768.2.25 2006/04/08 23:36:13 tron Exp $
+# $NetBSD: mi,v 1.768.2.26 2006/04/20 03:11:14 snj Exp $
 ./etc/mtree/set.man                            man-sys-root
 ./usr/share/info/am-utils.info                 man-amd-info            info
 ./usr/share/info/as.info                       man-computil-info       bfd,info
@@ -1027,6 +1027,7 @@
 ./usr/share/man/cat4/netsmb.0                  man-sys-catman          .cat
 ./usr/share/man/cat4/networking.0              man-sys-catman          .cat
 ./usr/share/man/cat4/njs.0                     man-sys-catman          .cat
+./usr/share/man/cat4/nfe.0                     man-sys-catman          .cat
 ./usr/share/man/cat4/ns.0                      man-sys-catman          .cat
 ./usr/share/man/cat4/nsclpcsio.0               man-sys-catman          .cat
 ./usr/share/man/cat4/nsip.0                    man-sys-catman          .cat
@@ -3250,6 +3251,7 @@
 ./usr/share/man/man4/netintro.4                        man-sys-man             .man
 ./usr/share/man/man4/netsmb.4                  man-sys-man             .man
 ./usr/share/man/man4/networking.4              man-sys-man             .man
+./usr/share/man/man4/nfe.4                     man-sys-man             .man
 ./usr/share/man/man4/njs.4                     man-sys-man             .man
 ./usr/share/man/man4/ns.4                      man-sys-man             .man
 ./usr/share/man/man4/nsclpcsio.4               man-sys-man             .man
diff -r 00002c25b53b -r 20a9a17c90bb share/man/man4/Makefile
--- a/share/man/man4/Makefile   Thu Apr 20 03:06:16 2006 +0000
+++ b/share/man/man4/Makefile   Thu Apr 20 03:11:14 2006 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.350.2.8 2006/04/08 23:36:13 tron Exp $
+#      $NetBSD: Makefile,v 1.350.2.9 2006/04/20 03:11:14 snj Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/18/93
 
 MAN=   aac.4 acardide.4 aceride.4 acphy.4 adc.4 adv.4 \
@@ -25,7 +25,7 @@
        kttcp.4 lc.4 ld.4 lkm.4 lo.4 lxtphy.4 mainbus.4 makphy.4 \
        mbe.4 mca.4 mcclock.4 md.4 mfb.4 mhzc.4 midi.4 \
        mii.4 mk48txx.4 mlx.4 mly.4 mpt.4 mpu.4 mtd.4 \
-       mtio.4 multicast.4 ne.4 neo.4 netintro.4 njs.4 ns.4 \
+       mtio.4 multicast.4 ne.4 neo.4 netintro.4 nfe.4 njs.4 ns.4 \
        nsclpcsio.4 nsip.4 nsphy.4 nsphyter.4 ntwoc.4 \
        null.4 nsmb.4 oak.4 oosiop.4 opl.4 options.4 \
        optiide.4 osiop.4 pas.4 pcdisplay.4 pciide.4 \
diff -r 00002c25b53b -r 20a9a17c90bb share/man/man4/nfe.4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man4/nfe.4      Thu Apr 20 03:11:14 2006 +0000
@@ -0,0 +1,84 @@
+.\"    $NetBSD: nfe.4,v 1.2.2.2 2006/04/20 03:11:14 snj Exp $
+.\"    $OpenBSD: nfe.4,v 1.8 2006/03/04 04:35:24 jsg Exp $
+.\"
+.\" Copyright (c) 2006 Jonathan Gray <jsg%openbsd.org@localhost>
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd March 12, 2006
+.Dt NFE 4
+.Os
+.Sh NAME
+.Nm nfe
+.Nd NVIDIA nForce MCP Ethernet driver
+.Sh SYNOPSIS
+.Cd "nfe* at pci?"
+.Cd "ciphy* at mii?"
+.Cd "icsphy* at mii?"
+.Cd "makphy* at mii?"
+.Cd "rlphy* at mii?"
+.Sh DESCRIPTION
+The
+.Nm
+driver supports PCI Ethernet adapters based on the NVIDIA
+nForce Media and Communications Processors (MCP), such as
+the nForce, nForce 2, nForce 3, CK804, MCP04, MCP51 and MCP55
+Ethernet controller chips.
+.Pp
+The
+.Nm
+driver supports the following
+.Ar media
+types:
+.Pp
+.Bl -tag -width autoselect -compact
+.It Cm autoselect
+Enable autoselection of the media type and options.
+.It Cm 10baseT
+Set 10Mbps operation.
+.It Cm 100baseTX
+Set 100Mbps (Fast Ethernet) operation.
+.It Cm 1000baseT
+Set 1000Mbps (Gigabit Ethernet) operation (recent models only).
+.El
+.Sh SEE ALSO
+.Xr arp 4 ,
+.Xr ciphy 4 ,
+.Xr eephy 4 ,
+.Xr icsphy 4 ,
+.Xr ifmedia 4 ,
+.Xr intro 4 ,
+.Xr netintro 4 ,
+.Xr pci 4 ,
+.Xr rlphy 4 ,
+.Xr hostname.if 5 ,
+.Xr ifconfig 8
+.Sh HISTORY
+The
+.Nm
+device driver first appeared in
+.Ox 3.9 .
+It was added to
+.Nx 4.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An Jonathan Gray
+.Aq jsg%openbsd.org@localhost
+and
+.An Damien Bergamini
+.Aq damien%openbsd.org@localhost .
+.Sh CAVEATS
+NVIDIA refuse to release any documentation on their products.
diff -r 00002c25b53b -r 20a9a17c90bb sys/dev/pci/if_nfe.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/pci/if_nfe.c      Thu Apr 20 03:11:14 2006 +0000
@@ -0,0 +1,1781 @@
+/*     $NetBSD: if_nfe.c,v 1.3.4.2 2006/04/20 03:11:14 snj Exp $       */
+/*     $OpenBSD: if_nfe.c,v 1.52 2006/03/02 09:04:00 jsg Exp $ */
+
+/*-
+ * Copyright (c) 2006 Damien Bergamini <damien.bergamini%free.fr@localhost>
+ * Copyright (c) 2005, 2006 Jonathan Gray <jsg%openbsd.org@localhost>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.3.4.2 2006/04/20 03:11:14 snj Exp $");
+
+#include "opt_inet.h"
+#include "bpfilter.h"
+#include "vlan.h"
+
+#include <sys/param.h>
+#include <sys/endian.h>
+#include <sys/systm.h>
+#include <sys/types.h>
+#include <sys/sockio.h>
+#include <sys/mbuf.h>
+#include <sys/queue.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/device.h>
+#include <sys/socket.h>
+
+#include <machine/bus.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_media.h>
+#include <net/if_ether.h>
+#include <net/if_arp.h>
+
+#ifdef INET
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/if_inarp.h>
+#endif
+
+#if NVLAN > 0
+#include <net/if_types.h>
+#endif
+
+#if NBPFILTER > 0
+#include <net/bpf.h>
+#endif
+
+#include <dev/mii/mii.h>
+#include <dev/mii/miivar.h>
+
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcidevs.h>
+
+#include <dev/pci/if_nfereg.h>
+#include <dev/pci/if_nfevar.h>
+
+int    nfe_match(struct device *, struct cfdata *, void *);
+void   nfe_attach(struct device *, struct device *, void *);
+void   nfe_power(int, void *);
+void   nfe_miibus_statchg(struct device *);
+int    nfe_miibus_readreg(struct device *, int, int);
+void   nfe_miibus_writereg(struct device *, int, int, int);
+int    nfe_intr(void *);
+int    nfe_ioctl(struct ifnet *, u_long, caddr_t);
+void   nfe_txdesc32_sync(struct nfe_softc *, struct nfe_desc32 *, int);
+void   nfe_txdesc64_sync(struct nfe_softc *, struct nfe_desc64 *, int);
+void   nfe_txdesc32_rsync(struct nfe_softc *, int, int, int);
+void   nfe_txdesc64_rsync(struct nfe_softc *, int, int, int);
+void   nfe_rxdesc32_sync(struct nfe_softc *, struct nfe_desc32 *, int);
+void   nfe_rxdesc64_sync(struct nfe_softc *, struct nfe_desc64 *, int);
+void   nfe_rxeof(struct nfe_softc *);
+void   nfe_txeof(struct nfe_softc *);
+int    nfe_encap(struct nfe_softc *, struct mbuf *);
+void   nfe_start(struct ifnet *);
+void   nfe_watchdog(struct ifnet *);
+int    nfe_init(struct ifnet *);
+void   nfe_stop(struct ifnet *, int);
+struct nfe_jbuf *nfe_jalloc(struct nfe_softc *);
+void   nfe_jfree(struct mbuf *, caddr_t, size_t, void *);
+int    nfe_jpool_alloc(struct nfe_softc *);
+void   nfe_jpool_free(struct nfe_softc *);
+int    nfe_alloc_rx_ring(struct nfe_softc *, struct nfe_rx_ring *);
+void   nfe_reset_rx_ring(struct nfe_softc *, struct nfe_rx_ring *);
+void   nfe_free_rx_ring(struct nfe_softc *, struct nfe_rx_ring *);
+int    nfe_alloc_tx_ring(struct nfe_softc *, struct nfe_tx_ring *);
+void   nfe_reset_tx_ring(struct nfe_softc *, struct nfe_tx_ring *);
+void   nfe_free_tx_ring(struct nfe_softc *, struct nfe_tx_ring *);
+int    nfe_ifmedia_upd(struct ifnet *);
+void   nfe_ifmedia_sts(struct ifnet *, struct ifmediareq *);
+void   nfe_setmulti(struct nfe_softc *);
+void   nfe_get_macaddr(struct nfe_softc *, uint8_t *);
+void   nfe_set_macaddr(struct nfe_softc *, const uint8_t *);
+void   nfe_tick(void *);
+
+CFATTACH_DECL(nfe, sizeof(struct nfe_softc), nfe_match, nfe_attach, NULL, NULL);
+
+/*#define NFE_NO_JUMBO*/
+
+#ifdef NFE_DEBUG
+int nfedebug = 0;
+#define DPRINTF(x)     do { if (nfedebug) printf x; } while (0)
+#define DPRINTFN(n,x)  do { if (nfedebug >= (n)) printf x; } while (0)
+#else
+#define DPRINTF(x)
+#define DPRINTFN(n,x)
+#endif
+
+/* deal with naming differences */
+
+#define        PCI_PRODUCT_NVIDIA_NFORCE3_LAN2 \
+       PCI_PRODUCT_NVIDIA_NFORCE2_400_LAN1
+#define        PCI_PRODUCT_NVIDIA_NFORCE3_LAN3 \
+       PCI_PRODUCT_NVIDIA_NFORCE2_400_LAN2
+#define        PCI_PRODUCT_NVIDIA_NFORCE3_LAN5 \
+       PCI_PRODUCT_NVIDIA_NFORCE3_250_LAN
+
+#define        PCI_PRODUCT_NVIDIA_CK804_LAN1 \
+       PCI_PRODUCT_NVIDIA_NFORCE4_LAN1
+#define        PCI_PRODUCT_NVIDIA_CK804_LAN2 \
+       PCI_PRODUCT_NVIDIA_NFORCE4_LAN2
+
+#define        PCI_PRODUCT_NVIDIA_MCP51_LAN1 \
+       PCI_PRODUCT_NVIDIA_NFORCE430_LAN1
+#define        PCI_PRODUCT_NVIDIA_MCP51_LAN2 \
+       PCI_PRODUCT_NVIDIA_NFORCE430_LAN2
+
+#ifdef _LP64
+#define        __LP64__ 1
+#endif
+
+const struct nfe_product {
+       pci_vendor_id_t         vendor;
+       pci_product_id_t        product;
+} nfe_devices[] = {
+       { PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE_LAN },
+       { PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE2_LAN },
+       { PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE3_LAN1 },
+       { PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE3_LAN2 },
+       { PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE3_LAN3 },
+       { PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE3_LAN4 },
+       { PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE3_LAN5 },
+       { PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_CK804_LAN1 },
+       { PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_CK804_LAN2 },
+       { PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP04_LAN1 },
+       { PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP04_LAN2 },
+       { PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP51_LAN1 },



Home | Main Index | Thread Index | Old Index