Files
RedBear-OS/drivers/storage
Red Bear OS df509fe737 usbscsid: P4 slice 1 — UAS transport with 4-pipe model
First UAS (USB Attached SCSI) implementation slice, cross-referenced
with Linux 7.1 drivers/usb/storage/uas.c and uas-detect.h.

  protocol/uas.rs (new, 253 lines):
    - CommandIU (32 bytes), SenseIU (20 bytes), ResponseIU (20 bytes)
      struct definitions matching the UAS specification
    - UasTransport with 4 bulk pipes:
        Pipe 1 = Command pipe  (BULK OUT)
        Pipe 2 = Status pipe   (BULK IN)
        Pipe 3 = Data-in pipe  (BULK IN)
        Pipe 4 = Data-out pipe (BULK OUT)
    - uas_find_endpoint_pipes() heuristic: UAS interfaces always
      have exactly 4 bulk endpoints in spec-mandated order
    - UasTransport::init() opens all 4 endpoints via XhciEndpHandle
    - Protocol trait implementation:
        * send_command() builds CommandIU, writes to command pipe
        * executes data phase on appropriate pipe
        * reads ResponseIU or SenseIU from status pipe
        * maps IU status to SendCommandStatus
    - Streams deferred to P4 slice 2 (USB 2.0 sequential, no
      CBW/CSW overhead)

  protocol/mod.rs:
    - mod uas promoted from //TODO stub to full module
    - setup() now dispatches protocol 0x62 (USB_PR_UAS) to
      UasTransport alongside 0x50 (BOT) to BulkOnlyTransport

Cross-reference: Linux 7.1
  - drivers/usb/storage/uas.c: uas_configure_endpoints()
  - drivers/usb/storage/uas-detect.h: uas_find_endpoints()
  - drivers/usb/storage/uas.c: struct uas_dev_info pipe model
  - include/uapi/linux/usb/ch11.h: USB_PR_UAS = 0x62

This means USB 3.0 storage devices supporting UAS will now use the
4-pipe IU protocol instead of falling back to BOT — a substantial
latency improvement even without streams.
2026-07-07 12:05:38 +03:00
..