PERFORCE change 39585 for review

Sam Leffler sam at FreeBSD.org
Sun Oct 12 10:39:10 PDT 2003


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

Change 39585 by sam at sam_ebb on 2003/10/12 10:38:31

	IFC @ 39584

Affected files ...

.. //depot/projects/netperf/sys/compat/linux/linux_socket.c#2 integrate
.. //depot/projects/netperf/sys/conf/files#11 integrate
.. //depot/projects/netperf/sys/crypto/ripemd160/rmd160.c#1 branch
.. //depot/projects/netperf/sys/crypto/ripemd160/rmd160.h#1 branch
.. //depot/projects/netperf/sys/dev/ata/ata-all.c#8 integrate
.. //depot/projects/netperf/sys/dev/ata/ata-disk.c#4 integrate
.. //depot/projects/netperf/sys/dev/ata/ata-queue.c#5 integrate
.. //depot/projects/netperf/sys/dev/ata/atapi-cd.c#8 integrate
.. //depot/projects/netperf/sys/dev/pci/pci_user.c#4 integrate
.. //depot/projects/netperf/sys/dev/sound/pci/au88x0.c#4 integrate
.. //depot/projects/netperf/sys/dev/sound/pci/au88x0.h#2 integrate
.. //depot/projects/netperf/sys/dev/sound/pcm/ac97.c#6 integrate
.. //depot/projects/netperf/sys/dev/usb/ugen.c#6 integrate
.. //depot/projects/netperf/sys/geom/geom_dev.c#6 integrate
.. //depot/projects/netperf/sys/geom/geom_event.c#2 integrate
.. //depot/projects/netperf/sys/i386/i386/locore.s#6 integrate
.. //depot/projects/netperf/sys/i386/i386/machdep.c#7 integrate
.. //depot/projects/netperf/sys/i386/i386/pmap.c#16 integrate
.. //depot/projects/netperf/sys/i386/ibcs2/ibcs2_misc.c#2 integrate
.. //depot/projects/netperf/sys/i386/ibcs2/ibcs2_signal.c#2 integrate
.. //depot/projects/netperf/sys/i386/ibcs2/ibcs2_socksys.c#2 integrate
.. //depot/projects/netperf/sys/i386/ibcs2/ibcs2_util.c#2 integrate
.. //depot/projects/netperf/sys/i386/ibcs2/ibcs2_util.h#2 integrate
.. //depot/projects/netperf/sys/i386/ibcs2/imgact_coff.c#3 integrate
.. //depot/projects/netperf/sys/kern/sys_pipe.c#6 integrate
.. //depot/projects/netperf/sys/kern/vfs_subr.c#6 integrate
.. //depot/projects/netperf/sys/net/route.c#14 integrate
.. //depot/projects/netperf/sys/netinet6/ah.h#2 integrate
.. //depot/projects/netperf/sys/netinet6/ah6.h#2 integrate
.. //depot/projects/netperf/sys/netinet6/ah_core.c#3 integrate
.. //depot/projects/netperf/sys/netinet6/ah_input.c#2 integrate
.. //depot/projects/netperf/sys/netinet6/ah_output.c#4 integrate
.. //depot/projects/netperf/sys/netinet6/dest6.c#3 integrate
.. //depot/projects/netperf/sys/netinet6/esp_core.c#4 integrate
.. //depot/projects/netperf/sys/pc98/i386/machdep.c#5 integrate

Differences ...

==== //depot/projects/netperf/sys/compat/linux/linux_socket.c#2 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.42 2003/06/10 21:27:39 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.43 2003/10/11 15:08:32 iwasaki Exp $");
 
 /* XXX we use functions that might not exist. */
 #include "opt_compat.h"
@@ -225,6 +225,17 @@
 }
 
 static int
+bsd_to_linux_sockopt_level(int level)
+{
+
+	switch (level) {
+	case SOL_SOCKET:
+		return (LINUX_SOL_SOCKET);
+	}
+	return (level);
+}
+
+static int
 linux_to_bsd_ip_sockopt(int opt)
 {
 
@@ -995,9 +1006,9 @@
 	} */ bsd_args;
 	struct msghdr msg;
 	struct msghdr *nmsg = NULL;
+	struct cmsghdr *cmsg;
 	int error;
-	int level;
-	caddr_t control;
+	caddr_t sg;
 
 	if ((error = copyin(args, &linux_args, sizeof(linux_args))))
 		return (error);
@@ -1006,54 +1017,39 @@
 	if (error)
 		return (error);
 
