dxd - dynax driver framework 3.0.1d223
cross platform open source driver development framework
Loading...
Searching...
No Matches
dxd::usb::device< base_t > Class Template Reference

#include <dxd_usb_device.h>

Inheritance diagram for dxd::usb::device< base_t >:
Collaboration diagram for dxd::usb::device< base_t >:

Public Types

enum  speed {
  low = ::UsbLowSpeed , full = ::UsbFullSpeed , high = ::UsbHighSpeed , usb1 = full ,
  usb2 = high
}
 the bus speeds this driver distinguishes, by their names and their generation More...

Public Member Functions

void conclude () override
 the configuration, the USBD handle and the bus interface let go while the bus below still answers: ahead of the remove IRP, past it the PDO is gone - a vanished device gets no deselect
unsigned char configuration () const
 return available USB configurations
os_result configuration (unsigned char configuration)
 choose USB configuration
unsigned char configurations () const
 return current USB configuration
os_result descriptors (unsigned char configuration)
 obtains the configuration descriptor, then all of the configuration's descriptors into config
template<typename... args_t>
 device (args_t &&... args)
 WDK: USB device constructor.
const decltype(dx::usb::descriptor::endpoint) * endpoint (unsigned char interface, unsigned char setting, unsigned char address)
 the endpoint descriptor of an interface setting's endpoint, from the selected configuration
os_result frame (uint64_t &frame, int64_t *timestamp=nullptr) const
 the current bus frame; timestamp: dxd::timestamp() of the readout
const ::USBD_INTERFACE_INFORMATION * interface (unsigned char index, unsigned char setting=0)
virtual os_result ioctl (unsigned int ioctl, const void *, size_t size_in, void *out, size_t size_out, size_t &size)
 control I/O handler, reached through client::ioctl()
 operator::DEVICE_OBJECT * () const
template<typename data_t>
os_result request (const dx::usb::control &control, data_t &data)
os_result request (const dx::usb::control &control, void *data, size_t &size)
speed speed () const
os_result string (unsigned char idx, char *string, unsigned char &chars)
template<typename string_t>
os_result string (unsigned char idx, string_t &string)

Public Attributes

os_result status {not_initialized}

Protected Member Functions

virtual os_result boot ()
 a device loading its firmware after enumeration reports readiness here, ahead of the configuration: its descriptors read (config), the ones it is configured from the booted one's
virtual client * client_create ()
os_result launch () override
 WDK: USB device initialization callback.
virtual void unplugged ()
 surprise removal hook, called with removed set: the hardware side goes at once, what open handles hold waits for their close and the remove

Protected Attributes

scoped<::USB_CONFIGURATION_DESCRIPTOR > config
bool removed {}
 the device vanished: the stack below no longer answers //////////////////////////////////////////////////////////////////////////// user client factory
struct dxd::device:: { ... }  wdm

Member Enumeration Documentation

◆ speed

template<typename base_t = dxd::device>
enum dxd::usb::device::speed

the bus speeds this driver distinguishes, by their names and their generation

Enumerator
low 
full 
high 
usb1 
usb2 

Constructor & Destructor Documentation

◆ device()

template<typename base_t = dxd::device>
template<typename... args_t>
dxd::usb::device< base_t >::device ( args_t &&... args)
inline

WDK: USB device constructor.

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

Member Function Documentation

◆ boot()

template<typename base_t = dxd::device>
virtual os_result dxd::usb::device< base_t >::boot ( )
inlineprotectedvirtual

a device loading its firmware after enumeration reports readiness here, ahead of the configuration: its descriptors read (config), the ones it is configured from the booted one's

Here is the caller graph for this function:

◆ client_create()

virtual client * dxd::device::client_create ( )
inlineprotectedvirtualinherited

◆ conclude()

template<typename base_t = dxd::device>
void dxd::usb::device< base_t >::conclude ( )
inlineoverridevirtual

the configuration, the USBD handle and the bus interface let go while the bus below still answers: ahead of the remove IRP, past it the PDO is gone - a vanished device gets no deselect

Reimplemented from dxd::device.

Here is the call graph for this function:

◆ configuration() [1/2]

template<typename base_t = dxd::device>
unsigned char dxd::usb::device< base_t >::configuration ( ) const
inline

return available USB configurations

Here is the caller graph for this function:

◆ configuration() [2/2]

template<typename base_t = dxd::device>
os_result dxd::usb::device< base_t >::configuration ( unsigned char configuration)
inline

