need ever to do usb_set_altinterface before usb_bulk_read since kernel linux 2.6.28

View: New views
2 Messages — Rating Filter:   Alert me  

need ever to do usb_set_altinterface before usb_bulk_read since kernel linux 2.6.28

by Yves-Gaël Chény-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
i had an error into a program that use the libusb 0.1 to make bulk write
and bulk read after updating my kernel from 2.6.27 to 2.6.30.

After a lot of test, i have found that i have to make an
usb_set_altinterface before all usb bulk read (not before usb bulk
write) to not have a 110 error.

My usb device have only one interface (0).


I can't understand why ...
Can anyone give me a reason, idea, explanations ?

Thanks ;)

yves

**************************************************
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           60
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              200mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           6
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass     10
      bInterfaceProtocol     10
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0005  1x 5 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0005  1x 5 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0005  1x 5 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0005  1x 5 bytes
        bInterval               1

********************************************************


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Libusb-devel mailing list
Libusb-devel@...
https://lists.sourceforge.net/lists/listinfo/libusb-devel

Re: need ever to do usb_set_altinterface before usb_bulk_read since kernel linux 2.6.28

by Robas, Teodor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Chény Yves-Gaël wrote:
> Hi,
> i had an error into a program that use the libusb 0.1 to make bulk write
> and bulk read after updating my kernel from 2.6.27 to 2.6.30.
>
> After a lot of test, i have found that i have to make an
> usb_set_altinterface before all usb bulk read (not before usb bulk
> write) to not have a 110 error.
>

I know about a bug in 2.6.28 where usb interface is not released after
releasing the usb device. Could this be your problem (because i could
not figure out myself) ?

For the problem I described there is this patch:
http://bugzilla.kernel.org/attachment.cgi?id=19550&action=edit


BR,
Teodor

--
                        _
ASCII ribbon campaign ( )
  - against HTML email  X
              & vCards / \

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Libusb-devel mailing list
Libusb-devel@...
https://lists.sourceforge.net/lists/listinfo/libusb-devel