Lenovo USB Modem in Linux (Ubuntu 10.04)

I recently bought a Lenovo USB modem for some experiments in telephony that I am working on. I want it to work on Linux. It is based on the Conexant RD02-D400 device. When plugging it in I get the following in dmesg:

cdc_acm 2-2:1.0: Zero length descriptor references
cdc_acm: probe of 2-2:1.0 failed with error -22

This seems to be a common problem – it looks like the cdc_acm driver is not correctly recognising and processing the descriptors.

The fix is pretty easy –

  1. Get root, install kernel source
  2. $ sudo -i
    # apt-get install linux-headers-`uname -r` linux-source-2.6.32
    # cd /usr/src
    # tar xjf linux-source-2.6.32.tar.bz2
    # ln -s linux-source-2.6.32 linux
    # cd /usr/src/linux

  3. Now edit the cdc_acm.c file
  4. # nano /usr/src/linux/drivers/usb/class/cdc-acm.c

  5. Add the following lines in the long list of entries that are similar to it:
  6. { USB_DEVICE(0x17ef, 0x7000), /* Lenovo USB modem */
    .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
    },

  7. Prepare configuration (will pull config file from /boot) and build the entire kernel
  8. # make oldconfig
    # make

  9. To re-build the driver (can now use this to rebuild if you get the VID/PID etc wrong)
  10. # make M=drivers/usb/class

  11. Remove current driver
  12. # rmmod cdc-acm

  13. Test the driver
  14. # insmod drivers/usb/class/cdc-acm.ko

  15. You should get something like
  16. cdc_acm 2-2:1.0: ttyACM0: USB ACM device

  17. Install the driver permanently
  18. # cd /lib/modules/`uname -r`
    # mv kernel/drivers/usb/class/cdc-acm.ko ~/cdc-acm.ko.bak
    # cp /usr/src/linux/drivers/usb/class/cdc-acm.ko kernel/drivers/usb/class/cdc-acm.ko
    # depmod -a

Note: I ended up using Ubuntu 10.04 because I was having a bit of a battle with 12.04. I suspect it was just some mistakes I made… the principles of the above should carry. Will update if I try it again on anything newer.

This entry was posted in Howto, Projects, Telephony and tagged , , , , , , , , , . Bookmark the permalink.

7 Responses to Lenovo USB Modem in Linux (Ubuntu 10.04)

  1. Pingback: The Lenovo Usb Modem

  2. sky says:

    The fix is pretty easy huh?

    Rebuilding the kernel, that is not ‘easy’ and not a fix, especially when it only works on an ancient os from way back when.

    Downgrade the kernel? thats not a fix, thats a farce.

    You could do better and explain this device is only worthy of the trash can.

    • The Silly Scientist says:

      Thanks for your feedback – maybe you could proffer a better solution and I’ll update the post accordingly? I haven’t used this particular bit of hardware in a while as the project I was using it for has taken to the sidelines for a bit.

      I mention that this fix should work with 12.04 (current LTS), but for the avoidance of doubt I explain what I used (10.04).

      For all I know it may well be fixed in the mainline kernel by now, but I haven’t had the need/chance to try it out.

  3. anon says:

    Hi, would you be able to post the altered cdc-acm.ko file to download. I am trying to set up the same modem on a cut down version of linux and rebuilding the kernel is proving to be a big hassle. I’m assuming as the standard cdc-acm.ko doesn’t seem to be distro specific the rebuilt version shouldn’t be either.

    Thanks in advance.

  4. Dayat says:

    nice tips i love it….

  5. rport says:

    Many thanks to sillyscientist ! These instructions have been extremely helpful to me in getting the modem working under SuSE 13.1. Here is the complete procedure once more as it worked for me
    (package kernel-sources had been installed before):

    Original messages from dmesg when plugging-in the Lenovo USB modem:

    usb 2-1.3: new full-speed USB device number 5 using ehci-pci
    usb 2-1.3: New USB device found, idVendor=17ef, idProduct=7000
    usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    usb 2-1.3: Product: USB Modem
    usb 2-1.3: Manufacturer: Conexant
    usb 2-1.3: SerialNumber: 24680246
    cdc_acm 2-1.3:1.0: Zero length descriptor references
    cdc_acm: probe of 2-1.3:1.0 failed with error -22

    Start rebuilding driver by editing /usr/src/linux/drivers/usb/class/cdc-acm.c : In the list of devices under:

    /* quirky and broken devices */

    insert:

    {USB_DEVICE(0x17ef, 0x7000), /* Lenovo USB modem */
    .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
    },

    Change directory to:

    /lib/modules/`uname -r`/build

    Build driver:

    # make M=drivers/usb/class

    (This rebuilds all files in

    ./drivers/usb/class

    which is the same as

    /usr/src/linux-3.11.10-29-obj/x86_64/desktop/drivers/usb/class

    . The old driver still resides in:

    /lib/modules/3.11.10-29-desktop/kernel/drivers/usb/class

    .)

    Remove old driver:

    # rmmod cdc-acm

    Test new driver:

    # insmod drivers/usb/class/cdc-acm.ko

    dmesg now shows:

    usbcore: deregistering interface driver cdc_acm
    cdc_acm 2-1.3:1.0: ttyACM0: USB ACM device
    usbcore: registered new interface driver cdc_acm

    Install new driver:

    cd /lib/modules/`uname -r`
    mv kernel/drivers/usb/class/cdc-acm.ko ~/cdc-acm.ko.bak
    cp build/drivers/usb/class/cdc-acm.ko kernel/drivers/usb/class/cdc-acm.ko
    depmod -a

    Configure in yast:

    yast2 modem &

    Install smpppd , qinternet . Connect through qinternet .

    Good luck to everybody!

Leave a Reply

Your email address will not be published. Required fields are marked *