Date: Tue, 16 Oct 2001 14:28:24 -0400 (EDT) From: "Alexander N. Kabaev" <ak03@gte.com> To: FreeBSD-gnats-submit@freebsd.org Subject: kern/31316: kldxref introduction broke snd_driver.ko Message-ID: <200110161828.f9GISO449220@h132-197-97-45.gte.com>
next in thread | raw e-mail | index | archive | help
>Number: 31316
>Category: kern
>Synopsis: kldxref introduction broke snd_driver.ko
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Oct 16 11:30:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Alexander N. Kabaev
>Release: FreeBSD 5.0-CURRENT i386
>Organization:
Verizon Data Services
>Environment:
System: FreeBSD kanpc.gte.com 5.0-CURRENT FreeBSD 5.0-CURRENT #6: Tue Oct 16 11:03:35 EDT 2001 root@kanpc.gte.com:/usr/src/sys/i386/compile/KANPC i386
>Description:
snd_driver uses MODULE_DEPEND(name, ....) to load specific cards
drivers. Previously, the 'name' above was treated as a name of
the kernel module binary, i.e system would try to load name.ko
in the above case. This has changed with kldxref and corresponding
kernel module linker changes. Linker currently looks for the name,
specified in the DRIVER_MODULE() macro instead.
Several sound drivers currently have driver name which differs
from the module filename, and since snd_driver tries to
depend on them using their filenames, it is unable to load
and fails with an 'unavailable dependency' error.
The patch below simply restores one-to-one mapping
between driver name and its module name. This way
the same code will work as expected on both -CURRENT and
-STABLE.
>How-To-Repeat:
kldload snd_driver.ko should suffice.
>Fix:
Index: pci/als4000.c
===================================================================
RCS file: /usr/ncvs/src/sys/dev/sound/pci/als4000.c,v
retrieving revision 1.7
diff -u -r1.7 als4000.c
--- pci/als4000.c 10 Oct 2001 17:56:35 -0000 1.7
+++ pci/als4000.c 16 Oct 2001 18:00:36 -0000
@@ -897,6 +897,6 @@
PCM_SOFTC_SIZE,
};
-DRIVER_MODULE(snd_als, pci, als_driver, pcm_devclass, 0, 0);
-MODULE_DEPEND(snd_als, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER);
-MODULE_VERSION(snd_als, 1);
+DRIVER_MODULE(snd_als4000, pci, als_driver, pcm_devclass, 0, 0);
+MODULE_DEPEND(snd_als4000, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER);
+MODULE_VERSION(snd_als4000, 1);
Index: pci/cmi.c
===================================================================
RCS file: /usr/ncvs/src/sys/dev/sound/pci/cmi.c,v
retrieving revision 1.13
diff -u -r1.13 cmi.c
--- pci/cmi.c 10 Oct 2001 17:56:35 -0000 1.13
+++ pci/cmi.c 16 Oct 2001 18:03:06 -0000
@@ -981,6 +981,6 @@
PCM_SOFTC_SIZE
};
-DRIVER_MODULE(snd_cmipci, pci, cmi_driver, pcm_devclass, 0, 0);
-MODULE_DEPEND(snd_cmipci, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER);
-MODULE_VERSION(snd_cmipci, 1);
+DRIVER_MODULE(snd_cmi, pci, cmi_driver, pcm_devclass, 0, 0);
+MODULE_DEPEND(snd_cmi, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER);
+MODULE_VERSION(snd_cmi, 1);
Index: pci/via82c686.c
===================================================================
RCS file: /usr/ncvs/src/sys/dev/sound/pci/via82c686.c,v
retrieving revision 1.15
diff -u -r1.15 via82c686.c
--- pci/via82c686.c 8 Oct 2001 05:55:03 -0000 1.15
+++ pci/via82c686.c 16 Oct 2001 18:10:51 -0000
@@ -584,8 +584,8 @@
PCM_SOFTC_SIZE,
};
-DRIVER_MODULE(via, pci, via_driver, pcm_devclass, 0, 0);
-MODULE_DEPEND(via, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER);
-MODULE_VERSION(via, 1);
+DRIVER_MODULE(snd_via82c686, pci, via_driver, pcm_devclass, 0, 0);
+MODULE_DEPEND(snd_via82c686, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER);
+MODULE_VERSION(snd_via82c686, 1);
Index: pci/vibes.c
===================================================================
RCS file: /usr/ncvs/src/sys/dev/sound/pci/vibes.c,v
retrieving revision 1.10
diff -u -r1.10 vibes.c
--- pci/vibes.c 10 Oct 2001 17:56:35 -0000 1.10
+++ pci/vibes.c 16 Oct 2001 18:12:11 -0000
@@ -940,6 +940,6 @@
PCM_SOFTC_SIZE
};
-DRIVER_MODULE(snd_sonicvibes, pci, sonicvibes_driver, pcm_devclass, 0, 0);
-MODULE_DEPEND(snd_sonicvibes, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER);
-MODULE_VERSION(snd_sonicvibes, 1);
+DRIVER_MODULE(snd_vibes, pci, sonicvibes_driver, pcm_devclass, 0, 0);
+MODULE_DEPEND(snd_vibes, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER);
+MODULE_VERSION(snd_vibes, 1);
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110161828.f9GISO449220>
