source: mainline/uspace/lib/usbhost/include/usb/host/usb2_bus.h@ 5f0b366

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 5f0b366 was 5e2b1ae6, checked in by Ondřej Hlavatý <aearsis@…>, 7 years ago

usbhost: reserve default speed in library

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
2 * Copyright (c) 2011 Jan Vesely
3 * Copyright (c) 2017 Ondrej Hlavaty <aearsis@eideo.cz>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * - Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * - The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29/** @addtogroup libusbhost
30 * @{
31 */
32/** @file
33 *
34 * Bus implementation common for OHCI, UHCI and EHCI.
35 */
36#ifndef LIBUSBHOST_HOST_USB2_BUS_H
37#define LIBUSBHOST_HOST_USB2_BUS_H
38
39#include <adt/list.h>
40#include <stdbool.h>
41#include <usb/usb.h>
42
43#include <usb/host/bus.h>
44
45typedef struct usb2_bus usb2_bus_t;
46typedef struct endpoint endpoint_t;
47
48/** Endpoint management structure */
49typedef struct usb2_bus {
50 bus_t base; /**< Inheritance - keep this first */
51
52 /** Map of occupied addresses */
53 bool address_occupied [USB_ADDRESS_COUNT];
54 /** The last reserved address */
55 usb_address_t last_address;
56
57 /** Size of the bandwidth pool */
58 size_t free_bw;
59} usb2_bus_t;
60
61extern const bus_ops_t usb2_bus_ops;
62
63extern void usb2_bus_init(usb2_bus_t *, size_t);
64
65#endif
66/**
67 * @}
68 */
Note: See TracBrowser for help on using the repository browser.