Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Aug 1999 20:32:39 +0800
From:      Peter Wemm <peter@netplex.com.au>
To:        "Cameron Grant" <gandalf@vilnya.demon.co.uk>
Cc:        multimedia@freebsd.org, current@freebsd.org
Subject:   Re: it's time... 
Message-ID:  <19990810123239.458CE1C1E@overcee.netplex.com.au>
In-Reply-To: Your message of "Sun, 08 Aug 1999 02:23:59 %2B0100." <000901bee13c$b1831dc0$0304020a@rings> 

next in thread | previous in thread | raw e-mail | index | archive | help
"Cameron Grant" wrote:
> to let newpcm out of the cage so you can all get your grubby little hands on
> it.
> 
> http://www.vilnya.demon.co.uk/newpcm+dfrpnp-19990807.diff.gz
> 
> this is a patch against a recent -current.  if you have a pci or isapnp
> soundcard, you should have pnp0 and pcm0 in your kernel config as
> appropriate.  isapnp cards should not need any pnp lines in kernel.conf.
> 
> the list of supported cards is as for luigi's driver, with the addition of a
> couple more mss-clones, and trident 4dwave.  there is a part done aureal
> vortex driver which is as yet nonfunctional.  mmap() is supported but not
> well tested.  format conversions are supported.  the code seems to be
> stable.
> 
> please test it and email me success and failure reports.
> 
>     - cameron

You're missing a bit of the patch I sent you to fix some resource problems
caused by excessive cut/paste in Doug's code. Also, I implemented a proper
(but still a hack) resource printer so you see all ranges.

Before:
pcm0: <Yamaha SA2> at port 0x220-0x22f,0x530-0x537 irq 5 drq 0,1 on isa0

After:
pcm0: <Yamaha SA2> at port 0x220-0x22f,0x530-0x537,0x388-0x38b,0x330-0x331,\
0x370-0x371 irq 5 drq 0,1 on isa0

This still needs more work to handle line wraps etc.  Matthew Dodd did some
work in this area for the EISA code which should be able to be used.

Patch appended.  I don't think it's too critical since ISA_NPORT_IVARS is
the largest range, but the lower layers might end up trying to allocate on
rids that the upper layers can't handle.

Cheers,
-Peter

diff -ru3 --exclude=CVS /home/peter/merge/isa/isa_common.c ./isa/isa_common.c
--- /home/peter/merge/isa/isa_common.c	Tue Aug 10 20:17:51 1999
+++ ./isa/isa_common.c	Sat Aug  7 21:20:04 1999
@@ -270,12 +270,12 @@
 {
 	device_t dev = device_get_parent(child);
 	int success, i;
-	struct resource *res[ISA_NPORT];
+	struct resource *res[ISA_NIRQ];
 
 	/*
 	 * First clear out any existing resource definitions.
 	 */
-	for (i = 0; i < ISA_NPORT; i++) {
+	for (i = 0; i < ISA_NIRQ; i++) {
 		ISA_DELETE_RESOURCE(dev, child, SYS_RES_IRQ, i);
 		res[i] = NULL;
 	}
@@ -300,7 +300,7 @@
 		}
 
 		/*
-		 * If we didn't find a place for port range i, then
+		 * If we didn't find a place for irq range i, then
 		 * give up now.
 		 */
 		if (!res[i]) {
@@ -309,7 +309,7 @@
 		}
 	}
 
-	for (i = 0; i < ISA_NPORT; i++) {
+	for (i = 0; i < ISA_NIRQ; i++) {
 		if (res[i])
 			bus_release_resource(child, SYS_RES_IRQ,
 					     i, res[i]);
@@ -330,12 +330,12 @@
 {
 	device_t dev = device_get_parent(child);
 	int success, i;
-	struct resource *res[ISA_NPORT];
+	struct resource *res[ISA_NDRQ];
 
 	/*
 	 * First clear out any existing resource definitions.
 	 */
-	for (i = 0; i < ISA_NPORT; i++) {
+	for (i = 0; i < ISA_NDRQ; i++) {
 		ISA_DELETE_RESOURCE(dev, child, SYS_RES_DRQ, i);
 		res[i] = NULL;
 	}
@@ -360,7 +360,7 @@
 		}
 
 		/*
-		 * If we didn't find a place for port range i, then
+		 * If we didn't find a place for drq range i, then
 		 * give up now.
 		 */
 		if (!res[i]) {
@@ -369,7 +369,7 @@
 		}
 	}
 
-	for (i = 0; i < ISA_NPORT; i++) {
+	for (i = 0; i < ISA_NDRQ; i++) {
 		if (res[i])
 			bus_release_resource(child, SYS_RES_DRQ,
 					     i, res[i]);
@@ -507,26 +507,27 @@
 isa_print_resources(struct resource_list *rl, const char *name, int type,
 		    const char *format)
 {
-	struct resource_list_entry *rle0 = resource_list_find(rl, type, 0);
-	struct resource_list_entry *rle1 = resource_list_find(rl, type, 1);
+	struct resource_list_entry *rle;
+	int printed;
+	int i;
 
-	if (rle0 || rle1) {
-		printf(" %s ", name);
-		if (rle0) {
-			printf(format, rle0->start);
-			if (rle0->count > 1) {
-				printf("-");
-				printf(format, rle0->start + rle0->count - 1);
-			}
-		}
-		if (rle1) {
-			if (rle0)
+	printed = 0;
+	for (i = 0; i < 16; i++) {	/* arbitary limit of 16 for now */
+		rle = resource_list_find(rl, type, i);
+		if (rle) {
+			if (printed == 0)
+				printf(" %s ", name);
+			else if (printed > 0)
 				printf(",");
-			printf(format, rle1->start);
-			if (rle1->count > 1) {
+			printed++;
+			printf(format, rle->start);
+			if (rle->count > 1) {
 				printf("-");
-				printf(format, rle1->start + rle1->count - 1);
+				printf(format, rle->start + rle->count - 1);
 			}
+		} else if (i > 3) {
+			/* check the first few regardless */
+			break;
 		}
 	}
 }
@@ -772,7 +773,7 @@
 	if (type == SYS_RES_IRQ && rid >= ISA_NIRQ)
 		return EINVAL;
 	if (type == SYS_RES_DRQ && rid >= ISA_NDRQ)
- 		return EINVAL;
+		return EINVAL;
 
 	resource_list_add(rl, type, rid, start, start + count - 1, count);
 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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