/DragonOS/kernel/src/driver/base/device/ |
H A D | dd.rs | 8 driver::base::kobject::KObject, 22 driver::{driver_manager, Driver, DriverManager}, 74 if dev.driver().is_some() { in do_device_attach() 97 for driver in bus.subsystem().drivers().iter() { in do_device_attach() 98 let r = self.do_device_attach_driver(driver, &mut data); in do_device_attach() 149 driver: &Arc<dyn Driver>, in do_device_attach_driver() 152 if let Some(bus) = driver.bus().and_then(|bus| bus.upgrade()) { in do_device_attach_driver() 153 let r = bus.match_device(&data.dev, driver); in do_device_attach_driver() 170 let async_allowed = driver.allows_async_probing(); in do_device_attach_driver() 176 .probe_device(driver, &data.dev) in do_device_attach_driver() [all …]
|
H A D | driver.rs | 6 driver::base::{ 195 pub fn register(&self, driver: Arc<dyn Driver>) -> Result<(), SystemError> { in register() 196 let bus = driver.bus().and_then(|bus| bus.upgrade()).ok_or_else(|| { in register() 199 driver.name() in register() 204 let drv_name = driver.name(); in register() 214 bus_manager().add_driver(&driver)?; in register() 216 self.add_groups(&driver, driver.groups()) in register() 218 bus_manager().remove_driver(&driver); in register() 228 pub fn unregister(&self, driver: &Arc<dyn Driver>) { in unregister() 229 self.remove_groups(driver, driver.groups()); in unregister() [all …]
|
H A D | bus.rs | 2 driver::{Driver, DriverMatchName, DriverMatcher}, 6 driver::base::{ 7 device::{device_manager, driver::driver_manager}, 295 pub fn add_driver(&self, driver: &Arc<dyn Driver>) -> Result<(), SystemError> { in add_driver() 296 let bus = driver in add_driver() 300 debug!("bus '{}' add driver '{}'", bus.name(), driver.name()); in add_driver() 303 let kobj = driver.clone() as Arc<dyn KObject>; in add_driver() 311 bus.subsystem().add_driver_to_vec(driver)?; in add_driver() 313 let r = driver_manager().driver_attach(driver); in add_driver() 315 bus.subsystem().remove_driver_from_vec(driver); in add_driver() [all …]
|
/DragonOS/kernel/src/driver/base/platform/ |
H A D | platform_driver.rs | 3 use crate::driver::base::device::{ 5 driver::{driver_manager, Driver}, 44 pub fn register(&self, driver: Arc<dyn PlatformDriver>) -> Result<(), SystemError> { in register() 45 driver.set_bus(Some(Arc::downgrade(&(platform_bus() as Arc<dyn Bus>)))); in register() 46 return driver_manager().register(driver as Arc<dyn Driver>); in register() 51 pub fn unregister(&self, driver: &Arc<dyn PlatformDriver>) { in unregister() 52 driver_manager().unregister(&(driver.clone() as Arc<dyn Driver>)); in unregister()
|
H A D | subsys.rs | 12 driver::{ 15 device::{bus::Bus, driver::Driver, Device}, 62 let drv = device.driver().ok_or(SystemError::EINVAL)?; in probe() 123 driver: &Arc<dyn Driver>, in match_device() 126 if let Ok(x) = acpi_manager().driver_match_device(driver, device) { in match_device() 133 if let Some(drv_id_table) = driver.id_table() { in match_device() 144 return Ok(device.name().eq(&driver.name())); in match_device()
|
/DragonOS/kernel/src/driver/tty/ |
H A D | tty_driver.rs | 14 driver::{ 20 driver::Driver, 57 for driver in drivers_guard.iter() { in lookup_tty_driver() 58 let base = DeviceNumber::new(driver.major, driver.minor_start); in lookup_tty_driver() 59 if dev_num < base || dev_num.data() > base.data() + driver.device_count { in lookup_tty_driver() 62 return Some(((dev_num.data() - base.data()) as usize, driver.clone())); in lookup_tty_driver() 69 pub fn tty_register_driver(mut driver: TtyDriver) -> Result<Arc<TtyDriver>, SystemError> { in tty_register_driver() 71 if driver.major == Major::UNNAMED_MAJOR { in tty_register_driver() 73 driver.minor_start, in tty_register_driver() 74 driver.device_count, in tty_register_driver() [all …]
|
H A D | tty_device.rs | 10 driver::{ 18 driver::Driver, 61 driver: Option<Weak<dyn Driver>>, field 74 driver: None, in new() 149 let (index, driver) = in open() 152 let tty = driver.open_tty(Some(index))?; in open() 168 let driver = tty.core().driver(); in open() localVariable 172 || (driver.tty_driver_type() == TtyDriverType::Pty in open() 173 && driver.tty_driver_sub_type() == TtyDriverSubType::PtyMaster)) in open() 464 fn kset(&self) -> Option<Arc<crate::driver::base::kset::KSet>> { in kset() [all …]
|
H A D | tty_core.rs | 14 driver::{base::device::device_number::DeviceNumber, tty::pty::ptm_driver}, 46 if self.core.driver().tty_driver_sub_type() == TtyDriverSubType::PtySlave { in drop() 53 pub fn new(driver: Arc<TtyDriver>, index: usize) -> Arc<Self> { in new() 54 let name = driver.tty_line_name(index); in new() 55 let device_number = driver in new() 58 let termios = driver.init_termios(); in new() 60 tty_driver: driver, in new() 108 .driver() in write_to_core() 115 let driver = tty_core.driver(); in reopen() localVariable 117 if driver.tty_driver_type() == TtyDriverType::Pty in reopen() [all …]
|
/DragonOS/kernel/src/driver/input/serio/ |
H A D | serio_driver.rs | 4 use crate::driver::base::device::{ 6 driver::{driver_manager, Driver}, 68 pub fn register(&self, driver: Arc<dyn SerioDriver>) -> Result<(), SystemError> { in register() 69 driver.set_bus(Some(Arc::downgrade(&(serio_bus() as Arc<dyn Bus>)))); in register() 70 return driver_manager().register(driver as Arc<dyn Driver>); in register() 82 pub fn unregister(&self, driver: &Arc<dyn SerioDriver>) { in unregister() 83 driver_manager().unregister(&(driver.clone() as Arc<dyn Driver>)); in unregister()
|
H A D | subsys.rs | 10 driver::{ 13 device::{bus::Bus, driver::Driver, Device}, 61 let drv = device.driver().ok_or(SystemError::EINVAL)?; in probe() 100 driver: &Arc<dyn Driver>, in match_device() 103 if let Ok(x) = acpi_manager().driver_match_device(driver, device) { in match_device() 110 if let Some(drv_id_table) = driver.id_table() { in match_device() 121 return Ok(device.name().eq(&driver.name())); in match_device()
|
/DragonOS/kernel/src/driver/pci/ |
H A D | driver.rs | 4 use crate::driver::base::device::{ 6 driver::{driver_manager, Driver}, 75 pub fn register(&self, driver: Arc<dyn PciDriver>) -> Result<(), SystemError> { in register() 76 driver.set_bus(Some(Arc::downgrade(&(pci_bus() as Arc<dyn Bus>)))); in register() 77 return driver_manager().register(driver as Arc<dyn Driver>); in register() 81 pub fn unregister(&self, driver: &Arc<dyn PciDriver>) { in unregister() 82 driver_manager().unregister(&(driver.clone() as Arc<dyn Driver>)); in unregister()
|
H A D | device.rs | 8 driver::base::{ 10 bus::Bus, device_manager, driver::Driver, Device, DeviceCommonData, DeviceType, IdTable, 155 ) -> crate::libs::rwlock::RwLockReadGuard<crate::driver::base::kobject::KObjectState> { in kobj_state() 201 fn driver(&self) -> Option<Arc<dyn Driver>> { in driver() method 202 self.inner().device_common.driver.clone()?.upgrade() in driver() 209 fn set_driver(&self, driver: Option<alloc::sync::Weak<dyn Driver>>) { in set_driver() 210 self.inner().device_common.driver = driver; in set_driver() 221 fn set_class(&self, _class: Option<alloc::sync::Weak<dyn crate::driver::base::class::Class>>) { in set_class()
|
H A D | subsys.rs | 10 driver::base::{ 14 driver::Driver, 25 driver::PciDriver, 91 let drv = device.driver().ok_or(SystemError::EINVAL)?; in probe() 130 driver: &Arc<dyn Driver>, in match_device() 133 let pci_driver = driver.clone().cast::<dyn PciDriver>().map_err(|_| { in match_device() 147 if let Some(driver_id_table) = driver.id_table() { in match_device() 175 _kobj: Arc<dyn crate::driver::base::kobject::KObject>, in is_visible()
|
H A D | raw_device.rs | 9 driver::base::{ 11 device::{bus::Bus, driver::Driver, Device, DeviceCommonData, DeviceType, IdTable}, 104 fn driver(&self) -> Option<Arc<dyn Driver>> { in driver() method 105 self.inner.read().device_common.driver.clone()?.upgrade() in driver() 134 fn set_driver(&self, driver: Option<Weak<dyn Driver>>) { in set_driver() 135 self.inner.write().device_common.driver = driver in set_driver()
|
/DragonOS/kernel/src/driver/net/ |
H A D | loopback.rs | 2 use crate::driver::base::class::Class; 3 use crate::driver::base::device::bus::Bus; 4 use crate::driver::base::device::driver::Driver; 5 use crate::driver::base::device::{Device, DeviceCommonData, DeviceType, IdTable}; 6 use crate::driver::base::kobject::{ 9 use crate::driver::base::kset::KSet; 62 driver: LoopbackDriver, field 82 let mut device = self.driver.inner.lock(); in consume() 221 driver: self.clone(), in receive() 236 driver: self.clone(), in transmit() [all …]
|
H A D | virtio_net.rs | 22 driver::{ 27 driver::{Driver, DriverCommonData}, 223 fn driver(&self) -> Option<Arc<dyn Driver>> { in driver() method 224 let r = self.inner().device_common.driver.clone()?.upgrade(); in driver() 226 self.inner().device_common.driver = None; in driver() 232 fn set_driver(&self, driver: Option<Weak<dyn Driver>>) { in set_driver() 233 self.inner().device_common.driver = driver; in set_driver() 475 fn driver(&self) -> Option<Arc<dyn Driver>> { in driver() method 476 let r = self.inner().device_common.driver.clone()?.upgrade(); in driver() 478 self.inner().device_common.driver = None; in driver() [all …]
|
/DragonOS/kernel/src/driver/net/e1000e/ |
H A D | e1000e_driver.rs | 5 driver::{ 8 device::{bus::Bus, driver::Driver, Device, DeviceCommonData, DeviceType, IdTable}, 42 driver: E1000EDriver, field 84 driver: E1000EDriverWrapper, field 117 let mut device = self.driver.inner.lock(); in consume() 159 driver: self.clone(), in receive() 171 driver: self.clone(), in transmit() 194 pub fn new(mut driver: E1000EDriver) -> Arc<Self> { in new() 197 smoltcp::wire::EthernetAddress(driver.inner.lock().mac_address()), in new() 202 smoltcp::iface::Interface::new(iface_config, &mut driver, Instant::now().into()); in new() [all …]
|
/DragonOS/kernel/src/driver/virtio/ |
H A D | virtio.rs | 4 use crate::driver::base::device::bus::Bus; 5 use crate::driver::base::device::{Device, DeviceId}; 6 use crate::driver::block::virtio_blk::virtio_blk; 7 use crate::driver::net::virtio_net::virtio_net; 8 use crate::driver::pci::pci::{ 12 use crate::driver::pci::subsys::pci_bus; 13 use crate::driver::virtio::transport::VirtIOTransport;
|
/DragonOS/kernel/src/driver/tty/pty/ |
H A D | unix98pty.rs | 5 driver::tty::{ 38 fn install(&self, driver: Arc<TtyDriver>, tty: Arc<TtyCore>) -> Result<(), SystemError> { in install() 39 PtyCommon::pty_common_install(driver, tty, false) in install() 78 if core.driver().tty_driver_sub_type() != TtyDriverSubType::PtyMaster { in ioctl() 109 if core.driver().tty_driver_sub_type() != TtyDriverSubType::PtySlave { in set_termios() 162 if core.driver().tty_driver_sub_type() != TtyDriverSubType::PtySlave { in start() 180 if core.driver().tty_driver_sub_type() != TtyDriverSubType::PtySlave { in stop() 218 let driver = tty.core().driver(); in close() localVariable 220 if tty.core().driver().tty_driver_sub_type() == TtyDriverSubType::PtySlave { in close() 221 driver.ttys().remove(&tty.core().index()); in close() [all …]
|
/DragonOS/kernel/src/driver/input/serio/i8042/ |
H A D | i8042_ports.rs | 8 driver::{ 11 device::{bus::Bus, driver::Driver, Device, DeviceCommonData, DeviceType, IdTable}, 86 fn driver(&self) -> Option<Arc<dyn Driver>> { in driver() method 87 self.inner().device_common.driver.clone()?.upgrade() in driver() 90 fn set_driver(&self, driver: Option<Weak<dyn Driver>>) { in set_driver() 91 self.inner().device_common.driver = driver; in set_driver()
|
H A D | i8042_device.rs | 7 driver::base::{ 10 bus::Bus, driver::Driver, Device, DeviceCommonData, DeviceState, DeviceType, IdTable, 89 fn driver(&self) -> Option<Arc<dyn Driver>> { in driver() method 90 self.inner().device_common.driver.clone()?.upgrade() in driver() 93 fn set_driver(&self, driver: Option<Weak<dyn Driver>>) { in set_driver() 94 self.inner().device_common.driver = driver; in set_driver()
|
/DragonOS/ |
H A D | triagebot.toml | 75 [autolabel."A-driver"] 77 "kernel/src/driver", 78 "kernel/src/arch/x86_64/driver", 79 "kernel/src/arch/riscv64/driver", 110 [mentions."kernel/src/driver/base"] 114 [mentions."kernel/src/driver/tty"] 131 driver = ["@dragonos/main"] 161 "/kernel/src/driver" = ["main"]
|
/DragonOS/kernel/src/driver/pci/test/ |
H A D | pt_device.rs | 10 driver::{ 13 device::{bus::Bus, driver::Driver, Device, DeviceCommonData, DeviceType, IdTable}, 94 fn driver(&self) -> Option<Arc<dyn Driver>> { in driver() method 95 self.device_data.read().driver.clone()?.upgrade() in driver() 126 fn set_driver(&self, driver: Option<Weak<dyn Driver>>) { in set_driver() 127 self.device_data.write().driver = driver in set_driver()
|
/DragonOS/kernel/src/arch/x86_64/pci/ |
H A D | pci.rs | 3 use crate::driver::acpi::acpi_manager; 4 use crate::driver::pci::ecam::{pci_ecam_root_info_manager, EcamRootInfo}; 5 use crate::driver::pci::pci::{ 9 use crate::driver::pci::root::{pci_root_manager, PciRoot};
|
/DragonOS/kernel/src/driver/disk/ahci/ |
H A D | mod.rs | 7 use crate::driver::base::block::manager::block_dev_manager; 8 use crate::driver::block::cache::cached_block_device::BlockCache; 9 use crate::driver::disk::ahci::ahcidisk::LockedAhciDisk; 10 use crate::driver::pci::pci::{ 14 use crate::driver::disk::ahci::{
|