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

DriverKit PCI device: its nub opened with bus mastering and memory space, its memory and interrupts. More...

#include <dxd_pci_device.h>

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

Classes

class  scatter_gather
 a memory's device addresses below 1<< limit_t, from initialize() to free(): mapped by the device's IOMMU (DART), in at most the 32 runs one preparation hands More...

Public Member Functions

client* client_create() override
 a client for an open: the platform's device makes the platform's client
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

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
void conclude() override
 no interrupt in flight reaches the device once its DPCs are flushed
void filter(::IO_RESOURCE_REQUIREMENTS_LIST& list) override
 a memory requirement of length 0 the bus states is dropped: no window answers it
virtual bool irq(unsigned int, int64_t)
 an interrupt of the vector, on the device's queue: claimed, its source quiet, isr() follows
virtual bool irq(unsigned int, int64_t)
 an interrupt of the vector, at its level: claimed, its source quiet, isr() follows in the vector's DPC
os_result irq_enable(bool enable= true)
os_result irq_enable(bool enable= true)
 the vectors connected or disconnected, at passive level
virtual void isr(unsigned int)
virtual void isr(unsigned int)
os_result launch() override
 start hook, called before any client can reach the device
os_result launch() override
 start hook, called before any client can reach the device
uint32_t read32(uint8_t bar, uint64_t offset) const
 a BAR the nub does not reach reads as a device gone from the bus, a write to it goes nowhere: conclude() takes any launch()
uint32_t read32(uint8_t bar, uint64_t offset) const
os_result sleep() override
 the sources off while the device sleeps - it reads all ones meanwhile -, on again behind its wake where they were
os_result sleep() override
 the interrupts off while the device sleeps - it reads all ones meanwhile -, connected again behind its wake where they were
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 interrupts go at the surprise removal, the BARs stay mapped until conclude(): the device reads all ones meanwhile
os_result wake() override
 power hooks: a launched device comes back to the working state, and leaves it - its start and its removal are launch() and conclude()
os_result wake() override
 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
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
static constexpr bool removed(uint32_t value)
 a register read of a device gone from the bus

Protected Attributes

::IOPCIDevice* pci{}
::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_interrupt

Detailed Description

DriverKit PCI device: its nub opened with bus mastering and memory space, its memory and interrupts.

WDM PCI device: its BARs mapped from the start's resources (pci::bars), its interrupts.

irq() and isr() run per vector on the device's own serial queue, isr() where irq() claims the interrupt - a dext has no primary interrupt level, so the two are the KMDF device's pair in one place; the vectors are MSI where the nub grants them, the legacy line otherwise, and launch with their sources disabled (irq_enable()). read32()/write32() reach a BAR by its index; a device gone from the bus reads all ones (removed()). PCI devices

irq() runs at the interrupt's level, isr() in the vector's DPC where irq() claims the interrupt; the vectors are MSI where the inf grants them, the legacy line otherwise, connected by irq_enable(). The bus's memory requirements of length 0 are dropped ahead of the start. PCI devices

Member Function Documentation

◆ client_create() [1/2]

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

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

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

Implements dxd::device.

◆ conclude() [1/2]

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

remove hook, the last word to the hardware

Reimplemented from dxd::device.

Here is the call graph for this function:

◆ conclude() [2/2]

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

no interrupt in flight reaches the device once its DPCs are flushed

Reimplemented from dxd::device.

Here is the call graph for this function:

◆ filter()

void dxd::pci::device::filter(::IO_RESOURCE_REQUIREMENTS_LIST& list)
inlineoverrideprotectedvirtual

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

Reimplemented from dxd::platform::device.

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

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:

◆ irq() [1/2]

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

an interrupt of the vector, on the device's queue: claimed, its source quiet, isr() follows

Reimplemented in dxd::firewire::controller< super_device_t >.

◆ irq() [2/2]

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

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

Reimplemented in dxd::firewire::controller< super_device_t >.

◆ irq_enable() [1/2]

os_result dxd::pci::device::irq_enable(bool enable= true)
inlineprotected
Here is the caller graph for this function:

◆ irq_enable() [2/2]

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

the vectors connected or disconnected, at passive level

◆ isr() [1/2]

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

◆ isr() [2/2]

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

◆ launch() [1/2]

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

start hook, called before any client can reach the device

Reimplemented from dxd::device.

Here is the call graph for this function:

◆ launch() [2/2]

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

start hook, called before any client can reach the device

Reimplemented from dxd::device.

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

◆ read32() [1/2]

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

a BAR the nub does not reach reads as a device gone from the bus, a write to it goes nowhere: conclude() takes any launch()

◆ read32() [2/2]

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

◆ removed() [1/2]

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

a register read of a device gone from the bus

◆ removed() [2/2]

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

a register read of a device gone from the bus

◆ requested()

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

the desc the host created this device with

◆ retain()

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

◆ sleep() [1/2]

os_result dxd::pci::device::sleep()
inlineoverrideprotectedvirtual

the sources off while the device sleeps - it reads all ones meanwhile -, on again behind its wake where they were

Reimplemented from dxd::device.

Here is the call graph for this function:

◆ sleep() [2/2]

os_result dxd::pci::device::sleep()
inlineoverrideprotectedvirtual

the interrupts off while the device sleeps - it reads all ones meanwhile -, connected again behind its wake where they were

Reimplemented from dxd::device.

Here is the call graph for this function:

◆ start()

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

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::pci::device::unplugged()
inlineoverrideprotectedvirtual

the interrupts go at the surprise removal, the BARs stay mapped until conclude(): the device reads all ones meanwhile

Reimplemented from dxd::device.

Here is the call graph for this function:

◆ wake() [1/2]

os_result dxd::pci::device::wake()
inlineoverrideprotectedvirtual

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

Reimplemented from dxd::device.

Here is the call graph for this function:

◆ wake() [2/2]

os_result dxd::pci::device::wake()
inlineoverrideprotectedvirtual

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

Reimplemented from dxd::device.

Here is the call graph for this function:

◆ write32() [1/2]

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

◆ write32() [2/2]

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

◆ ::dxd_interrupt

friend class ::dxd_interrupt
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

◆ pci

::IOPCIDevice* dxd::pci::device::pci{}
protected

◆ provider

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

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

the device vanished: the stack below no longer answers

◆ service

::IOService* dxd::platform::device::service
protectedinherited

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: