View previous topic :: View next topic |
Author |
Message |
pestilence Apprentice
Joined: 05 Feb 2004 Posts: 213 Location: Athens / Greece
|
Posted: Mon Oct 11, 2004 7:08 am Post subject: Kernel > 2.6.7 USB modem fix! |
|
|
This applies to USB modem which stopped working after upgrading your kernel to a version higher than 2.6.7 (2.6.8, 2.6.9).
I had my Netmod USB modem dead after upgrading and this turned out to be a terrible headache since i could not connect to the Net at my home, i don't know why this patch was not included in the higher sources (it's not my patch i found this one on the Linux-usb-development mailing list).
1) Open up the file: /usr/src/linux/drivers/usb/class/cdc-acm.c
2) Find somewhere at line 547 (this can be different from one kernel version to another) the line:
Code: |
if (!buffer) {
err("Wierd descriptor references");
return -EINVAL;
}
|
If you don't have the same line search for a line that contains the -EINVAL (i found out that in kernel versions prior 2.6.9 the !buffer is named !buflen.
3)Comment out this lines (beware backup the file before changing it!).
4) Add the following lines:
Code: |
if (!buflen) {
if (intf->cur_altsetting->endpoint->extralen && intf->cur_altsetting->endp
oint->extra) {
dev_dbg(&intf->dev,"Seeking extra descriptors on endpoint");
buflen = intf->cur_altsetting->endpoint->extralen;
buffer = intf->cur_altsetting->endpoint->extra;
} else {
err("Zero length descriptor references");
return -EINVAL;
}
}
|
5) If you have cdc-acm as a module recompile the modules, if you have it inside your kernel recompile your kernel.
Thanks to the Linux-usb-devel Mailing list for this tip... _________________ Gentoo the rising hope
Last edited by pestilence on Mon Oct 11, 2004 11:29 am; edited 1 time in total |
|
Back to top |
|
|
asyr n00b
Joined: 01 Sep 2004 Posts: 56 Location: Hellas
|
Posted: Mon Oct 11, 2004 11:20 am Post subject: |
|
|
Just a clarification:
in the first code section (the original) the 'if' is related to the 'buffer' variable. In the second code section (the fix) the 'if' is related to the 'buflen' variable.
This is OK or an error ? |
|
Back to top |
|
|
pestilence Apprentice
Joined: 05 Feb 2004 Posts: 213 Location: Athens / Greece
|
Posted: Mon Oct 11, 2004 11:26 am Post subject: |
|
|
It's ok it worked for me just as it is, i totaly erased the first part and used the second one and had no problems, all my usb devices are working properly now.
And for being precise here is the code snip from the source (after the modification):
Code: |
/*
if (!buffer) {
err("Wierd descriptor references");
return -EINVAL;
}
*/
if (!buflen) {
if (intf->cur_altsetting->endpoint->extralen && intf->cur_altsetting->endp
oint->extra) {
dev_dbg(&intf->dev,"Seeking extra descriptors on endpoint");
buflen = intf->cur_altsetting->endpoint->extralen;
buffer = intf->cur_altsetting->endpoint->extra;
} else {
err("Zero length descriptor references");
return -EINVAL;
}
}
|
_________________ Gentoo the rising hope |
|
Back to top |
|
|
asyr n00b
Joined: 01 Sep 2004 Posts: 56 Location: Hellas
|
Posted: Mon Oct 11, 2004 11:33 am Post subject: |
|
|
Êáëü !
Cool ! |
|
Back to top |
|
|
gentoorizer n00b
Joined: 04 Apr 2004 Posts: 10
|
Posted: Tue Oct 12, 2004 2:27 pm Post subject: Excellent fix! |
|
|
I had been looking for a month now for this fix!!!!
Thank you Pestilence a LOT!
At last this damn netmod worked. Can you give us the devel-list message id where you found this fix?
Any ideas about how to remove the 'ignore extra header' when initializing cdc_acm driver (found in dmesg)
Thanks again! Time to say goodbye to little 2.6.4.... |
|
Back to top |
|
|
theape n00b
Joined: 11 Jul 2002 Posts: 15
|
Posted: Tue Oct 12, 2004 3:07 pm Post subject: Use mm sources |
|
|
Or alternatively, use any mm source after 2.6.9-rc3-mm2 - has the modem fix, and doesn't require manual fiddling of kernel sources.
Although you might want to backout optimize-profile-path-slightly.patch... causes oopses with gnome/mozilla/etc. |
|
Back to top |
|
|
|