1/*
2 * Copyright (c) 2007-2013 ETH Zurich.
3 * All rights reserved.
4 *
5 * This file is distributed under the terms in the attached LICENSE file.
6 * If you do not find this file, copies can be found by writing to:
7 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
8 */
9
10#ifndef _USB_INTERFACE_H_
11#define _USB_INTERFACE_H_
12
13
14/*
15 * ------------------------------------------------------------------------
16 * USB Interface
17 * ------------------------------------------------------------------------
18 * This data structure defines an USB tendpoint reflecting the state on a
19 * physical endpoint on the device.
20 *
21 * Fields:
22 *  - descriptor        pointer to the interface descriptor
23 *  - alt_setting       alternative setting for this iface
24 *  - iface_index       interface index of this interface
25 *  - device            pointer to the device
26 *  - num_endpoints     the number of endpoints for this interface
27 *  - endpoints         array of pointer to the endpoints of this iface
28 */
29struct usb_interface
30{
31    struct usb_interface_descriptor *descriptor;
32    uint8_t alt_setting;
33    uint8_t parent_iface_index;
34    uint8_t iface_index;
35
36    struct usb_device *device;
37
38    uint8_t num_endpoints;
39
40    struct usb_endpoint endpoints[USB_ENDPOINT_MAX];
41
42};
43
44#define USB_INTERFACE_INDEX_ANY 0xFF
45
46#endif
47