choose USB configuration

deselects current configuration on request #0

enumerates interfaces in the configuration,

allocates and builds an URB for the select-configuration request,

creates interface cache

enumerates the pipes in the interface information array, which is now filled with pipe information.

Here is the call graph for this function:

◆ configurations()

template<typename base_t = dxd::device>
unsigned char dxd::usb::device< base_t >::configurations ( ) const
inline

return current USB configuration

◆ descriptors()

template<typename base_t = dxd::device>
os_result dxd::usb::device< base_t >::descriptors ( unsigned char configuration)
inline

obtains the configuration descriptor, then all of the configuration's descriptors into config

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

◆ endpoint()

template<typename base_t = dxd::device>
const decltype(dx::usb::descriptor::endpoint) * dxd::usb::device< base_t >::endpoint ( unsigned char interface,
unsigned char setting,
unsigned char address )
inline

the endpoint descriptor of an interface setting's endpoint, from the selected configuration

Here is the call graph for this function:

◆ frame()

template<typename base_t = dxd::device>
os_result dxd::usb::device< base_t >::frame ( uint64_t & frame,
int64_t * timestamp = nullptr ) const
inline

the current bus frame; timestamp: dxd::timestamp() of the readout

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

◆ interface()

template<typename base_t = dxd::device>
const ::USBD_INTERFACE_INFORMATION * dxd::usb::device< base_t >::interface ( unsigned char index,
unsigned char setting = 0 )
inline

requests settings change,

disposes and creates new interface cache on size change,

and fills interface cache,

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

◆ ioctl()

virtual os_result dxd::device::ioctl ( unsigned int ioctl,
const void * ,
size_t size_in,
void * out,
size_t size_out,
size_t & size )
inlinevirtualinherited

control I/O handler, reached through client::ioctl()

Reimplemented in dxd::adapter::device.

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

◆ launch()

template<typename base_t = dxd::device>
os_result dxd::usb::device< base_t >::launch ( )
inlineoverrideprotectedvirtual

WDK: USB device initialization callback.

obtains the device descriptor,

reads the configuration the boot decision looks at,

and select USB configuration #1.

Reimplemented from dxd::device.

Here is the call graph for this function:

◆ operator::DEVICE_OBJECT *()

template<typename base_t = dxd::device>
dxd::usb::device< base_t >::operator::DEVICE_OBJECT * ( ) const
inline

◆ request() [1/2]

template<typename base_t = dxd::device>
template<typename data_t>
os_result dxd::usb::device< base_t >::request ( const dx::usb::control & control,
data_t & data )
inline
Parameters
controlthe USB request control defining the request type
datadata to transmit or receive
Here is the call graph for this function:
Here is the caller graph for this function:

◆ request() [2/2]

template<typename base_t = dxd::device>
os_result dxd::usb::device< base_t >::request ( const dx::usb::control & control,
void * data,
size_t & size )
inline

◆ speed()

template<typename base_t = dxd::device>
speed dxd::usb::device< base_t >::speed ( ) const
inline
Todo
implement WDK low/super speed check for dxd::usb::device::speed() the device's own operating speed: a full speed device behind a high speed hub is full speed

◆ string() [1/2]

template<typename base_t = dxd::device>
os_result dxd::usb::device< base_t >::string ( unsigned char idx,
char * string,
unsigned char & chars )
inline
Here is the caller graph for this function:

◆ string() [2/2]

template<typename base_t = dxd::device>
template<typename string_t>
os_result dxd::usb::device< base_t >::string ( unsigned char idx,
string_t & string )
inline
Here is the call graph for this function:

◆ unplugged()

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

surprise removal hook, called with removed set: the hardware side goes at once, what open handles hold waits for their close and the remove

Reimplemented in dxd::adapter::device.

Here is the caller graph for this function:

Member Data Documentation

◆ config

template<typename base_t = dxd::device>
scoped<::USB_CONFIGURATION_DESCRIPTOR> dxd::usb::device< base_t >::config
protected

the selected configuration's descriptors: endpoint attributes live here, a class compliant device is configured from them

◆ removed

bool dxd::device::removed {}
protectedinherited

the device vanished: the stack below no longer answers //////////////////////////////////////////////////////////////////////////// user client factory

◆ status

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

◆ wdm

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

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

(c) copyright 2009 dynamic acoustics e.U. generated on

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.