-	if (msg.msg_name) {
+	sg = stackgap_init();
+	nmsg = (struct msghdr *)stackgap_alloc(&sg, sizeof(struct msghdr));
+	if (nmsg == NULL)
+		return (ENOMEM);
+
+	bcopy(&msg, nmsg, sizeof(struct msghdr));
+
+	if (msg.msg_name != NULL) {
 		struct sockaddr *sa;
-		caddr_t sg = stackgap_init();
 
-		nmsg = (struct msghdr *) stackgap_alloc(&sg,
-		    sizeof(struct msghdr));
-		if (!nmsg)
-			return (ENOMEM);
-
 		error = linux_sa_get(&sg, &sa,
 		    (struct osockaddr *) msg.msg_name, &msg.msg_namelen);
 		if (error)
 			return (error);
 
-		msg.msg_name = (struct sockaddr *) sa;
-		error = copyout(&msg, nmsg, sizeof(struct msghdr));
-		if (error)
-			return (error);
+		nmsg->msg_name = sa;
 	}
 
-	error = copyin(&linux_args.msg->msg_control, &control,
-	    sizeof(caddr_t));
-	if (error)
-		return (error);
+	if (msg.msg_control != NULL) {
+		nmsg->msg_control = (struct cmsghdr *)stackgap_alloc(&sg,
+		    msg.msg_controllen);
+		if (nmsg->msg_control == NULL)
+			return (ENOMEM);
 
-	if (control == NULL)
-		goto done;
+		bcopy(msg.msg_control, nmsg->msg_control, msg.msg_controllen);
+		cmsg = (struct cmsghdr*)nmsg->msg_control;
 
-	error = copyin(&((struct cmsghdr*)control)->cmsg_level, &level,
-	    sizeof(int));
-	if (error)
-		return (error);
+		cmsg->cmsg_level = linux_to_bsd_sockopt_level(cmsg->cmsg_level);
+	}
 
-	if (level == 1) {
-		/*
-		 * Linux thinks that SOL_SOCKET is 1; we know
-		 * that it's really 0xffff, of course.
-		 */
-		level = SOL_SOCKET;
-		error = copyout(&level,
-		    &((struct cmsghdr *)control)->cmsg_level, sizeof(int));
-		if (error)
-			return (error);
-	}
-done:
 	bsd_args.s = linux_args.s;
 	bsd_args.msg = (caddr_t)nmsg;
-	bsd_args.flags = linux_args.flags;
+	bsd_args.flags = linux_to_bsd_msg_flags(linux_args.flags);
 	return (sendmsg(td, &bsd_args));
 }
 
@@ -1073,6 +1069,7 @@
 		int	flags;
 	} */ bsd_args;
 	struct msghdr msg;
+	struct cmsghdr *cmsg;
 	int error;
 
 	if ((error = copyin(args, &linux_args, sizeof(linux_args))))
@@ -1085,6 +1082,11 @@
 	if (error)
 		return (error);
 
+	if (bsd_args.msg->msg_control != NULL) {
+		cmsg = (struct cmsghdr*)bsd_args.msg->msg_control;
+		cmsg->cmsg_level = bsd_to_linux_sockopt_level(cmsg->cmsg_level);
+	}
+
 	error = copyin(linux_args.msg, &msg, sizeof(msg));
 	if (error)
 		return (error);

==== //depot/projects/netperf/sys/conf/files#11 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.828 2003/10/01 15:13:29 ume Exp $
+# $FreeBSD: src/sys/conf/files,v 1.829 2003/10/12 09:41:42 ume Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -207,6 +207,7 @@
 crypto/des/des_setkey.c	optional ipsec ipsec_esp
 crypto/rijndael/rijndael-alg-fst.c	optional ipsec ipsec_esp
 crypto/rijndael/rijndael-api-fst.c	optional ipsec ipsec_esp
+crypto/ripemd160/rmd160.c	optional ipsec
 crypto/sha1.c		optional ipsec
 crypto/sha2/sha2.c	optional ipsec
 ddb/db_access.c		optional ddb

==== //depot/projects/netperf/sys/dev/ata/ata-all.c#8 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.193 2003/10/10 11:03:27 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.195 2003/10/12 12:37:11 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -197,12 +197,14 @@
     if (ch->device[MASTER].param) {
 	if (ch->device[MASTER].param->support.command2 & ATA_SUPPORT_FLUSHCACHE)
 	    ata_controlcmd(&ch->device[MASTER], ATA_FLUSHCACHE, 0, 0, 0);
+	ata_controlcmd(&ch->device[MASTER], ATA_SLEEP, 0, 0, 0);
 	free(ch->device[MASTER].param, M_ATA);
 	ch->device[MASTER].param = NULL;
     }
     if (ch->device[SLAVE].param) {
 	if (ch->device[SLAVE].param->support.command2 & ATA_SUPPORT_FLUSHCACHE)
 	    ata_controlcmd(&ch->device[SLAVE], ATA_FLUSHCACHE, 0, 0, 0);
+	ata_controlcmd(&ch->device[SLAVE], ATA_SLEEP, 0, 0, 0);
 	free(ch->device[SLAVE].param, M_ATA);
 	ch->device[SLAVE].param = NULL;
     }
@@ -563,7 +565,7 @@
 	    }
 	    ata_free_request(request);
 	}
