Source-Changes-HG archive

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

[src/trunk]: src New driver for Xircom CreditCard PCMCIA Ethernet. Replaces ...



details:   https://anonhg.NetBSD.org/src/rev/5af573a1d4a2
branches:  trunk
changeset: 487294:5af573a1d4a2
user:      gmcgarry <gmcgarry%NetBSD.org@localhost>
date:      Mon Jun 05 23:14:22 2000 +0000

description:
New driver for Xircom CreditCard PCMCIA Ethernet.  Replaces xe driver which
didn't work.  Renamed to avoid clash with next68k network driver.

diffstat:

 distrib/sets/lists/man/mi   |     3 +-
 share/man/man4/Makefile     |     4 +-
 share/man/man4/xi.4         |    96 ++
 sys/dev/pcmcia/files.pcmcia |     8 +-
 sys/dev/pcmcia/if_xi.c      |  1562 +++++++++++++++++++++++++++++++++++++++++++
 sys/dev/pcmcia/if_xireg.h   |   306 ++++++++
 6 files changed, 1972 insertions(+), 7 deletions(-)

diffs (truncated from 2030 to 300 lines):

diff -r 05fcc40d2aa7 -r 5af573a1d4a2 distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Mon Jun 05 23:06:31 2000 +0000
+++ b/distrib/sets/lists/man/mi Mon Jun 05 23:14:22 2000 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.248 2000/05/28 22:38:54 augustss Exp $
+# $NetBSD: mi,v 1.249 2000/06/05 23:14:23 gmcgarry Exp $
 ./usr/share/info/am-utils.info
 ./usr/share/info/awk.info
 ./usr/share/info/as.info
@@ -1608,6 +1608,7 @@
 ./usr/share/man/man4/wsmux.4
 ./usr/share/man/man4/wss.4
 ./usr/share/man/man4/wt.4
+./usr/share/man/man4/xi.4
 ./usr/share/man/man4/ym.4
 ./usr/share/man/man4/zero.4
 ./usr/share/man/man4/zstty.4
diff -r 05fcc40d2aa7 -r 5af573a1d4a2 share/man/man4/Makefile
--- a/share/man/man4/Makefile   Mon Jun 05 23:06:31 2000 +0000
+++ b/share/man/man4/Makefile   Mon Jun 05 23:14:22 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.157 2000/06/03 07:18:47 veego Exp $
+#      $NetBSD: Makefile,v 1.158 2000/06/05 23:14:23 gmcgarry Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/18/93
 
 MAN=   adv.4 adw.4 ahb.4 ahc.4 aria.4 atalk.4 audio.4 auvia.4 \
@@ -39,7 +39,7 @@
        wds.4 we.4 wss.4 wt.4
 
 # machine-independent PCMCIA devices
-MAN+=  pcic.4 tcic.4 pcmcom.4
+MAN+=  pcic.4 tcic.4 pcmcom.4 xi.4
 
 # machine-independent VME devices
 MAN+=  si.4
diff -r 05fcc40d2aa7 -r 5af573a1d4a2 share/man/man4/xi.4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man4/xi.4       Mon Jun 05 23:14:22 2000 +0000
@@ -0,0 +1,96 @@
+.\" $NetBSD: xi.4,v 1.1 2000/06/05 23:14:23 gmcgarry Exp $
+.\"
+.\" Copyright (c) 2000 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Gregory McGarry.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"        This product includes software developed by the NetBSD
+.\"        Foundation, Inc. and its contributors.
+.\" 4. Neither the name of The NetBSD Foundation nor the names of its
+.\"    contributors may be used to endorse or promote products derived
+.\"    from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd June 4, 2000
+.Dt XI 4
+.Os
+.Sh NAME
+.Nm xi
+.Nd Xircom CreditCard Ethernet device driver
+.Sh SYNOPSIS
+.Cd "xi*  at pcmcia? function ?
+.Pp
+Configuration of PHYs may also be necessary.  See
+.Xr mii 4 .
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for the Xircom CreditCard family of PCMCIA
+Ethernet adapters.  Supported cards include:
+.Pp
+.Bl -hang -tag -compact -indent
+.It Xircom CreditCard Ethernet II
+.It Xircom CreditCard 10/100 Ethernet
+.It Xircom CreditCard Ethernet + Modem
+.It Xircom CreditCard 10/100 Ethernet + Modem
+.It Intel EtherExpress Pro/100
+.It Compaq Netelligent 10/100
+.El
+.Pp
+Cards which should work, but have not been confirmed include:
+.Pp
+.Bl -hang -tag -compact -indent
+.It Xircom RealPort Ethernet
+.It Xircom RealPort 10/100 Ethernet
+.It Xircom RealPort 10/100 Ethernet + Modem
+.El
+.Pp
+Some Xircom Ethernet products are supported by the
+.Xr tlp 4
+driver.
+.Sh MEDIA SELECTION
+Media selection is done using
+.Xr ifconfig 8
+using the standard
+.Xr ifmedia 4
+mechanism.  Refer to those manual pages for more information.
+.Sh BUGS
+The driver suffers from poor performance.  Even with the 10/100 cards,
+do not expect more than ~450KB/s.  Autonegotiation on the 10/100 cards
+does not appear to be functional and therefore media selection must be
+performed manually.  Promiscuous mode is known not to work on some adapters.
+.Sh SEE ALSO
+.Xr ifconfig 8 ,
+.Xr ifmedia 4 ,
+.Xr mii 4 ,
+.Xr netintro 4 ,
+.Xr pcmcia 4 ,
+.Xr tlp 4
+.Sh HISTORY
+The
+.Nm
+device driver appeared in
+.Nx 1.5 .
diff -r 05fcc40d2aa7 -r 5af573a1d4a2 sys/dev/pcmcia/files.pcmcia
--- a/sys/dev/pcmcia/files.pcmcia       Mon Jun 05 23:06:31 2000 +0000
+++ b/sys/dev/pcmcia/files.pcmcia       Mon Jun 05 23:14:22 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.pcmcia,v 1.24 2000/03/19 21:54:02 mycroft Exp $
+#      $NetBSD: files.pcmcia,v 1.25 2000/06/05 23:14:22 gmcgarry Exp $
 #
 # Config.new file and device description for machine-independent PCMCIA code.
 # Included by ports that need it.
