Files
RedBear-OS/drivers/storage
Red Bear OS ea2219148e USB: P4-B multi-LUN support — Protocol trait + BOT/UAS LUN propagation + REPORT_LUNS
Cross-referenced with Linux 7.1 drivers/usb/storage/usb.c and SPC-3 §6.27.

Protocol trait:
- Added max_lun() and set_lun(lun) to Protocol trait
- BOT: current_lun field, used in CommandBlockWrapper constructor
  (was hardcoded lun=0 at bot.rs:212)
- UAS: current_lun field, used in CommandIU.lun field
  (was hardcoded lun=0 with TODO comment)
- get_max_lun() already existed (BOT class-specific request 0xFE)

SCSI:
- Added report_luns() method — SCSI REPORT_LUNS command (opcode 0xA0).
  Returns Vec<u64> of 8-byte LUN addresses per SPC-3 format.
  Handles big-endian LUN list length and per-entry parsing.
- Import opcodes::Opcode

main.rs:
- Prints max_lun detection (GET_MAX_LUN result)
- Multi-LUN device detection with per-LUN init TODO marker
- Per-LUN inquiry/capacity init deferred to next round (P4-B slice 2)

Per-LUN SCSI init and separate scheme registration per LUN deferred
to P4-B slice 3 — this round provides the protocol infrastructure
and LUN propagation through the full stack.
2026-07-07 15:17:38 +03:00
..