-	if (!isalpha(atacap->model[0]) || !isalpha(atacap->model[1]))
+	if (!isprint(atacap->model[0]) || !isprint(atacap->model[1]))
 	    error = ENXIO;
 	if (error) {
 	    atadev->param = NULL;

==== //depot/projects/netperf/sys/dev/ata/ata-disk.c#4 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.159 2003/08/25 09:01:49 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.160 2003/10/12 12:35:44 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -256,7 +256,7 @@
     request->device = atadev;
     request->driver = bp;
     request->callback = ad_done;
-    request->timeout = 5;
+    request->timeout = 10;
     request->retries = 2;
     request->data = bp->bio_data;
     request->bytecount = bp->bio_bcount;

==== //depot/projects/netperf/sys/dev/ata/ata-queue.c#5 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.7 2003/10/07 13:47:40 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.8 2003/10/12 12:38:03 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -97,8 +97,9 @@
 	return;
 
     /* if this is not a callback and we havn't seen DONE yet -> sleep */
-    if (!request->callback && !(request->flags & ATA_R_DONE)) {
-	while (tsleep(request, PRIBIO, "atareq", 60*10*hz)) ;
+    if (!request->callback) {
+	while (!(request->flags & ATA_R_DONE))
+	    tsleep(request, PRIBIO, "atareq", hz/10);
     }
 }
 

==== //depot/projects/netperf/sys/dev/ata/atapi-cd.c#8 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cd.c,v 1.147 2003/09/22 17:58:40 tmm Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cd.c,v 1.148 2003/10/12 13:11:57 sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -94,7 +94,7 @@
 static int acd_report_key(struct acd_softc *, struct dvd_authinfo *);
 static int acd_send_key(struct acd_softc *, struct dvd_authinfo *);
 static int acd_read_structure(struct acd_softc *, struct dvd_struct *);
-static int acd_eject(struct acd_softc *, int);
+static int acd_tray(struct acd_softc *, int);
 static int acd_blank(struct acd_softc *, int);
 static int acd_prevent_allow(struct acd_softc *, int);
 static int acd_start_stop(struct acd_softc *, int);
@@ -651,13 +651,13 @@
 	    error = EBUSY;
 	    break;
 	}
-	error = acd_eject(cdp, 0);
+	error = acd_tray(cdp, 0);
 	break;
 
     case CDIOCCLOSE:
 	if (count_dev(dev) > 1)
 	    break;
-	error = acd_eject(cdp, 1);
+	error = acd_tray(cdp, 1);
 	break;
 
     case CDIOREADTOCHEADER:
@@ -1879,28 +1879,27 @@
 }
 
 static int 
