FreeBSD kernel usb device Code
|
#include <sys/stdint.h>
#include <sys/stddef.h>
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/bus.h>
#include <sys/module.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/condvar.h>
#include <sys/sbuf.h>
#include <sys/sysctl.h>
#include <sys/sx.h>
#include <sys/unistd.h>
#include <sys/callout.h>
#include <sys/malloc.h>
#include <sys/priv.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdi_util.h>
#include <dev/usb/usb_core.h>
#include <dev/usb/usb_process.h>
#include <dev/usb/usb_device.h>
#include <dev/usb/usb_request.h>
#include <dev/usb/usb_debug.h>
#include <dev/usb/usb_hub.h>
#include <dev/usb/usb_util.h>
#include <dev/usb/usb_busdma.h>
#include <dev/usb/usb_transfer.h>
#include <dev/usb/usb_dynamic.h>
#include <dev/usb/usb_controller.h>
#include <dev/usb/usb_bus.h>
#include <dev/usb/usb_hub_private.h>
Go to the source code of this file.
Macros | |
#define | USB_DEBUG_VAR uhub_debug |
#define | UHUB_PROTO(sc) ((sc)->sc_udev->ddesc.bDeviceProtocol) |
#define | UHUB_IS_HIGH_SPEED(sc) (UHUB_PROTO(sc) != UDPROTO_FSHUB) |
#define | UHUB_IS_SINGLE_TT(sc) (UHUB_PROTO(sc) == UDPROTO_HSHUBSTT) |
#define | UHUB_IS_MULTI_TT(sc) (UHUB_PROTO(sc) == UDPROTO_HSHUBMTT) |
#define | UHUB_IS_SUPER_SPEED(sc) (UHUB_PROTO(sc) == UDPROTO_SSHUB) |
Functions | |
static void | usb_dev_resume_peer (struct usb_device *udev) |
static void | usb_dev_suspend_peer (struct usb_device *udev) |
static uint8_t | usb_peer_should_wakeup (struct usb_device *udev) |
DRIVER_MODULE (uhub, usbus, uhub_driver, uhub_devclass, 0, 0) | |
DRIVER_MODULE (uhub, uhub, uhub_driver, uhub_devclass, NULL, 0) | |
MODULE_VERSION (uhub, 1) | |
static void | uhub_intr_callback (struct usb_xfer *xfer, usb_error_t error) |
uint8_t | uhub_count_active_host_ports (struct usb_device *udev, enum usb_dev_speed speed) |
void | uhub_explore_handle_re_enumerate (struct usb_device *child) |
static usb_error_t | uhub_explore_sub (struct uhub_softc *sc, struct usb_port *up) |
static usb_error_t | uhub_read_port_status (struct uhub_softc *sc, uint8_t portno) |
static usb_error_t | uhub_reattach_port (struct uhub_softc *sc, uint8_t portno) |
static uint8_t | usb_device_20_compatible (struct usb_device *udev) |
static usb_error_t | uhub_suspend_resume_port (struct uhub_softc *sc, uint8_t portno) |
void | uhub_root_intr (struct usb_bus *bus, const uint8_t *ptr, uint8_t len) |
static uint8_t | uhub_is_too_deep (struct usb_device *udev) |
static usb_error_t | uhub_explore (struct usb_device *udev) |
int | uhub_probe (device_t dev) |
usb_error_t | uhub_query_info (struct usb_device *udev, uint8_t *pnports, uint8_t *ptt) |
int | uhub_attach (device_t dev) |
int | uhub_detach (device_t dev) |
static int | uhub_suspend (device_t dev) |
static int | uhub_resume (device_t dev) |
static void | uhub_driver_added (device_t dev, driver_t *driver) |
void | uhub_find_iface_index (struct usb_hub *hub, device_t child, struct hub_result *res) |
int | uhub_child_location (device_t parent, device_t child, struct sbuf *sb) |
int | uhub_get_device_path (device_t bus, device_t child, const char *locator, struct sbuf *sb) |
static int | uhub_child_pnpinfo (device_t parent, device_t child, struct sbuf *sb) |
static uint8_t | usb_intr_find_best_slot (usb_size_t *ptr, uint8_t start, uint8_t end, uint8_t mask) |
static uint8_t | usb_hs_bandwidth_adjust (struct usb_device *udev, int16_t len, uint8_t slot, uint8_t mask) |
void | usb_hs_bandwidth_alloc (struct usb_xfer *xfer) |
void | usb_hs_bandwidth_free (struct usb_xfer *xfer) |
uint16_t | usb_isoc_time_expand (struct usb_bus *bus, uint16_t isoc_time_curr) |
struct usb_device * | usb_bus_port_get_device (struct usb_bus *bus, struct usb_port *up) |
void | usb_bus_port_set_device (struct usb_bus *bus, struct usb_port *up, struct usb_device *udev, uint8_t device_index) |
void | usb_needs_explore (struct usb_bus *bus, uint8_t do_probe) |
void | usb_needs_explore_all (void) |
static void | usb_needs_explore_init (void *arg) |
SYSINIT (usb_needs_explore_init, SI_SUB_KICK_SCHEDULER, SI_ORDER_SECOND, usb_needs_explore_init, NULL) | |
static usb_error_t | usbd_device_30_remote_wakeup (struct usb_device *udev, uint8_t bRequest) |
static usb_error_t | usbd_clear_dev_wakeup (struct usb_device *udev) |
static usb_error_t | usbd_set_dev_wakeup (struct usb_device *udev) |
void | usbd_set_power_mode (struct usb_device *udev, uint8_t power_mode) |
uint8_t | usbd_filter_power_mode (struct usb_device *udev, uint8_t power_mode) |
void | usbd_start_re_enumerate (struct usb_device *udev) |
usb_error_t | usbd_start_set_config (struct usb_device *udev, uint8_t index) |
Variables | |
static device_suspend_t | uhub_suspend |
static device_resume_t | uhub_resume |
static bus_driver_added_t | uhub_driver_added |
static bus_child_pnpinfo_t | uhub_child_pnpinfo |
static usb_callback_t | uhub_intr_callback |
static const struct usb_config | uhub_config [UHUB_N_TRANSFER] |
static devclass_t | uhub_devclass |
static device_method_t | uhub_methods [] |
driver_t | uhub_driver |
#define UHUB_IS_HIGH_SPEED | ( | sc | ) | (UHUB_PROTO(sc) != UDPROTO_FSHUB) |
#define UHUB_IS_MULTI_TT | ( | sc | ) | (UHUB_PROTO(sc) == UDPROTO_HSHUBMTT) |
#define UHUB_IS_SINGLE_TT | ( | sc | ) | (UHUB_PROTO(sc) == UDPROTO_HSHUBSTT) |
#define UHUB_IS_SUPER_SPEED | ( | sc | ) | (UHUB_PROTO(sc) == UDPROTO_SSHUB) |
#define UHUB_PROTO | ( | sc | ) | ((sc)->sc_udev->ddesc.bDeviceProtocol) |
DRIVER_MODULE | ( | uhub | , |
uhub | , | ||
uhub_driver | , | ||
uhub_devclass | , | ||
NULL | , | ||
0 | |||
) |
DRIVER_MODULE | ( | uhub | , |
usbus | , | ||
uhub_driver | , | ||
uhub_devclass | , | ||
0 | , | ||
0 | |||
) |
MODULE_VERSION | ( | uhub | , |
1 | |||
) |
SYSINIT | ( | usb_needs_explore_init | , |
SI_SUB_KICK_SCHEDULER | , | ||
SI_ORDER_SECOND | , | ||
usb_needs_explore_init | , | ||
NULL | |||
) |
int uhub_attach | ( | device_t | dev | ) |
Definition at line 1190 of file usb_hub.c.
References usb_hub_descriptor::bNbrPorts, usb_hub_ss_descriptor::bNbrPorts, usb_hub_descriptor::bPwrOn2PwrGood, usb_hub_ss_descriptor::bPwrOn2PwrGood, usb_device::depth, dev, usb_attach_arg::device, usb_port::device_index, device_set_usb_desc(), DPRINTF, error, usb_hub::explore, usb_device::flags, usb_device::hub, usb_hub::hubsoftc, usb_hub::hubudev, usb_hub::nports, usb_device::parent_hub, usb_hub::portpower, usb_hub::ports, usb_port::restartcnt, uhub_softc::sc_dev, uhub_softc::sc_mtx, uhub_softc::sc_udev, uhub_softc::sc_xfer, usb_device_flags::self_powered, usb_device::speed, UHD_NOT_REMOV, UHD_PWRON_FACTOR, UHF_PORT_POWER, uhub_config, uhub_explore(), UHUB_INTR_TRANSFER, UHUB_IS_MULTI_TT, uhub_is_too_deep(), UHUB_N_TRANSFER, usb_extra_power_up_time, USB_MAX_PORTS, USB_MAX_POWER, USB_MIN_POWER, USB_MS_TO_TICKS, USB_MTX_LOCK, USB_MTX_UNLOCK, usb_pause_mtx(), USB_POWER_DOWN_TIME, USB_POWER_MODE_SAVE, USB_SPEED_FULL, USB_SPEED_HIGH, USB_SPEED_LOW, USB_SPEED_SUPER, usbd_errstr(), usbd_req_clear_port_feature(), usbd_req_get_hub_descriptor(), usbd_req_get_ss_hub_descriptor(), usbd_req_set_hub_depth(), usbd_req_set_port_feature(), usbd_set_alt_interface_index(), usbd_set_power_mode(), usbd_transfer_setup(), usbd_transfer_start(), and usbd_transfer_unsetup().
int uhub_child_location | ( | device_t | parent, |
device_t | child, | ||
struct sbuf * | sb | ||
) |
Definition at line 1638 of file usb_hub.c.
References usb_bus::bdev, usb_device::bus, child, usb_device::device_index, DPRINTF, usb_device::hub, hub_result::iface_index, usb_device::parent_hub, hub_result::portno, uhub_softc::sc_udev, hub_result::udev, uhub_find_iface_index(), and USB_HAVE_UGEN.
|
static |
Definition at line 1709 of file usb_hub.c.
References usb_device_descriptor::bcdDevice, usb_device_descriptor::bDeviceClass, usb_device_descriptor::bDeviceProtocol, usb_device_descriptor::bDeviceSubClass, usb_interface_descriptor::bInterfaceClass, usb_interface_descriptor::bInterfaceProtocol, usb_interface_descriptor::bInterfaceSubClass, child, usb_device::ddesc, DPRINTF, usb_device::flags, usb_device::hub, usb_interface::idesc, usb_device_descriptor::idProduct, usb_device_descriptor::idVendor, hub_result::iface_index, usb_interface::pnpinfo, uhub_softc::sc_udev, hub_result::udev, UGETW, uhub_find_iface_index(), usb_get_serial(), usb_device_flags::usb_mode, USB_MODE_HOST, usbd_ctrl_lock(), usbd_ctrl_unlock(), and usbd_get_iface().
uint8_t uhub_count_active_host_ports | ( | struct usb_device * | udev, |
enum usb_dev_speed | speed | ||
) |
Definition at line 386 of file usb_hub.c.
References usb_device::bus, child, usb_device::hub, usb_hub::hubsoftc, usb_hub::nports, usb_hub::ports, usb_bus_port_get_device(), and USB_MODE_HOST.
Referenced by usbd_req_re_enumerate().
int uhub_detach | ( | device_t | dev | ) |
Definition at line 1536 of file usb_hub.c.
References usb_device::bus, bus, child, dev, usb_device::hub, usb_hub::nports, usb_hub::ports, uhub_softc::sc_mtx, uhub_softc::sc_udev, uhub_softc::sc_xfer, UHUB_N_TRANSFER, USB_BUS_LOCK, usb_bus_port_get_device(), USB_BUS_TT_PROC, USB_BUS_UNLOCK, usb_free_device(), usb_proc_mwait(), and usbd_transfer_unsetup().
|
static |
Definition at line 1599 of file usb_hub.c.
References usb_needs_explore_all().
|
static |
Definition at line 995 of file usb_hub.c.
References usb_device::address, DPRINTF, usb_device::flags, usb_device::hub, usb_hub::hubsoftc, usb_hub::nports, uhub_current_state::port_change, uhub_current_state::port_status, usb_hub::ports, usb_port::restartcnt, uhub_softc::sc_flags, uhub_softc::sc_st, usb_device_flags::self_suspended, UHF_C_PORT_ENABLE, UHF_C_PORT_OVER_CURRENT, uhub_explore_sub(), UHUB_FLAG_DID_EXPLORE, uhub_is_too_deep(), uhub_read_port_status(), uhub_reattach_port(), uhub_suspend_resume_port(), UPS_C_CONNECT_STATUS, UPS_C_OVERCURRENT_INDICATOR, UPS_C_PORT_ENABLED, UPS_C_PORT_LINK_STATE, UPS_C_SUSPEND, UPS_PORT_ENABLED, USB_ERR_NORMAL_COMPLETION, USB_ERR_TOO_DEEP, USB_RESTART_MAX, usbd_enum_lock(), usbd_enum_unlock(), and usbd_req_clear_port_feature().
Referenced by uhub_attach().
void uhub_explore_handle_re_enumerate | ( | struct usb_device * | child | ) |
Definition at line 417 of file usb_hub.c.
References child, DPRINTF, UHF_PORT_ENABLE, usb_get_langid(), USB_IFACE_INDEX_ANY, USB_MODE_HOST, usb_probe_and_attach(), USB_RE_ENUM_DONE, USB_RE_ENUM_PWR_OFF, USB_RE_ENUM_SET_CONFIG, USB_RE_ENUM_START, usb_set_device_strings(), USB_UNCONFIG_INDEX, usbd_enum_lock(), usbd_enum_unlock(), usbd_errstr(), usbd_req_clear_port_feature(), usbd_req_re_enumerate(), and usbd_set_config_index().
Referenced by uhub_explore_sub(), and usb_bus_explore().
|
static |
Definition at line 510 of file usb_hub.c.
References usb_device::bus, bus, child, usb_bus::driver_added_refcount, usb_device::refcount, uhub_softc::sc_udev, uhub_explore_handle_re_enumerate(), usb_bus_port_get_device(), USB_ERR_NORMAL_COMPLETION, USB_IFACE_INDEX_ANY, USB_MODE_DEVICE, usb_probe_and_attach(), and usbd_ctrl_transfer_setup().
Referenced by uhub_explore().
void uhub_find_iface_index | ( | struct usb_hub * | hub, |
device_t | child, | ||
struct hub_result * | res | ||
) |
Definition at line 1605 of file usb_hub.c.
References usb_device::bus, child, usb_device::hub, usb_hub::hubudev, hub_result::iface_index, usb_hub::nports, hub_result::portno, usb_hub::ports, usb_interface::subdev, hub_result::udev, usb_bus_port_get_device(), USB_IFACE_MAX, and usbd_get_iface().
Referenced by acpi_uhub_read_ivar(), uhub_child_location(), uhub_child_pnpinfo(), and uhub_get_device_path().
int uhub_get_device_path | ( | device_t | bus, |
device_t | child, | ||
const char * | locator, | ||
struct sbuf * | sb | ||
) |
Definition at line 1676 of file usb_hub.c.
References bus, child, usb_device::hub, hub_result::iface_index, hub_result::portno, uhub_softc::sc_udev, hub_result::udev, and uhub_find_iface_index().
|
static |
Definition at line 188 of file usb_hub.c.
References usb_device::bus, usb_xfer::error, uhub_softc::sc_udev, USB_ERR_CANCELLED, USB_GET_STATE, usb_needs_explore(), USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_transfer_submit(), usbd_xfer_max_len(), usbd_xfer_set_frame_len(), usbd_xfer_set_stall(), and usbd_xfer_softc().
|
static |
Definition at line 968 of file usb_hub.c.
References usb_device::depth, usb_device::speed, USB_HUB_MAX_DEPTH, USB_SPEED_FULL, USB_SPEED_HIGH, USB_SPEED_LOW, USB_SPEED_SUPER, and USB_SS_HUB_DEPTH_MAX.
Referenced by uhub_attach(), and uhub_explore().
int uhub_probe | ( | device_t | dev | ) |
Definition at line 1110 of file usb_hub.c.
References usbd_lookup_info::bConfigIndex, usbd_lookup_info::bDeviceClass, dev, usb_attach_arg::info, UDCLASS_HUB, usb_attach_arg::usb_mode, and USB_MODE_HOST.
usb_error_t uhub_query_info | ( | struct usb_device * | udev, |
uint8_t * | pnports, | ||
uint8_t * | ptt | ||
) |
Definition at line 1130 of file usb_hub.c.
References usb_device_descriptor::bDeviceClass, usb_hub_descriptor::bNbrPorts, usb_hub_ss_descriptor::bNbrPorts, usb_device::ddesc, usb_device::speed, UDCLASS_HUB, UGETW, USB_ERR_INVAL, USB_SPEED_FULL, USB_SPEED_HIGH, USB_SPEED_LOW, USB_SPEED_SUPER, usbd_errstr(), usbd_req_get_hub_descriptor(), usbd_req_get_ss_hub_descriptor(), and usb_hub_descriptor::wHubCharacteristics.
Referenced by xhci_device_state_change().
|
static |
Definition at line 560 of file usb_hub.c.
References uhub_current_state::port_change, uhub_current_state::port_status, uhub_softc::sc_st, uhub_softc::sc_udev, uhub_softc::sc_usb_port_errors, UGETW, UHUB_USB_PORT_ERRORS_MAX, USB_ERR_TIMEOUT, usbd_errstr(), usbd_req_get_port_status(), usb_port_status::wPortChange, and usb_port_status::wPortStatus.
Referenced by uhub_explore(), uhub_reattach_port(), and uhub_suspend_resume_port().
|
static |
Definition at line 602 of file usb_hub.c.
References usb_device::bus, child, usb_device::depth, DPRINTF, error, usb_device::flags, usb_device::hub, usb_device::parent_hub, uhub_current_state::port_change, uhub_current_state::port_status, usb_hub::ports, uhub_softc::sc_dev, uhub_softc::sc_st, uhub_softc::sc_udev, usb_device::speed, UHF_C_PORT_CONNECTION, UHF_PORT_ENABLE, UHF_PORT_SUSPEND, uhub_read_port_status(), UPS_C_CONNECT_STATUS, UPS_CURRENT_CONNECT_STATUS, UPS_HIGH_SPEED, UPS_LOW_SPEED, UPS_OTHER_SPEED, UPS_PORT_ENABLED, UPS_PORT_MODE_DEVICE, UPS_PORT_POWER, UPS_PORT_POWER_SS, UPS_SUSPEND, usb_alloc_device(), usb_bus_port_get_device(), usb_free_device(), usb_device_flags::usb_mode, USB_MODE_DEVICE, USB_MODE_HOST, USB_MS_TO_TICKS, usb_pause_mtx(), usb_port_powerup_delay, USB_SPEED_FULL, USB_SPEED_HIGH, USB_SPEED_LOW, USB_SPEED_SUPER, usbd_errstr(), usbd_req_clear_port_feature(), usbd_req_reset_port(), usbd_req_set_hub_u1_timeout(), and usbd_req_set_hub_u2_timeout().
Referenced by uhub_explore().
|
static |
void uhub_root_intr | ( | struct usb_bus * | bus, |
const uint8_t * | ptr, | ||
uint8_t | len | ||
) |
Definition at line 960 of file usb_hub.c.
References usb_device::bus, USB_BUS_LOCK_ASSERT, and usb_needs_explore().
Referenced by atmegadci_root_intr(), avr32dci_root_intr(), dwc_otg_root_intr(), ehci_root_intr(), musbotg_root_intr(), ohci_root_intr(), uhci_root_intr(), uss820dci_root_intr(), and xhci_root_intr().
|
static |
|
static |
Definition at line 876 of file usb_hub.c.
References usb_device::bus, child, DPRINTF, usb_device::hub, uhub_current_state::port_status, usb_hub::ports, uhub_softc::sc_st, uhub_softc::sc_udev, UHF_C_PORT_LINK_STATE, UHF_C_PORT_SUSPEND, uhub_read_port_status(), UPS_PORT_LINK_STATE_GET, UPS_PORT_LS_SS_INA, UPS_PORT_LS_U3, UPS_SUSPEND, usb_bus_port_get_device(), usb_dev_resume_peer(), usb_dev_suspend_peer(), usb_device_20_compatible(), USB_MODE_DEVICE, usbd_req_clear_port_feature(), and usbd_req_warm_reset_port().
Referenced by uhub_explore().
struct usb_device * usb_bus_port_get_device | ( | struct usb_bus * | bus, |
struct usb_port * | up | ||
) |
Definition at line 2193 of file usb_hub.c.
References usb_device::bus, usb_port::device_index, and usb_bus::devices.
Referenced by uhub_count_active_host_ports(), uhub_detach(), uhub_explore_sub(), uhub_find_iface_index(), uhub_reattach_port(), uhub_suspend_resume_port(), and usb_dev_suspend_peer().
void usb_bus_port_set_device | ( | struct usb_bus * | bus, |
struct usb_port * | up, | ||
struct usb_device * | udev, | ||
uint8_t | device_index | ||
) |
Definition at line 2212 of file usb_hub.c.
References usb_device::bus, usb_device::device_index, usb_port::device_index, usb_bus::devices, and usb_ref_lock.
Referenced by usb_alloc_device(), and usb_free_device().
|
static |
Definition at line 2639 of file usb_hub.c.
References usb_device::bus, bus, DPRINTF, usb_device::flags, usb_power_save::last_xfer_time, usb_device::parent_hub, usb_device::port_no, usb_device::pwr_save, usb_device_flags::remote_wakeup, usb_device_flags::self_suspended, usb_power_save::type_refs, UE_BULK, UE_CONTROL, UE_INTERRUPT, UE_ISOCHRONOUS, UHF_PORT_SUSPEND, UPS_PORT_LS_U0, USB_BUS_LOCK, USB_BUS_UNLOCK, usb_dev_resume_peer(), usb_device_20_compatible(), USB_HW_POWER_BULK, USB_HW_POWER_CONTROL, USB_HW_POWER_INTERRUPT, USB_HW_POWER_ISOC, usb_device_flags::usb_mode, USB_MODE_DEVICE, USB_MS_TO_TICKS, usb_pause_mtx(), usb_peer_can_wakeup(), usb_port_resume_delay, usb_suspend_resume(), usbd_clear_dev_wakeup(), usbd_errstr(), usbd_req_clear_port_feature(), usbd_req_set_port_link_state(), usbd_sr_lock(), and usbd_sr_unlock().
Referenced by uhub_suspend_resume_port(), usb_dev_resume_peer(), and usb_dev_suspend_peer().
|
static |
Definition at line 2748 of file usb_hub.c.
References usb_device::bus, child, usb_bus_methods::device_suspend, DPRINTF, usb_device::flags, usb_device::hub, usb_bus::methods, usb_hub::nports, usb_device::parent_hub, usb_device::port_no, usb_hub::ports, usb_device_flags::self_suspended, UHF_PORT_SUSPEND, UPS_PORT_LS_U3, USB_BUS_LOCK, usb_bus_port_get_device(), USB_BUS_UNLOCK, usb_dev_resume_peer(), usb_device_20_compatible(), usb_device_flags::usb_mode, USB_MODE_DEVICE, USB_MS_TO_TICKS, usb_pause_mtx(), usb_peer_can_wakeup(), usb_peer_should_wakeup(), usb_port_resume_delay, usb_suspend_resume(), usbd_clear_dev_wakeup(), usbd_get_dma_delay(), usbd_req_clear_port_feature(), usbd_req_set_port_feature(), usbd_req_set_port_link_state(), usbd_set_dev_wakeup(), usbd_sr_lock(), and usbd_sr_unlock().
Referenced by uhub_suspend_resume_port().
|
static |
Definition at line 854 of file usb_hub.c.
References usb_device::speed, USB_SPEED_FULL, USB_SPEED_HIGH, and USB_SPEED_LOW.
Referenced by uhub_suspend_resume_port(), usb_dev_resume_peer(), usb_dev_suspend_peer(), usbd_clear_dev_wakeup(), and usbd_set_dev_wakeup().
|
static |
Definition at line 1850 of file usb_hub.c.
References usb_device::bus, bus, usb_device::hub, len, usb_device::parent_hs_hub, slot, usb_hub::uframe_usage, USB_BUS_LOCK_ASSERT, USB_FS_ISOC_UFRAME_MAX, USB_HS_MICRO_FRAMES_MAX, usb_intr_find_best_slot(), USB_SPEED_FULL, USB_SPEED_LOW, and usbd_get_speed().
Referenced by usb_hs_bandwidth_alloc(), and usb_hs_bandwidth_free().
void usb_hs_bandwidth_alloc | ( | struct usb_xfer * | xfer | ) |
Definition at line 1908 of file usb_hub.c.
References usb_endpoint_descriptor::bmAttributes, usb_endpoint::edesc, usb_xfer::endpoint, usb_device::flags, usb_xfer::max_frame_size, usb_endpoint::refcount_bw, slot, usb_device::speed, usb_xfer_root::udev, UE_INTERRUPT, UE_ISOCHRONOUS, UE_XFERTYPE, usb_endpoint::usb_cmask, usb_hs_bandwidth_adjust(), USB_HS_MICRO_FRAMES_MAX, usb_device_flags::usb_mode, USB_MODE_HOST, usb_endpoint::usb_smask, USB_SPEED_FULL, USB_SPEED_LOW, usb_endpoint::usb_uframe, usbd_get_speed(), usbd_xfer_get_fps_shift(), and usb_xfer::xroot.
Referenced by ehci_device_intr_open(), and ehci_device_isoc_hs_open().
void usb_hs_bandwidth_free | ( | struct usb_xfer * | xfer | ) |
Definition at line 1989 of file usb_hub.c.
References usb_endpoint_descriptor::bmAttributes, usb_endpoint::edesc, usb_xfer::endpoint, usb_device::flags, usb_xfer::max_frame_size, usb_endpoint::refcount_bw, slot, usb_xfer_root::udev, UE_INTERRUPT, UE_ISOCHRONOUS, UE_XFERTYPE, usb_endpoint::usb_cmask, usb_hs_bandwidth_adjust(), usb_device_flags::usb_mode, USB_MODE_HOST, usb_endpoint::usb_smask, usb_endpoint::usb_uframe, and usb_xfer::xroot.
Referenced by ehci_device_intr_close(), and ehci_device_isoc_hs_close().
|
static |
Definition at line 1802 of file usb_hub.c.
References start.
Referenced by usb_hs_bandwidth_adjust().
uint16_t usb_isoc_time_expand | ( | struct usb_bus * | bus, |
uint16_t | isoc_time_curr | ||
) |
Definition at line 2037 of file usb_hub.c.
References usb_device::bus, usb_bus::isoc_time_last, USB_BUS_LOCK_ASSERT, and USB_ISOC_TIME_MAX.
Referenced by usbd_xfer_get_isochronous_start_frame().
void usb_needs_explore | ( | struct usb_bus * | bus, |
uint8_t | do_probe | ||
) |
Definition at line 2255 of file usb_hub.c.
References usb_device::bus, usb_bus::bus_mtx, usb_bus::devices, usb_bus::do_probe, DPRINTF, usb_bus::explore_msg, USB_BUS_LOCK, USB_BUS_UNLOCK, usb_proc_msignal(), and USB_ROOT_HUB_ADDR.
Referenced by uhub_intr_callback(), uhub_root_intr(), usb_attach_sub(), usb_handle_request_callback(), usb_needs_explore_all(), usbd_set_power_mode(), usbd_start_re_enumerate(), and usbd_start_set_config().
void usb_needs_explore_all | ( | void | ) |
Definition at line 2300 of file usb_hub.c.
References bus, dev, usb_devclass_ptr, and usb_needs_explore().
Referenced by uhub_driver_added(), and usb_needs_explore_init().
|
static |
Definition at line 2337 of file usb_hub.c.
References usb_needs_explore_all().
|
static |
Definition at line 2453 of file usb_hub.c.
References usb_device::bus, usb_bus::driver_added_refcount, usb_device::driver_added_refcount, usb_device::flags, usb_device::power_mode, usb_device::pwr_save, usb_device::re_enumerate_wait, usb_power_save::read_refs, usb_power_save::type_refs, UE_ISOCHRONOUS, usb_device_flags::usb_mode, USB_MODE_HOST, usb_peer_can_wakeup(), USB_POWER_MODE_ON, USB_RE_ENUM_DONE, and usb_power_save::write_refs.
Referenced by usb_dev_suspend_peer().
|
static |
Definition at line 2603 of file usb_hub.c.
References UF_DEVICE_REMOTE_WAKEUP, UR_CLEAR_FEATURE, usb_device_20_compatible(), usbd_device_30_remote_wakeup(), and usbd_req_clear_device_feature().
Referenced by usb_dev_resume_peer(), and usb_dev_suspend_peer().
|
static |
Definition at line 2589 of file usb_hub.c.
References usb_device_request::bRequest, req, USB_INTERFACE_FUNC_SUSPEND, USB_INTERFACE_FUNC_SUSPEND_LP, USB_INTERFACE_FUNC_SUSPEND_RW, usbd_do_request, USETW, and UT_WRITE_INTERFACE.
Referenced by usbd_clear_dev_wakeup(), and usbd_set_dev_wakeup().
uint8_t usbd_filter_power_mode | ( | struct usb_device * | udev, |
uint8_t | power_mode | ||
) |
Definition at line 2920 of file usb_hub.c.
References usb_device::bus, usb_bus_methods::get_power_mode, and usb_bus::methods.
Referenced by usb_alloc_device(), and usbd_set_power_mode().
|
static |
Definition at line 2618 of file usb_hub.c.
References UF_DEVICE_REMOTE_WAKEUP, UR_SET_FEATURE, usb_device_20_compatible(), usbd_device_30_remote_wakeup(), and usbd_req_set_device_feature().
Referenced by usb_dev_suspend_peer().
void usbd_set_power_mode | ( | struct usb_device * | udev, |
uint8_t | power_mode | ||
) |
Definition at line 2896 of file usb_hub.c.
References usb_device::bus, usb_device::power_mode, usb_bus_power_update(), usb_needs_explore(), USB_POWER_MODE_OFF, USB_POWER_MODE_ON, USB_POWER_MODE_SAVE, and usbd_filter_power_mode().
Referenced by cfumass_attach(), uhub_attach(), usie_attach(), and ustorage_fs_attach().
void usbd_start_re_enumerate | ( | struct usb_device * | udev | ) |
Definition at line 2947 of file usb_hub.c.
References usb_device::bus, usb_device::re_enumerate_wait, usb_needs_explore(), USB_RE_ENUM_DONE, and USB_RE_ENUM_START.
Referenced by usb_do_clear_stall_callback().
usb_error_t usbd_start_set_config | ( | struct usb_device * | udev, |
uint8_t | index | ||
) |
Definition at line 2963 of file usb_hub.c.
References usb_device::bus, usb_device::curr_config_index, index, usb_device::next_config_index, usb_device::re_enumerate_wait, USB_ERR_PENDING_REQUESTS, usb_needs_explore(), USB_RE_ENUM_DONE, and USB_RE_ENUM_SET_CONFIG.
|
static |
Definition at line 132 of file usb_hub.c.
Referenced by uhub_attach().
driver_t uhub_driver |
|
static |
|
static |