Ignore:
Timestamp:
2016-07-22T08:24:47Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f76d2c2
Parents:
5b18137 (diff), 8351f9a4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from lp:~jan.vesely/helenos/usb

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/include/usb/dev/alternate_ifaces.h

    r5b18137 rb4b534ac  
    11/*
    22 * Copyright (c) 2011 Vojtech Horky
     3 * Copyright (c) 2013 Jan Vesely
    34 * All rights reserved.
    45 *
     
    3132 */
    3233/** @file
    33  * Functions needed by hub drivers.
    34  *
    35  * For class specific requests, see usb/classes/hub.h.
     34 * USB device driver framework.
    3635 */
    3736
    38 #ifndef LIBUSBDEV_HUB_H_
    39 #define LIBUSBDEV_HUB_H_
     37#ifndef LIBUSBDEV_ALTERNATE_IFACES_H_
     38#define LIBUSBDEV_ALTERNATE_IFACES_H_
    4039
    41 #include <ddf/driver.h>
     40#include <usb/descriptor.h>
    4241#include <sys/types.h>
    43 #include <errno.h>
    44 #include <usb/hc.h>
    4542
    46 extern int usb_hc_new_device_wrapper(ddf_dev_t *, ddf_fun_t *,
    47     usb_hc_connection_t *, usb_speed_t, int (*)(void *), void *,
    48     usb_address_t *, ddf_dev_ops_t *);
    49 
    50 /** Info about device attached to host controller.
    51  *
    52  * This structure exists only to keep the same signature of
    53  * usb_hc_register_device() when more properties of the device
    54  * would have to be passed to the host controller.
     43/** Wrapper for data related to alternate interface setting.
     44 * The pointers will typically point inside configuration descriptor and
     45 * thus you shall not deallocate them.
    5546 */
    5647typedef struct {
    57         /** Device address. */
    58         usb_address_t address;
    59         /** DDF function (external) of the device. */
    60         ddf_fun_t *fun;
    61 } usb_hub_attached_device_t;
     48        /** Interface descriptor. */
     49        const usb_standard_interface_descriptor_t *interface;
     50        /** Pointer to start of descriptor tree bound with this interface. */
     51        const uint8_t *nested_descriptors;
     52        /** Size of data pointed by nested_descriptors in bytes. */
     53        size_t nested_descriptors_size;
     54} usb_alternate_interface_descriptors_t;
    6255
    63 extern int usb_hub_register_device(usb_hc_connection_t *,
    64     const usb_hub_attached_device_t *);
     56/** Alternate interface settings. */
     57typedef struct {
     58        /** Array of alternate interfaces descriptions. */
     59        const usb_alternate_interface_descriptors_t *alternatives;
     60        /** Size of @c alternatives array. */
     61        size_t alternative_count;
     62        /** Index of currently selected one. */
     63        size_t current;
     64} usb_alternate_interfaces_t;
    6565
    66 static inline int usb_hub_unregister_device(usb_hc_connection_t *conn,
    67     const usb_hub_attached_device_t *attached_device)
    68 {
    69         assert(conn);
    70         if (attached_device == NULL)
    71                 return EBADMEM;
    72        
    73         return usb_hc_release_address(conn, attached_device->address);
    74 }
     66size_t usb_interface_count_alternates(const uint8_t *, size_t, uint8_t);
     67int usb_alternate_interfaces_init(usb_alternate_interfaces_t *,
     68    const uint8_t *, size_t, int);
     69void usb_alternate_interfaces_deinit(usb_alternate_interfaces_t *);
    7570
    7671#endif
    77 
    7872/**
    7973 * @}
Note: See TracChangeset for help on using the changeset viewer.