Skip to content

DeviceDriver

Defined in: src/drivers/base/driver.ts:43

TDevice extends Device = Device

new DeviceDriver<TDevice>(init): DeviceDriver<TDevice>

Defined in: src/drivers/base/driver.ts:67

DeviceDriverInit<TDevice>

DeviceDriver<TDevice>

readonly attrs: Record<string, DriverAttribute>

Defined in: src/drivers/base/driver.ts:64


readonly bus: BusType

Defined in: src/drivers/base/driver.ts:45


readonly dev_attrs: Record<string, DeviceAttribute>

Defined in: src/drivers/base/driver.ts:65


optional disableSysfsBind?: boolean

Defined in: src/drivers/base/driver.ts:59

Don’t add the bind and unbind attributes


optional kobject?: KObject

Defined in: src/drivers/base/driver.ts:56

Internal

/sys/bus/<bus>/drivers/<name>, set by register.


readonly optional mod_name?: string

Defined in: src/drivers/base/driver.ts:50

Used for built-in modules


readonly name: string

Defined in: src/drivers/base/driver.ts:44


readonly optional of_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


optional owner?: Module

Defined in: src/drivers/base/driver.ts:48

The module this driver is part of. Built-in drivers don’t have one.

get protected link_name(): string

Defined in: src/drivers/base/driver.ts:104

The name this driver is linked as in /sys/module/<module>/drivers.

string


get protected module(): 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.

Module | null

attach(): void

Defined in: src/drivers/base/driver.ts:167

Offer every unbound device on the bus to this driver.

void


bind(name): void

Defined in: src/drivers/base/driver.ts:179

Bind the device named name to this driver. Backs the bind attribute.

string

void

ENODEV if there is no such device on the bus, or the bus doesn’t match it

EBUSY if the device already has a driver


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.

Device

boolean


optional probe(device): boolean

Defined in: src/drivers/base/driver.ts:82

TDevice

boolean


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.

void

EEXIST if the driver is already registered, or the bus already has one by that name


optional remove(device): void

Defined in: src/drivers/base/driver.ts:84

TDevice

void


optional resume(device): void

Defined in: src/drivers/base/driver.ts:88

TDevice

void


optional shutdown(device): void

Defined in: src/drivers/base/driver.ts:85

TDevice

void


optional suspend(device): void

Defined in: src/drivers/base/driver.ts:87

TDevice

void


unbind(name): void

Defined in: src/drivers/base/driver.ts:191

Unbind the device named name from this driver. Backs the unbind attribute.

string

void

ENODEV if there is no such device on the bus, or it isn’t bound to this driver


unregister(): void

Defined in: src/drivers/base/driver.ts:147

Undo register, unbinding every device the driver is bound to

void