On Tue, 12 Feb 2019, Peter Chen wrote:

> The calculation of packet number within microframe is different between
> high-speed and super-speed endpoint, we add support for super-speed
> in this patch.
> 
> Cc: Pawel Laszczak <[email protected]>
> Signed-off-by: Peter Chen <[email protected]>
> ---
>  drivers/usb/misc/usbtest.c | 28 ++++++++++++++++++++++++----
>  1 file changed, 24 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
> index c7f82310e73e..98ada1a3425c 100644
> --- a/drivers/usb/misc/usbtest.c
> +++ b/drivers/usb/misc/usbtest.c
> @@ -347,6 +347,14 @@ static unsigned get_maxpacket(struct usb_device *udev, 
> int pipe)
>       return le16_to_cpup(&ep->desc.wMaxPacketSize);
>  }
>  
> +static int ss_isoc_get_packet_num(struct usb_device *udev, int pipe)
> +{
> +     struct usb_host_endpoint *ep = usb_pipe_endpoint(udev, pipe);
> +
> +     return USB_SS_MULT(ep->ss_ep_comp.bmAttributes)
> +             * (1 + ep->ss_ep_comp.bMaxBurst);
> +}

Could this calculation be useful for other drivers?  Should it go into 
ch9.h or some other similar place?

Alan Stern

Reply via email to