3 * SPDX-License-Identifier: BSD-2-Clause-NetBSD
5 * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved.
6 * Copyright (c) 1998 Lennart Augustsson. All rights reserved.
7 * Copyright (c) 2008-2010 Hans Petter Selasky. All rights reserved.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * USB spec: http://www.usb.org/developers/docs/usbspec.zip
35 #ifndef USB_HUB_PRIVATE_H_
36 #define USB_HUB_PRIVATE_H_
37 #define UHUB_INTR_INTERVAL 250 /* ms */
41 #if USB_HAVE_TT_SUPPORT
42 UHUB_RESET_TT_TRANSFER,
48 struct uhub_current_state {
54 struct uhub_current_state sc_st; /* current state */
55 #if (USB_HAVE_FIXED_PORT != 0)
56 struct usb_hub sc_hub;
58 device_t sc_dev; /* base device */
59 struct mtx sc_mtx; /* our mutex */
60 struct usb_device *sc_udev; /* USB device */
61 struct usb_xfer *sc_xfer[UHUB_N_TRANSFER]; /* interrupt xfer */
62 #if USB_HAVE_DISABLE_ENUM
63 int sc_disable_enumeration;
64 int sc_disable_port_power;
66 uint8_t sc_usb_port_errors; /* error counter */
67 #define UHUB_USB_PORT_ERRORS_MAX 4
69 #define UHUB_FLAG_DID_EXPLORE 0x01
72 struct usb_device *udev;
78 uhub_find_iface_index(struct usb_hub *hub, device_t child,
79 struct hub_result *res);
81 device_probe_t uhub_probe;
82 device_attach_t uhub_attach;
83 device_detach_t uhub_detach;
84 bus_child_location_str_t uhub_child_location_string;