dxd - dynax driver framework 2.6.0d205
cross platform open source driver development framework
Loading...
Searching...
No Matches
dxd::usb_stream_device Class Reference

generic USB device More...

#include <dxd_usb_stream.h>

Inheritance diagram for dxd::usb_stream_device:
Collaboration diagram for dxd::usb_stream_device:

Classes

class  clock
class  stream
 USB stream. More...

Public Types

enum  speed {
  low =::kUSBHostConnectionSpeedLow , full =::kUSBHostConnectionSpeedFull , high =::kUSBHostConnectionSpeedHigh , usb1 =full ,
  usb2 =high , low =::kUSBHostConnectionSpeedLow , full =::kUSBHostConnectionSpeedFull , high =::kUSBHostConnectionSpeedHigh ,
  usb1 =full , usb2 =high
}
enum  speed {
  low =::kUSBHostConnectionSpeedLow , full =::kUSBHostConnectionSpeedFull , high =::kUSBHostConnectionSpeedHigh , usb1 =full ,
  usb2 =high , low =::kUSBHostConnectionSpeedLow , full =::kUSBHostConnectionSpeedFull , high =::kUSBHostConnectionSpeedHigh ,
  usb1 =full , usb2 =high
}

Public Member Functions

os_result clear ()
unsigned char configuration () const
unsigned char configuration () const
 return available USB configurations
os_result configuration (unsigned char configuration)
os_result configuration (unsigned char configuration)
 choose USB configuration
unsigned char configurations () const
unsigned char configurations () const
 return current USB configuration
decltype(dx::usb::descriptor::device) descriptor () const
 IOKit: request the USB device descriptor.
uint64_t frame () const
uint64_t frame () const
::IOUSBHostInterface * interface (unsigned char index, unsigned char setting=0)
 IOKit: USB interface.
const ::USBD_INTERFACE_INFORMATION * interface (unsigned char index, unsigned char setting=0)
 operator const ::HANDLE () const
 operator const::IOLock * () const
 operator::DEVICE_OBJECT * () const
 operator::IOLock * ()
 operator::IOUSBHostDevice * () const
 IOKit: IOUSBDevice* implicit cast.
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)
os_result remove ()
template<typename data_t>
os_result request (const dx::usb::control &control, data_t &data)
 IOKit: synchronously sends an USB request.
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)
os_result request (const dx::usb::control &control, void *data, size_t &size)
os_result set (const ::UNICODE_STRING &key, const ::GUID &value)
os_result set (const ::UNICODE_STRING &key, const ::UNICODE_STRING &value)
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)
speed speed () const
speed speed () const
os_result state () const
os_result string (unsigned char idx, char *string, unsigned char &chars)
os_result string (unsigned char idx, char *string, unsigned char &chars, dx::usb::language language=dx::usb::language::standard)
 IOKit: request the USB string descriptor for the index.
template<typename string_t>
os_result string (unsigned char idx, string_t &string)
template<typename string_t>
os_result string (unsigned char idx, string_t &string)
template<typename type_t>
unsigned long type ()

Public Attributes

dxd::usb_stream_device::clock clock
os_result status =not_initialized
os_result status = not_initialized
scoped< streamstreams [0x20] {}

Protected Member Functions

void close_interfaces ()
void conclude () override
 IOKit: USB conclude.
void conclude () override
 WDK: USB device de-initialization callback.
os_result ioctl (unsigned int ioctl, const void *in, size_t size_in, void *out, size_t size_out, size_t &size) override
 usb IOCTL handler
os_result launch () override
 IOKit: USB launch.
os_result launch () override
 WDK: USB device initialization callback.
os_result open (const dx::stream::open< dx::usb::endpoint > &open, dxd::stream::opened< dx::circular > *opened, size_t &size)
os_result open_interfaces ()
os_result sleep () override
 device PNP sleep virtual method
bool start (::IOService *provider) override
 IOKit: USB start.
os_result wake () override
 device PNP wake virtual method

Detailed Description

generic USB device

Member Enumeration Documentation

◆ speed [1/2]

enum dxd::usb_device::speed
inherited
Todo
enum class
Enumerator
low 
full 
high 
usb1 
usb2 
low 
full 
high 
usb1 
usb2 

◆ speed [2/2]

enum dxd::usb_device::speed
inherited
Enumerator
low 
full 
high 
usb1 
usb2 
low 
full 
high 
usb1 
usb2 

Member Function Documentation

◆ clear()

os_result dxd::usb_device::clear ( )
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ close_interfaces()

void dxd::usb_device::close_interfaces ( )
inlineprotectedinherited
Here is the caller graph for this function:

