Files
RedBear-OS/local
vasilito 0ae101fdd0 usb-core: add class_driver_for_usb_class and spawn_class_driver_for_port
P0-B1 spawn infrastructure from USB-IMPLEMENTATION-PLAN.md v2.

Add two new public functions to usb-core::spawn:

  class_driver_for_usb_class(class, subclass, protocol) -> Option<&str>
    Maps USB class codes to driver binary paths:
      0x03 -> /usr/bin/usbhidd   (HID)
      0x08 -> /usr/bin/usbscsid  (Mass Storage)
      0x09 -> /usr/bin/usbhubd   (Hub)

  spawn_class_driver_for_port(...args...)
    Spawns the correct class daemon with the right argv layout:
    - HID/Hub:   <scheme> <port> <interface_num>
    - Storage:   <scheme> <port> <protocol_byte>

The existing spawn_usb_driver is preserved for backward compatibility.
Both new functions have no_std stubs so the crate still compiles without
the std feature.

Next: wire the spawn call into ehcid after device enumeration (P0-B1
call site) + add xhcid-compatible scheme paths (descriptors/request/
endpoints/attach) to ehcid's scheme handler so the spawned daemons can
open XhciClientHandle successfully.
2026-07-07 00:51:54 +03:00
..
2026-07-05 22:29:19 +03:00