-acd_eject(struct acd_softc *cdp, int close)
+acd_tray(struct acd_softc *cdp, int close)
 {
-    int error;
+    int error = ENODEV;
 
-    if ((error = acd_start_stop(cdp, 0)) == EBUSY) {
-	if (!close)
-	    return 0;
-	if ((error = acd_start_stop(cdp, 3)))
-	    return error;
-	acd_read_toc(cdp);
-	acd_prevent_allow(cdp, 1);
-	cdp->flags |= F_LOCKED;
-	return 0;
+    if (cdp->cap.mechanism & MST_EJECT) {
+	if (close) {
+	    if (!(error = acd_start_stop(cdp, 3))) {
+		acd_read_toc(cdp);
+		acd_prevent_allow(cdp, 1);
+		cdp->flags |= F_LOCKED;
+	    }
+	}
+	else {
+	    acd_start_stop(cdp, 0);
+	    acd_prevent_allow(cdp, 0);
+	    cdp->flags &= ~F_LOCKED;
+	    cdp->device->flags |= ATA_D_MEDIA_CHANGED;
+	    error = acd_start_stop(cdp, 2);
+	}
     }
-    if (error)
-	return error;
-    if (close)
-	return 0;
-    acd_prevent_allow(cdp, 0);
-    cdp->flags &= ~F_LOCKED;
-    cdp->device->flags |= ATA_D_MEDIA_CHANGED;
-    return acd_start_stop(cdp, 2);
+    return error;
 }
 
 static int

==== //depot/projects/netperf/sys/dev/pci/pci_user.c#4 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/pci/pci_user.c,v 1.13 2003/08/24 17:54:15 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/pci/pci_user.c,v 1.14 2003/10/11 22:20:34 se Exp $");
 
 #include "opt_bus.h"	/* XXX trim includes */
 
@@ -179,12 +179,6 @@
 	if (!(flag & FWRITE) && cmd != PCIOCGETCONF)
 		return EPERM;
 
-	/* make sure register is in bounds and aligned */
-	if (cmd == PCIOCREAD || cmd == PCIOCWRITE)
-		if (io->pi_reg < 0 || io->pi_reg + io->pi_width > PCI_REGMAX ||
-		    io->pi_reg & (io->pi_width - 1))
-			error = EINVAL;
-
 	switch(cmd) {
 	case PCIOCGETCONF:
 		{
@@ -376,46 +370,21 @@
 
 		break;
 		}
+
 	case PCIOCREAD:
+	case PCIOCWRITE:
 		io = (struct pci_io *)data;
 		switch(io->pi_width) {
 		case 4:
 		case 2:
 		case 1:
-			/*
-			 * Assume that the user-level bus number is
-			 * actually the pciN instance number. We map
-			 * from that to the real pcib+bus combination.
-			 */
-			pci = devclass_get_device(devclass_find("pci"),
-						  io->pi_sel.pc_bus);
-			if (pci) {
-				int b = pcib_get_bus(pci);
-				pcib = device_get_parent(pci);
-				io->pi_data =
-					PCIB_READ_CONFIG(pcib,
-							 b,
-							 io->pi_sel.pc_dev,
-							 io->pi_sel.pc_func,
-							 io->pi_reg,
-							 io->pi_width);
-				error = 0;
-			} else {
-				error = ENODEV;
-			}
-			break;
-		default:
-			error = EINVAL;
-			break;
-		}
-		break;
+			/* make sure register is in bounds and aligned */
+			if (cmd == PCIOCREAD || cmd == PCIOCWRITE)
+				if (io->pi_reg < 0 ||
+				    io->pi_reg + io->pi_width > PCI_REGMAX ||
+				    io->pi_reg & (io->pi_width - 1))
+					error = EINVAL;
 
-	case PCIOCWRITE:
-		io = (struct pci_io *)data;
-		switch(io->pi_width) {
-		case 4:
-		case 2:
-		case 1:
 			/*
 			 * Assume that the user-level bus number is
 			 * actually the pciN instance number. We map
@@ -426,13 +395,22 @@
 			if (pci) {
 				int b = pcib_get_bus(pci);
 				pcib = device_get_parent(pci);
-				PCIB_WRITE_CONFIG(pcib,
-						  b,
-						  io->pi_sel.pc_dev,
-						  io->pi_sel.pc_func,
-						  io->pi_reg,
-						  io->pi_data,
-						  io->pi_width);
+				if (cmd == PCIOCWRITE)
+					PCIB_WRITE_CONFIG(pcib,
+							  b,
+							  io->pi_sel.pc_dev,
+							  io->pi_sel.pc_func,
+							  io->pi_reg,
+							  io->pi_data,
+							  io->pi_width);
+				else
+					io->pi_data =
+						PCIB_READ_CONFIG(pcib,
+							  b,
+							  io->pi_sel.pc_dev,
+							  io->pi_sel.pc_func,
+							  io->pi_reg,
+							  io->pi_width);
 				error = 0;
 			} else {
 				error = ENODEV;

==== //depot/projects/netperf/sys/dev/sound/pci/au88x0.c#4 (text+ko) ====

@@ -25,7 +25,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/sound/pci/au88x0.c,v 1.4 2003/09/02 17:30:37 jhb Exp $
+ * $FreeBSD: src/sys/dev/sound/pci/au88x0.c,v 1.5 2003/10/12 11:33:39 des Exp $
  */
 
 #include <dev/sound/pcm/sound.h>
@@ -40,6 +40,103 @@
 
 /***************************************************************************\
  *                                                                         *
+ *                          SUPPORTED CHIPSETS                             *
+ *                                                                         *
+\***************************************************************************/
+
+static struct au88x0_chipset au88x0_chipsets[] = {
+	{
+		.auc_name		= "Aureal Vortex (8820)",
+		.auc_pci_id		= 0x000112eb,
+
+		.auc_control		= 0x1280c,
+
+		.auc_irq_source		= 0x12800,
+		.auc_irq_mask		= 0x12804,
+		.auc_irq_control	= 0x12808,
+		.auc_irq_status		= 0x1199c,
+
+		.auc_dma_control	= 0x1060c,
+
+		.auc_fifo_size		= 0x20,
+		.auc_wt_fifos		= 32,
+		.auc_wt_fifo_base	= 0x0e800,
+		.auc_wt_fifo_ctl	= 0x0f800,
+		.auc_wt_dma_ctl		= 0x10500,
+		.auc_adb_fifos		= 16,
+		.auc_adb_fifo_base	= 0x0e000,
+		.auc_adb_fifo_ctl	= 0x0f840,
+		.auc_adb_dma_ctl	= 0x10580,
+
+		.auc_adb_route_base	= 0x10800,
+		.auc_adb_route_bits	= 7,
+		.auc_adb_codec_in	= 0x48,
+		.auc_adb_codec_out	= 0x58,
+	},
+	{
+		.auc_name		= "Aureal Vortex 2 (8830)",
+		.auc_pci_id		= 0x000212eb,
+
+		.auc_control		= 0x2a00c,
+
+		.auc_irq_source		= 0x2a000,
+		.auc_irq_mask		= 0x2a004,
+		.auc_irq_control	= 0x2a008,
+		.auc_irq_status		= 0x2919c,
+
+		.auc_dma_control	= 0x27ae8,
+
+		.auc_fifo_size		= 0x40,
+		.auc_wt_fifos		= 64,
+		.auc_wt_fifo_base	= 0x10000,
+		.auc_wt_fifo_ctl	= 0x16000,
+		.auc_wt_dma_ctl		= 0x27900,
+		.auc_adb_fifos		= 32,
+		.auc_adb_fifo_base	= 0x14000,
+		.auc_adb_fifo_ctl	= 0x16100,
+		.auc_adb_dma_ctl	= 0x27a00,
+
+		.auc_adb_route_base	= 0x28000,
+		.auc_adb_route_bits	= 8,
+		.auc_adb_codec_in	= 0x70,
+		.auc_adb_codec_out	= 0x88,
+	},
+	{
+		.auc_name		= "Aureal Vortex Advantage (8810)",
+		.auc_pci_id		= 0x000312eb,
+
+		.auc_control		= 0x2a00c,
+
+		.auc_irq_source		= 0x2a000,
+		.auc_irq_mask		= 0x2a004,
+		.auc_irq_control	= 0x2a008,
+		.auc_irq_status		= 0x2919c,
+
+		.auc_dma_control	= 0x27ae8,
+
+		.auc_fifo_size		= 0x20,
+		.auc_wt_fifos		= 32,
+		.auc_wt_fifo_base	= 0x10000,
+		.auc_wt_fifo_ctl	= 0x16000,
+		.auc_wt_dma_ctl		= 0x27fd8,
+		.auc_adb_fifos		= 16,
+		.auc_adb_fifo_base	= 0x14000,
+		.auc_adb_fifo_ctl	= 0x16100,
+		.auc_adb_dma_ctl	= 0x27180,
+
+		.auc_adb_route_base	= 0x28000,
+		.auc_adb_route_bits	= 8,
+		.auc_adb_codec_in	= 0x70,
+		.auc_adb_codec_out	= 0x88,
+	},
+	{
+		.auc_pci_id		= 0,
+	}
+};
+
+
+/***************************************************************************\
+ *                                                                         *
  *                       FORMATS AND CAPABILITIES                          *
  *                                                                         *
 \***************************************************************************/
@@ -343,12 +440,13 @@
 au88x0_intr(void *arg)
 {
 	struct au88x0_info *aui = arg;
+	struct au88x0_chipset *auc = aui->aui_chipset;
 	int pending, source;
 
-	pending = au88x0_read(aui, AU88X0_IRQ_PENDING, 4);
+	pending = au88x0_read(aui, auc->auc_irq_control, 4);
 	if ((pending & AU88X0_IRQ_PENDING_BIT) == 0)
 		return;
-	source = au88x0_read(aui, AU88X0_IRQ_SOURCE, 4);
+	source = au88x0_read(aui, auc->auc_irq_source, 4);
 	if (source & AU88X0_IRQ_FATAL_ERR)
 		device_printf(aui->aui_dev,
 		    "fatal error interrupt received\n");
@@ -358,8 +456,8 @@
 	/* XXX handle the others... */
 
 	/* acknowledge the interrupts we just handled */
-	au88x0_write(aui, AU88X0_IRQ_SOURCE, source, 4);
-	au88x0_read(aui, AU88X0_IRQ_SOURCE, 4);
+	au88x0_write(aui, auc->auc_irq_source, source, 4);
+	au88x0_read(aui, auc->auc_irq_source, 4);
 }
 
 
@@ -377,19 +475,20 @@
 static void
 au88x0_fifo_init(struct au88x0_info *aui)
 {
+	struct au88x0_chipset *auc = aui->aui_chipset;
 	int i;
 
 	/* reset, then clear the ADB FIFOs */
-	for (i = 0; i < AU88X0_ADB_FIFOS; ++i)
-		au88x0_write(aui, AU88X0_ADB_FIFO_CTL + i * 4, 0x42000, 4);
-	for (i = 0; i < AU88X0_ADB_FIFOS * AU88X0_ADB_FIFO_SIZE; ++i)
-		au88x0_write(aui, AU88X0_ADB_FIFO_BASE + i * 4, 0, 4);
+	for (i = 0; i < auc->auc_adb_fifos; ++i)
+		au88x0_write(aui, auc->auc_adb_fifo_ctl + i * 4, 0x42000, 4);
+	for (i = 0; i < auc->auc_adb_fifos * auc->auc_fifo_size; ++i)
+		au88x0_write(aui, auc->auc_adb_fifo_base + i * 4, 0, 4);
 
 	/* reset, then clear the WT FIFOs */
-	for (i = 0; i < AU88X0_WT_FIFOS; ++i)
-		au88x0_write(aui, AU88X0_WT_FIFO_CTL + i * 4, 0x42000, 4);
-	for (i = 0; i < AU88X0_WT_FIFOS * AU88X0_WT_FIFO_SIZE; ++i)
-		au88x0_write(aui, AU88X0_WT_FIFO_BASE + i * 4, 0, 4);
+	for (i = 0; i < auc->auc_wt_fifos; ++i)
+		au88x0_write(aui, auc->auc_wt_fifo_ctl + i * 4, 0x42000, 4);
+	for (i = 0; i < auc->auc_wt_fifos * auc->auc_fifo_size; ++i)
+		au88x0_write(aui, auc->auc_wt_fifo_base + i * 4, 0, 4);
 }
 
 /*
@@ -398,15 +497,16 @@
 static void
 au88x0_init(struct au88x0_info *aui)
 {
+	struct au88x0_chipset *auc = aui->aui_chipset;
 
 	/* reset the chip */
-	au88x0_write(aui, AU88X0_CONTROL, 0xffffffff, 4);
+	au88x0_write(aui, auc->auc_control, 0xffffffff, 4);
 	DELAY(10000);
 
 	/* clear all interrupts */
-	au88x0_write(aui, AU88X0_IRQ_SOURCE, 0xffffffff, 4);
-	au88x0_read(aui, AU88X0_IRQ_SOURCE, 4);
-	au88x0_read(aui, AU88X0_IRQ_STATUS, 4);
+	au88x0_write(aui, auc->auc_irq_source, 0xffffffff, 4);
+	au88x0_read(aui, auc->auc_irq_source, 4);
+	au88x0_read(aui, auc->auc_irq_status, 4);
 
 	/* initialize the codec */
 	au88x0_codec_init(aui);
@@ -416,7 +516,7 @@
 
 	/* initialize the DMA engine */
 	/* XXX chicken-waving! */
-	au88x0_write(aui, AU88X0_DMA_CONTROL, 0x1380000, 4);
+	au88x0_write(aui, auc->auc_dma_control, 0x1380000, 4);
 }
 
 /*
@@ -448,18 +548,17 @@
 static int
 au88x0_pci_probe(device_t dev)
 {
+	struct au88x0_chipset *auc;
+	uint32_t pci_id;
 
-	switch (pci_get_devid(dev)) {
-	case AUREAL_VORTEX_2:
-		device_set_desc(dev, "Aureal Vortex 2");
-		return (0);
-	case AUREAL_VORTEX_ADVANTAGE:
-		device_set_desc(dev, "Aureal Vortex Advantage");
-		return (0);
-	default:
-		return (ENXIO);
+	pci_id = pci_get_devid(dev);
+	for (auc = au88x0_chipsets; auc->auc_pci_id; ++auc) {
+		if (auc->auc_pci_id == pci_id) {
+			device_set_desc(dev, auc->auc_name);
+			return (0);
+		}
 	}
-	return (0);
+	return (ENXIO);
 }
 
 /*
@@ -468,6 +567,7 @@
 static int
 au88x0_pci_attach(device_t dev)
 {
+	struct au88x0_chipset *auc;
 	struct au88x0_info *aui = NULL;
 	uint32_t config;
 	int error;
@@ -480,15 +580,11 @@
 
 	/* Model-specific parameters */
 	aui->aui_model = pci_get_devid(dev);
-	switch (aui->aui_model) {
-	case AUREAL_VORTEX_1:
-		break;
-	case AUREAL_VORTEX_2:
-	case AUREAL_VORTEX_ADVANTAGE:
-		break;
-	default:
+	for (auc = au88x0_chipsets; auc->auc_pci_id; ++auc)
+		if (auc->auc_pci_id == aui->aui_model)
+			aui->aui_chipset = auc;
+	if (aui->aui_chipset == NULL)
 		panic("%s() called for non-au88x0 device", __func__);
-	}
 
 	/* enable pio, mmio, bus-mastering dma */
 	config = pci_read_config(dev, PCIR_COMMAND, 2);
@@ -567,8 +663,8 @@
 	/* register with the pcm driver */
 	if (pcm_register(dev, aui, 0, 0))
 		goto failed;
+	pcm_addchan(dev, PCMDIR_PLAY, &au88x0_chan_class, aui);
 #if 0
-	pcm_addchan(dev, PCMDIR_PLAY, &au88x0_chan_class, aui);
 	pcm_addchan(dev, PCMDIR_REC, &au88x0_chan_class, aui);
 #endif
 	au88x0_set_status(dev);

==== //depot/projects/netperf/sys/dev/sound/pci/au88x0.h#2 (text+ko) ====

@@ -25,13 +25,63 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/sound/pci/au88x0.h,v 1.1 2003/06/01 11:58:46 des Exp $
+ * $FreeBSD: src/sys/dev/sound/pci/au88x0.h,v 1.2 2003/10/12 11:33:39 des Exp $
  */
 
 #ifndef _AU88X0_H_INCLUDED
 #define _AU88X0_H_INCLUDED
 
 /*
+ * Chipset parameters
+ */
+struct au88x0_chipset {
+	const char		*auc_name;
+	uint32_t		 auc_pci_id;
+
+	/* General control register */
+	uint32_t		 auc_control;
+#define	AU88X0_CTL_MIDI_ENABLE		0x0001
+#define	AU88X0_CTL_GAME_ENABLE		0x0008
+#define	AU88X0_CTL_IRQ_ENABLE		0x4000
+
+	/* IRQ control register */
+	uint32_t		 auc_irq_source;
+#define	AU88X0_IRQ_FATAL_ERR		0x0001
+#define	AU88X0_IRQ_PARITY_ERR		0x0002
+#define	AU88X0_IRQ_REG_ERR		0x0004
+#define	AU88X0_IRQ_FIFO_ERR		0x0008
+#define	AU88X0_IRQ_DMA_ERR		0x0010
+#define	AU88X0_IRQ_PCMOUT		0x0020
+#define	AU88X0_IRQ_TIMER		0x1000
+#define	AU88X0_IRQ_MIDI			0x2000
+#define	AU88X0_IRQ_MODEM		0x4000
+	uint32_t		 auc_irq_mask;
+	uint32_t		 auc_irq_control;
+#define		AU88X0_IRQ_PENDING_BIT		0x0001
+	uint32_t		 auc_irq_status;
+
+	/* DMA control registers */
+	uint32_t		 auc_dma_control;
+
+	/* FIFOs */
+	int			 auc_fifo_size;
+	int			 auc_wt_fifos;
+	uint32_t		 auc_wt_fifo_base;
+	uint32_t		 auc_wt_fifo_ctl;
+	uint32_t		 auc_wt_dma_ctl;
+	int			 auc_adb_fifos;
+	uint32_t		 auc_adb_fifo_base;
+	uint32_t		 auc_adb_fifo_ctl;
+	uint32_t		 auc_adb_dma_ctl;
+
+	/* Routing */
+	uint32_t		 auc_adb_route_base;
+	int			 auc_adb_route_bits;
+	int			 auc_adb_codec_in;
+	int			 auc_adb_codec_out;
+};
+
+/*
  * Channel information
  */
 struct au88x0_chan_info {
@@ -48,9 +98,16 @@
 	/* the device we're associated with */
 	device_t		 aui_dev;
 	uint32_t		 aui_model;
+	struct au88x0_chipset	*aui_chipset;
 
 	/* parameters */
 	bus_size_t		 aui_bufsize;
+	int			 aui_wt_fifos;
+	int			 aui_wt_fifo_ctl;
+	int			 aui_adb_fifos;
+	int			 aui_adb_fifo_ctl;
+	int			 aui_fifo_size;
+	uint32_t		 aui_chanbase;
 
 	/* bus_space tag and handle */
 	bus_space_tag_t		 aui_spct;
@@ -78,13 +135,6 @@
 };
 
 /*
- * PCI IDs of supported cards
- */
-#define AUREAL_VORTEX_1		0x000112eb	/* 8820 (not supported) */
-#define AUREAL_VORTEX_2		0x000212eb	/* 8830 */
-#define AUREAL_VORTEX_ADVANTAGE	0x000312eb	/* 8810 */
-
-/*
  * Common parameters
  */
 #define AU88X0_SETTLE_DELAY	1000
@@ -94,30 +144,6 @@
 #define AU88X0_BUFSIZE_MAX	0x4000
 
 /*
- * General control registers
- */
-#define AU88X0_CONTROL		0x2a00c
-#define		AU88X0_CTL_MIDI_ENABLE	0x0001
-#define		AU88X0_CTL_GAME_ENABLE	0x0008
-#define		AU88X0_CTL_IRQ_ENABLE	0x4000
-
-#define AU88X0_IRQ_SOURCE	0x2a000
-#define AU88X0_IRQ_MASK		0x2a004
-#define		AU88X0_IRQ_FATAL_ERR		0x0001
-#define		AU88X0_IRQ_PARITY_ERR		0x0002
-#define		AU88X0_IRQ_REG_ERR		0x0004
-#define		AU88X0_IRQ_FIFO_ERR		0x0008
-#define		AU88X0_IRQ_DMA_ERR		0x0010
-#define		AU88X0_IRQ_PCMOUT		0x0020
-#define		AU88X0_IRQ_TIMER		0x1000
-#define		AU88X0_IRQ_MIDI			0x2000
-#define		AU88X0_IRQ_MODEM		0x4000
-#define AU88X0_IRQ_PENDING	0x2a008
-#define		AU88X0_IRQ_PENDING_BIT		0x0001
-#define AU88X0_IRQ_STATUS	0x2919c
-#define AU88X0_DMA_CONTROL	0x27ae8
-
-/*
  * Codec control registers
  *
  * AU88X0_CODEC_CHANNEL	array of 32 32-bit words
@@ -149,26 +175,4 @@
 	 (((d) << AU88X0_CDIO_DATA_SHIFT) & AU88X0_CDIO_DATA_MASK))
 #define AU88X0_CODEC_ENABLE	0x29190
 
-/*
- * FIFO and DMA contorl registers
- *
- * There are two sets of these, one for PCM audio (ADB) and one for
- * wavetables (WT).
- */
-#define AU88X0_ADB_FIFOS	32
-#define AU88X0_ADB_FIFO_CTL	0x16100
-#define AU88X0_ADB_FIFO_BASE	0x14000
-#define AU88X0_ADB_FIFO_SIZE	0x40
-#define AU8810_ADB_DMA_CTL	0x27180
-#define AU8820_ADB_DMA_CTL	0x10580
-#define AU8830_ADB_DMA_CTL	0x27a00
-
-#define AU88X0_WT_FIFOS		32
-#define AU88X0_WT_FIFO_CTL	0x16000
-#define AU88X0_WT_FIFO_BASE	0x10000
-#define AU88X0_WT_FIFO_SIZE	0x40
-#define AU8810_WT_DMA_CTL	0x27fd8
-#define AU8820_WT_DMA_CTL	0x10500
-#define AU8830_WT_DMA_CTL	0x27900
-
 #endif

==== //depot/projects/netperf/sys/dev/sound/pcm/ac97.c#6 (text+ko) ====

@@ -30,7 +30,7 @@
 
 #include "mixer_if.h"
 
-SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/ac97.c,v 1.47 2003/09/07 16:28:03 cg Exp $");
+SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/ac97.c,v 1.48 2003/10/12 11:51:24 des Exp $");
 
 MALLOC_DEFINE(M_AC97, "ac97", "ac97 codec");
 
@@ -137,6 +137,7 @@
 	{ 0x414c4710, 0x0f, 0, "ALC200", 	0 },
 	{ 0x414c4740, 0x0f, 0, "ALC202", 	0 },
 	{ 0x414c4720, 0x0f, 0, "ALC650", 	0 },
+	{ 0x414c4760, 0x0f, 0, "ALC655",	0 },
 	{ 0x43525900, 0x07, 0, "CS4297", 	0 },
 	{ 0x43525910, 0x07, 0, "CS4297A", 	0 },
 	{ 0x43525920, 0x07, 0, "CS4294/98",	0 },

==== //depot/projects/netperf/sys/dev/usb/ugen.c#6 (text+ko) ====

@@ -7,7 +7,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/ugen.c,v 1.79 2003/10/01 14:49:53 ticso Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/ugen.c,v 1.80 2003/10/12 15:51:40 ticso Exp $");
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -272,9 +272,9 @@
 				"%s.%d",
 				USBDEVNAME(sc->sc_dev), endptno);
 			if (sc->sc_endpoints[endptno][IN].sc != NULL)
-				sc->sc_endpoints[endptno][IN].sc->dev = dev;
+				sc->sc_endpoints[endptno][IN].dev = dev;
 			if (sc->sc_endpoints[endptno][OUT].sc != NULL)
-				sc->sc_endpoints[endptno][OUT].sc->dev = dev;
+				sc->sc_endpoints[endptno][OUT].dev = dev;
 		}
 	}
 }
