Documentation/driver-api/usb/usb.rst

Source file repositories/reference/linux-study-clean/Documentation/driver-api/usb/usb.rst

File Facts

System
Linux kernel
Corpus path
Documentation/driver-api/usb/usb.rst
Extension
.rst
Size
43259 bytes
Lines
1058
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

struct usbdevfs_connectinfo {
		unsigned int   devnum;
		unsigned char  slow;
	};

    File modification time is not updated by this request.

    *You can't tell whether a "not slow" device is connected at high
    speed (480 MBit/sec) or just full speed (12 MBit/sec).* You should
    know the devnum value already, it's the DDD value of the device file
    name.

USBDEVFS_GET_SPEED
    Returns the speed of the device. The speed is returned as a
    numerical value in accordance with enum usb_device_speed

    File modification time is not updated by this request.

USBDEVFS_GETDRIVER
    Returns the name of the kernel driver bound to a given interface (a
    string). Parameter is a pointer to this structure, which is
    modified::

	struct usbdevfs_getdriver {
		unsigned int  interface;
		char          driver[USBDEVFS_MAXDRIVERNAME + 1];
	};

    File modification time is not updated by this request.

USBDEVFS_IOCTL
    Passes a request from userspace through to a kernel driver that has
    an ioctl entry in the *struct usb_driver* it registered::

	struct usbdevfs_ioctl {
		int     ifno;
		int     ioctl_code;
		void    *data;
	};

	/* user mode call looks like this.
	 * 'request' becomes the driver->ioctl() 'code' parameter.
	 * the size of 'param' is encoded in 'request', and that data
	 * is copied to or from the driver->ioctl() 'buf' parameter.
	 */
	static int
	usbdev_ioctl (int fd, int ifno, unsigned request, void *param)
	{
		struct usbdevfs_ioctl   wrapper;

		wrapper.ifno = ifno;
		wrapper.ioctl_code = request;
		wrapper.data = param;

		return ioctl (fd, USBDEVFS_IOCTL, &wrapper);
	}

    File modification time is not updated by this request.

    This request lets kernel drivers talk to user mode code through
    filesystem operations even when they don't create a character or
    block special device. It's also been used to do things like ask
    devices what device special file should be used. Two pre-defined
    ioctls are used to disconnect and reconnect kernel drivers, so that
    user mode code can completely manage binding and configuration of
    devices.

USBDEVFS_RELEASEINTERFACE
    This is used to release the claim usbfs made on interface, either
    implicitly or because of a USBDEVFS_CLAIMINTERFACE call, before the

Annotation

Implementation Notes