@@ -98,6 +98,6 @@
 file   dev/ic/awi.c                            awi
 file   dev/ic/am79c930.c                       awi
 
-device xe: arp, ether, ifnet, mii
-attach xe at pcmcia with xe_pcmcia
-file   dev/pcmcia/if_xe.c                      xe_pcmcia
+device xi: arp, ether, ifnet, mii
+attach xi at pcmcia with xi_pcmcia
+file   dev/pcmcia/if_xi.c                      xi_pcmcia
diff -r 05fcc40d2aa7 -r 5af573a1d4a2 sys/dev/pcmcia/if_xi.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/pcmcia/if_xi.c    Mon Jun 05 23:14:22 2000 +0000
@@ -0,0 +1,1562 @@
+/*     $NetBSD: if_xi.c,v 1.1 2000/06/05 23:14:22 gmcgarry Exp $       */
+/*     OpenBSD: if_xe.c,v 1.9 1999/09/16 11:28:42 niklas Exp   */
+
+/*
+ * Copyright (c) 1999 Niklas Hallqvist, Brandon Creighton, Job de Haas
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by Niklas Hallqvist,
+ *     Brandon Creighton and Job de Haas.
+ * 4. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * A driver for Xircom CreditCard PCMCIA Ethernet adapters.
+ */
+
+/*
+ * Known Bugs:
+ *
+ * 1) Promiscuous mode doesn't work on at least the CE2.
+ * 2) Slow. ~450KB/s.  Memory access would be better.
+ */
+
+#include "opt_inet.h"
+#include "bpfilter.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+#include <sys/ioctl.h>
+#include <sys/mbuf.h>
+#include <sys/malloc.h>
+#include <sys/socket.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_media.h>
+#include <net/if_types.h>
+#include <net/if_ether.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
+
+#ifdef IPX
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
+#endif
+
+#ifdef NS
+#include <netns/ns.h>
+#include <netns/ns_if.h>
+#endif
+
+#if NBPFILTER > 0
+#include <net/bpf.h>
+#include <net/bpfdesc.h>
+#endif
+
+#define ETHER_MIN_LEN 64
+#define ETHER_CRC_LEN 4
+
+/*
+ * Maximum number of bytes to read per interrupt.  Linux recommends
+ * somewhere between 2000-22000.
+ * XXX This is currently a hard maximum.
+ */
+#define MAX_BYTES_INTR 12000
+
+#include <dev/mii/mii.h>
+#include <dev/mii/miivar.h>
+
+#include <dev/pcmcia/pcmciareg.h>
+#include <dev/pcmcia/pcmciavar.h>
+#include <dev/pcmcia/pcmciadevs.h>
+
+#define XI_IOSIZ       16
+
+#include <dev/pcmcia/if_xireg.h>
+
+#ifdef __GNUC__
+#define INLINE __inline
+#else
+#define INLINE
+#endif /* __GNUC__ */
+
+#ifdef XIDEBUG
+#define DPRINTF(cat, x) if (xidebug & (cat)) printf x
+
+#define XID_CONFIG     0x1
+#define XID_MII                0x2
+#define XID_INTR       0x4
+#define XID_FIFO       0x8
+
+#ifdef XIDEBUG_VALUE
+int xidebug = XIDEBUG_VALUE;
+#else
+int xidebug = 0;
+#endif
+#else
+#define DPRINTF(cat, x) (void)0
+#endif
+
+int    xi_pcmcia_match __P((struct device *, struct cfdata *, void *));
+void   xi_pcmcia_attach __P((struct device *, struct device *, void *));
+int    xi_pcmcia_detach __P((struct device *, int));
+int    xi_pcmcia_activate __P((struct device *, enum devact));
+
+/*
+ * In case this chipset ever turns up out of pcmcia attachments (very
+ * unlikely) do the driver splitup.
+ */
+struct xi_softc {
+       struct device sc_dev;                   /* Generic device info */
+       struct ethercom sc_ethercom;            /* Ethernet common part */
+



Home | Main Index | Thread Index | Old Index