On Mon, Oct 15, 2001, Amira Solomovici <[EMAIL PROTECTED]> wrote:
> I am writing a USB driver that uses both bulk and interrupt transfers.
> Since I have no experience in writing drivers on Linux, I looked at the code
> of
> some existing driver and adjusted the code to fit my needs.
> In the probe() function I noticed that the interrupt pipe is initialized by:
> 
>       FILL_INT_URB(&data->irq_event, dev,
>                        usb_rcvintpipe(dev, 1),
>                      &data->intr_event, 8, irq_event_callback, data,
>                      endpoint[1].bInterval);
>       if (usb_submit_urb(&data->reader_irq_event)) {

I suspect you meant &data->irq_event ?

>               err("probe: Unable to allocate INT URB.");

This should really be something like:
                err("Unable to submit URB");

because you allocate the URB elsewhere with usb_alloc_urb()

>             kfree(data);
>             return NULL;
>       }
> 
> I guess this is done that way because no usb_intr_msg() function exists.

Yes, this is because we've never seen anything where synchronous
interrupt messages are useful.

Typically that's what bulk messages are used for.

> Is it a normal behavior that the callback function is called whenever some
> data is sent in the interrupt pipe?

Yes. When the transfer is completed by the HC, it'll interrupt the
kernel at the end of the frame. Then the HC driver will do some processing
and then call your callback, irq_event_callback in this case.

If the bInterval is not 0, it'll automatically resubmit the URB and
reset the internal state.

If bInterval is 0, it'll retire the URB like normal.

> Does it mean that the kernel (as a usb host) initiates an interrupt request
> every bInterval?

It'll try hard to do it every bInterval, but it may not be exactly
bInterval. It should be close enough.

Just to clarify, the HC will initiate the interrupt request, the kernel
just programs the HC.

> The problem is that I dont want to count on the kernel behavior but want to
> initiate an interrupt transfer myself (as it's done for the bulk pipe). Is
> it possible? 

It sounds like you may want to set bInterval to 0 to get what you want,
but I'm not exactly sure I understand what you want.

JE


_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to