Re: [PATCH 1/1] usb: misc: usbtest: add super-speed isoc support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <pawell@xxxxxxxxxxx>
> Signed-off-by: Peter Chen <peter.chen@xxxxxxx>
> ---
>  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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux