summaryrefslogtreecommitdiffstats
path: root/usb.c
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-06-17 08:33:14 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-06-17 08:33:14 +0000
commit92b5b247fbc13b9f808689b759c908bf90cd9586 (patch)
tree843888744a0a0513d2a5cb8e2ba1fd014d1e8249 /usb.c
parentcde33da8c3a8406988caa1075ba22aea9a80ac76 (diff)
downloadldetect-92b5b247fbc13b9f808689b759c908bf90cd9586.tar
ldetect-92b5b247fbc13b9f808689b759c908bf90cd9586.tar.gz
ldetect-92b5b247fbc13b9f808689b759c908bf90cd9586.tar.bz2
ldetect-92b5b247fbc13b9f808689b759c908bf90cd9586.tar.xz
ldetect-92b5b247fbc13b9f808689b759c908bf90cd9586.zip
(usb_probe) ask the kernel for module to use with usb devices
Diffstat (limited to 'usb.c')
-rw-r--r--usb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usb.c b/usb.c
index 004eaa7..d71357b 100644
--- a/usb.c
+++ b/usb.c
@@ -58,9 +58,12 @@ extern struct pciusb_entries usb_probe(void) {
break;
}
case 'I': if (e->class_ == 0) {
+ char driver[50];
int class_, sub, prot = 0;
- if (sscanf(buf, "I: If#=%*2d Alt=%*2d #EPs=%*2d Cls=%02x(%*5c) Sub=%02x Prot=%02x", &class_, &sub, &prot) == 3) {
+ if (sscanf(buf, "I: If#=%*2d Alt=%*2d #EPs=%*2d Cls=%02x(%*5c) Sub=%02x Prot=%02x Driver=%s", &class_, &sub, &prot, driver) == 4) {
e->class_ = (class_ * 0x100 + sub) * 0x100 + prot;
+ if (strncmp(driver, "(none)", 6))
+ e->module = strdup(driver);
/* see linux/sound/usb/usbaudio.c::usb_audio_ids */
if (e->class_ == (0x1*0x100+ 0x01)) /* USB_AUDIO_CLASS*0x100 + USB_SUBCLASS_AUDIO_CONTROL*/
e->module = "snd-usb-audio";