4300c + 2.6.0 kernel

Help!
2003-12-20
2013-04-09
  • Nobody/Anonymous

    After compiling a new 2.6.0 kernel I found my 4300c was no longer detected and on the console I saw, usb_control/bulk_msg: timeout

    I found the following:

    In 2.4.21 drivers/usb/usb.c line 2157 was:
            err = usb_get_string(dev, dev->string_langid, index, tbuf, 255);

    Now in 2.6.0 drivers/usb/core/message.c line 1208:
            err = usb_get_string(dev, dev->string_langid, index, tbuf, len);

    I think the 4300c is returning the wrong length for the string descriptors. I changed the line to be the same as it was in 2.4.21, which simply requests the maximum length, and now my 4300c is happy.

     
    • Bertrik Sikken

      Bertrik Sikken - 2003-12-21

      Hmm, I've been running 2.5/2.6 kernels for some time now, but I haven't seen this problem. Then again, I have a HP3300c, not a HP4300c.
      Was the scanner accessed using the scanner kernel module or through libusb?
      I think this looks like a kernel problem, perhaps we should report this to the linux-usb mailing list.
      Can you somehow find out what value 'len' has?

       
    • Nobody/Anonymous

      It is being accessed via the kernel module.

      2.6.0
      drivers/usb/core/message.c

          err = usb_get_string(dev, dev->string_langid, index, tbuf, 2);
          if(err<2)
              goto errout;
          len=tbuf[0];   
         
          err = usb_get_string(dev, dev->string_langid, index, tbuf, len);

      The len value returned is the length of the string descriptor.  My other USB devices return the length of the string descriptor plus the header.

      Regards

       
    • Bertrik Sikken

      Bertrik Sikken - 2003-12-22

      Ok, thanks. As far as I understand the USB spec, the way your scanner apparently reports the string descriptor length is incorrect. Can you report this also to the linux-usb-devel mailing list?

       
    • Nobody/Anonymous

      Will do.

       
    • Ullrich Sigwanz

      Ullrich Sigwanz - 2004-03-01

      Positive !!!

      with "len" as last parameter my 4300 does not say any thing, but "255" is fine and all works.

      This happened to me with kernel 2.6.3. The line number certainly is a different one, but  the effect is all the same.

      Seems as if the linux.-usb-devel guys are quite immune to some posts.

      So probably , when nothing changes, the 3400 and 4300 scanners will not work with stock kernels ;-(

      I will also post on occasion

      Regards

      Ullrich

       
    • Nobody/Anonymous

      I just installed kernel 2.6.8 and this problem looks like it has been resolved. Thanks for your help.

      Regards,
      Ray

       
    • Ullrich Sigwanz

      Ullrich Sigwanz - 2004-08-16

      Hello Ray,

      Positive.

      It is resolved.

      There was a lot of email traffic the last couple months, but eventually the linux-usb-crew could be convinced to include the change ;-) (They weren't as resistant as it seems, the kernel-release-frequency gets a bit lower now - that's it).

      Have fun

      Ullrich

       
    • Joop Verdoorn

      Joop Verdoorn - 2004-10-06

      Ullrich,
      I've changed the "len" part two times in message.c but I still get errors like described in the Help-forum before:

      Oct  6 21:50:23 linux kernel: usb 2-2: new full speed USB device using address 2
      Oct  6 21:50:28 linux kernel: usb 2-2: control timeout on ep0in
      Oct  6 21:50:33 linux kernel: usb 2-2: control timeout on ep0in
      Oct  6 21:50:33 linux kernel: usb 2-2: can't set config #1, error -71
      Oct  6 21:50:33 linux kernel: usb 2-2: new full speed USB device using address 3
      Oct  6 21:50:38 linux /etc/hotplug/usb.agent[5099]: cat: /sys//devices/pci0000:00/0000:00:10.1/usb2/2-2/bNumConfigurations: No such file or directory
      Oct  6 21:50:38 linux /etc/hotplug/usb.agent[5099]: /etc/hotplug/usb.agent: line 100: [: too many arguments

      Testtool says:
      No LibUSB niash-scanner devices found
      NiashXferOpen failed for ''
      NiashOpen failed

      I am using Suse 9.1 with kernel 2.6.5-7.104-default.
      Is it inevitable to upgrade to 2.6.8 or higher, or could something else be wrong?

      Joop

       
    • Ullrich Sigwanz

      Ullrich Sigwanz - 2004-10-07

      Hi Joop,

      I have had exactly this kernel at home.

      I installed the kernel+source (as I assume you did), but I only changed one statement.
      The description above is a bit rough so look for the line

      len=tbuf[0];

      and change it to

      len=tbuf[0]=255;

      maybe the 2nd change, which you did, spoiled your system.

      just as a reminder:
      after a

      > make cloneconfig
      > make
      > make modules_install

      you must copy the files
      "bzImage"
      and
      "SystemMap"
      with the according renaming to the
      "/boot"
      directory ?

      call
      > mkinitrd
      and change "/boot/grub/menu.lst" or "/etc/lilo.conf "accordingly

      Perhaps these are silly annotations for you, but I just want to make sure.

      So please reinstall the sources or undo your first changes and make the change as I described it in this post here.

      I hope that helps

      Ullrich

       
      • Joop Verdoorn

        Joop Verdoorn - 2004-10-11

        Ullrich,
        Thanks for helping me on this! Compiling with your suggested change did help, as I can see my scanner now in the Yast2 Hardware info. Testtool now also indicates that the scanner is there:

        ERROR: usb_claim_interface failed
        NiashXferOpen failed for 'libusb(002,003)'
        NiashOpen failed

        The error is because of a rights-problem; I can use xsane  as root now (looks easier to tackle than the first problem).

        Thanks again!
        Joop

         
    • Joop Verdoorn

      Joop Verdoorn - 2004-10-11

      PS:
      chmod 666 /proc/bus/usb/001/00*
      did the thing; I can use my scanner now as a normal user

       
      • Bertrik Sikken

        Bertrik Sikken - 2004-10-11

        AFAIK, sane-backends has a hotplug script (and related files) in tools/hotplug that you can use to automatically adjust the permission for the scanner when you plug it in. This is ultimately simpler, since you don't need to specify exact path to the /proc/bus/usb files.

         
        • Nobody/Anonymous

          Yes, I've tried the hotplug-way, visited the appropriate website, but found it to difficult. I 'll just use the work-around and wait when the whole niash-backend is included in a Suse-distribution.
          Joop

           

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks