xref: /DragonOS/kernel/src/driver/base/device/driver.rs (revision 78bf93f02f84bf5e024ddfb559f040e68ce39ccf)
12a7d773dSTingHuang use super::IdTable;
22a7d773dSTingHuang use core::{any::Any, fmt::Debug};
32a7d773dSTingHuang 
42a7d773dSTingHuang /// @brief: Driver error
52a7d773dSTingHuang #[allow(dead_code)]
6*78bf93f0SYJwu2023 #[derive(Debug, PartialEq, Eq, Clone, Copy)]
72a7d773dSTingHuang pub enum DriverError {
82a7d773dSTingHuang     ProbeError,
92a7d773dSTingHuang }
102a7d773dSTingHuang 
112a7d773dSTingHuang /// @brief: 所有设备驱动都应该实现该trait
122a7d773dSTingHuang pub trait Driver: Any + Send + Sync + Debug {
132a7d773dSTingHuang     /// @brief: 获取设备驱动标识符
142a7d773dSTingHuang     /// @parameter: None
152a7d773dSTingHuang     /// @return: 该设备驱动唯一标识符
162a7d773dSTingHuang     fn get_id_table(&self) -> IdTable;
172a7d773dSTingHuang }
18