Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 May 2004 02:11:10 -0700 (PDT)
From:      Scott Long <scottl@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 53734 for review
Message-ID:  <200405290911.i4T9BAuE041412@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=53734

Change 53734 by scottl@scottl-esp-sparc64 on 2004/05/29 02:11:02

	Starting changing the DMA engine code so that it can be compiled.
	Fix up headers, modify bus_space usage, etc.

Affected files ...

.. //depot/projects/scottl-esp/src/sys/dev/esp/esp_sbus.c#9 edit
.. //depot/projects/scottl-esp/src/sys/dev/esp/lsi64854.c#3 edit
.. //depot/projects/scottl-esp/src/sys/dev/esp/lsi64854var.h#4 edit

Differences ...

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

@@ -210,6 +210,7 @@
 
 	lsc->sc_channel = L64854_CHANNEL_SCSI;
 	lsc->sc_client = sc;
+	lsc->sc_dev = dev;
 
 	lsi64854_attach(lsc);
 

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

@@ -37,30 +37,26 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lsi64854.c,v 1.22 2002/10/01 07:07:03 petrov Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
+#include <sys/bus.h>
 #include <sys/kernel.h>
-#include <sys/errno.h>
-#include <sys/device.h>
-#include <sys/malloc.h>
-
-#include <uvm/uvm_extern.h>
+#include <sys/resource.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
 
 #include <machine/bus.h>
-#include <machine/autoconf.h>
-#include <machine/cpu.h>
 
-#include <dev/scsipi/scsi_all.h>
-#include <dev/scsipi/scsipi_all.h>
-#include <dev/scsipi/scsiconf.h>
+#include <cam/cam.h>
+#include <cam/cam_ccb.h>
+#include <cam/scsi/scsi_all.h>
 
-#include <dev/ic/lsi64854reg.h>
-#include <dev/ic/lsi64854var.h>
+#include <dev/esp/lsi64854reg.h>
+#include <dev/esp/lsi64854var.h>
 
-#include <dev/ic/ncr53c9xreg.h>
-#include <dev/ic/ncr53c9xvar.h>
+#include <dev/esp/ncr53c9xreg.h>
+#include <dev/esp/ncr53c9xvar.h>
 
 void	lsi64854_reset(struct lsi64854_softc *);
 int	lsi64854_setup(struct lsi64854_softc *, caddr_t *, size_t *,
@@ -97,7 +93,7 @@
 {
 	u_int32_t csr;
 
-	sc->dv_name = device_get_nameunit(sc->sc_client);
+	sc->dv_name = device_get_nameunit(sc->sc_dev);
 
 	/* Indirect functions */
 	switch (sc->sc_channel) {
@@ -279,7 +275,7 @@
 	L64854_SCSR(sc, csr);
 
 	if (sc->sc_rev == DMAREV_HME) {
-		bus_space_write_4(sc->sc_bustag, sc->sc_regs, L64854_REG_ADDR, 0);
+		bus_space_write_4(sc->sc_regt, sc->sc_regh, L64854_REG_ADDR, 0);
 		sc->sc_dmactl = csr;
 	}
 	sc->sc_active = 0;
@@ -328,7 +324,7 @@
 		L64854_SCSR(sc, sc->sc_dmactl | L64854_RESET);
 		L64854_SCSR(sc, sc->sc_dmactl);
 
-		bus_space_write_4(sc->sc_bustag, sc->sc_regs, L64854_REG_CNT, *dmasize);
+		bus_space_write_4(sc->sc_regt, sc->sc_regh, L64854_REG_CNT, *dmasize);
 	}
 
 	/* Program the DMA address */
@@ -343,7 +339,7 @@
 				datain
 					? BUS_DMASYNC_PREREAD
 					: BUS_DMASYNC_PREWRITE);
-		bus_space_write_4(sc->sc_bustag, sc->sc_regs, L64854_REG_ADDR,
+		bus_space_write_4(sc->sc_regt, sc->sc_regh, L64854_REG_ADDR,
 				  sc->sc_dmamap->dm_segs[0].ds_addr);
 	}
 
@@ -353,7 +349,7 @@
 		long eaddr = bcnt + (long)*sc->sc_dmaaddr;
 		if ((eaddr & PGOFSET) != 0)
 			bcnt = roundup(bcnt, PAGE_SIZE);
-		bus_space_write_4(sc->sc_bustag, sc->sc_regs, L64854_REG_CNT,
+		bus_space_write_4(sc->sc_regt, sc->sc_regh, L64854_REG_CNT,
 				  bcnt);
 	}
 
@@ -395,7 +391,7 @@
 	csr = L64854_GCSR(sc);
 
 	DPRINTF(LDB_SCSI, ("%s: dmaintr: addr 0x%x, csr %s\n", sc->dv_name,
-		 bus_space_read_4(sc->sc_bustag, sc->sc_regs, L64854_REG_ADDR),
+		 bus_space_read_4(sc->sc_regt, sc->sc_regh, L64854_REG_ADDR),
 		 bitmask_snprintf(csr, DDMACSR_BITS, bits, sizeof(bits))));
 
 	if (csr & (D_ERR_PEND|D_SLAVE_ERR)) {
@@ -590,10 +586,10 @@
 				datain
 					? BUS_DMASYNC_PREREAD
 					: BUS_DMASYNC_PREWRITE);
-		bus_space_write_4(sc->sc_bustag, sc->sc_regs, L64854_REG_ADDR,
+		bus_space_write_4(sc->sc_regt, sc->sc_regh, L64854_REG_ADDR,
 				  sc->sc_dmamap->dm_segs[0].ds_addr);
 
-		bus_space_write_4(sc->sc_bustag, sc->sc_regs, L64854_REG_CNT,
+		bus_space_write_4(sc->sc_regt, sc->sc_regh, L64854_REG_CNT,
 				  sc->sc_dmasize);
 	}
 
@@ -634,11 +630,11 @@
 	csr = L64854_GCSR(sc);
 
 	DPRINTF(LDB_PP, ("%s: pp intr: addr 0x%x, csr %s\n", sc->dv_name,
-		 bus_space_read_4(sc->sc_bustag, sc->sc_regs, L64854_REG_ADDR),
+		 bus_space_read_4(sc->sc_regt, sc->sc_regh, L64854_REG_ADDR),
 		 bitmask_snprintf(csr, PDMACSR_BITS, bits, sizeof(bits))));
 
 	if (csr & (P_ERR_PEND|P_SLAVE_ERR)) {
-		resid = bus_space_read_4(sc->sc_bustag, sc->sc_regs,
+		resid = bus_space_read_4(sc->sc_regt, sc->sc_regh,
 					 L64854_REG_CNT);
 		printf("%s: pp error: resid %d csr=%s\n", sc->dv_name, resid,
 		       bitmask_snprintf(csr, PDMACSR_BITS, bits,sizeof(bits)));
@@ -653,7 +649,7 @@
 
 	if (sc->sc_active != 0) {
 		DMA_DRAIN(sc, 0);
-		resid = bus_space_read_4(sc->sc_bustag, sc->sc_regs,
+		resid = bus_space_read_4(sc->sc_regt, sc->sc_regh,
 					 L64854_REG_CNT);
 	}
 

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

@@ -37,7 +37,8 @@
  */
 
 struct lsi64854_softc {
-	char			*dv_name;
+	device_t		sc_dev;
+	const char		*dv_name;
 
 	int			sc_rid;
 	struct resource		*sc_res;


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200405290911.i4T9BAuE041412>