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.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/usb.hlinux/usbdevice_fs.hasm/byteorder.h
Detected Declarations
struct usbdevfs_connectinfostruct usbdevfs_getdriverstruct usbdevfs_ioctlstruct usbdevfs_bulktransferstruct usbdevfs_ctrltransferstruct usbdevfs_setinterfacestruct usbdevfs_iso_packet_descstruct usbdevfs_urbfunction usbdev_ioctl
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
- Immediate include surface: `linux/usb.h`, `linux/usbdevice_fs.h`, `asm/byteorder.h`.
- Detected declarations: `struct usbdevfs_connectinfo`, `struct usbdevfs_getdriver`, `struct usbdevfs_ioctl`, `struct usbdevfs_bulktransfer`, `struct usbdevfs_ctrltransfer`, `struct usbdevfs_setinterface`, `struct usbdevfs_iso_packet_desc`, `struct usbdevfs_urb`, `function usbdev_ioctl`.
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.