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

DriverKit device: the plain C++ object its IOService shell (dxd_device) holds. More...

#include <dxd_platform_device.h>

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

Classes

class  client
 an open of the device: one per dxd_user_client the device's shell opens More...

Public Member Functions

client* client_create() override
 a client for an open: the platform's device makes the platform's client
 device(dxd::driver& driver, ::DEVICE_OBJECT* wdm_device, ::DEVICE_OBJECT* wdm_pdo, ::DEVICE_OBJECT* wdm_bus)
 the puid is the last part of the devnode's instance id, what its enumerator named it by - a software device's id as its host spelled it
 device(dxd::driver& driver, ::IOService* service)
void identify(uint64_t id)
 the OS's identity of the hardware as the puid, until launch() states a persistent one
os_result ioctl(unsigned int ioctl, const void* in, size_t size_in, void* out, size_t size_out, size_t& size) override
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
template<typename reference_t>
int release(reference_t& reference)
template<typename desc_t>
os_result requested(desc_t& desc) const
 the desc the host created this device with
void retain()
void try_conclude()
 conclude()s if launched
os_result try_launch()
 launch()es unless launched, a failure concluded
 ~device() override

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
atomic<int> references{}
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

client* client_create() override
 a client for an open: the platform's device makes the platform's client
void conclude() override
 remove hook, the last word to the hardware
virtual void filter(::IO_RESOURCE_REQUIREMENTS_LIST &)
 the resource requirements the bus states, filtered ahead of the start
virtual os_result launch()
 start hook, called before any client can reach the device
virtual os_result sleep()
os_result start(const ::CM_RESOURCE_LIST* raw, const ::CM_RESOURCE_LIST* translated, const ::GUID& guid)
 the start: launch() with the resources at hand, then the control clients' interface
void unplugged() override
 the control interface goes while the PDO stands: at the surprise removal, else at the remove
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

::IOService* provider{}
 the driver's shell it stands on
bool removed{}
 the device vanished: the stack below no longer answers
::IOService* service
 the shell hosting this device
struct dxd::platform::device:: { ... }  wdm

Friends

class ::dxd_device
class driver
template<typename>
class dxd::power

Detailed Description

DriverKit device: the plain C++ object its IOService shell (dxd_device) holds.

plain WDM device, one per FDO

The driver makes it on the host's request: it binds the shell's provider - its own shell - and the request, and runs launch(); the OS object stays with the shell, since iig classes can neither be templates nor bases of framework code.

The KMDF bound counterpart is dxd::kmdf::device (kmdf/dxd_kmdf_device.h): both stand on the same contract, so classes built on either (dxd::streaming::device, the bus devices) name only that. Its client is the contract's: plain WDM adds nothing to an open. The form starts it with the start's resources (start()), which a device kind takes in its launch().

Constructor & Destructor Documentation

◆ device() [1/2]

dxd::platform::device::device(dxd::driver& driver, ::IOService* service)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~device()

dxd::platform::device::~device()
inlineoverridevirtual

Reimplemented from dxd::device.

Reimplemented in dxd::portcls::adapter::device.

◆ device() [2/2]

dxd::platform::device::device(dxd::driver& driver, ::DEVICE_OBJECT* wdm_device, ::DEVICE_OBJECT* wdm_pdo, ::DEVICE_OBJECT* wdm_bus)
inline

the puid is the last part of the devnode's instance id, what its enumerator named it by - a software device's id as its host spelled it

Here is the call graph for this function:

Member Function Documentation

◆ client_create() [1/2]

client* dxd::platform::device::client_create()
inlineoverridevirtual

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

Implements dxd::device.

Here is the caller graph for this function:

◆ client_create() [2/2]

client* dxd::platform::device::client_create()
inlineoverrideprotectedvirtual

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

Implements dxd::device.

◆ conclude()

void dxd::platform::device::conclude()
inlineoverrideprotectedvirtual

remove hook, the last word to the hardware

Reimplemented from dxd::device.

Reimplemented in dxd::usb::device< super_device_t >.

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

◆ filter()

virtual void dxd::platform::device::filter(::IO_RESOURCE_REQUIREMENTS_LIST&)
inlineprotectedvirtual

the resource requirements the bus states, filtered ahead of the start

Reimplemented in dxd::pci::device.

Here is the caller graph for this function:

◆ identify()

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

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()

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

dx::ioctl::device::reenumerate: the shell of a device the OS matched on its hardware terminates, the OS matches the hardware anew - a dext a replacement activated takes it, kernelmanagerd leaving the replaced one to its devices

Reimplemented from dxd::device.

Reimplemented in 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()
inlineprotectedvirtualinherited

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)
inlineinherited

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:

◆ release()

template<typename reference_t>
int dxd::referenced::release(reference_t& reference)
inlineinherited
Here is the caller graph for this function:

◆ requested()

template<typename desc_t>
os_result dxd::platform::device::requested(desc_t& desc) const
inline

the desc the host created this device with

◆ retain()

void dxd::referenced::retain()
inlineinherited
Here is the caller graph for this function:

◆ sleep()

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

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

Here is the caller graph for this function:

◆ start()

os_result dxd::platform::device::start(const ::CM_RESOURCE_LIST* raw, const ::CM_RESOURCE_LIST* translated, const ::GUID& guid)
inlineprotected

the start: launch() with the resources at hand, then the control clients' interface

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

◆ try_conclude()

void dxd::device::try_conclude()
inlineinherited

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()
inlineinherited

launch()es unless launched, a failure concluded

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

◆ unplugged()

void dxd::platform::device::unplugged()
inlineoverrideprotectedvirtual

the control interface goes while the PDO stands: at the surprise removal, else at the remove

Reimplemented from dxd::device.

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

◆ wake()

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

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:

◆ ::dxd_device

friend class ::dxd_device
friend

◆ driver

driver
friend

◆ dxd::power

template<typename>
friend class dxd::power
friend

Member Data Documentation

◆ launched

bool dxd::device::launched{}
inherited

◆ model

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

the model's name alike

◆ on

bool dxd::device::on{true}
inherited

in the working state

◆ provider

::IOService* dxd::platform::device::provider{}
protected

the driver's shell it stands on

◆ puid

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

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

◆ references

atomic<int> dxd::referenced::references{}
inherited

◆ removed

bool dxd::platform::device::removed{}
protected

the device vanished: the stack below no longer answers

◆ service

::IOService* dxd::platform::device::service
protected

the shell hosting this device

◆ status

os_result dxd::device::status{not_initialized}
inherited

◆ vendor

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

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

◆ wdm

struct { ... } dxd::platform::device::wdm

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