dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
Loading...
Searching...
No Matches
dxd::device Class Referenceabstract

the device the OS publishes and user mode finds and opens More...

#include <dxd_device.h>

Inheritance diagram for dxd::device:
Collaboration diagram for dxd::device:

Classes

class  client
 an open of a device, created by device::client_create(): what it does not answer itself goes to its device More...

Public Member Functions

 device(class driver& driver)
void identify(uint64_t id)
 the OS's identity of the hardware as the puid, until launch() states a persistent one
virtual os_result ioctl(unsigned int ioctl, const void* in, size_t size_in, void* out, size_t size_out, size_t& size)
 control I/O, reached through client::ioctl(): the driver answers what the device does not
template<typename transition_t>
os_result powered(bool on, transition_t&& transition)
 a power transition, as dxd::power binds the OS's: sleep() ahead of leaving the working state, the transition, wake() once in it - a change of a launched device alone
void try_conclude()
 conclude()s if launched
os_result try_launch()
 launch()es unless launched, a failure concluded
virtual ~device()= default

Public Attributes

bool launched{}
const char* model{}
 the model's name alike
bool on{true}
char puid [0x80] {}
 persistent UID, system unique: the platform takes it from the OS's identity of the device
os_result status{not_initialized}
const char* vendor{}
 the vendor's name the desc states, published with the puid for user mode to match by

Protected Member Functions

virtual client* client_create()= 0
 a client for an open: the platform's device makes the platform's client
virtual void conclude()
 remove hook, the last word to the hardware
virtual os_result launch()
 start hook, called before any client can reach the device
virtual os_result sleep()
virtual void unplugged()
 surprise removal hook: the hardware side goes at once, what open clients hold waits for conclude()
virtual os_result wake()
 power hooks: a launched device comes back to the working state, and leaves it - its start and its removal are launch() and conclude()

Protected Attributes

class driver& driver

Detailed Description

the device the OS publishes and user mode finds and opens

Its life is create, launch(), [unplugged()], conclude(), delete, each hook reached once through try_launch()/try_conclude() as dx::object has it in user mode - the platform's device runs them on the OS's calls and creates its client for every open. A rebalance retires the device as its clients see a removal and launches a successor on the new resources (plain WDM, KMDF); a form that cannot refuses it. A failed launch() is concluded, so conclude() takes whatever launch() reached. What a device does not answer is driver-wide.

Constructor & Destructor Documentation

◆ device()

dxd::device::device(class driver& driver)
inline

◆ ~device()

virtual dxd::device::~device()
virtualdefault

Member Function Documentation

◆ client_create()

virtual client* dxd::device::client_create()
protectedpure virtual

a client for an open: the platform's device makes the platform's client

Implemented in dxd::platform::device, and dxd::platform::device.

◆ conclude()

virtual void dxd::device::conclude()
inlineprotectedvirtual

remove hook, the last word to the hardware

Reimplemented in dxd::firewire::controller< super_device_t >, dxd::firewire::platform::device< super_device_t >, dxd::kmdf::pci::device, dxd::pci::device, dxd::pci::device, dxd::platform::device, and dxd::usb::device< super_device_t >.

Here is the caller graph for this function:

◆ identify()

void dxd::device::identify(uint64_t id)
inline

the OS's identity of the hardware as the puid, until launch() states a persistent one

Here is the caller graph for this function:

◆ ioctl()

virtual os_result dxd::device::ioctl(unsigned int ioctl, const void* in, size_t size_in, void* out, size_t size_out, size_t& size)
inlinevirtual

control I/O, reached through client::ioctl(): the driver answers what the device does not

Reimplemented in dxd::kmdf::device, dxd::platform::device, and dxd::usb::device< super_device_t >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ launch()

virtual os_result dxd::device::launch()
inlineprotectedvirtual

start hook, called before any client can reach the device

Reimplemented in dxd::firewire::controller< super_device_t >, dxd::firewire::platform::device< super_device_t >, dxd::kmdf::pci::device, dxd::pci::device, dxd::pci::device, and dxd::usb::device< super_device_t >.

Here is the caller graph for this function:

◆ powered()

template<typename transition_t>
os_result dxd::device::powered(bool on, transition_t&& transition)
inline

a power transition, as dxd::power binds the OS's: sleep() ahead of leaving the working state, the transition, wake() once in it - a change of a launched device alone

Here is the call graph for this function:

◆ sleep()

virtual os_result dxd::device::sleep()
inlineprotectedvirtual

Reimplemented in dxd::firewire::controller< super_device_t >, dxd::pci::device, and dxd::pci::device.

Here is the caller graph for this function:

◆ try_conclude()

void dxd::device::try_conclude()
inline

conclude()s if launched

Here is the call graph for this function:
Here is the caller graph for this function:

◆ try_launch()

os_result dxd::device::try_launch()
inline

launch()es unless launched, a failure concluded

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unplugged()

virtual void dxd::device::unplugged()
inlineprotectedvirtual

surprise removal hook: the hardware side goes at once, what open clients hold waits for conclude()

Reimplemented in dxd::pci::device, and dxd::platform::device.

Here is the caller graph for this function:

◆ wake()

virtual os_result dxd::device::wake()
inlineprotectedvirtual

power hooks: a launched device comes back to the working state, and leaves it - its start and its removal are launch() and conclude()

Reimplemented in dxd::firewire::controller< super_device_t >, dxd::firewire::platform::device< super_device_t >, dxd::pci::device, and dxd::pci::device.

Here is the caller graph for this function:

Member Data Documentation

◆ driver

class driver& dxd::device::driver
protected

◆ launched

bool dxd::device::launched{}

◆ model

const char* dxd::device::model{}

the model's name alike

◆ on

bool dxd::device::on{true}

in the working state

◆ puid

char dxd::device::puid[0x80]{}

persistent UID, system unique: the platform takes it from the OS's identity of the device

◆ status

os_result dxd::device::status{not_initialized}

◆ vendor

const char* dxd::device::vendor{}

the vendor's name the desc states, published with the puid for user mode to match by


The documentation for this class was generated from the following file: