- scsi/linux.rs: full rewrite from async write/poll/read+1.5s timeout+ close-on-timeout to one synchronous ioctl(fd, SG_IO, &hdr). Kernel honors hdr.timeout and runs its own ABORT/RESET escalation. Errors check host_status and driver_status (both 0xFF-synthesised) plus status. Sense-key parser handles descriptor (0x72/0x73) + fixed (0x70/0x71) formats. Deleted fd_recovery, bg close+open thread, fd swap dance. -331/+155 lines. - scsi/macos.rs: try_recover() removed (userspace handle-recovery on task failure was the same anti-pattern stripped from Linux). bsd_name field deleted. Errors bubble up directly. - scsi/windows.rs: try_recover() removed, wide_path field deleted, INVALID_HANDLE guard removed. - scsi/mod.rs: parse_sense_key() helper extracted (used by all three platforms now — single canonical sense-key parse rather than three inlined copies). +10 unit tests covering descriptor format, fixed format, truncated buffers, unknown response codes. - drive/mod.rs: Drive::reset() deleted (escalating eject + STOP/START + reinit recovery — per audit, kernel handles its own escalation; userspace shouldn't). pub fn find_drives() -> Vec<Drive> deleted (opened N drives just to throw most away). find_drive() now uses discover_drives() directly. wait_ready() simplified — drops the reset path on sense_key=5, just keeps polling TUR for 60 iterations. - lib.rs: find_drives re-export removed. - benches/sgio_read.rs: switched to find_drive() (no longer iterates a drive list). Net: 9 files changed, 226 insertions(+), 473 deletions(-). 329 tests pass, clippy -D warnings clean. No consumer breakage (CLI, autorip, bdemu compile + test green). Architecture decision documented in (internal)/docs/audits/2026-04-26-scsi-architecture-research.md (primary-source survey of MakeMKV, sg_dd, ddrescue, and the kernel mid-layer's own scsi_eh.rst escalation ladder).
45 lines
1.1 KiB
TOML
45 lines
1.1 KiB
TOML
[package]
|
|
name = "libfreemkv"
|
|
version = "0.13.20"
|
|
edition = "2024"
|
|
rust-version = "1.86"
|
|
license = "AGPL-3.0-only"
|
|
description = "Open source raw disc access library for optical drives"
|
|
repository = "https://github.com/freemkv/libfreemkv"
|
|
keywords = ["bluray", "uhd", "optical", "scsi", "disc"]
|
|
categories = ["hardware-support", "multimedia"]
|
|
|
|
[dependencies]
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
sha1 = "0.10"
|
|
sha2 = "0.10"
|
|
aes = "0.8"
|
|
cbc = "0.1"
|
|
flate2 = "1"
|
|
num-bigint = "0.4"
|
|
num-traits = "0.2"
|
|
num-integer = "0.1"
|
|
rand = "0.8"
|
|
cmac = "0.7"
|
|
zip = { version = "2", default-features = false, features = ["deflate"] }
|
|
base64 = "0.22.1"
|
|
# Trace-level instrumentation for Disc::copy + SgIoTransport::execute. Permitted
|
|
# under project docs ("Acceptable strings: debug/trace logging"). Consumers (autorip)
|
|
# wire a tracing subscriber and pipe events into the JSONL debug log.
|
|
tracing = "0.1"
|
|
|
|
[target.'cfg(target_os = "linux")'.dependencies]
|
|
libc = "0.2"
|
|
|
|
[target.'cfg(target_os = "macos")'.dependencies]
|
|
libc = "0.2"
|
|
|
|
[dev-dependencies]
|
|
tempfile = "3"
|
|
|
|
[[bench]]
|
|
name = "sgio_read"
|
|
harness = false
|
|
|