Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/isa hp@isa was marked non-compiling and broken 14 ye...



details:   https://anonhg.NetBSD.org/src/rev/ff97bf1d2abc
branches:  trunk
changeset: 750933:ff97bf1d2abc
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Jan 19 12:41:41 2010 +0000

description:
hp@isa was marked non-compiling and broken 14 years ago.  I'm sure
the tens of well-tested changes since then have been necessary,
but now i'll just spoil the fun for everyone by sending the driver
to the attic.

diffstat:

 sys/dev/isa/files.isa |     8 +-
 sys/dev/isa/if_hp.c   |  1012 -------------------------------------------------
 2 files changed, 1 insertions(+), 1019 deletions(-)

diffs (truncated from 1038 to 300 lines):

diff -r 206b270d4965 -r ff97bf1d2abc sys/dev/isa/files.isa
--- a/sys/dev/isa/files.isa     Tue Jan 19 12:11:21 2010 +0000
+++ b/sys/dev/isa/files.isa     Tue Jan 19 12:41:41 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.isa,v 1.157 2008/04/03 22:46:22 xtraeme Exp $
+#      $NetBSD: files.isa,v 1.158 2010/01/19 12:41:41 pooka Exp $
 #
 # Config file and device description for machine-independent ISA code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -218,12 +218,6 @@
 attach fmv at isa with fmv_isa
 file   dev/isa/if_fmv_isa.c            fmv_isa
 
-# HP Lan Ethernet controllers
-# XXX currently broken
-#device hp: ether, ifnet, arp
-#attach        hp at isa
-#file  dev/isa/if_hp.c                 hp
-
 # Intel i82595-based boards.
 # (Intel EtherExpress PRO)
 device iy: ether, ifnet, arp
