Changeset 7526e3d in mainline for uspace/lib/usb/include/usb/devdrv.h


Ignore:
Timestamp:
2011-04-03T16:34:31Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
159b91f4
Parents:
bb18a59
Message:

Add base support for alternate interfaces

Currently, alternate interfaces are queried and are part of the
usb_device_t structure. Changing interface is not possible easily.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/include/usb/devdrv.h

    rbb18a59 r7526e3d  
    4747} usb_device_descriptors_t;
    4848
     49/** Wrapper for data related to alternate interface setting.
     50 * The pointers will typically point inside configuration descriptor and
     51 * thus you shall not deallocate them.
     52 */
     53typedef struct {
     54        /** Interface descriptor. */
     55        usb_standard_interface_descriptor_t *interface;
     56        /** Pointer to start of descriptor tree bound with this interface. */
     57        uint8_t *nested_descriptors;
     58        /** Size of data pointed by nested_descriptors in bytes. */
     59        size_t nested_descriptors_size;
     60} usb_alternate_interface_descriptors_t;
     61
     62/** Alternate interface settings. */
     63typedef struct {
     64        /** Array of alternate interfaces descriptions. */
     65        usb_alternate_interface_descriptors_t *alternatives;
     66        /** Size of @c alternatives array. */
     67        size_t alternative_count;
     68        /** Index of currently selected one. */
     69        size_t current;
     70} usb_alternate_interfaces_t;
     71
    4972/** USB device structure. */
    5073typedef struct {
     
    6184         */
    6285        int interface_no;
     86
     87        /** Alternative interfaces.
     88         * Set to NULL when the driver controls whole device
     89         * (i.e. more (or any) interfaces).
     90         */
     91        usb_alternate_interfaces_t *alternate_interfaces;
    6392
    6493        /** Some useful descriptors. */
     
    132161typedef void (*usb_polling_terminted_callback_t)(usb_device_t *, bool, void *);
    133162
    134 
    135163int usb_device_auto_poll(usb_device_t *, size_t,
    136164    usb_polling_callback_t, size_t, usb_polling_terminted_callback_t, void *);
Note: See TracChangeset for help on using the changeset viewer.