> About control pipes. It doesn't work. This idea
> is stopped until I get more information from IBM.
I suggested using a control pipe just because they are
always I/O (either direction), but you are right,
you need more product interface info if it's available.
> I am quite new to USB programming so please be patient
> and answer some newbie questions.
>
> 1. creating pipes
>
> I have enpoint settings (usbview):
> Endpoint Address: 81
> Direction: in
> Attribute: 3
> Type: Int.
> Max Packet Size: 8
> Interval: 32ms
>
> Can I write to this endpoint or only read (Direction: in)?
Read only (IN).
> How to create pipe?
> usb_sndintpipe(dev, endpoint="Endpoint Address") - (Type: Int.)?
See linux/include/linux/usb.h for the variations of snd/rcv
and pipe types. All 8 combinations are available.
> But in [1] we can read that endpoint is between 1 and 15.
Endpoint is actually between 0 and 15 (4-bit value).
0 is the default control endpoint.
A Snd (OUT) pipe has its direction bit set to 0.
A Rcv (IN) pipe has its direction bit set to 1.
> 2. EMSGSIZE
> When I try to submit URB filled with:
>
> FILL_INT_URB(purb, data.dev, usb_sndintpipe(data.dev, data.ep_A),
> buff, 8, drawer_complete, &data, data.int_A*HZ);
>
> where data.{ep,int}_A is address and interval of the endpoint then
{ep,int}_A is a memory address or a device address or what?
See where usbview says that the Interval value for endpoint
81 (actually endpoint 01 + IN=0x80) is 32 ms?
That's the value that you should be passing as the last
parameter to FILL_INT_URB(). You don't need to "*HZ"
unless you don't like the 32 ms interval that the device
wants you to use, but still, the max interval value that
you can use [in usb-uhci at least] is 256 (ms).
> I am getting -EMSGSIZE. In [1] we can read that we get it when
> "Endpoint message size is zero" and "do interface/alternate setting".
> Should I use usb_set_interface? But I have only one alternate setting
> which is current alternate setting so it is set, right?
-EMSGSIZE is only returned by the usb-uhci driver and only
for bulk transfer requests for which the endpoint max packet
size is 0 [or if there's a bug in usb-uhci on this test, like
maybe the usb_set_configuration() didn't update the max packet
sizes for the endpoints correctly].
But you aren't requesting a bulk transfer...
Do you use usb_set_interface() or usb_set_configuratin() at all,
even for the only (default) ones on the device?
> Please help!
>
> wrobell <[EMAIL PROTECTED]>
>
> [1] "Programming Guide for Linux USB Device Drivers"
~Randy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]