source: mainline/uspace/lib/usbhost/include/usb/host/utility.h@ 4db49344

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 4db49344 was 6271a34, checked in by Jenda <jenda.jzqk73@…>, 8 years ago

handle HS/SS max_packet_size

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/*
2 * Copyright (c) 2017 Ondrej Hlavaty <aearsis@eideo.cz>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28/** @addtogroup drvusbehci
29 * @{
30 */
31/** @file
32 * @brief USB host controller library: Utility functions.
33 *
34 * A mix of various functions that makes life of USB HC driver developers
35 * easier.
36 */
37#ifndef LIB_USBHOST_UTILITY
38#define LIB_USBHOST_UTILITY
39
40#include <usb/host/bus.h>
41#include <usb/host/usb_transfer_batch.h>
42#include <usb/descriptor.h>
43#include <usb/classes/hub.h>
44#include <usb/request.h>
45
46typedef void (*endpoint_reset_toggle_t)(endpoint_t *);
47
48uint16_t hc_get_ep0_initial_mps(usb_speed_t);
49int hc_get_ep0_max_packet_size(uint16_t *, bus_t *, device_t *);
50void hc_reset_toggles(const usb_transfer_batch_t *batch, endpoint_reset_toggle_t);
51int hc_setup_virtual_root_hub(hc_device_t *, usb_speed_t);
52int hc_get_device_desc(device_t *, usb_standard_device_descriptor_t *);
53int hc_get_hub_desc(device_t *, usb_hub_descriptor_header_t *);
54int hc_device_explore(device_t *);
55
56#endif
57/**
58 * @}
59 */
Note: See TracBrowser for help on using the repository browser.