Changeset 2c381250 in mainline for uspace/lib/usbvirt/device.h


Ignore:
Timestamp:
2010-10-13T06:49:48Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7da3219
Parents:
fd17ab5
Message:

virtusb: add get_descriptor(config) handling

The virtusb framework is now able to handle the standard request for
obtaining configuration descriptor. This includes sending extra data
such as interface or endpoint descriptor.

Using this approach, the virtual keyboard sends also its HID descriptor.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbvirt/device.h

    rfd17ab5 r2c381250  
    4646        uint8_t *data);
    4747
     48/** Device operations. */
    4849typedef struct {
     50        /** Callback for standard USB request.
     51         * Called only when the request could not be handled by this
     52         * framework.
     53         */
    4954        usbvirt_on_device_request_t on_devreq_std;
     55        /** Callback for class-specific USB request. */
    5056        usbvirt_on_device_request_t on_devreq_class;
     57        /** Callback for all other incoming data. */
    5158        int (*on_data)(struct usbvirt_device *dev,
    5259            usb_endpoint_t endpoint, void *buffer, size_t size);
    5360} usbvirt_device_ops_t;
     61
     62/** Extra configuration data for GET_CONFIGURATION request. */
     63typedef struct {
     64        /** Actual data. */
     65        uint8_t *data;
     66        /** Data length. */
     67        size_t length;
     68} usbvirt_device_configuration_extras_t;
     69
     70/** Single device configuration. */
     71typedef struct {
     72        /** Standard configuration descriptor. */
     73        usb_standard_configuration_descriptor_t *descriptor;
     74        /** Array of extra data. */
     75        usbvirt_device_configuration_extras_t *extra;
     76        /** Length of @c extra array. */
     77        size_t extra_count;
     78} usbvirt_device_configuration_t;
     79
     80/** Standard USB descriptors. */
     81typedef struct {
     82        /** Standard device descriptor.
     83         * There is always only one such descriptor for the device.
     84         */
     85        usb_standard_device_descriptor_t *device;
     86       
     87        /** Configurations. */
     88        usbvirt_device_configuration_t *configuration;
     89        /** Number of configurations. */
     90        size_t configuration_count;
     91} usbvirt_descriptors_t;
     92
    5493
    5594typedef struct usbvirt_device {
     
    69108        /* Device attributes. */
    70109       
    71         /** Standard device descriptor.
    72          * If this descriptor is set (i.e. not NULL), the framework
    73          * automatically handles call for its retrieval.
    74          */
    75         usb_standard_device_descriptor_t *standard_descriptor;
     110        /** Standard descriptors. */
     111        usbvirt_descriptors_t *descriptors;
    76112       
    77113       
Note: See TracChangeset for help on using the changeset viewer.