@@ -298,9 +298,9 @@
 			 * of the structs is populated.
 			 */
 			if (sc->sc_endpoints[endptno][IN].sc != NULL)
-				dev = sc->sc_endpoints[endptno][IN].sc->dev;
+				dev = sc->sc_endpoints[endptno][IN].dev;
 			else
-				dev = sc->sc_endpoints[endptno][OUT].sc->dev;
+				dev = sc->sc_endpoints[endptno][OUT].dev;
 			destroy_dev(dev);
 		}
 	}

==== //depot/projects/netperf/sys/geom/geom_dev.c#6 (text+ko) ====

@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/geom_dev.c,v 1.68 2003/09/04 21:23:46 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/geom_dev.c,v 1.69 2003/10/12 11:35:55 phk Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -386,7 +386,6 @@
 		tsleep(&bp, PRIBIO, "gdstrat", hz / 10);
 	}
 	KASSERT(bp2 != NULL, ("XXX: ENOMEM in a bad place"));
-	bp2->bio_offset = (off_t)bp->bio_blkno << DEV_BSHIFT;
 	KASSERT(bp2->bio_offset >= 0,
 	    ("Negative bio_offset (%jd) on bio %p",
 	    (intmax_t)bp2->bio_offset, bp));

==== //depot/projects/netperf/sys/geom/geom_event.c#2 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/geom_event.c,v 1.41 2003/06/11 06:49:15 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/geom_event.c,v 1.42 2003/10/12 11:34:35 phk Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -139,6 +139,8 @@
 		cp->geom->orphan(cp);
 		cp = cp2;
 	}
+	if (LIST_EMPTY(&pp->consumers) && (pp->flags & G_PF_WITHER))
+		g_destroy_provider(pp);
 #ifdef notyet
 	cp = LIST_FIRST(&pp->consumers);
 	if (cp != NULL)

==== //depot/projects/netperf/sys/i386/i386/locore.s#6 (text+ko) ====

@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)locore.s	7.3 (Berkeley) 5/13/91

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list