Lines Matching refs:Arc

23     sync::{Arc, Weak},
32 static mut BUS_KSET_INSTANCE: Option<Arc<KSet>> = None;
34 static mut DEVICES_SYSTEM_KSET_INSTANCE: Option<Arc<KSet>> = None;
39 pub fn sys_bus_kset() -> Arc<KSet> { in sys_bus_kset()
45 pub fn sys_devices_system_kset() -> Arc<KSet> { in sys_devices_system_kset()
139 fn probe(&self, _device: &Arc<dyn Device>) -> Result<(), SystemError> { in probe()
142 fn remove(&self, _device: &Arc<dyn Device>) -> Result<(), SystemError>; in remove()
143 fn sync_state(&self, _device: &Arc<dyn Device>) {} in sync_state()
144 fn shutdown(&self, _device: &Arc<dyn Device>); in shutdown()
145 fn suspend(&self, _device: &Arc<dyn Device>) { in suspend()
149 fn resume(&self, device: &Arc<dyn Device>) -> Result<(), SystemError>; in resume()
166 _device: &Arc<dyn Device>, in match_device()
167 _driver: &Arc<dyn Driver>, in match_device()
191 ) -> Option<Arc<dyn Device>> { in find_device()
207 pub fn find_device_by_name(&self, name: &str) -> Option<Arc<dyn Device>> { in find_device_by_name()
221 ) -> Option<Arc<dyn Driver>> { in find_driver()
233 pub fn find_driver_by_name(&self, name: &str) -> Option<Arc<dyn Driver>> { in find_driver_by_name()
242 kset_bus_map: RwLock<HashMap<Arc<KSet>, Arc<dyn Bus>>>,
265 pub fn add_device(&self, dev: &Arc<dyn Device>) -> Result<(), SystemError> { in add_device()
275 let dev_kobj = dev.clone() as Arc<dyn KObject>; in add_device()
295 pub fn add_driver(&self, driver: &Arc<dyn Driver>) -> Result<(), SystemError> { in add_driver()
303 let kobj = driver.clone() as Arc<dyn KObject>; in add_driver()
361 pub fn register(&self, bus: Arc<dyn Bus>) -> Result<(), SystemError> { in register()
362 bus.subsystem().set_bus(Some(Arc::downgrade(&bus))); in register()
385 pub fn unregister(&self, _bus: Arc<dyn Bus>) -> Result<(), SystemError> { in unregister()
389 fn add_probe_files(&self, bus: &Arc<dyn Bus>) -> Result<(), SystemError> { in add_probe_files()
400 fn remove_probe_files(&self, bus: &Arc<dyn Bus>) { in remove_probe_files()
407 bus: &Arc<dyn Bus>, in create_file()
410 let bus_kobj = bus.subsystem().subsys() as Arc<dyn KObject>; in create_file()
414 fn remove_file(&self, bus: &Arc<dyn Bus>, attr: &'static dyn Attribute) { in remove_file()
415 let bus_kobj = bus.subsystem().subsys() as Arc<dyn KObject>; in remove_file()
422 bus: &Arc<dyn Bus>, in add_groups()
425 let bus_kobj = bus.subsystem().subsys() as Arc<dyn KObject>; in add_groups()
430 fn get_bus_by_kset(&self, kset: &Arc<KSet>) -> Option<Arc<dyn Bus>> { in get_bus_by_kset()
442 pub fn rescan_devices(&self, bus: &Arc<dyn Bus>) -> Result<(), SystemError> { in rescan_devices()
452 pub fn probe_device(&self, dev: &Arc<dyn Device>) { in probe_device()
478 pub fn remove_driver(&self, _driver: &Arc<dyn Driver>) { in remove_driver()
482 fn add_bind_files(&self, driver: &Arc<dyn Driver>) -> Result<(), SystemError> { in add_bind_files()
496 fn rescan_devices_helper(dev: &Arc<dyn Device>) -> Result<(), SystemError> { in rescan_devices_helper()
520 pub fn bus_register(bus: Arc<dyn Bus>) -> Result<(), SystemError> { in bus_register()
528 pub fn bus_unregister(bus: Arc<dyn Bus>) -> Result<(), SystemError> { in bus_unregister()
542 let parent = sys_devices_kset() as Arc<dyn KObject>; in buses_init()
543 devices_system_kset.set_parent(Some(Arc::downgrade(&parent))); in buses_init()
575 pub fn bus_add_device(dev: &Arc<dyn Device>) -> Result<(), SystemError> { in bus_add_device()
588 pub fn bus_probe_device(dev: &Arc<dyn Device>) { in bus_probe_device()
610 fn store(&self, kobj: Arc<dyn KObject>, buf: &[u8]) -> Result<usize, SystemError> { in store()
611 let kset: Arc<KSet> = kobj.arc_any().downcast().map_err(|_| SystemError::EINVAL)?; in store()
648 fn store(&self, kobj: Arc<dyn KObject>, buf: &[u8]) -> Result<usize, SystemError> { in store()
653 let kset: Arc<KSet> = kobj.arc_any().downcast().map_err(|_| SystemError::EINVAL)?; in store()
668 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
669 let kset: Arc<KSet> = kobj.arc_any().downcast().map_err(|_| SystemError::EINVAL)?; in show()
723 kobj: Arc<dyn KObject>, in show()
733 kobj: Arc<dyn KObject>, in store()
753 fn store(&self, kobj: Arc<dyn KObject>, buf: &[u8]) -> Result<usize, SystemError> { in store()
773 if Arc::ptr_eq(&p, &driver) { in store()
802 fn store(&self, kobj: Arc<dyn KObject>, buf: &[u8]) -> Result<usize, SystemError> { in store()
850 subsys: &Arc<dyn Bus>, in subsys_register()
851 fake_root_dev: &Arc<dyn Device>, in subsys_register()
852 parent_of_root: &Arc<dyn KObject>, in subsys_register()
856 fake_root_dev.set_parent(Some(Arc::downgrade(parent_of_root))); in subsys_register()
860 subsys.set_root_device(Some(Arc::downgrade(fake_root_dev))); in subsys_register()
875 subsys: &Arc<dyn Bus>, in subsys_system_register()
876 fake_root_dev: &Arc<dyn Device>, in subsys_system_register()
881 &(sys_devices_system_kset() as Arc<dyn KObject>), in subsys_system_register()