Re: [PATCH, RFC] usbmon: correct computing of the ISO packets withmmap

From: Alan Stern
Date: Mon Nov 15 2010 - 10:06:56 EST


On Sun, 14 Nov 2010, Pete Zaitcev wrote:

> On Mon, 15 Nov 2010 06:48:40 +0100
> Németh Márton <nm127@xxxxxxxxxxx> wrote:
>
> > ev_type == 'S' && usb_urb_dir_out(urb) ---> data is available, we'll need it
>
> The write submission case should be covered by the transfer_buffer_length,
> I think. Is there a driver that only sets the ISO descriptors but not
> the overall length?

If there is, it's a bug. usb_submit_urb() could check for that sort of
thing -- although so far nobody has complained of problems, so checking
doesn't seem necessary.

Other things usb_submit_urb() could check for, but currently doesn't,
include:

Make sure the packet offsets are non-decreasing;

Make sure the packet don't overlap in the buffer;

Make sure the spacing between two consecutive packets
in the buffer doesn't exceed some upper limit (needed
by ehci-hcd).

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/