◆ conclude() [1/2]

void dxd::usb_device::conclude ( )
inlineoverrideprotectedinherited

IOKit: USB conclude.

This method:

  • iterates over and closes all USB interfaces
  • deselects USB configuration
  • closes the USB device from exclusive access
  • De-selects previosly selected USB configuration,
Todo
investigate if reset() is still needed here
  • closes the USB device, so another driver has the chance to match against (important: this driver will not unload otherwise)
Here is the call graph for this function:

◆ conclude() [2/2]

void dxd::usb_device::conclude ( )
inlineoverrideprotectedinherited

WDK: USB device de-initialization callback.

Here is the call graph for this function:

◆ configuration() [1/4]

unsigned char dxd::usb_device::configuration ( ) const
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ configuration() [2/4]

unsigned char dxd::usb_device::configuration ( ) const
inlineinherited

return available USB configurations

◆ configuration() [3/4]

os_result dxd::usb_device::configuration ( unsigned char configuration)
inlineinherited
Here is the call graph for this function:

◆ configuration() [4/4]

os_result dxd::usb_device::configuration ( unsigned char configuration)
inlineinherited

choose USB configuration

removes interface cache

deselects current configuration on request #0

obtains the configuration descriptor,

obtains all descriptors,

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() [1/2]

unsigned char dxd::usb_device::configurations ( ) const
inlineinherited
Here is the call graph for this function:

◆ configurations() [2/2]

unsigned char dxd::usb_device::configurations ( ) const
inlineinherited

return current USB configuration

◆ descriptor()

decltype(dx::usb::descriptor::device) dxd::usb_device::descriptor ( ) const
inlineinherited

IOKit: request the USB device descriptor.

Deprecated
Here is the call graph for this function:

◆ frame() [1/2]

uint64_t dxd::usb_device::frame ( ) const
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ frame() [2/2]

uint64_t dxd::usb_device::frame ( ) const
inlineinherited
Here is the call graph for this function:

◆ interface() [1/2]

::IOUSBHostInterface * dxd::usb_device::interface ( unsigned char index,
unsigned char setting = 0 )
inlineinherited

IOKit: USB interface.

Selects the USB interface

checks interface, if it fails: was it configured?

and selects the (alternate) setting

Parameters
indexindex of the USB interface in the USB configuration
settingsetting # of the USB interface
Here is the caller graph for this function:

◆ interface() [2/2]

const ::USBD_INTERFACE_INFORMATION * dxd::usb_device::interface ( unsigned char index,
unsigned char setting = 0 )
inlineinherited

requests settings change,

disposes and creates new interface cache on size change,

and fills interface cache,

◆ ioctl()

os_result dxd::usb_stream_device::ioctl ( unsigned int ioctl,
const void * in,
size_t size_in,
void * out,
size_t size_out,
size_t & size )
inlineoverrideprotected

usb IOCTL handler

virtual ioctl() gets called by the dynax driver framework for usb device IOCTL handling.

implemented handler

checks endpoint address,

obtains stream index from endpoint address

checks if stream is opened;

detaches mapping from stream

checks endpoint address,

checks stream user mode mapping,

checks endpoint address,

checks stream user mode mapping,

    - <i>dx::ioctl::stream::clock::samplerate</i>
        - in: clock domain ID (ignored since the supported devices only
            have one clock domain so far)
            + optional (unsigned int) samplerate,
        - out:
            optional (unsigned int) samplerate, or
            optional dx::iobridge<unsigned int> samplerate map

/

Todo
clean way of switching SR of device or endpoint, /when streams are opened or closed

checks clock domain validity,

prevent samplerate setting when streaming

setup stream DMA to be used with the new samplerate

  • dx::usb::descriptor - obtain generic USB device descriptor
  • in: none,
  • out: dx::usb::device_descriptor
  • dx::usb::string - obtain generic USB device string
  • in: (char) string index,
  • out: unsigned short[] unicode string from device
  • dx::usb::configuration - select/obtain USB configuration
  • in: optional (unsigned char) configuration,
  • out: optional (unsigned char) configuration,
Parameters
ioctlIOCTL
inbuffer pointer containing data from user mode
size_insize of the buffer containing data from user mode
outbuffer pointer accepting data to be returned to user mode
size_outsize of the buffer accepting data to be returned to user mode
sizeactual size of data to be returned to user mode
Here is the call graph for this function:
Here is the caller graph for this function:

◆ launch() [1/2]

os_result dxd::usb_device::launch ( )
inlineoverrideprotectedinherited

IOKit: USB launch.

This method:

  • opens the USB device for exclusive access,
  • selects default USB configuration
  • iterates over and opens all USB interfaces
