PERFORCE change 53646 for review

Scott Long scottl at FreeBSD.org
Thu May 27 22:17:13 PDT 2004


http://perforce.freebsd.org/chv.cgi?CH=53646

Change 53646 by scottl at scottl-esp-sparc64 on 2004/05/27 22:16:16

	Hack the headers enough so that they compile without error.  Start
	hacking up esp_sbus.c so that it will compile.

Affected files ...

.. //depot/projects/scottl-esp/src/sys/dev/esp/esp_sbus.c#3 edit
.. //depot/projects/scottl-esp/src/sys/dev/esp/ncr53c9x.c#2 edit
.. //depot/projects/scottl-esp/src/sys/dev/esp/ncr53c9xvar.h#3 edit

Differences ...

==== //depot/projects/scottl-esp/src/sys/dev/esp/esp_sbus.c#3 (text+ko) ====

@@ -38,21 +38,26 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: esp_sbus.c,v 1.27 2002/12/10 13:44:47 pk Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <sys/device.h>
-#include <sys/buf.h>
-#include <sys/malloc.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/resource.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+
+#include <machine/bus.h>
+#include <dev/ofw/openfirm.h>
+#include <machine/ofw_machdep.h>
+#include <machine/resource.h>
+#include <sys/rman.h>
+#include <sparc64/sbus/sbusvar.h>
 
 #include <cam/cam.h>
 #include <cam/cam_ccb.h>
 #include <cam/scsi/scsi_all.h>
 
-#include <machine/bus.h>
-#include <machine/resource.h>
-
 #include <dev/esp/lsi64854reg.h>
 #include <dev/esp/lsi64854var.h>
 
@@ -78,16 +83,24 @@
 	int	sc_pri;				/* SBUS priority */
 };
 
-void	espattach_sbus(struct device *, struct device *, void *);
-void	espattach_dma(struct device *, struct device *, void *);
-int	espmatch_sbus(struct device *, struct cfdata *, void *);
+static int	esp_sbus_probe(device_t);
+static int	esp_sbus_attach(device_t);
 
+static device_method_t esp_sbus_methods[] = {
+	DEVMETHOD(device_probe,		esp_sbus_probe),
+	DEVMETHOD(device_attach,	esp_sbus_attach),
+#if 0
+	DEVMETHOD(device_detach,	espdetach_sbus),
+	DEVMETHOD(device_suspend,	espsuspend_sbus),
+	DEVMETHOD(device_resume,	espresume_sbus),
+#endif
+	{0, 0}
+};
 
+#if 0
 CFATTACH_DECL(esp_sbus, sizeof(struct esp_softc),
     espmatch_sbus, espattach_sbus, NULL, NULL);
-
-CFATTACH_DECL(esp_dma, sizeof(struct esp_softc),
-    espmatch_sbus, espattach_dma, NULL, NULL);
+#endif
 
 /*
  * Functions and the switch for the MI code.
@@ -133,11 +146,8 @@
 
 static void	espattach(struct esp_softc *, struct ncr53c9x_glue *);
 
-int
-espmatch_sbus(parent, cf, aux)
-	struct device *parent;
-	struct cfdata *cf;
-	void *aux;
+static int
+esp_sbus_probe(device_t dev)
 {
 	int rv;
 	struct sbus_attach_args *sa = aux;
@@ -150,10 +160,8 @@
 	return (rv);
 }
 
-void
-espattach_sbus(parent, self, aux)
-	struct device *parent, *self;
-	void *aux;
+static int
+esp_sbus_attach(device_t dev)
 {
 	struct esp_softc *esc = (void *)self;
 	struct ncr53c9x_softc *sc = &esc->sc_ncr53c9x;
@@ -531,10 +539,6 @@
 	icookie = bus_intr_establish(esc->sc_bustag, esc->sc_pri, IPL_BIO,
 				     ncr53c9x_intr, sc);
 
-	/* register interrupt stats */
-	evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL,
-	    sc->sc_dev.dv_xname, "intr");
-
 	/* Turn on target selection using the `dma' method */
 	if (sc->sc_rev != NCR_VARIANT_FAS366)
 		sc->sc_features |= NCR_F_DMASELECT;

==== //depot/projects/scottl-esp/src/sys/dev/esp/ncr53c9x.c#2 (text+ko) ====

@@ -2080,8 +2080,6 @@
 	/* and what do the registers say... */
 	ncr53c9x_readregs(sc);
 
-	sc->sc_intrcnt.ev_count++;
-
 	/*
 	 * At the moment, only a SCSI Bus Reset or Illegal
 	 * Command are classed as errors. A disconnect is a

==== //depot/projects/scottl-esp/src/sys/dev/esp/ncr53c9xvar.h#3 (text+ko) ====

@@ -269,12 +269,13 @@
 };
 
 struct ncr53c9x_softc {
-	struct device sc_dev;			/* us as a device */
+	device_t sc_dev;			/* us as a device */
 
-	struct evcnt sc_intrcnt;		/* intr count */
 	struct cam_sim	*sim;			/* our scsi adapter */
 	struct cam_path	*path;			/* our scsi channel */
+#if 0
 	struct device *sc_child;		/* attached scsibus, if any */
+#endif
 	struct callout sc_watchdog;		/* periodic timer */
 
 	struct ncr53c9x_glue *sc_glue;		/* glue to MD code */
@@ -342,7 +343,7 @@
 	int sc_minsync;		/* Minimum sync period / 4 */
 	int sc_maxxfer;		/* Maximum transfer size */
 
-	struct simplelock sc_lock;/* driver mutex */
+	struct mtx sc_lock;	/* driver mutex */
 };
 
 /* values for sc_state */
@@ -445,7 +446,7 @@
 
 void	ncr53c9x_attach(struct ncr53c9x_softc *);
 int	ncr53c9x_detach(struct ncr53c9x_softc *, int);
-void	ncr53c9x_action(struct cam_sim *, union *);
+void	ncr53c9x_action(struct cam_sim *, union ccb *);
 void	ncr53c9x_reset(struct ncr53c9x_softc *);
 int	ncr53c9x_intr(void *);
 void	ncr53c9x_init(struct ncr53c9x_softc *, int);


More information about the p4-projects mailing list