BusType
Defined in: src/drivers/base/bus.ts:13
Unlike Linux, we don’t use ksets, ktypes, or attribute groups.
Extends
Section titled “Extends”Type Parameters
Section titled “Type Parameters”TDevice
Section titled “TDevice”TDevice extends Device = Device
TDriver
Section titled “TDriver”TDriver extends DeviceDriver<TDevice> = DeviceDriver<TDevice>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BusType<
TDevice,TDriver>(name):BusType<TDevice,TDriver>
Defined in: src/drivers/base/bus.ts:46
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”BusType<TDevice, TDriver>
Overrides
Section titled “Overrides”Properties
Section titled “Properties”attributes
Section titled “attributes”attributes:
Map<string,Attribute>
Defined in: src/kobject.ts:21
These attributes use the kobject’s show and store.
Inherited from
Section titled “Inherited from”bus_attrs
Section titled “bus_attrs”
readonlybus_attrs:Record<string,BusAttribute> ={}
Defined in: src/drivers/base/bus.ts:42
children
Section titled “children”children:
Map<string,KEntry>
Defined in: src/kobject.ts:16
Inherited from
Section titled “Inherited from”dev_attrs
Section titled “dev_attrs”
readonlydev_attrs:Record<string,DeviceAttribute> ={}
Defined in: src/drivers/base/bus.ts:43
dev_name?
Section titled “dev_name?”
optionaldev_name?:string
Defined in: src/drivers/base/bus.ts:14
dev_root?
Section titled “dev_root?”
optionaldev_root?:Device<unknown>
Defined in: src/drivers/base/bus.ts:31
The device this bus’ devices go under when they have no parent,
for example /sys/devices/system/cpu.
subsys_system_register
devices
Section titled “devices”
readonlydevices:Set<Device<unknown>>
Defined in: src/drivers/base/bus.ts:22
devices_kobj
Section titled “devices_kobj”
readonlydevices_kobj:KObject
Defined in: src/drivers/base/bus.ts:17
/sys/bus/<name>/devices, which has a link for every device on the bus
drivers
Section titled “drivers”
readonlydrivers:Set<DeviceDriver<Device<unknown>>>
Defined in: src/drivers/base/bus.ts:24
drivers_kobj
Section titled “drivers_kobj”
readonlydrivers_kobj:KObject
Defined in: src/drivers/base/bus.ts:20
/sys/bus/<name>/drivers
drv_attrs
Section titled “drv_attrs”
readonlydrv_attrs:Record<string,DriverAttribute> ={}
Defined in: src/drivers/base/bus.ts:44
name:
string
Defined in: src/kobject.ts:24
Inherited from
Section titled “Inherited from”parent?
Section titled “parent?”
optionalparent?:KObject|null
Defined in: src/kobject.ts:25
Inherited from
Section titled “Inherited from”Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get path():
string
Defined in: src/kobject.ts:34
The path of this kobject, relative to the root of sysfs.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”[dispose]()
Section titled “[dispose]()”[dispose]():
void
Defined in: src/kobject.ts:72
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”add_uevent_attr()
Section titled “add_uevent_attr()”add_uevent_attr():
void
Defined in: src/kobject.ts:115
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”create_attribute()
Section titled “create_attribute()”create_attribute(
name,show?,store?,mode?):Attribute
Defined in: src/kobject.ts:132
Parameters
Section titled “Parameters”string
((kobj) => string) | null
store?
Section titled “store?”((kobj, value) => void) | null
number = ...
Defaults based on which of show and store were passed.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”dispose()
Section titled “dispose()”dispose():
void
Defined in: src/kobject.ts:64
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”find_device()
Section titled “find_device()”find_device(
name):Device<unknown> |null
Defined in: src/drivers/base/bus.ts:52
Find a device on this bus by name
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Device<unknown> | null
find_driver()
Section titled “find_driver()”find_driver(
name):DeviceDriver<Device<unknown>> |null
Defined in: src/drivers/base/bus.ts:58
Find a driver registered on this bus by name
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”DeviceDriver<Device<unknown>> | null
keys()
Section titled “keys()”keys():
Iterable<string>
Defined in: src/kobject.ts:60
The names of everything in this kobject.
Returns
Section titled “Returns”Iterable<string>
Inherited from
Section titled “Inherited from”lookup()
Section titled “lookup()”lookup(
name):KEntry|undefined
Defined in: src/kobject.ts:44
Resolve a single entry by name.
Attributes that use this kobject’s show and store are bound before being returned.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”KEntry | undefined
Inherited from
Section titled “Inherited from”match()?
Section titled “match()?”
optionalmatch(device,driver):boolean
Defined in: src/drivers/base/bus.ts:67
Parameters
Section titled “Parameters”device
Section titled “device”TDevice
driver
Section titled “driver”Readonly<TDriver>
Returns
Section titled “Returns”boolean
whether a device or driver can be handled by this bus.
Throws
Section titled “Throws”When it can’t be determined that the driver supports the device.
notify_uevent()
Section titled “notify_uevent()”notify_uevent(
action,env?):void
Defined in: src/kobject.ts:82
Notify listeners that something happened to kobj.
Parameters
Section titled “Parameters”action
Section titled “action”"add" | "remove" | "change" | "move" | "online" | "offline" | "bind" | "unbind"
UEventEnv = {}
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”offline()?
Section titled “offline()?”
optionaloffline(device):void
Defined in: src/drivers/base/bus.ts:77
Called to put a device offline
Parameters
Section titled “Parameters”device
Section titled “device”TDevice
Returns
Section titled “Returns”void
online()?
Section titled “online()?”
optionalonline(device):void
Defined in: src/drivers/base/bus.ts:74
Called to put a device back online
Parameters
Section titled “Parameters”device
Section titled “device”TDevice
Returns
Section titled “Returns”void
remove()?
Section titled “remove()?”
optionalremove(device):void
Defined in: src/drivers/base/bus.ts:69
Parameters
Section titled “Parameters”device
Section titled “device”TDevice
Returns
Section titled “Returns”void
resume()?
Section titled “resume()?”
optionalresume(device):void
Defined in: src/drivers/base/bus.ts:83
Called when a device wants to resume from sleep
Parameters
Section titled “Parameters”device
Section titled “device”TDevice
Returns
Section titled “Returns”void
send_uevent()
Section titled “send_uevent()”send_uevent(
text):void
Defined in: src/kobject.ts:100
Send a uevent described by text, an action optionally followed by KEY=VALUE pairs.
This is what writing to a uevent attribute does.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”show()?
Section titled “show()?”
optionalshow(attr):string
Defined in: src/kobject.ts:76
Parameters
Section titled “Parameters”Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”shutdown()?
Section titled “shutdown()?”
optionalshutdown(device):void
Defined in: src/drivers/base/bus.ts:71
Parameters
Section titled “Parameters”device
Section titled “device”TDevice
Returns
Section titled “Returns”void
store()?
Section titled “store()?”
optionalstore(attr,value):void
Defined in: src/kobject.ts:77
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”subsys_system_register()
Section titled “subsys_system_register()”subsys_system_register():
Device
Defined in: src/drivers/base/bus.ts:36
Register a bus as a system subsystem, which gives it a root device at /sys/devices/system/<name> that its devices go under.
Returns
Section titled “Returns”suspend()?
Section titled “suspend()?”
optionalsuspend(device):void
Defined in: src/drivers/base/bus.ts:80
Called when a device wants to go to sleep
Parameters
Section titled “Parameters”device
Section titled “device”TDevice
Returns
Section titled “Returns”void
uevent()?
Section titled “uevent()?”
optionaluevent(env):void
Defined in: src/kobject.ts:127
Add variables to the environment of uevents sent for this kobject and its descendants.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
notify_uevent