dxd - dynax driver framework 3.0.0d222
cross platform open source driver development framework
Loading...
Searching...
No Matches
dxd::usb_device Class Reference

#include <dxd_usb.h>

Inheritance diagram for dxd::usb_device:
Collaboration diagram for dxd::usb_device:

Classes

class  pipe
 IOKit: USB pipe class. More...

Public Types

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

Public Member Functions

os_result clear ()
unsigned char configuration () const
os_result configuration (unsigned char configuration)
unsigned char configurations () const
decltype(dx::usb::descriptor::device) descriptor () const
 IOKit: request the USB device descriptor.
uint64_t frame () const
::IOUSBHostInterface * interface (unsigned char index, unsigned char setting=0)
 IOKit: USB interface.
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::IOUSBHostDevice * () const
 IOKit: IOUSBDevice* implicit cast.
template<typename data_t>
os_result request (const dx::usb::control &control, data_t &data)
 IOKit: synchronously sends an USB request.
os_result request (const dx::usb::control &control, void *data, size_t &size)
speed speed () const
os_result state () const
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)

Public Attributes

os_result status = not_initialized

Protected Member Functions

virtual clientclient_create ()
 user client factory
void close_interfaces ()
void conclude () override
 IOKit: USB conclude.
os_result launch () override
 IOKit: USB launch.
os_result open_interfaces ()
bool start (::IOService *provider) override
 IOKit: USB start.

Protected Attributes

struct { 
   ::DEVICE_OBJECT *   bus 
 the device object below More...
   ::DEVICE_OBJECT *   device 
 this device's own FDO More...
   ::DEVICE_OBJECT *   pdo 
 the devnode's PDO More...
wdm

Member Enumeration Documentation

◆ speed

Todo
enum class
Enumerator
low 
full 
high 
usb1 
usb2 

Member Function Documentation

◆ clear()

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

◆ client_create()

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

user client factory

◆ close_interfaces()

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

◆ conclude()

void dxd::usb_device::conclude ( )
inlineoverrideprotectedvirtual

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)

Reimplemented from dxd::device.

Here is the call graph for this function:

◆ configuration() [1/2]

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

◆ configuration() [2/2]

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

◆ configurations()

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

◆ descriptor()

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

IOKit: request the USB device descriptor.

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

◆ frame()

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

◆ interface()

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

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

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

os_result dxd::usb_device::launch ( )
inlineoverrideprotectedvirtual

IOKit: USB launch.

This method:

  • opens the USB device for exclusive access,
  • selects default USB configuration
  • iterates over and opens all USB interfaces

Reimplemented from dxd::device.

Here is the call graph for this function:

◆ open_interfaces()

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

◆ operator::IOUSBHostDevice *()

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

IOKit: IOUSBDevice* implicit cast.

◆ request() [1/2]

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

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/2]

os_result dxd::usb_device::request ( const dx::usb::control & control,
void * data,
size_t & size )
inline
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:

◆ speed()

speed dxd::usb_device::speed ( ) const
inline

◆ start()

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

IOKit: USB start.

◆ state()

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

◆ string() [1/2]

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

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

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

Member Data Documentation

◆ bus

::DEVICE_OBJECT* dxd::device::bus
inherited

the device object below

◆ pdo

::DEVICE_OBJECT* dxd::device::pdo
inherited

the devnode's PDO

◆ status

os_result dxd::device::status = not_initialized
inherited

◆ [struct]

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.