| 1 | /*
|
|---|
| 2 | * Copyright (c) 2011 Vojtech Horky
|
|---|
| 3 | * Copyright (c) 2011 Jan Vesely
|
|---|
| 4 | * Copyright (c) 2018 Ondrej Hlavaty
|
|---|
| 5 | * All rights reserved.
|
|---|
| 6 | *
|
|---|
| 7 | * Redistribution and use in source and binary forms, with or without
|
|---|
| 8 | * modification, are permitted provided that the following conditions
|
|---|
| 9 | * are met:
|
|---|
| 10 | *
|
|---|
| 11 | * - Redistributions of source code must retain the above copyright
|
|---|
| 12 | * notice, this list of conditions and the following disclaimer.
|
|---|
| 13 | * - Redistributions in binary form must reproduce the above copyright
|
|---|
| 14 | * notice, this list of conditions and the following disclaimer in the
|
|---|
| 15 | * documentation and/or other materials provided with the distribution.
|
|---|
| 16 | * - The name of the author may not be used to endorse or promote products
|
|---|
| 17 | * derived from this software without specific prior written permission.
|
|---|
| 18 | *
|
|---|
| 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|---|
| 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|---|
| 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|---|
| 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|---|
| 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|---|
| 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|---|
| 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|---|
| 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|---|
| 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|---|
| 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|---|
| 29 | */
|
|---|
| 30 |
|
|---|
| 31 | /** @addtogroup drvusbhub
|
|---|
| 32 | * @{
|
|---|
| 33 | */
|
|---|
| 34 | /** @file
|
|---|
| 35 | * Hub port handling.
|
|---|
| 36 | */
|
|---|
| 37 |
|
|---|
| 38 | #ifndef DRV_USBHUB_PORT_H
|
|---|
| 39 | #define DRV_USBHUB_PORT_H
|
|---|
| 40 |
|
|---|
| 41 | #include <usb/dev/driver.h>
|
|---|
| 42 | #include <usb/classes/hub.h>
|
|---|
| 43 | #include <usb/port.h>
|
|---|
| 44 |
|
|---|
| 45 | typedef struct usb_hub_dev usb_hub_dev_t;
|
|---|
| 46 |
|
|---|
| 47 | /** Information about single port on a hub. */
|
|---|
| 48 | typedef struct {
|
|---|
| 49 | usb_port_t base;
|
|---|
| 50 | /* Parenting hub */
|
|---|
| 51 | usb_hub_dev_t *hub;
|
|---|
| 52 | /** Port number as reported in descriptors. */
|
|---|
| 53 | unsigned int port_number;
|
|---|
| 54 | /** Speed at the time of enabling the port */
|
|---|
| 55 | usb_speed_t speed;
|
|---|
| 56 | } usb_hub_port_t;
|
|---|
| 57 |
|
|---|
| 58 | void usb_hub_port_init(usb_hub_port_t *, usb_hub_dev_t *, unsigned int);
|
|---|
| 59 |
|
|---|
| 60 | void usb_hub_port_process_interrupt(usb_hub_port_t *port);
|
|---|
| 61 |
|
|---|
| 62 | #endif
|
|---|
| 63 |
|
|---|
| 64 | /**
|
|---|
| 65 | * @}
|
|---|
| 66 | */
|
|---|