linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Extending USB_CONNECTINFO ioctl
@ 2019-06-04  0:24 Dmitry Torokhov
  2019-06-04  5:38 ` Greg Kroah-Hartman
  2019-06-04 14:17 ` Alan Stern
  0 siblings, 2 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2019-06-04  0:24 UTC (permalink / raw)
  To: Alan Stern, Greg Kroah-Hartman; +Cc: linux-usb

Hi Alan, Greg,

When running software in a jailed environment where sysfs or udev is not
readily available and one can only have an FD to usbdevfs device passed
into the jail, there is a desire to allow libusb working. Alan recently
added USBDEVFS_GET_SPEED, but we are still missing bus number and list
of port numbers on the way to the root to be able to better identify the
device in question.

What do you think about adding a new ioctl:

struct usbdevfs_connectinfo_ex {
	__u32 size;		/* size of the structure from the kernel POV */
	__u32 busnum;
	__u32 devnum;
	__u32 speed;		/* USB_SPEED_* form ch9.h */
	u8 num_ports;		/* Number of entries in port_numbers array */
	u8 port_numbers[31];	/* Current limit in USB3.0 spec is 7 */
};

/*
 * Returns struct usbdevfs_connectinfo_ex; length is variable to allow
 * extending size of the data returned.
 */
#define USBDEVFS_CONNINFO_EX(len)  _IOC(_IOC_READ, 'U', 32, len)

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-10 22:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-04  0:24 Extending USB_CONNECTINFO ioctl Dmitry Torokhov
2019-06-04  5:38 ` Greg Kroah-Hartman
2019-06-04 14:17 ` Alan Stern
2019-06-04 16:14   ` Dmitry Torokhov
2019-06-04 16:48     ` Greg Kroah-Hartman
2019-06-10 22:31       ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).