|
dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
|
the device the OS publishes and user mode finds and opens More...
#include <dxd_device.h>
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 |
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.
|
virtualdefault |
Reimplemented in dxd::platform::device, and dxd::portcls::adapter::device.
|
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.
|
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 >.
|
inline |
the OS's identity of the hardware as the puid, until launch() states a persistent one
|
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 >.
|
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 >.
|
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
|
inlineprotectedvirtual |
Reimplemented in dxd::firewire::controller< super_device_t >, dxd::pci::device, and dxd::pci::device.
|
inline |
conclude()s if launched
|
inline |
launch()es unless launched, a failure concluded
|
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.
|
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.
|
protected |
| bool dxd::device::launched{} |
| const char* dxd::device::model{} |
the model's name alike
| bool dxd::device::on{true} |
in the working state
| char dxd::device::puid[0x80]{} |
persistent UID, system unique: the platform takes it from the OS's identity of the device
| os_result dxd::device::status{not_initialized} |
| const char* dxd::device::vendor{} |
the vendor's name the desc states, published with the puid for user mode to match by