Profiles v2: chipset+variant top-level keys, minimal per-drive data

profiles.json: { "mt1959_a": [...], "mt1959_b": [...], "renesas": [] }
Each profile: identity + signature + firmware (3 fields)
Platform enum replaces Chipset — section determines variant
This commit is contained in:
MattJackson
2026-04-09 12:50:44 -07:00
parent 7c8c26af24
commit 81a88dcad0
6 changed files with 1374 additions and 1629 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ use crate::scsi::ScsiTransport;
/// init() — one-time initialization
/// set_read_speed() — per-zone speed during reads
/// is_ready() — state check
pub(crate) trait Platform {
pub(crate) trait PlatformDriver {
fn init(&mut self, scsi: &mut dyn ScsiTransport) -> Result<()>;
fn set_read_speed(&mut self, scsi: &mut dyn ScsiTransport, lba: u32) -> Result<()>;
fn is_ready(&self) -> bool;
+7 -6
View File
@@ -3,7 +3,7 @@
use crate::error::{Error, Result};
use crate::profile::DriveProfile;
use crate::scsi::{self, DataDirection, ScsiTransport};
use super::Platform;
use super::PlatformDriver;
const UNLOCK_RESPONSE_SIZE: u8 = 64;
@@ -29,10 +29,11 @@ pub struct Mt1959 {
}
impl Mt1959 {
pub fn new(profile: DriveProfile) -> Self {
let (mode, buffer_id) = match profile.variant.as_str() {
"b" => (MODE_B, BUFFER_ID_B),
_ => (MODE_A, BUFFER_ID_A),
pub fn new(profile: DriveProfile, is_variant_b: bool) -> Self {
let (mode, buffer_id) = if is_variant_b {
(MODE_B, BUFFER_ID_B)
} else {
(MODE_A, BUFFER_ID_A)
};
Mt1959 {
profile,
@@ -125,7 +126,7 @@ impl Mt1959 {
}
}
impl Platform for Mt1959 {
impl PlatformDriver for Mt1959 {
fn init(&mut self, scsi: &mut dyn ScsiTransport) -> Result<()> {
if self.unlocked && self.calibrated {
return Ok(());