source: mainline/uspace/lib/usbdev/include/usb/dev/alternate_ifaces.h@ c6f23a7

Last change on this file since c6f23a7 was d7f7a4a, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 4 years ago

Replace some license headers with SPDX identifier

Headers are replaced using tools/transorm-copyright.sh only
when it can be matched verbatim with the license header used
throughout most of the codebase.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 * SPDX-FileCopyrightText: 2011 Vojtech Horky
3 * SPDX-FileCopyrightText: 2013 Jan Vesely
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8/** @addtogroup libusbdev
9 * @{
10 */
11/** @file
12 * USB device driver framework.
13 */
14
15#ifndef LIBUSBDEV_ALTERNATE_IFACES_H_
16#define LIBUSBDEV_ALTERNATE_IFACES_H_
17
18#include <errno.h>
19#include <usb/descriptor.h>
20#include <stddef.h>
21#include <stdint.h>
22
23/** Wrapper for data related to alternate interface setting.
24 * The pointers will typically point inside configuration descriptor and
25 * thus you shall not deallocate them.
26 */
27typedef struct {
28 /** Interface descriptor. */
29 const usb_standard_interface_descriptor_t *interface;
30 /** Pointer to start of descriptor tree bound with this interface. */
31 const uint8_t *nested_descriptors;
32 /** Size of data pointed by nested_descriptors in bytes. */
33 size_t nested_descriptors_size;
34} usb_alternate_interface_descriptors_t;
35
36/** Alternate interface settings. */
37typedef struct {
38 /** Array of alternate interfaces descriptions. */
39 usb_alternate_interface_descriptors_t *alternatives;
40 /** Size of @c alternatives array. */
41 size_t alternative_count;
42 /** Index of currently selected one. */
43 size_t current;
44} usb_alternate_interfaces_t;
45
46size_t usb_interface_count_alternates(const uint8_t *, size_t, uint8_t);
47errno_t usb_alternate_interfaces_init(usb_alternate_interfaces_t *,
48 const uint8_t *, size_t, int);
49void usb_alternate_interfaces_deinit(usb_alternate_interfaces_t *);
50
51#endif
52/**
53 * @}
54 */
Note: See TracBrowser for help on using the repository browser.