Re: New USB core API to change interval and max packet size

Alan Stern
2013-10-02T16:38:15Z

On Wed, 2 Oct 2013, Mauro Carvalho Chehab wrote:

> > > So, there's no need to call usb_change_ep_bandwidth().
> >
> > That's right.
> >
> > > If so, then usb_change_ep_bandwidth() as a quirk, if bInterval
> > > or wMaxPacketSize were improperly filled.
> > >
> > > Right?
> >
> > Or if the values are correct, but the driver wants to use something
> > different for its own reasons (for example, to get lower latency or
> > because it knows that it will never use packets as large as the
> > descriptor allows). Right.
>
> Ok, so, in this case, usb_change_ep_bandwidth() could be called
> just before usb_alloc_urb(), in order to make it to use the packet
> size that would be expected for that kind of ISOC traffic that
> userspace indirectly selected, by adjusting the streaming
> video resolution selected, right?

We haven't decided on the final API yet. However, note that
usb_alloc_urb() doesn't depend on the packet size. It requires you to
specify only the number of packets, not their sizes. Therefore it
doesn't matter whether you call usb_change_ep_bandwidth() before or
after usb_alloc_urb().

Alan Stern