Here is the call graph for this function:

◆ launch() [2/2]

os_result dxd::usb_device::launch ( )
inlineoverrideprotectedinherited

WDK: USB device initialization callback.

obtain vage speed info

obtains the device descriptor,

and select USB configuration #1.

Here is the call graph for this function:

◆ open()

os_result dxd::usb_stream_device::open ( const dx::stream::open< dx::usb::endpoint > & open,
dxd::stream::opened< dx::circular > * opened,
size_t & size )
inlineprotected

checks endpoint address,

obtains stream index from endpoint address

opens device receiver endpoint and checks its status,

registers this client, and returns

  • kernel space address of shared buffer,
  • kernel data available event pointer
  • kernel backingstore space available pointer
Here is the call graph for this function:
Here is the caller graph for this function:

◆ open_interfaces()

os_result dxd::usb_device::open_interfaces ( )
inlineprotectedinherited
Here is the caller graph for this function:

◆ operator const ::HANDLE()

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

◆ operator const::IOLock *()

dxd::mutex::operator const::IOLock * ( ) const
inlineinherited

◆ operator::DEVICE_OBJECT *()

dxd::usb_device::operator::DEVICE_OBJECT * ( ) const
inlineinherited

◆ operator::IOLock *()

dxd::mutex::operator::IOLock * ( )
inlineinherited

◆ operator::IOUSBHostDevice *()

dxd::usb_device::operator::IOUSBHostDevice * ( ) const
inlineinherited

IOKit: IOUSBDevice* implicit cast.

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

◆ remove()

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

◆ request() [1/4]

template<typename data_t>
os_result dxd::usb_device::request ( const dx::usb::control & control,
data_t & data )
inlineinherited

IOKit: synchronously sends an USB request.

Todo
USB device control request timeout
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/4]

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

◆ request() [3/4]

os_result dxd::usb_device::request ( const dx::usb::control & control,
void * data,
size_t & size )
inlineinherited
Parameters
controlthe USB request control defining the request type
datadata to transmit or receive
sizesize of the actual transaction
Here is the call graph for this function:

◆ request() [4/4]

os_result dxd::usb_device::request ( const dx::usb::control & control,
void * data,
size_t & size )
inlineinherited

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

◆ 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

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

os_result dxd::usb_stream_device::sleep ( )
inlineoverrideprotected

device PNP sleep virtual method

virtual sleep() gets called by the dynax driver framework for device PNP sleep handling.

stops all endpoints

◆ speed() [1/2]

speed dxd::usb_device::speed ( ) const
inlineinherited

◆ speed() [2/2]

speed dxd::usb_device::speed ( ) const
inlineinherited
Todo
implement WDK low/super speed check for dxd::usb_device.speed()

◆ start()

bool dxd::usb_device::start ( ::IOService * provider)
inlineoverrideprotectedinherited

IOKit: USB start.

Here is the caller graph for this function:

◆ state()

os_result dxd::usb_device::state ( ) const
inlineinherited
Todo
find out if isInactive() is equivalent to getState()
Here is the caller graph for this function:

◆ string() [1/4]

os_result dxd::usb_device::string ( unsigned char idx,
char * string,
unsigned char & chars )
inlineinherited

◆ string() [2/4]

os_result dxd::usb_device::string ( unsigned char idx,
char * string,
unsigned char & chars,
dx::usb::language language = dx::usb::language::standard )
inlineinherited

IOKit: request the USB string descriptor for the index.

Parameters
idxindex of the string to request
stringpreallocated string buffer
charsnumber of characters returned
Here is the call graph for this function:
Here is the caller graph for this function:

◆ string() [3/4]

template<typename string_t>
os_result dxd::usb_device::string ( unsigned char idx,
string_t & string )
inlineinherited
Here is the call graph for this function:

◆ string() [4/4]

template<typename string_t>
os_result dxd::usb_device::string ( unsigned char idx,
string_t & string )
inlineinherited
Here is the call graph for this function:

◆ type()

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

◆ wake()

os_result dxd::usb_stream_device::wake ( )
inlineoverrideprotected

device PNP wake virtual method

virtual wake() gets called by the dynax driver framework for device PNP wake handling.

starts all endpoints

Member Data Documentation

◆ clock

dxd::usb_stream_device::clock dxd::usb_stream_device::clock

◆ status [1/2]

os_result dxd::mutex::status =not_initialized
inherited

◆ status [2/2]

os_result dxd::wdm::registry::status = not_initialized
inherited

◆ streams

scoped<stream> dxd::usb_stream_device::streams[0x20] {}

list of open streams


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.