Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Nov 2003 15:07:24 -0500
From:      Mathew Kanner <mat@cnd.mcgill.ca>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/59306: patch to augment /dev/sndstat to show which module provides driver
Message-ID:  <20031115200724.GF68875@cnd.mcgill.ca>
Resent-Message-ID: <200311152020.hAFKKJ7E093897@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
	Note: There was a bad value `medium' for the field `>Severity:'.
	It was set to the default value of `serious'.


>Number:         59306
>Category:       kern
>Synopsis:       patch to augment /dev/sndstat to show which module provides driver
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 15 12:20:19 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Mathew Kanner
>Release:        FreeBSD 5.x
>Organization:
>Environment:
System: FreeBSD tube.mine.nu 5.1-CURRENT-20031021-JPSNAP FreeBSD 5.1-CURRENT-20031021-JPSNAP #0: Tue Oct 21 01:07:08 GMT 2003     root@ushi.jp.freebsd.org:/usr/obj/usr/src/sys/GENERIC  i386

>Description:

	Sometimes it's very hard to know which module provides the
driver for a soundcard.  This patch changes the output of /dev/sndstat
to include this information (note the kld snd_cmi).

mat@tube$ cat /dev/sndstat 
FreeBSD Audio Driver (newpcm)
Installed devices:
pcm0: <CMedia CMI8738> at io 0xb800 irq 10 kld snd_cmi (1p/1r/0v channels duplex default)

	This eases the installation of a new soundcard as the
procedure becomes

	kldload snd_driver
	cat /dev/sndstat
	[edit /boot/loader.conf to load the klds show]


>How-To-Repeat:
	
>Fix:

--69pVuxX8awAiJ7fD
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="snd_module_status.patch"

diff -ru dev/sound/pci.old/als4000.c dev/sound/pci/als4000.c
--- dev/sound/pci.old/als4000.c	Sun Sep  7 05:14:58 2003
+++ dev/sound/pci/als4000.c	Fri Nov  7 18:59:42 2003
@@ -818,7 +818,7 @@
 	pcm_addchan(dev, PCMDIR_PLAY, &alspchan_class, sc);
 	pcm_addchan(dev, PCMDIR_REC,  &alsrchan_class, sc);
 
-	snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld",
+	snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld kld snd_als4000",
 		 rman_get_start(sc->reg), rman_get_start(sc->irq));
 	pcm_setstatus(dev, status);
 	return 0;
diff -ru dev/sound/pci.old/au88x0.c dev/sound/pci/au88x0.c
--- dev/sound/pci.old/au88x0.c	Wed Oct 22 00:55:50 2003
+++ dev/sound/pci/au88x0.c	Fri Nov  7 19:00:03 2003
@@ -529,7 +529,7 @@
 	struct au88x0_info *aui;
 
 	aui = pcm_getdevinfo(dev);
-	snprintf(status, sizeof status, "at %s 0x%lx irq %ld",
+	snprintf(status, sizeof status, "at %s 0x%lx irq %ld kld snd_au88x0",
 	    (aui->aui_regtype == SYS_RES_IOPORT)? "io" : "memory",
 	    rman_get_start(aui->aui_reg), rman_get_start(aui->aui_irq));
 	pcm_setstatus(dev, status);
diff -ru dev/sound/pci.old/aureal.c dev/sound/pci/aureal.c
--- dev/sound/pci.old/aureal.c	Sat Sep 13 21:09:21 2003
+++ dev/sound/pci/aureal.c	Fri Nov  7 19:01:10 2003
@@ -647,7 +647,7 @@
 		goto bad;
 	}
 
-	snprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld",
+	snprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld kld snd_aureal",
 		 (type[0] == SYS_RES_IOPORT)? "io" : "memory",
 		 rman_get_start(reg[0]), rman_get_start(irq));
 
diff -ru dev/sound/pci.old/cmi.c dev/sound/pci/cmi.c
--- dev/sound/pci.old/cmi.c	Fri Oct 24 23:49:03 2003
+++ dev/sound/pci/cmi.c	Fri Nov  7 19:01:19 2003
@@ -898,7 +898,7 @@
 	pcm_addchan(dev, PCMDIR_PLAY, &cmichan_class, sc);
 	pcm_addchan(dev, PCMDIR_REC, &cmichan_class, sc);
 
-	snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld",
+	snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld kld snd_cmi",
 		 rman_get_start(sc->reg), rman_get_start(sc->irq));
 	pcm_setstatus(dev, status);
 
diff -ru dev/sound/pci.old/cs4281.c dev/sound/pci/cs4281.c
--- dev/sound/pci.old/cs4281.c	Sun Sep  7 05:14:58 2003
+++ dev/sound/pci/cs4281.c	Fri Nov  7 19:01:43 2003
@@ -858,7 +858,7 @@
     pcm_addchan(dev, PCMDIR_PLAY, &cs4281chan_class, sc);
     pcm_addchan(dev, PCMDIR_REC, &cs4281chan_class, sc);
 
-    snprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld",
+    snprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld kld snd_cs4281",
 	     (sc->regtype == SYS_RES_IOPORT)? "io" : "memory",
 	     rman_get_start(sc->reg), rman_get_start(sc->irq));
     pcm_setstatus(dev, status);
diff -ru dev/sound/pci.old/csapcm.c dev/sound/pci/csapcm.c
--- dev/sound/pci.old/csapcm.c	Sun Sep  7 05:14:58 2003
+++ dev/sound/pci/csapcm.c	Fri Nov  7 19:02:10 2003
@@ -788,7 +788,7 @@
 		return (ENXIO);
 	}
 
-	snprintf(status, SND_STATUSLEN, "at irq %ld", rman_get_start(resp->irq));
+	snprintf(status, SND_STATUSLEN, "at irq %ld kld snd_csa", rman_get_start(resp->irq));
 
 	/* Enable interrupt. */
 	if (snd_setup_intr(dev, resp->irq, INTR_MPSAFE, csa_intr, csa, &csa->ih)) {
diff -ru dev/sound/pci.old/ds1.c dev/sound/pci/ds1.c
--- dev/sound/pci.old/ds1.c	Sun Sep  7 05:14:58 2003
+++ dev/sound/pci/ds1.c	Fri Nov  7 19:02:33 2003
@@ -996,7 +996,7 @@
 		goto bad;
 	}
 
-	snprintf(status, SND_STATUSLEN, "at memory 0x%lx irq %ld",
+	snprintf(status, SND_STATUSLEN, "at memory 0x%lx irq %ld kld snd_ds1",
 		 rman_get_start(sc->reg), rman_get_start(sc->irq));
 
 	if (pcm_register(dev, sc, DS1_CHANS, 2))
diff -ru dev/sound/pci.old/emu10k1.c dev/sound/pci/emu10k1.c
--- dev/sound/pci.old/emu10k1.c	Sat Sep 13 21:09:21 2003
+++ dev/sound/pci/emu10k1.c	Fri Nov  7 19:02:48 2003
@@ -1517,7 +1517,7 @@
 		goto bad;
 	}
 
-	snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld", rman_get_start(sc->reg), rman_get_start(sc->irq));
+	snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld kld snd_emu10k1", rman_get_start(sc->reg), rman_get_start(sc->irq));
 
 	if (pcm_register(dev, sc, EMU_CHANS, gotmic ? 3 : 2)) goto bad;
 	for (i = 0; i < EMU_CHANS; i++)
diff -ru dev/sound/pci.old/es137x.c dev/sound/pci/es137x.c
--- dev/sound/pci.old/es137x.c	Sat Sep 13 21:09:21 2003
+++ dev/sound/pci/es137x.c	Fri Nov  7 19:03:01 2003
@@ -924,7 +924,7 @@
 		goto bad;
 	}
 
-	snprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld",
+	snprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld kld snd_es137x",
 		 (es->regtype == SYS_RES_IOPORT)? "io" : "memory",
 		 rman_get_start(es->reg), rman_get_start(es->irq));
 
diff -ru dev/sound/pci.old/fm801.c dev/sound/pci/fm801.c
--- dev/sound/pci.old/fm801.c	Sun Sep  7 05:14:58 2003
+++ dev/sound/pci/fm801.c	Fri Nov  7 19:03:20 2003
@@ -638,7 +638,7 @@
 		goto oops;
 	}
 
-	snprintf(status, 64, "at %s 0x%lx irq %ld",
+	snprintf(status, 64, "at %s 0x%lx irq %ld kld snd_fm801",
 		(fm801->regtype == SYS_RES_IOPORT)? "io" : "memory",
 		rman_get_start(fm801->reg), rman_get_start(fm801->irq));
 
diff -ru dev/sound/pci.old/ich.c dev/sound/pci/ich.c
--- dev/sound/pci.old/ich.c	Wed Oct 22 00:55:50 2003
+++ dev/sound/pci/ich.c	Fri Nov  7 19:03:32 2003
@@ -761,7 +761,7 @@
 	if (sc->hasmic)
 		pcm_addchan(dev, PCMDIR_REC, &ichchan_class, sc);	/* record mic */
 
-	snprintf(status, SND_STATUSLEN, "at io 0x%lx, 0x%lx irq %ld bufsz %u",
+	snprintf(status, SND_STATUSLEN, "at io 0x%lx, 0x%lx irq %ld bufsz %u kld snd_ich",
 		 rman_get_start(sc->nambar), rman_get_start(sc->nabmbar), rman_get_start(sc->irq), sc->bufsz);
 
 	pcm_setstatus(dev, status);
diff -ru dev/sound/pci.old/maestro.c dev/sound/pci/maestro.c
--- dev/sound/pci.old/maestro.c	Sat Sep 13 21:09:21 2003
+++ dev/sound/pci/maestro.c	Fri Nov  7 19:03:46 2003
@@ -1033,7 +1033,7 @@
 	ess->irqid = irqid;
 	ess->ih = ih;
 
-	snprintf(status, SND_STATUSLEN, "at I/O port 0x%lx irq %ld",
+	snprintf(status, SND_STATUSLEN, "at I/O port 0x%lx irq %ld kld snd_maestro",
 	    rman_get_start(reg), rman_get_start(irq));
 
 	if (pcm_register(dev, ess, AGG_MAXPLAYCH, 1))
diff -ru dev/sound/pci.old/maestro3.c dev/sound/pci/maestro3.c
--- dev/sound/pci.old/maestro3.c	Sun Sep  7 05:14:58 2003
+++ dev/sound/pci/maestro3.c	Fri Nov  7 19:04:05 2003
@@ -1189,7 +1189,7 @@
 			goto bad;
 		}
 	}
- 	snprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld",
+ 	snprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld kld snd_maestro3",
 		 (sc->regtype == SYS_RES_IOPORT)? "io" : "memory",
 		 rman_get_start(sc->reg), rman_get_start(sc->irq));
 	if (pcm_setstatus(dev, status)) {
diff -ru dev/sound/pci.old/neomagic.c dev/sound/pci/neomagic.c
--- dev/sound/pci.old/neomagic.c	Sat Sep 13 21:09:22 2003
+++ dev/sound/pci/neomagic.c	Fri Nov  7 19:04:24 2003
@@ -704,7 +704,7 @@
 		goto bad;
 	}
 
-	snprintf(status, SND_STATUSLEN, "at memory 0x%lx, 0x%lx irq %ld",
+	snprintf(status, SND_STATUSLEN, "at memory 0x%lx, 0x%lx irq %ld kld snd_neomagic",
 		 rman_get_start(sc->buf), rman_get_start(sc->reg),
 		 rman_get_start(sc->irq));
 
diff -ru dev/sound/pci.old/solo.c dev/sound/pci/solo.c
--- dev/sound/pci.old/solo.c	Sat Sep 13 21:09:22 2003
+++ dev/sound/pci/solo.c	Fri Nov  7 19:04:37 2003
@@ -997,7 +997,7 @@
 		goto no;
     	}
 
-    	snprintf(status, SND_STATUSLEN, "at io 0x%lx,0x%lx,0x%lx irq %ld",
+    	snprintf(status, SND_STATUSLEN, "at io 0x%lx,0x%lx,0x%lx irq %ld kld snd_solo",
     	     	rman_get_start(sc->io), rman_get_start(sc->sb), rman_get_start(sc->vc),
 		rman_get_start(sc->irq));
 
diff -ru dev/sound/pci.old/t4dwave.c dev/sound/pci/t4dwave.c
--- dev/sound/pci.old/t4dwave.c	Sat Sep 13 21:09:22 2003
+++ dev/sound/pci/t4dwave.c	Fri Nov  7 19:04:48 2003
@@ -860,7 +860,7 @@
 		goto bad;
 	}
 
-	snprintf(status, 64, "at io 0x%lx irq %ld",
+	snprintf(status, 64, "at io 0x%lx irq %ld kld snd_t4dwave",
 		 rman_get_start(tr->reg), rman_get_start(tr->irq));
 
 	if (pcm_register(dev, tr, TR_MAXPLAYCH, 1)) goto bad;
diff -ru dev/sound/pci.old/via8233.c dev/sound/pci/via8233.c
--- dev/sound/pci.old/via8233.c	Sun Sep  7 05:14:58 2003
+++ dev/sound/pci/via8233.c	Fri Nov  7 19:04:59 2003
@@ -843,7 +843,7 @@
 		ac97_setextmode(via->codec, ext);
 	}
 
-	snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld", 
+	snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld kld snd_via8233", 
 		 rman_get_start(via->reg), rman_get_start(via->irq));
 
 	/* Register */
diff -ru dev/sound/pci.old/via82c686.c dev/sound/pci/via82c686.c
--- dev/sound/pci.old/via82c686.c	Sun Sep  7 05:14:58 2003
+++ dev/sound/pci/via82c686.c	Fri Nov  7 19:05:12 2003
@@ -572,7 +572,7 @@
 	if (bus_dmamap_load(via->sgd_dmat, via->sgd_dmamap, via->sgd_table, NSEGS * sizeof(struct via_dma_op), dma_cb, via, 0))
 		goto bad;
 
-	snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld", rman_get_start(via->reg), rman_get_start(via->irq));
+	snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld kld snd_via82c686", rman_get_start(via->reg), rman_get_start(via->irq));
 
 	/* Register */
 	if (pcm_register(dev, via, 1, 1)) goto bad;
diff -ru dev/sound/pci.old/vibes.c dev/sound/pci/vibes.c
--- dev/sound/pci.old/vibes.c	Sun Sep  7 05:14:58 2003
+++ dev/sound/pci/vibes.c	Fri Nov  7 19:05:26 2003
@@ -878,7 +878,7 @@
         pcm_addchan(dev, PCMDIR_PLAY, &svpchan_class, sc);
         pcm_addchan(dev, PCMDIR_REC,  &svrchan_class, sc);
 
-        snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld",
+        snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld kld snd_vibes",
                  rman_get_start(sc->enh_reg),  rman_get_start(sc->irq));
         pcm_setstatus(dev, status);
 

--69pVuxX8awAiJ7fD--
>Release-Note:
>Audit-Trail:
>Unformatted:
 --69pVuxX8awAiJ7fD
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 



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