diff -r 206b270d4965 -r ff97bf1d2abc sys/dev/isa/if_hp.c
--- a/sys/dev/isa/if_hp.c       Tue Jan 19 12:11:21 2010 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,1012 +0,0 @@
-/*     $NetBSD: if_hp.c,v 1.48 2009/03/17 18:19:15 dsl Exp $   */
-
-/* XXX THIS DRIVER IS BROKEN.  IT WILL NOT EVEN COMPILE. */
-
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- */
-
-/*-
- * Copyright (c) 1990, 1991 William F. Jolitz.
- *
- * 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 University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- */
-
-/*
- * HP LAN Ethernet driver
- *
- * Parts inspired from Tim Tucker's if_wd driver for the wd8003,
- * insight on the ne2000 gained from Robert Clements PC/FTP driver.
- *
- * receive bottom end totally rewritten by Curt Mayer, Dec 1992.
- * no longer loses back to back packets.
- * note to driver writers: RTFM!
- *
- * hooks for packet filter added by Charles Hannum, 29DEC1992.
- *
- * Mostly rewritten for HP-labelled EISA controllers by Charles Hannum,
- * 18JAN1993.
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_hp.c,v 1.48 2009/03/17 18:19:15 dsl Exp $");
-
-#include "hp.h"
-#if NHP > 0
-
-#include "opt_inet.h"
-#include "rnd.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/buf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#if NRND > 0
-#include <sys/rnd.h>
-#endif
-
-#include <net/if.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
-
-
-#include "bpfilter.h"
-#if NBPFILTER > 0
-#include <sys/select.h>
-#include <net/bpf.h>
-#include <net/bpfdesc.h>
-#endif
-
-#include <sys/cpu.h>
-#include <machine/pio.h>
-
-#include <i386/isa/isa_device.h>       /* XXX BROKEN */
-#include <dev/isa/if_nereg.h>
-#include <i386/isa/icu.h>              /* XXX BROKEN */
-
-int     hpprobe(), hpattach(), hpintr();
-int     hpstart(), hpinit(), ether_output(), hpioctl();
-
-struct isa_driver hpdriver =
-{
-       hpprobe, hpattach, "hp",
-};
-
-struct mbuf *hpget();
-
-/*
- * Ethernet software status per interface.
- *
- * Each interface is referenced by a network interface structure,
- * ns_if, which the routing code uses to locate the interface.
- * This structure contains the output queue for the interface, its address, ...
- */
-struct hp_softc {
-       struct ethercom ns_ec;  /* Ethernet common part */
-#define        ns_if           ns_ac.ac_if     /* network-visible interface */
-       int     ns_flags;
-#define        DSF_LOCK        1       /* block re-entering enstart */
-       int     ns_oactive;
-       int     ns_mask;
-       struct prhdr ns_ph;     /* hardware header of incoming packet */
-       u_char  ns_pb[2048];
-       u_char  ns_txstart;     /* transmitter buffer start */
-       u_char  ns_rxstart;     /* receiver buffer start */
-       u_char  ns_rxend;       /* receiver buffer end */
-       u_char  hp_type;        /* HP board type */
-       u_char  hp_irq;         /* interrupt vector */
-       short   ns_port;        /* i/o port base */
-       short   ns_mode;        /* word/byte mode */
-       short   ns_rcr;
-#if NBPFILTER > 0
-       void *ns_bpf;
-#endif
-       u_int8_t ns_addrp[ETHER_ADDR_LEN]; /* hardware Ethernet address */
-
-#if NRND > 0
-       rndsource_element_t rnd_source;
-#endif
-}
-        hp_softc[NHP];
-#define        ENBUFSIZE       (sizeof(struct ether_header) + ETHERMTU + 2 + ETHER_MIN_LEN)
-
-#define        PAT(n)  (0xa55a + 37*(n))
-
-u_short boarddata[16];
-
-#define hp_option (-8)
-#define hp_data (-4)
-#define HP_RUN (0x01)
-#define HP_DATA (0x10)
-
-hpprobe(struct isa_device *dvp)
-{
-       int     val, i, s, sum, pat;
-       struct hp_softc *ns = &hp_softc[0];
-       int hpc;
-
-#ifdef lint
-       hpintr(0);
-#endif
-
-       hpc = (ns->ns_port = dvp->id_iobase + 0x10);
-       s = splnet();
-
-       ns->hp_irq = ffs(dvp->id_irq) - 1;
-
-       /* Extract board address */
-       for (i = 0; i < 6; i++)
-               ns->ns_addrp[i] = inb(hpc - 0x10 + i);
-       ns->hp_type = inb(hpc - 0x10 + 7);
-
-       if (ns->ns_addrp[0] != 0x08 ||
-           ns->ns_addrp[1] != 0x00 ||
-           ns->ns_addrp[2] != 0x09) {
-               splx(s);
-               return 0;
-       }
-       /* Word Transfers, Burst Mode Select, Fifo at 8 bytes */
-       /* On this board, WTS means 32-bit transfers, which is still
-        * experimental.  - mycroft, 18JAN93 */
-#ifdef HP_32BIT
-       ns->ns_mode = DSDC_WTS | DSDC_BMS | DSDC_FT1;
-#else
-       ns->ns_mode = DSDC_BMS | DSDC_FT1;
-#endif
-       ns->ns_txstart = 0 * 1024 / DS_PGSIZE;
-       ns->ns_rxend = 32 * 1024 / DS_PGSIZE;
-
-       ns->ns_rxstart = ns->ns_txstart + (PKTSZ / DS_PGSIZE);
-
-       outb(hpc + hp_option, HP_RUN);
-
-#if 0
-       outb(hpc + ds0_isr, 0xff);
-       outb(hpc + ds_cmd, DSCM_NODMA | DSCM_PG0 | DSCM_STOP);
-       delay(1000);
-
-       /* Check cmd reg and fail if not right */
-       if ((i = inb(hpc + ds_cmd)) != (DSCM_NODMA | DSCM_PG0 | DSCM_STOP)) {
-               splx(s);
-               return (0);
-       }
-#endif
-
-       outb(hpc + hp_option, 0);
-
-       splx(s);
-       return (32);
-}
-/*
- * Fetch from onboard ROM/RAM
- */
-hpfetch(struct hp_softc *ns, void *up, int ad, int len)
-{
-       u_char  cmd;
-       int     hpc = ns->ns_port;
-       int     counter = 100000;
-
-       outb(hpc + hp_option, inb(hpc + hp_option) | HP_DATA);
-
-       cmd = inb(hpc + ds_cmd);
-       outb(hpc + ds_cmd, DSCM_NODMA | DSCM_PG0 | DSCM_START);
-
-       /* Setup remote DMA */
-       outb(hpc + ds0_isr, DSIS_RDC);
-
-       if (ns->ns_mode & DSDC_WTS)
-               len = (len + 3) & ~3;
-       else
-               len = (len + 1) & ~1;
-
-       outb(hpc + ds0_rbcr0, len);
-       outb(hpc + ds0_rbcr1, len >> 8);
-       outb(hpc + ds0_rsar0, ad);
-       outb(hpc + ds0_rsar1, ad >> 8);
-
-#ifdef HP_DEBUG
-       printf("hpfetch: len=%d ioaddr=0x%03x addr=0x%04x option=0x%02x %d-bit\n",
-           len, hpc + hp_data, ad, inb(hpc + hp_option),
-           ns->ns_mode & DSDC_WTS ? 32 : 16);
-       printf("hpfetch: cmd=0x%02x isr=0x%02x ",



Home | Main Index | Thread Index | Old Index