Home
last modified time | relevance | path

Searched refs:Device (Results 1 – 25 of 54) sorted by relevance

123

/DragonOS/kernel/src/driver/acpi/
H A Dbus.rs5 Device,
24 _device: &Arc<dyn Device>, in driver_match_device() argument
72 fn remove(&self, _device: &Arc<dyn Device>) -> Result<(), SystemError> { in remove()
76 fn shutdown(&self, _device: &Arc<dyn Device>) { in shutdown() argument
80 fn resume(&self, _device: &Arc<dyn Device>) -> Result<(), SystemError> { in resume()
89 _device: &Arc<dyn Device>, in match_device() argument
97 fn probe(&self, _device: &Arc<dyn Device>) -> Result<(), SystemError> { in probe()
115 pub trait AcpiDevice: Device {}
H A Dglue.rs3 use crate::driver::base::device::Device;
6 pub fn acpi_device_notify(_dev: &Arc<dyn Device>) { in acpi_device_notify() argument
/DragonOS/kernel/src/driver/base/platform/
H A Dsubsys.rs15 device::{bus::Bus, driver::Driver, Device},
61 fn probe(&self, device: &Arc<dyn Device>) -> Result<(), SystemError> { in probe()
79 fn remove(&self, _device: &Arc<dyn Device>) -> Result<(), SystemError> { in remove()
83 fn sync_state(&self, _device: &Arc<dyn Device>) { in sync_state() argument
87 fn shutdown(&self, _device: &Arc<dyn Device>) { in shutdown() argument
91 fn resume(&self, _device: &Arc<dyn Device>) -> Result<(), SystemError> { in resume()
122 device: &Arc<dyn Device>, in match_device() argument
147 fn root_device(&self) -> Option<Weak<dyn Device>> { in root_device() argument
148 let root_device = platform_bus_device() as Arc<dyn Device>; in root_device()
H A Dplatform_device.rs14 Device, DeviceCommonData, DevicePrivateData, DeviceType, IdTable,
50 pub trait PlatformDevice: Device {
85 &(platform_bus_device() as Arc<dyn Device>), in device_add()
111 let r = device_manager().add_device(pdev.clone() as Arc<dyn Device>); in device_add()
129 #[cast_to([sync] Device)]
276 impl Device for PlatformBusDevice {
325 fn dev_parent(&self) -> Option<Weak<dyn Device>> { in dev_parent() argument
329 fn set_dev_parent(&self, dev_parent: Option<Weak<dyn Device>>) { in set_dev_parent() argument
/DragonOS/kernel/src/driver/base/device/
H A Ddd.rs23 Device, DeviceManager,
47 pub fn device_attach(&self, dev: &Arc<dyn Device>) -> Result<bool, SystemError> { in device_attach()
51 pub fn device_initial_probe(&self, dev: &Arc<dyn Device>) -> Result<bool, SystemError> { in device_initial_probe()
58 dev: &Arc<dyn Device>, in do_device_attach() argument
189 pub fn device_is_bound(&self, dev: &Arc<dyn Device>) -> bool { in device_is_bound()
206 pub fn device_bind_driver(&self, dev: &Arc<dyn Device>) -> Result<(), SystemError> { in device_bind_driver()
230 fn unbind_cleanup(&self, dev: &Arc<dyn Device>) { in unbind_cleanup() argument
240 dev: Arc<dyn Device>,
267 pub fn new(dev: Arc<dyn Device>, check_async: bool, want_async: bool) -> Self { in new() argument
302 fn do_driver_attach(&self, device: &Arc<dyn Device>, driver: &Arc<dyn Driver>) -> bool { in do_driver_attach() argument
[all …]
H A Ddriver.rs3 Device, DeviceMatchName, DeviceMatcher, IdTable,
57 fn coredump(&self, _device: &Arc<dyn Device>) -> Result<(), SystemError> { in coredump()
66 fn devices(&self) -> Vec<Arc<dyn Device>>; in devices() argument
69 fn add_device(&self, device: Arc<dyn Device>); in add_device() argument
72 fn delete_device(&self, device: &Arc<dyn Device>); in delete_device() argument
83 fn __find_device_by_name_fast(&self, _name: &str) -> Option<Arc<dyn Device>> { in __find_device_by_name_fast() argument
119 pub devices: Vec<Arc<dyn Device>>,
124 pub fn push_device(&mut self, device: Arc<dyn Device>) { in push_device() argument
130 pub fn delete_device(&mut self, device: &Arc<dyn Device>) { in delete_device() argument
163 ) -> Option<Arc<dyn Device>> { in find_device_slow() argument
[all …]
H A Dmod.rs135 pub trait Device: KObject { interface
205 fn dev_parent(&self) -> Option<Weak<dyn Device>>; in dev_parent() argument
207 fn set_dev_parent(&self, parent: Option<Weak<dyn Device>>); in set_dev_parent() argument
210 impl dyn Device { implementation
225 pub parent: Option<Weak<dyn Device>>,
266 pub fn get_parent_weak_or_clear(&mut self) -> Option<Weak<dyn Device>> { in get_parent_weak_or_clear() argument
421 let dev = kobj.cast::<dyn Device>().unwrap(); in release()
482 pub fn register(&self, device: Arc<dyn Device>) -> Result<(), SystemError> { in register()
497 pub fn add_device(&self, device: Arc<dyn Device>) -> Result<(), SystemError> { in add_device()
610 device: &Arc<dyn Device>, in get_device_parent() argument
[all …]
H A Dbus.rs3 sys_devices_kset, Device, DeviceMatchName, DeviceMatcher, DeviceState,
108 fn root_device(&self) -> Option<Weak<dyn Device>> { in root_device() argument
112 fn set_root_device(&self, _dev: Option<Weak<dyn Device>>) {} in set_root_device() argument
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() argument
144 fn shutdown(&self, _device: &Arc<dyn Device>); in shutdown() argument
145 fn suspend(&self, _device: &Arc<dyn Device>) { in suspend() argument
149 fn resume(&self, device: &Arc<dyn Device>) -> Result<(), SystemError>; in resume()
166 _device: &Arc<dyn Device>, in match_device() argument
[all …]
/DragonOS/kernel/src/driver/input/serio/
H A Dsubsys.rs13 device::{bus::Bus, driver::Driver, Device},
60 fn probe(&self, device: &Arc<dyn Device>) -> Result<(), SystemError> { in probe()
81 fn remove(&self, _device: &Arc<dyn Device>) -> Result<(), SystemError> { in remove()
85 fn sync_state(&self, _device: &Arc<dyn Device>) { in sync_state() argument
89 fn shutdown(&self, _device: &Arc<dyn Device>) { in shutdown() argument
93 fn resume(&self, _device: &Arc<dyn Device>) -> Result<(), SystemError> { in resume()
99 device: &Arc<dyn Device>, in match_device() argument
H A Dserio_device.rs4 use crate::driver::base::device::{bus::Bus, device_manager, Device};
12 pub trait SerioDevice: Device {
67 device_manager().add_device(device.clone() as Arc<dyn Device>)?; in init_port()
/DragonOS/kernel/src/driver/pci/
H A Dsubsys.rs15 sys_devices_kset, Device,
90 fn probe(&self, device: &Arc<dyn Device>) -> Result<(), SystemError> { in probe()
111 fn remove(&self, _device: &Arc<dyn Device>) -> Result<(), SystemError> { in remove()
115 fn sync_state(&self, _device: &Arc<dyn Device>) { in sync_state() argument
119 fn shutdown(&self, _device: &Arc<dyn Device>) { in shutdown() argument
123 fn resume(&self, _device: &Arc<dyn Device>) -> Result<(), SystemError> { in resume()
129 device: &Arc<dyn Device>, in match_device() argument
155 fn root_device(&self) -> Option<Weak<dyn Device>> { in root_device() argument
156 let root_device = pci_bus_device() as Arc<dyn Device>; in root_device()
H A Ddevice.rs10 bus::Bus, device_manager, driver::Driver, Device, DeviceCommonData, DeviceType, IdTable,
49 pci_dev.set_dev_parent(Some(Arc::downgrade(&(pci_bus_device() as Arc<dyn Device>)))); in device_add()
54 device_manager().device_default_initialize(&(pci_dev.clone() as Arc<dyn Device>)); in device_add()
56 let r = device_manager().add_device(pci_dev.clone() as Arc<dyn Device>); in device_add()
70 pub trait PciDevice: Device {
99 #[cast_to([sync] Device)]
191 impl Device for PciBusDevice {
236 fn dev_parent(&self) -> Option<alloc::sync::Weak<dyn Device>> { in dev_parent() argument
240 fn set_dev_parent(&self, dev_parent: Option<alloc::sync::Weak<dyn Device>>) { in set_dev_parent() argument
/DragonOS/kernel/src/driver/base/
H A Dsubsys.rs23 Device,
41 devices: RwLock<Vec<Arc<dyn Device>>>,
45 bus_notifier: AtomicNotifierChain<BusNotifyEvent, Arc<dyn Device>>,
120 pub fn devices(&self) -> RwLockReadGuard<Vec<Arc<dyn Device>>> { in devices() argument
159 pub fn bus_notifier(&self) -> &AtomicNotifierChain<BusNotifyEvent, Arc<dyn Device>> { in bus_notifier() argument
184 pub fn add_device_to_vec(&self, device: &Arc<dyn Device>) -> Result<(), SystemError> { in add_device_to_vec()
194 pub fn remove_device_from_vec(&self, device: &Arc<dyn Device>) { in remove_device_from_vec() argument
208 fn add_device(&self, _device: &Arc<dyn Device>) -> Result<(), SystemError> { in add_device()
211 fn remove_device(&self, device: &Arc<dyn Device>); in remove_device() argument
H A Dswnode.rs3 use super::device::Device;
5 pub fn software_node_notify(_dev: &Arc<dyn Device>) { in software_node_notify() argument
H A Dcpu.rs19 Device, DeviceCommonData, DeviceType, IdTable,
48 &(root_device.clone() as Arc<dyn Device>), in init()
87 fn remove(&self, _device: &Arc<dyn Device>) -> Result<(), SystemError> { in remove()
91 fn shutdown(&self, _device: &Arc<dyn Device>) { in shutdown() argument
95 fn resume(&self, _device: &Arc<dyn Device>) -> Result<(), SystemError> { in resume()
101 device: &Arc<dyn Device>, in match_device() argument
114 #[cast_to([sync] Device)]
146 impl Device for CpuSubSystemFakeRootDevice {
191 fn dev_parent(&self) -> Option<Weak<dyn Device>> { in dev_parent() argument
195 fn set_dev_parent(&self, dev_parent: Option<Weak<dyn Device>>) { in set_dev_parent() argument
/DragonOS/kernel/src/driver/virtio/
H A Dsysfs.rs18 Device,
80 fn probe(&self, device: &Arc<dyn Device>) -> Result<(), SystemError> { in probe()
101 fn remove(&self, _device: &Arc<dyn Device>) -> Result<(), SystemError> { in remove()
105 fn sync_state(&self, _device: &Arc<dyn Device>) { in sync_state() argument
109 fn shutdown(&self, _device: &Arc<dyn Device>) { in shutdown() argument
113 fn resume(&self, _device: &Arc<dyn Device>) -> Result<(), SystemError> { in resume()
120 _device: &Arc<dyn Device>, in match_device() argument
193 device_manager().device_default_initialize(&(dev.clone() as Arc<dyn Device>)); in device_add()
199 device_manager().add_device(dev.clone() as Arc<dyn Device>)?; in device_add()
201 .add_groups(&(dev.clone() as Arc<dyn Device>), &[&VirtIODeviceAttrGroup]); in device_add()
[all …]
/DragonOS/kernel/src/driver/input/ps2_dev/
H A Dps2_device.rs1 use crate::driver::{base::device::Device, input::serio::serio_device::SerioDevice};
5 pub trait Ps2Device: Device + SerioDevice {}
/DragonOS/kernel/src/driver/input/serio/i8042/
H A Dmod.rs8 device::{device_manager, Device},
38 device_manager().device_default_initialize(&(i8042_device.clone() as Arc<dyn Device>)); in i8042_init()
68 &(i8042_platform_device() as Arc<dyn Device>), in i8042_setup_aux()
74 aux_port.clone() as Arc<dyn Device> in i8042_setup_aux()
H A Di8042_ports.rs11 device::{bus::Bus, driver::Driver, Device, DeviceCommonData, DeviceType, IdTable},
27 #[cast_to([sync] Device)]
56 impl Device for I8042AuxPort {
108 fn dev_parent(&self) -> Option<Weak<dyn Device>> { in dev_parent() argument
112 fn set_dev_parent(&self, parent: Option<Weak<dyn Device>>) { in set_dev_parent() argument
H A Di8042_device.rs10 bus::Bus, driver::Driver, Device, DeviceCommonData, DeviceState, DeviceType, IdTable,
24 #[cast_to([sync] Device)]
60 impl Device for I8042PlatformDevice {
111 fn dev_parent(&self) -> Option<Weak<dyn Device>> { in dev_parent() argument
115 fn set_dev_parent(&self, dev_parent: Option<Weak<dyn Device>>) { in set_dev_parent() argument
H A Di8042_driver.rs10 device::{bus::Bus, driver::Driver, Device, IdTable},
59 devices: Vec<Arc<dyn Device>>,
106 fn devices(&self) -> Vec<Arc<dyn Device>> { in devices() argument
110 fn add_device(&self, device: Arc<dyn Device>) { in add_device() argument
120 fn delete_device(&self, device: &Arc<dyn Device>) { in delete_device() argument
/DragonOS/docs/kernel/filesystem/
H A Dsysfs.md29 pub trait Device: Any + Send + Sync + Debug {}
35 /// @brief Device管理器
38 devices: BTreeMap<IdTable, Arc<dyn Device>>, // 所有设备
70 pub trait Bus: Device {}
85 …线是一种虚拟总线,可以对挂载在其上的设备和驱动进行匹配,并驱动设备。该总线是一类设备,同时也是一类总线,编程时需要创建该设备实例,并为设备实例实现Device trait和Bus trait,以表…
/DragonOS/kernel/src/driver/video/fbdev/base/
H A Dfbmem.rs21 sys_dev_char_kset, Device, DeviceCommonData, DeviceType, IdTable,
148 device_manager().device_default_initialize(&(fb_device.clone() as Arc<dyn Device>)); in register_fb()
149 fb_device.set_dev_parent(Some(Arc::downgrade(&(fb.clone() as Arc<dyn Device>)))); in register_fb()
153 device_manager().add_device(fb_device.clone() as Arc<dyn Device>)?; in register_fb()
161 device_manager().remove(&(fb_device.clone() as Arc<dyn Device>)); in register_fb()
210 #[cast_to([sync] Device)]
332 impl Device for FbDevice {
380 fn dev_parent(&self) -> Option<Weak<dyn Device>> { in dev_parent() argument
384 fn set_dev_parent(&self, dev_parent: Option<Weak<dyn Device>>) { in set_dev_parent() argument
/DragonOS/kernel/src/exception/
H A Dmsi.rs6 driver::{base::device::Device, pci::pci_irq::PciIrqMsg},
78 dev: Option<Arc<dyn Device>>,
96 dev: Option<Arc<dyn Device>>, in new() argument
/DragonOS/kernel/src/driver/pci/test/
H A Dpt_device.rs13 device::{bus::Bus, driver::Driver, Device, DeviceCommonData, DeviceType, IdTable},
29 #[cast_to([sync] Device)]
101 impl Device for TestDevice {
160 fn dev_parent(&self) -> Option<Weak<dyn Device>> { in dev_parent() argument
164 fn set_dev_parent(&self, dev_parent: Option<Weak<dyn Device>>) { in set_dev_parent() argument

123