rust: usb: add basic USB abstractions

Add basic USB abstractions, consisting of usb::{Device, Interface,
Driver, Adapter, DeviceId} and the module_usb_driver macro. This is the
first step in being able to write USB device drivers, which paves the
way for USB media drivers - for example - among others.

This initial support will then be used by a subsequent sample driver,
which constitutes the only user of the USB abstractions so far.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Link: https://lore.kernel.org/r/20250825-b4-usb-v1-1-7aa024de7ae8@collabora.com
[ force USB = y for now - gregkh ]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Daniel Almeida
2025-08-25 15:18:05 -03:00
committed by Greg Kroah-Hartman
parent a446baa83e
commit e7e2296b0e
5 changed files with 469 additions and 0 deletions

View File

@@ -74,6 +74,7 @@
#include <linux/slab.h>
#include <linux/task_work.h>
#include <linux/tracepoint.h>
#include <linux/usb.h>
#include <linux/wait.h>
#include <linux/workqueue.h>
#include <linux/xarray.h>