Lines Matching refs:driver
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()
75 driver.name, in tty_register_driver()
77 driver.major = dev_num.major(); in tty_register_driver()
78 driver.minor_start = dev_num.minor(); in tty_register_driver()
80 let dev_num = DeviceNumber::new(driver.major, driver.minor_start); in tty_register_driver()
81 CharDevOps::register_chardev_region(dev_num, driver.device_count, driver.name)?; in tty_register_driver()
84 driver.flags |= TtyDriverFlag::TTY_DRIVER_INSTALLED; in tty_register_driver()
87 let driver = Arc::new(driver); in tty_register_driver() localVariable
88 driver.self_ref.init(Arc::downgrade(&driver)); in tty_register_driver()
89 TTY_DRIVERS.lock().push(driver.clone()); in tty_register_driver()
93 Ok(driver) in tty_register_driver()
232 pub fn set_other_pty_driver(&self, driver: Weak<TtyDriver>) { in set_other_pty_driver()
233 *self.other_pty_driver.write() = driver in set_other_pty_driver()
394 fn kset(&self) -> Option<alloc::sync::Arc<crate::driver::base::kset::KSet>> { in kset()
398 fn set_kset(&self, _kset: Option<alloc::sync::Arc<crate::driver::base::kset::KSet>>) { in set_kset()
402 fn kobj_type(&self) -> Option<&'static dyn crate::driver::base::kobject::KObjType> { in kobj_type()
406 fn set_kobj_type(&self, _ktype: Option<&'static dyn crate::driver::base::kobject::KObjType>) { in set_kobj_type()
420 ) -> crate::libs::rwlock::RwLockReadGuard<crate::driver::base::kobject::KObjectState> { in kobj_state()
426 ) -> crate::libs::rwlock::RwLockWriteGuard<crate::driver::base::kobject::KObjectState> { in kobj_state_mut()
430 fn set_kobj_state(&self, _state: crate::driver::base::kobject::KObjectState) { in set_kobj_state()
436 fn id_table(&self) -> Option<crate::driver::base::device::IdTable> { in id_table()
442 ) -> alloc::vec::Vec<alloc::sync::Arc<dyn crate::driver::base::device::Device>> { in devices()
446 fn add_device(&self, _device: alloc::sync::Arc<dyn crate::driver::base::device::Device>) { in add_device()
450 fn delete_device(&self, _device: &alloc::sync::Arc<dyn crate::driver::base::device::Device>) { in delete_device()
454 fn set_bus(&self, _bus: Option<alloc::sync::Weak<dyn crate::driver::base::device::bus::Bus>>) { in set_bus()