device.h File Reference

Virtual USB device. More...

#include <usb/usb.h>
#include <usb/dev/request.h>

Go to the source code of this file.

Data Structures

struct  usbvirt_control_request_handler_t
 Callback for control request on a virtual USB device. More...
struct  usbvirt_descriptors_t
 Standard USB descriptors for virtual device. More...
struct  usbvirt_device
 Virtual USB device. More...
struct  usbvirt_device_configuration_extras_t
 Extra configuration data for GET_CONFIGURATION request. More...
struct  usbvirt_device_configuration_t
 Single device configuration. More...
struct  usbvirt_device_ops_t
 Ops structure for virtual USB device. More...

Defines

#define USBVIRT_ENDPOINT_MAX   16
 Maximum number of endpoints supported by virtual USB.

Typedefs

typedef usbvirt_device usbvirt_device_t
typedef int(*) usbvirt_on_control_t (usbvirt_device_t *dev, const usb_device_request_setup_packet_t *setup_packet, uint8_t *data, size_t *act_data_size)
 Callback for control transfer on endpoint zero.
typedef int(*) usbvirt_on_data_from_device_t (usbvirt_device_t *dev, usb_endpoint_t endpoint, usb_transfer_type_t transfer_type, void *buffer, size_t buffer_size, size_t *act_buffer_size)
 Callback for data from device (IN transaction).
typedef int(*) usbvirt_on_data_to_device_t (usbvirt_device_t *dev, usb_endpoint_t endpoint, usb_transfer_type_t transfer_type, void *buffer, size_t buffer_size)
 Callback for data to device (OUT transaction).

Enumerations

enum  usbvirt_device_state_t { USBVIRT_STATE_DEFAULT, USBVIRT_STATE_ADDRESS, USBVIRT_STATE_CONFIGURED }
 Possible states of virtual USB device. More...

Functions

int usbvirt_control_read (usbvirt_device_t *dev, void *setup, size_t setup_size, void *data, size_t data_size, size_t *data_size_sent)
 Issue a control read transfer to virtual USB device.
void usbvirt_control_reply_helper (const usb_device_request_setup_packet_t *setup_packet, uint8_t *data, size_t *act_size, void *actual_data, size_t actual_data_size)
 Helper for replying to control read transfer from virtual USB device.
int usbvirt_control_write (usbvirt_device_t *dev, void *setup, size_t setup_size, void *data, size_t data_size)
 Issue a control write transfer to virtual USB device.
int usbvirt_data_in (usbvirt_device_t *dev, usb_transfer_type_t transf_type, usb_endpoint_t endpoint, void *data, size_t data_size, size_t *data_size_sent)
 Request data from virtual USB device.
int usbvirt_data_out (usbvirt_device_t *dev, usb_transfer_type_t transf_type, usb_endpoint_t endpoint, void *data, size_t data_size)
 Send data to virtual USB device.
int usbvirt_device_plug (usbvirt_device_t *dev, const char *vhc_path)
 Connect the device to the virtual host controller.
void usbvirt_device_unplug (usbvirt_device_t *dev)
 Disconnect the device from virtual host controller.


Detailed Description

Virtual USB device.

Definition in file device.h.


Generated on Thu Jun 2 07:45:53 2011 for HelenOS/USB by  doxygen 1.4.7