Files
vgpu_unlock-rs/src/config.rs
Matt Bilker e8c1d1381e lib: add PCI bus info mapping to allow custom spoofing
- Including spoofing Maxwell and Pascal cards to Turing for 19.x use
2025-11-08 13:51:03 +00:00

41 lines
768 B
Rust

// SPDX-License-Identifier: MIT
use std::collections::HashMap;
use serde::Deserialize;
struct Defaults;
impl Defaults {
#[inline]
const fn unlock() -> bool {
true
}
#[inline]
const fn unlock_migration() -> bool {
false
}
}
#[derive(Deserialize)]
pub struct Config {
#[serde(default = "Defaults::unlock")]
pub unlock: bool,
#[serde(default = "Defaults::unlock_migration")]
pub unlock_migration: bool,
#[serde(default)]
pub pci_info_map: Option<HashMap<u32, u32>>,
}
impl Default for Config {
#[inline]
fn default() -> Self {
Self {
unlock: Defaults::unlock(),
unlock_migration: Defaults::unlock_migration(),
pci_info_map: None,
}
}
}