[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <71130307-1c5c-468b-b876-799c434002cc@rowland.harvard.edu>
Date: Fri, 21 Jul 2023 13:26:22 -0400
From: Alan Stern <stern@...land.harvard.edu>
To: Dingyan Li <18500469033@....com>
Cc: Greg KH <gregkh@...uxfoundation.org>,
sebastian.reichel@...labora.com, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: Re: Re: [PATCH] USB: add usbfs ioctl to get specific
superspeedplus rates
On Fri, Jul 21, 2023 at 11:43:29PM +0800, Dingyan Li wrote:
> Okay, got it. The motivation should come from real-world needs.
>
> Just like I mentioned above, currently in libusb ioctl USBDEVFS_GET_SPEED
> is still used, especially where sysfs is not supported. My original idea
> was exactly trying to add this new ioctl into libusb. So in order to get 20Gbps
> speed, we need extra information. The basic workflow is like below:
>
> // This is pretty much how libusb does it, get 10Gbps at most
> ret = ioctl(USBDEVFS_GET_SPEED)
> if (ret == USB_SPEED_SUPER_PLUS) then
> speed = 10Gbps
> // With this new ioctl, we can get 20Gbps now
> ret = ioctl(USBDEVFS_GET_SSP_RATE)
> if (ret == USB_SSP_GEN_2x2)
> speed = 20Gbps
>
> libusb can be a good place to document the usage of this new ioctl if similar patch
> can be accepted into it. And I can't think of other real-world users now. Of course,
> like you've explained, it seems quite unnecessary when sysfs is supported.
For what it's worth, many of the other ioctls in usbfs are documented
(very incompletely) in Documentation/driver-api/usb/usb.rst. That's
probably the best place to add any documentation for new APIs.
Alan Stern
Powered by blists - more mailing lists