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

a KMDF device: the contract's hooks on the framework's callbacks, its clients created per file object More...

#include <dxd_kmdf_device.h>

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

Public Member Functions

 device(dxd::driver& driver, ::WDFDEVICE wdf_device)
void identify(uint64_t id)
 the OS's identity of the hardware as the puid, until launch() states a persistent one
os_result notify_clients(const ::GUID& guid)
 operator const ::HANDLE() const
 operator ::DEVICE_OBJECT*() const
 operator ::WDFDEVICE() const
 operator ::WDFDRIVER() const
::DEVICE_OBJECT* pdo() const
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 type_t>
os_result property(property::key key, type_t& value)
 < the device's creation status, not the Parameters key's
template<typename type_t>
os_result query(const ::UNICODE_STRING& key, type_t& value)
template<typename key_t, typename type_t>
os_result query(key_t* key, type_t& value)
template<typename reference_t>
int release(reference_t& reference)
os_result remove()
void retain()
os_result set(const ::UNICODE_STRING& key, const ::GUID& value)
os_result set(const ::UNICODE_STRING& key, const ::UNICODE_STRING& value, unsigned long type= REG_SZ)
os_result set(const ::UNICODE_STRING& key, const char* value)
os_result set(const ::UNICODE_STRING& key, const wchar_t* value)
os_result set(const ::UNICODE_STRING& key, unsigned int value)
template<typename key_t, typename type_t>
os_result set(key_t* key, const type_t& value)
void try_conclude()
 conclude()s if launched
os_result try_launch()
 launch()es unless launched, a failure concluded
template<typename type_t>
unsigned long type()

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
const char* vendor{}
 the vendor's name the desc states, published with the puid for user mode to match by

Protected Member Functions

virtual void conclude()
 remove hook, the last word to the hardware
virtual::NTSTATUS filter(::WDFIORESREQLIST)
 the resource requirements the bus states, filtered ahead of the start
os_result ioctl(unsigned int ioctl, const void* in, size_t size_in, void* out, size_t size_out, size_t& size) override
 control I/O, reached through client::ioctl(): the driver answers what the device does not
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

bool removed{}
struct dxd::kmdf::device:: { ... }  wdf
struct dxd::kmdf::device:: { ... }  wdm

Friends

class bus
class driver

Detailed Description

a KMDF device: the contract's hooks on the framework's callbacks, its clients created per file object

The framework device object is the driver's, made on the framework's add (driver); the device stands on it, held by reference - one for the device object's context, one per open client. A rebalance releases the hardware, which retires the device as its clients see a removal - unplugged(), conclude(), removed -, and prepares it anew: a successor on the device object takes its place and launches on the new resources, the retired one goes with its last client. The WDM counterpart, which the PortCls path takes, is dxd::platform::device.

Constructor & Destructor Documentation

◆ device()

dxd::kmdf::device::device(dxd::driver& driver, ::WDFDEVICE wdf_device)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ conclude()

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

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:

◆ filter()

virtual::NTSTATUS dxd::kmdf::device::filter(::WDFIORESREQLIST)
inlineprotected

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

◆ 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::kmdf::device::ioctl(unsigned int ioctl, const void* in, size_t size_in, void* out, size_t size_out, size_t& size)
inlineoverrideprotectedvirtual

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

Reimplemented from dxd::device.

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:

◆ notify_clients()

os_result dxd::kmdf::device::notify_clients(const ::GUID& guid)
inline
Here is the call graph for this function:

◆ operator const ::HANDLE()

dxd::wdm::registry::operator const ::HANDLE() const
inlineinherited
Here is the caller graph for this function:

◆ operator ::DEVICE_OBJECT *()

dxd::kmdf::device::operator ::DEVICE_OBJECT*() const
inline

◆ operator ::WDFDEVICE()

dxd::kmdf::device::operator ::WDFDEVICE() const
inline
Here is the caller graph for this function:

◆ operator ::WDFDRIVER()

dxd::kmdf::device::operator ::WDFDRIVER() const
inline

◆ pdo()

::DEVICE_OBJECT* dxd::kmdf::device::pdo() const
inline
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:

◆ property()

template<typename type_t>
os_result dxd::kmdf::device::property(property::key key, type_t& value)
inline

< the device's creation status, not the Parameters key's

◆ query() [1/2]

template<typename type_t>
os_result dxd::wdm::registry::query(const ::UNICODE_STRING& key, type_t& value)
inlineinherited

◆ query() [2/2]

template<typename key_t, typename type_t>
os_result dxd::wdm::registry::query(key_t* key, type_t& value)
inlineinherited
Here is the call graph for this function:
Here is the caller 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:

◆ remove()

os_result dxd::wdm::registry::remove()
inlineinherited

◆ retain()

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

◆ set() [1/6]

os_result dxd::wdm::registry::set(const ::UNICODE_STRING& key, const ::GUID& value)
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set() [2/6]

os_result dxd::wdm::registry::set(const ::UNICODE_STRING& key, const ::UNICODE_STRING& value, unsigned long type= REG_SZ)
inlineinherited
Here is the call graph for this function:

◆ set() [3/6]

os_result dxd::wdm::registry::set(const ::UNICODE_STRING& key, const char* value)
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set() [4/6]

os_result dxd::wdm::registry::set(const ::UNICODE_STRING& key, const wchar_t* value)
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set() [5/6]

os_result dxd::wdm::registry::set(const ::UNICODE_STRING& key, unsigned int value)
inlineinherited
Here is the caller graph for this function:

◆ set() [6/6]

template<typename key_t, typename type_t>
os_result dxd::wdm::registry::set(key_t* key, const type_t& value)
inlineinherited
Here is the call graph for this function:
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:

◆ 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:

◆ type()

template<typename type_t>
unsigned long dxd::wdm::registry::type()
inherited
Here is the caller graph for this function:

◆ unplugged()

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

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

◆ bus

friend class bus
friend

◆ driver

friend class driver
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

◆ 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::kmdf::device::removed{}
protected

the hardware released - removed or rebalanced: the device takes no I/O any more

◆ status

◆ vendor

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

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

◆ wdf

struct { ... } dxd::kmdf::device::wdf

◆ wdm

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

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