ld: public profile catalog API + emulation feature; clippy-clean

Expose the LibreDrive profile catalog as a curated public API on `ld`:
`ld::profiles()` returns the `Profiles` object (with `.get(drive_id)`) and
`ld::profile(filter)` finds one — the catalog of supported drives, queried
without unlocking. The unlock mechanism (firmware blobs, upload sequence, CDB
wire format) stays private; `LibreDrive` is pub(crate), reached only via
`all_unlockers()`.

The unlock-handshake wire format the bdemu test-emulator needs to impersonate a
drive (`UNLOCK_MARKER`, `is_unlock_read_buffer`) is behind a non-default
`emulation` feature; the `cdb` module compiles only under it. Rename the
`ScsiError` error variant to `Scsi` (matches css), gate the test-only
`load_bundled` and `SCSI_STATUS_CHECK_CONDITION`. Clippy-clean in both feature
configs; 86/89 tests pass.
This commit is contained in:
Matthew Jackson
2026-06-29 20:44:52 -07:00
parent 5ea0e2cc5a
commit 30f653f7f4
9 changed files with 109 additions and 51 deletions
+2 -2
View File
@@ -1350,7 +1350,7 @@ mod tests {
// A transport wedge mid-handshake must NOT be reported as a cert/key
// rejection — the operator needs to see the real (replug) cause, not
// be sent down a keydb/host-cert rabbit hole.
let transport = Error::ScsiError {
let transport = Error::Scsi {
opcode: 0xA3, // SEND KEY
status: SCSI_STATUS_TRANSPORT_FAILURE,
sense: None,
@@ -1363,7 +1363,7 @@ mod tests {
// A genuine SCSI rejection (CHECK CONDITION) IS the drive saying no, so
// it maps to the handshake-specific code as before.
let rejected = Error::ScsiError {
let rejected = Error::Scsi {
opcode: 0xA3,
status: SCSI_STATUS_CHECK_CONDITION,
sense: Some(crate::scsi::ScsiSense {