Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Kernel > 2.6.7 USB modem fix!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
pestilence
Apprentice
Apprentice


Joined: 05 Feb 2004
Posts: 213
Location: Athens / Greece

PostPosted: Mon Oct 11, 2004 7:08 am    Post subject: Kernel > 2.6.7 USB modem fix! Reply with quote

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
View user's profile Send private message
asyr
n00b
n00b


Joined: 01 Sep 2004
Posts: 56
Location: Hellas

PostPosted: Mon Oct 11, 2004 11:20 am    Post subject: Reply with quote

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
View user's profile Send private message
pestilence
Apprentice
Apprentice


Joined: 05 Feb 2004
Posts: 213
Location: Athens / Greece

PostPosted: Mon Oct 11, 2004 11:26 am    Post subject: Reply with quote

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
View user's profile Send private message
asyr
n00b
n00b


Joined: 01 Sep 2004
Posts: 56
Location: Hellas

PostPosted: Mon Oct 11, 2004 11:33 am    Post subject: Reply with quote

Êáëü !

Cool !
Back to top
View user's profile Send private message
gentoorizer
n00b
n00b


Joined: 04 Apr 2004
Posts: 10

PostPosted: Tue Oct 12, 2004 2:27 pm    Post subject: Excellent fix! Reply with quote

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
View user's profile Send private message
theape
n00b
n00b


Joined: 11 Jul 2002
Posts: 15

PostPosted: Tue Oct 12, 2004 3:07 pm    Post subject: Use mm sources Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum