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

KMDF PCI device: the PCI half's interface (PCI devices) on the framework. More...

#include <dxd_kmdf_pci_device.h>

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

Classes

class  scatter_gather

Public Member Functions

 device(dxd::driver& driver, ::WDFDEVICE wdf_device)
 the interrupts made with the framework device object's first device: a successor finds them standing
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

void conclude() override
 remove hook, the last word to the hardware
::NTSTATUS filter(::WDFIORESREQLIST wdf_requirements) override
 a memory requirement of length 0 the bus states is dropped: no window answers it
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 bool irq(unsigned int, int64_t)
 an interrupt of the vector, at its level: claimed, its source quiet, isr() follows in the interrupt's DPC
os_result irq_enable(bool enable= true)
 the sources enabled or disabled: the framework connects them in D0 and disconnects them out of it
virtual void isr(unsigned int)
os_result launch() override
 start hook, called before any client can reach the device
uint32_t read32(uint8_t bar, uint64_t offset) const
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()
void write32(uint8_t bar, uint64_t offset, uint32_t value) const

Static Protected Member Functions

static constexpr bool removed(uint32_t value)
 a register read of a device gone from the bus

Protected Attributes

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

Detailed Description

KMDF PCI device: the PCI half's interface (PCI devices) on the framework.

The interrupts are the framework device object's, made with its first device - one per MSI message the device may be granted, the legacy line the first -: the framework connects them in D0 and binds the new resources at a rebalance, irq() reaches the device object's current device while its irq_enable() lets it, and isr() follows in the interrupt's DPC. The bus's memory requirements of length 0 are dropped ahead of the start.

Constructor & Destructor Documentation

◆ device()

dxd::kmdf::pci::device::device(dxd::driver& driver, ::WDFDEVICE wdf_device)
inline

the interrupts made with the framework device object's first device: a successor finds them standing

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

Member Function Documentation

◆ conclude()

void dxd::kmdf::pci::device::conclude()
inlineoverrideprotectedvirtual

remove hook, the last word to the hardware

Reimplemented from dxd::device.

Here is the call graph for this function:

◆ filter()

::NTSTATUS dxd::kmdf::pci::device::filter(::WDFIORESREQLIST wdf_requirements)
inlineoverrideprotected

a memory requirement of length 0 the bus states is dropped: no window answers it

◆ 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)
inlineoverrideprotectedvirtualinherited

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:

◆ irq()

virtual bool dxd::kmdf::pci::device::irq(unsigned int, int64_t)
inlineprotectedvirtual

an interrupt of the vector, at its level: claimed, its source quiet, isr() follows in the interrupt's DPC

◆ irq_enable()

os_result dxd::kmdf::pci::device::irq_enable(bool enable= true)
inlineprotected

the sources enabled or disabled: the framework connects them in D0 and disconnects them out of it

◆ isr()

virtual void dxd::kmdf::pci::device::isr(unsigned int)
inlineprotectedvirtual

◆ launch()

os_result dxd::kmdf::pci::device::launch()
inlineoverrideprotectedvirtual

start hook, called before any client can reach the device

Reimplemented from dxd::device.

◆ notify_clients()

os_result dxd::kmdf::device::notify_clients(const ::GUID& guid)
inlineinherited
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
inlineinherited

◆ operator ::WDFDEVICE()

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

◆ operator ::WDFDRIVER()

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

◆ pdo()

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

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

◆ read32()

uint32_t dxd::kmdf::pci::device::read32(uint8_t bar, uint64_t offset) const
inlineprotected

◆ 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

◆ removed()

constexpr bool dxd::kmdf::pci::device::removed(uint32_t value)
inlinestaticconstexprprotected

a register read of a device gone from the bus

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

◆ write32()

void dxd::kmdf::pci::device::write32(uint8_t bar, uint64_t offset, uint32_t value) const
inlineprotected

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{}
protectedinherited

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: