DeviceDriver
Defined in: src/drivers/base/driver.ts:43
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”TDevice
Section titled “TDevice”TDevice extends Device = Device
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DeviceDriver<
TDevice>(init):DeviceDriver<TDevice>
Defined in: src/drivers/base/driver.ts:67
Parameters
Section titled “Parameters”DeviceDriverInit<TDevice>
Returns
Section titled “Returns”DeviceDriver<TDevice>
Properties
Section titled “Properties”
readonlyattrs:Record<string,DriverAttribute>
Defined in: src/drivers/base/driver.ts:64
readonlybus:BusType
Defined in: src/drivers/base/driver.ts:45
dev_attrs
Section titled “dev_attrs”
readonlydev_attrs:Record<string,DeviceAttribute>
Defined in: src/drivers/base/driver.ts:65
disableSysfsBind?
Section titled “disableSysfsBind?”
optionaldisableSysfsBind?:boolean
Defined in: src/drivers/base/driver.ts:59
Don’t add the bind and unbind attributes
kobject?
Section titled “kobject?”
optionalkobject?:KObject
Defined in: src/drivers/base/driver.ts:56
Internal
/sys/bus/<bus>/drivers/<name>, set by register.
mod_name?
Section titled “mod_name?”
readonlyoptionalmod_name?:string
Defined in: src/drivers/base/driver.ts:50
Used for built-in modules
readonlyname:string
Defined in: src/drivers/base/driver.ts:44
of_match_table?
Section titled “of_match_table?”
readonlyoptionalof_match_table?: readonly"xterm"[]
Defined in: src/drivers/base/driver.ts:62
The device tree node kinds this driver handles, i.e. driver->of_match_table
owner?
Section titled “owner?”
optionalowner?:Module
Defined in: src/drivers/base/driver.ts:48
The module this driver is part of. Built-in drivers don’t have one.
Accessors
Section titled “Accessors”link_name
Section titled “link_name”Get Signature
Section titled “Get Signature”get
protectedlink_name():string
Defined in: src/drivers/base/driver.ts:104
The name this driver is linked as in /sys/module/<module>/drivers.
Returns
Section titled “Returns”string
module
Section titled “module”Get Signature
Section titled “Get Signature”get
protectedmodule():Module|null
Defined in: src/drivers/base/driver.ts:111
The module this driver belongs to, which is either the one it was registered with or the built-in one named by mod_name.
Returns
Section titled “Returns”Module | null
Methods
Section titled “Methods”attach()
Section titled “attach()”attach():
void
Defined in: src/drivers/base/driver.ts:167
Offer every unbound device on the bus to this driver.
Returns
Section titled “Returns”void
bind()
Section titled “bind()”bind(
name):void
Defined in: src/drivers/base/driver.ts:179
Bind the device named name to this driver. Backs the bind attribute.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Throws
Section titled “Throws”ENODEV if there is no such device on the bus, or the bus doesn’t match it
Throws
Section titled “Throws”EBUSY if the device already has a driver
matches()
Section titled “matches()”matches(
device):boolean
Defined in: src/drivers/base/driver.ts:96
Whether this driver can handle device, according to the bus they share.
A bus without a match accepts every device on it, like Linux.
Parameters
Section titled “Parameters”device
Section titled “device”Returns
Section titled “Returns”boolean
probe()?
Section titled “probe()?”
optionalprobe(device):boolean
Defined in: src/drivers/base/driver.ts:82
Parameters
Section titled “Parameters”device
Section titled “device”TDevice
Returns
Section titled “Returns”boolean
register()
Section titled “register()”register():
void
Defined in: src/drivers/base/driver.ts:120
Add the driver to its bus, creating /sys/bus/<bus>/drivers/<name>,
then offer it every unbound device on the bus.
Returns
Section titled “Returns”void
Throws
Section titled “Throws”EEXIST if the driver is already registered, or the bus already has one by that name
remove()?
Section titled “remove()?”
optionalremove(device):void
Defined in: src/drivers/base/driver.ts:84
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/driver.ts:88
Parameters
Section titled “Parameters”device
Section titled “device”TDevice
Returns
Section titled “Returns”void
shutdown()?
Section titled “shutdown()?”
optionalshutdown(device):void
Defined in: src/drivers/base/driver.ts:85
Parameters
Section titled “Parameters”device
Section titled “device”TDevice
Returns
Section titled “Returns”void
suspend()?
Section titled “suspend()?”
optionalsuspend(device):void
Defined in: src/drivers/base/driver.ts:87
Parameters
Section titled “Parameters”device
Section titled “device”TDevice
Returns
Section titled “Returns”void
unbind()
Section titled “unbind()”unbind(
name):void
Defined in: src/drivers/base/driver.ts:191
Unbind the device named name from this driver. Backs the unbind attribute.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Throws
Section titled “Throws”ENODEV if there is no such device on the bus, or it isn’t bound to this driver
unregister()
Section titled “unregister()”unregister():
void
Defined in: src/drivers/base/driver.ts:147
Undo register, unbinding every device the driver is bound to
Returns
Section titled “Returns”void