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/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/usb_core.h>
#include <dev/usb/usb_debug.h>
#include <dev/usb/usb_busdma.h>
#include <dev/usb/usb_process.h>
#include <dev/usb/usb_transfer.h>
#include <dev/usb/usb_device.h>
#include <dev/usb/usb_hub.h>
#include <dev/usb/usb_util.h>
#include <dev/usb/usb_controller.h>
#include <dev/usb/usb_bus.h>
#include <dev/usb/controller/uhci.h>
#include <dev/usb/controller/uhcireg.h>
Go to the source code of this file.
Data Structures | |
struct | uhci_mem_layout |
struct | uhci_std_temp |
Macros | |
#define | USB_DEBUG_VAR uhcidebug |
#define | alt_next next |
#define | UHCI_BUS2SC(bus) __containerof(bus, uhci_softc_t, sc_bus) |
#define | UBARR(sc) |
#define | UWRITE1(sc, r, x) |
#define | UWRITE2(sc, r, x) |
#define | UWRITE4(sc, r, x) |
#define | UREAD1(sc, r) (UBARR(sc), bus_space_read_1((sc)->sc_io_tag, (sc)->sc_io_hdl, (r))) |
#define | UREAD2(sc, r) (UBARR(sc), bus_space_read_2((sc)->sc_io_tag, (sc)->sc_io_hdl, (r))) |
#define | UREAD4(sc, r) (UBARR(sc), bus_space_read_4((sc)->sc_io_tag, (sc)->sc_io_hdl, (r))) |
#define | UHCICMD(sc, cmd) UWRITE2(sc, UHCI_CMD, cmd) |
#define | UHCISTS(sc) UREAD2(sc, UHCI_STS) |
#define | UHCI_RESET_TIMEOUT 100 /* ms, reset timeout */ |
#define | UHCI_INTR_ENDPT 1 |
#define | UHCI_APPEND_TD(std, last) (last) = _uhci_append_td(std,last) |
#define | UHCI_APPEND_QH(sqh, last) (last) = _uhci_append_qh(sqh,last) |
#define | UHCI_REMOVE_TD(std, last) (last) = _uhci_remove_td(std,last) |
#define | UHCI_REMOVE_QH(sqh, last) (last) = _uhci_remove_qh(sqh,last) |
#define | C(x, y) ((x) | ((y) << 8)) |
Variables | |
static const struct usb_bus_methods | uhci_bus_methods |
static const struct usb_pipe_methods | uhci_device_bulk_methods |
static const struct usb_pipe_methods | uhci_device_ctrl_methods |
static const struct usb_pipe_methods | uhci_device_intr_methods |
static const struct usb_pipe_methods | uhci_device_isoc_methods |
static const struct usb_device_descriptor | uhci_devd |
static const struct uhci_config_desc | uhci_confd |
static const struct usb_hub_descriptor_min | uhci_hubd_piix |
#define C | ( | x, | |
y | |||
) | ((x) | ((y) << 8)) |
#define UBARR | ( | sc | ) |
#define UHCI_APPEND_QH | ( | sqh, | |
last | |||
) | (last) = _uhci_append_qh(sqh,last) |
#define UHCI_APPEND_TD | ( | std, | |
last | |||
) | (last) = _uhci_append_td(std,last) |
#define UHCI_BUS2SC | ( | bus | ) | __containerof(bus, uhci_softc_t, sc_bus) |
#define UHCI_REMOVE_QH | ( | sqh, | |
last | |||
) | (last) = _uhci_remove_qh(sqh,last) |
#define UHCI_REMOVE_TD | ( | std, | |
last | |||
) | (last) = _uhci_remove_td(std,last) |
#define UWRITE1 | ( | sc, | |
r, | |||
x | |||
) |
#define UWRITE2 | ( | sc, | |
r, | |||
x | |||
) |
#define UWRITE4 | ( | sc, | |
r, | |||
x | |||
) |
Definition at line 917 of file uhci.c.
References uhci_qh::h_next, uhci_qh::h_prev, uhci_qh::page_cache, uhci_qh::qh_h_next, uhci_qh::qh_self, and usb_pc_cpu_flush().
Definition at line 891 of file uhci.c.
References uhci_td::next, uhci_td::page_cache, uhci_td::prev, uhci_td::td_next, uhci_td::td_self, and usb_pc_cpu_flush().
Definition at line 973 of file uhci.c.
References uhci_qh::h_next, uhci_qh::h_prev, uhci_qh::page_cache, uhci_qh::qh_h_next, and usb_pc_cpu_flush().
Definition at line 953 of file uhci.c.
References uhci_td::next, uhci_td::page_cache, uhci_td::prev, uhci_td::td_next, and usb_pc_cpu_flush().
|
static |
Definition at line 831 of file uhci.c.
References uhci_qh::page_cache, uhci_qh::qh_h_next, uhci_qh::qh_self, uhci_softc::sc_last_qh_p, uhci_softc::sc_loops, uhci_softc::sc_reclaim_qh_p, and usb_pc_cpu_flush().
Referenced by uhci_device_bulk_start(), and uhci_device_resume().
|
static |
Definition at line 1295 of file uhci.c.
References usb_xfer::endpoint, usb_xfer::flags_int, usb_endpoint::methods, uhci_td::page_cache, usb_xfer_flags_int::short_frames_ok, status, uhci_td::td_status, uhci_td::td_token, usb_xfer::td_transfer_cache, usb_xfer::td_transfer_first, usb_xfer::td_transfer_last, uhci_check_transfer_sub(), uhci_device_done(), uhci_device_isoc_methods, uhci_non_isoc_done(), UHCI_PTR_T, UHCI_TD_ACTIVE, UHCI_TD_GET_ACTLEN, UHCI_TD_STALLED, USB_ERR_NORMAL_COMPLETION, and usb_pc_cpu_invalidate().
Referenced by uhci_interrupt_poll(), and uhci_transfer_intr_enqueue().
|
static |
Definition at line 1236 of file uhci.c.
References usb_xfer_flags_int::control_xfr, usb_xfer_flags_int::curr_dma_set, usb_xfer::flags_int, uhci_td::obj_next, uhci_td::page_cache, uhci_qh::page_cache, uhci_qh::qh_e_next, usb_xfer::qh_start, td_self, uhci_td::td_self, td_token, uhci_td::td_token, usb_xfer::td_transfer_cache, usb_xfer::td_transfer_last, UHCI_TD_SET_DT, and usb_pc_cpu_flush().
Referenced by uhci_check_transfer().
|
static |
Definition at line 1876 of file uhci.c.
References uhci_device_done(), and USB_ERR_CANCELLED.
|
static |
|
static |
|
static |
Definition at line 1888 of file uhci.c.
References usb_xfer_flags_int::bandwidth_reclaimed, usb_xfer_root::bus, usb_xfer_flags_int::curr_dma_set, uhci_qh::e_next, usb_device::flags, usb_xfer::flags_int, uhci_qh::page_cache, uhci_qh::qh_e_next, usb_xfer::qh_start, uhci_softc::sc_bulk_p_last, usb_device_flags::self_suspended, uhci_td::td_self, usb_xfer_root::udev, uhci_add_loop(), UHCI_APPEND_QH, UHCI_BUS2SC, uhci_setup_standard_chain(), uhci_transfer_intr_enqueue(), usb_pc_cpu_flush(), and usb_xfer::xroot.
|
static |
Definition at line 1933 of file uhci.c.
References uhci_device_done(), and USB_ERR_CANCELLED.
|
static |
|
static |
|
static |
Definition at line 1945 of file uhci.c.
References usb_xfer_root::bus, usb_xfer_flags_int::curr_dma_set, uhci_qh::e_next, usb_device::flags, usb_xfer::flags_int, uhci_qh::page_cache, uhci_qh::qh_e_next, usb_xfer::qh_start, uhci_softc::sc_fs_ctl_p_last, uhci_softc::sc_ls_ctl_p_last, usb_device_flags::self_suspended, usb_device::speed, uhci_td::td_self, usb_xfer_root::udev, UHCI_APPEND_QH, UHCI_BUS2SC, uhci_setup_standard_chain(), uhci_transfer_intr_enqueue(), usb_pc_cpu_flush(), USB_SPEED_LOW, and usb_xfer::xroot.
|
static |
Definition at line 1818 of file uhci.c.
References usb_xfer_flags_int::bandwidth_reclaimed, usb_xfer_root::bus, usb_xfer_flags_int::curr_dma_set, usb_xfer::endpoint, error, usb_xfer::flags_int, usb_endpoint::methods, uhci_qh::page_cache, usb_xfer::qh_pos, usb_xfer::qh_start, uhci_softc::sc_bulk_p_last, uhci_softc::sc_bus, uhci_softc::sc_fs_ctl_p_last, uhci_softc::sc_intr_p_last, uhci_softc::sc_ls_ctl_p_last, usb_device::speed, usb_xfer::td_transfer_first, usb_xfer::td_transfer_last, usb_xfer_root::udev, UHCI_BUS2SC, uhci_device_bulk_methods, uhci_device_ctrl_methods, uhci_device_intr_methods, uhci_device_isoc_methods, uhci_isoc_done(), uhci_rem_loop(), UHCI_REMOVE_QH, USB_BUS_LOCK_ASSERT, usb_pc_cpu_invalidate(), USB_SPEED_LOW, usbd_transfer_done(), and usb_xfer::xroot.
Referenced by uhci_check_transfer(), uhci_device_bulk_close(), uhci_device_ctrl_close(), uhci_device_intr_close(), uhci_device_isoc_close(), uhci_non_isoc_done(), and uhci_timeout().
|
static |
Definition at line 2022 of file uhci.c.
References usb_xfer_root::bus, usb_xfer::qh_pos, uhci_softc::sc_intr_stat, UHCI_BUS2SC, uhci_device_done(), USB_ERR_CANCELLED, and usb_xfer::xroot.
|
static |
|
static |
Definition at line 1989 of file uhci.c.
References usb_xfer_root::bus, usb_xfer::interval, usb_xfer::qh_pos, uhci_softc::sc_intr_stat, UHCI_BUS2SC, UHCI_IFRAMELIST_COUNT, and usb_xfer::xroot.
|
static |
Definition at line 2038 of file uhci.c.
References usb_xfer_root::bus, usb_xfer_flags_int::curr_dma_set, uhci_qh::e_next, usb_device::flags, usb_xfer::flags_int, uhci_qh::page_cache, uhci_qh::qh_e_next, usb_xfer::qh_pos, usb_xfer::qh_start, uhci_softc::sc_intr_p_last, usb_device_flags::self_suspended, uhci_td::td_self, usb_xfer_root::udev, UHCI_APPEND_QH, UHCI_BUS2SC, uhci_setup_standard_chain(), uhci_transfer_intr_enqueue(), usb_pc_cpu_flush(), and usb_xfer::xroot.
|
static |
Definition at line 2103 of file uhci.c.
References uhci_device_done(), and USB_ERR_CANCELLED.
|
static |
Definition at line 2109 of file uhci.c.
References usb_xfer_root::bus, usb_xfer_flags_int::curr_dma_set, DPRINTF, usb_xfer::endpoint, uhci_td::fix_pc, usb_xfer::flags_int, usb_xfer::frlengths, usb_endpoint::isoc_next, uhci_td::len, usb_xfer::max_frame_size, usb_xfer::nframes, uhci_td::obj_next, uhci_td::page_cache, plen, usb_xfer::qh_pos, uhci_td::td_buffer, usb_xfer::td_start, uhci_td::td_status, uhci_td::td_token, usb_xfer::td_transfer_first, usb_xfer::td_transfer_last, UHCI_APPEND_TD, UHCI_BUS2SC, UHCI_FRNUM, uhci_mem_layout_fixup(), uhci_mem_layout_init(), UHCI_TD_ACTIVE, UHCI_TD_IOC, UHCI_TD_IOS, UHCI_TD_MAXLEN_MASK, UHCI_TD_SET_ERRCNT, UHCI_TD_SET_MAXLEN, UHCI_TD_ZERO_ACTLEN, UHCI_VFRAMELIST_COUNT, UREAD2, usb_pc_cpu_flush(), usbd_xfer_get_isochronous_start_frame(), and usb_xfer::xroot.
|
static |
Definition at line 2076 of file uhci.c.
References usb_xfer::address, usb_xfer::endpointno, uhci_td::obj_next, uhci_td::page_cache, usb_xfer::td_start, uhci_td::td_status, td_token, uhci_td::td_token, UE_DIR_IN, UE_GET_DIR, UHCI_TD_IN, UHCI_TD_IOS, UHCI_TD_OUT, and usb_pc_cpu_flush().
|
static |
Definition at line 2233 of file uhci.c.
References uhci_transfer_intr_enqueue().
|
static |
Definition at line 3016 of file uhci.c.
References usb_xfer_flags_int::bandwidth_reclaimed, usb_device::bus, usb_xfer_flags_int::curr_dma_set, DPRINTF, usb_xfer::endpoint, usb_xfer::flags_int, usb_bus::intr_q, usb_endpoint::methods, usb_xfer::qh_pos, usb_xfer::qh_start, uhci_softc::sc_bulk_p_last, uhci_softc::sc_bus, uhci_softc::sc_fs_ctl_p_last, uhci_softc::sc_intr_p_last, uhci_softc::sc_ls_ctl_p_last, usb_device::speed, usb_xfer_root::udev, uhci_add_loop(), UHCI_APPEND_QH, UHCI_BUS2SC, uhci_device_bulk_methods, uhci_device_ctrl_methods, uhci_device_intr_methods, USB_BUS_LOCK, USB_BUS_UNLOCK, USB_SPEED_LOW, and usb_xfer::xroot.
|
static |
Definition at line 3056 of file uhci.c.
References usb_xfer_flags_int::bandwidth_reclaimed, usb_device::bus, usb_xfer_flags_int::curr_dma_set, DPRINTF, usb_xfer::endpoint, usb_xfer::flags_int, usb_bus::intr_q, usb_endpoint::methods, usb_xfer::qh_pos, usb_xfer::qh_start, uhci_softc::sc_bulk_p_last, uhci_softc::sc_bus, uhci_softc::sc_fs_ctl_p_last, uhci_softc::sc_intr_p_last, uhci_softc::sc_ls_ctl_p_last, usb_device::speed, usb_xfer_root::udev, UHCI_BUS2SC, uhci_device_bulk_methods, uhci_device_ctrl_methods, uhci_device_intr_methods, uhci_rem_loop(), UHCI_REMOVE_QH, USB_BUS_LOCK, USB_BUS_UNLOCK, USB_SPEED_LOW, and usb_xfer::xroot.
|
static |
Definition at line 1498 of file uhci.c.
References bus, uhci_softc::sc_bus, UHCI_BUS2SC, uhci_interrupt_poll(), USB_BUS_LOCK, and USB_BUS_UNLOCK.
Referenced by uhci_init(), and uhci_resume().
|
static |
Definition at line 2966 of file uhci.c.
References usb_device::address, usb_endpoint_descriptor::bEndpointAddress, usb_endpoint_descriptor::bmAttributes, usb_device::bus, usb_device::device_index, usb_device::flags, usb_endpoint::methods, uhci_softc::sc_addr, usb_device::speed, UE_BULK, UE_CONTROL, UE_INTERRUPT, UE_ISOCHRONOUS, UE_XFERTYPE, UHCI_BUS2SC, uhci_device_bulk_methods, uhci_device_ctrl_methods, uhci_device_intr_methods, uhci_device_isoc_methods, usb_device_flags::usb_mode, and USB_SPEED_FULL.
|
static |
usb_error_t uhci_init | ( | uhci_softc_t * | sc | ) |
Definition at line 450 of file uhci.c.
References usb_page_search::buffer, uhci_hw_softc::bulk_start_pc, usb_bus::bus_mtx, DPRINTF, uhci_qh::e_next, uhci_hw_softc::fs_ctl_start_pc, uhci_qh::h_next, uhci_hw_softc::intr_start_pc, uhci_hw_softc::isoc_start_pc, uhci_hw_softc::last_qh_pc, uhci_hw_softc::last_td_pc, uhci_hw_softc::ls_ctl_start_pc, usb_bus::methods, uhci_td::next, uhci_hw_softc::pframes_pc, uhci_qh::qh_e_next, uhci_qh::qh_h_next, uhci_qh::qh_self, uhci_softc::sc_bulk_p_last, uhci_softc::sc_bus, uhci_softc::sc_fs_ctl_p_last, uhci_softc::sc_hw, uhci_softc::sc_intr_p_last, uhci_softc::sc_isoc_p_last, uhci_softc::sc_last_qh_p, uhci_softc::sc_last_td_p, uhci_softc::sc_ls_ctl_p_last, uhci_softc::sc_reclaim_qh_p, uhci_softc::sc_root_intr, uhci_td::td_buffer, uhci_td::td_next, uhci_td::td_self, uhci_td::td_status, uhci_td::td_token, uhci_bus_methods, uhci_do_poll(), UHCI_FRAMELIST_COUNT, UHCI_IFRAMELIST_COUNT, uhci_init_qh(), uhci_init_td(), uhci_iterate_hw_softc(), UHCI_PTR_T, uhci_reset(), uhci_start(), UHCI_TD_IOS, UHCI_VFRAMELIST_COUNT, USB_BUS_LOCK, usb_bus_mem_flush_all(), USB_BUS_UNLOCK, usb_callout_init_mtx, and usbd_get_page().
Referenced by uhci_pci_attach().
|
static |
Definition at line 412 of file uhci.c.
References usb_page_search::buffer, uhci_qh::page_cache, uhci_qh::qh_self, UHCI_PTR_QH, and usbd_get_page().
Referenced by uhci_init().
|
static |
Definition at line 431 of file uhci.c.
References usb_page_search::buffer, uhci_td::page_cache, uhci_td::td_self, UHCI_PTR_TD, and usbd_get_page().
Referenced by uhci_init().
void uhci_interrupt | ( | uhci_softc_t * | sc | ) |
Definition at line 1414 of file uhci.c.
References DPRINTF, uhci_softc::sc_bus, status, uhci_interrupt_poll(), UHCI_STS, UHCI_STS_ALLINTRS, UHCI_STS_HCH, UHCI_STS_HCPE, UHCI_STS_HSE, UHCI_STS_RD, UHCI_STS_USBEI, UHCI_STS_USBINT, UREAD2, USB_BUS_LOCK, USB_BUS_UNLOCK, and UWRITE2.
Referenced by uhci_pci_attach().
|
static |
Definition at line 1390 of file uhci.c.
References usb_bus::intr_q, uhci_softc::sc_bus, and uhci_check_transfer().
Referenced by uhci_do_poll(), and uhci_interrupt().
|
static |
Definition at line 1000 of file uhci.c.
References usb_xfer::aframes, usb_page_search::buffer, DPRINTF, usb_xfer::endpoint, uhci_td::fix_pc, usb_xfer::frbuffers, usb_xfer::frlengths, len, usb_xfer::nframes, uhci_td::obj_next, offset, uhci_td::page_cache, plen, usb_xfer::qh_pos, uhci_softc::sc_isoc_p_last, status, uhci_td::td_status, usb_xfer::td_transfer_first, UHCI_REMOVE_TD, UHCI_TD_GET_ACTLEN, UHCI_VFRAMELIST_COUNT, usb_bdma_post_sync(), usb_pc_cpu_invalidate(), usbd_copy_in(), and usbd_get_page().
Referenced by uhci_device_done().
void uhci_iterate_hw_softc | ( | struct usb_bus * | bus, |
usb_bus_mem_sub_cb_t * | cb | ||
) |
Definition at line 167 of file uhci.c.
References uhci_hw_softc::bulk_start_pc, uhci_hw_softc::bulk_start_pg, bus, uhci_hw_softc::fs_ctl_start_pc, uhci_hw_softc::fs_ctl_start_pg, uhci_hw_softc::intr_start_pc, uhci_hw_softc::intr_start_pg, uhci_hw_softc::isoc_start_pc, uhci_hw_softc::isoc_start_pg, uhci_hw_softc::last_qh_pc, uhci_hw_softc::last_qh_pg, uhci_hw_softc::last_td_pc, uhci_hw_softc::last_td_pg, uhci_hw_softc::ls_ctl_start_pc, uhci_hw_softc::ls_ctl_start_pg, uhci_hw_softc::pframes_pc, uhci_hw_softc::pframes_pg, uhci_softc::sc_hw, UHCI_BUS2SC, UHCI_FRAMELIST_ALIGN, UHCI_FRAMELIST_COUNT, UHCI_IFRAMELIST_COUNT, UHCI_QH_ALIGN, UHCI_TD_ALIGN, and UHCI_VFRAMELIST_COUNT.
Referenced by uhci_init().
|
static |
Definition at line 215 of file uhci.c.
References uhci_mem_layout::buf_offset, uhci_mem_layout::buf_pc, uhci_mem_layout::buf_res, usb_page_search::buffer, uhci_mem_layout::fix_pc, uhci_td::fix_pc, uhci_mem_layout::fix_res, uhci_td::len, usb_page_search::length, uhci_td::td_buffer, uhci_td::td_token, UHCI_TD_PID, UHCI_TD_PID_IN, usb_pc_cpu_flush(), usb_pc_cpu_invalidate(), usbd_copy_out(), and usbd_get_page().
Referenced by uhci_device_isoc_enter(), and uhci_setup_standard_chain_sub().
|
static |
Definition at line 204 of file uhci.c.
References usb_xfer::buf_fixup, uhci_mem_layout::buf_offset, uhci_mem_layout::buf_pc, uhci_mem_layout::fix_pc, usb_xfer::frbuffers, uhci_mem_layout::max_frame_size, and usb_xfer::max_frame_size.
Referenced by uhci_device_isoc_enter(), and uhci_setup_standard_chain().
|
static |
Definition at line 1181 of file uhci.c.
References usb_xfer::aframes, usb_xfer_flags_int::control_act, usb_xfer_flags_int::control_hdr, usb_xfer_flags_int::control_xfr, usb_xfer::endpoint, usb_xfer::flags_int, usb_xfer::nframes, usb_xfer::td_transfer_cache, usb_xfer::td_transfer_first, uhci_device_done(), uhci_non_isoc_done_sub(), and usb_bdma_post_sync().
Referenced by uhci_check_transfer().
|
static |
Definition at line 1066 of file uhci.c.
References usb_xfer::address, usb_xfer::aframes, usb_page_search::buffer, DPRINTF, usb_xfer::endpoint, usb_xfer::endpointno, usb_xfer::flags_int, usb_xfer::frbuffers, usb_xfer::frlengths, len, usb_xfer::nframes, usb_xfer_flags_int::short_frames_ok, status, usb_xfer::td_transfer_cache, usb_xfer::td_transfer_last, usb_endpoint::toggle_next, UHCI_TD_ACTIVE, UHCI_TD_BABBLE, UHCI_TD_BITSTUFF, UHCI_TD_CRCTO, UHCI_TD_DBUFFER, UHCI_TD_ERROR, UHCI_TD_GET_ACTLEN, UHCI_TD_GET_ERRCNT, UHCI_TD_IOC, UHCI_TD_IOS, UHCI_TD_LS, UHCI_TD_NAK, UHCI_TD_SET_DT, UHCI_TD_SPD, UHCI_TD_STALLED, USB_ERR_IOERROR, USB_ERR_NORMAL_COMPLETION, USB_ERR_STALLED, usb_pc_cpu_invalidate(), usbd_copy_in(), usbd_get_page(), and usbd_xfer_set_frame_len().
Referenced by uhci_non_isoc_done().
|
static |
Definition at line 2319 of file uhci.c.
References usb_bus::bus_mtx, index, uhci_softc::sc_bus, uhci_softc::sc_isreset, UHCI_PORTSC1, UHCI_PORTSC2, UHCI_PORTSC_CCS, UHCI_PORTSC_CSC, UHCI_PORTSC_PE, UHCI_PORTSC_POEDC, UHCI_PORTSC_PR, uhci_restart(), UREAD2, URWMASK, USB_ERR_IOERROR, USB_ERR_NORMAL_COMPLETION, USB_ERR_TIMEOUT, USB_MS_TO_TICKS, usb_pause_mtx(), usb_port_reset_delay, usb_port_root_reset_delay, and UWRITE2.
Referenced by uhci_roothub_exec().
|
static |
Definition at line 855 of file uhci.c.
References uhci_qh::page_cache, uhci_qh::qh_h_next, uhci_softc::sc_last_qh_p, uhci_softc::sc_loops, UHCI_PTR_T, and usb_pc_cpu_flush().
Referenced by uhci_device_done(), and uhci_device_suspend().
void uhci_reset | ( | uhci_softc_t * | sc | ) |
Definition at line 314 of file uhci.c.
References usb_bus::bdev, usb_bus::bus_mtx, DPRINTF, n, uhci_softc::sc_bus, uhci_softc::sc_root_intr, UHCI_CMD, UHCI_CMD_GRESET, UHCI_CMD_HCRESET, UHCI_FRNUM, UHCI_INTR, UHCI_RESET_TIMEOUT, UHCI_SOF, UHCI_STS, UHCI_STS_HCH, UHCICMD, UREAD2, USB_BUS_LOCK, USB_BUS_LOCK_ASSERT, USB_BUS_RESET_DELAY, USB_BUS_UNLOCK, usb_callout_drain, USB_MS_TO_TICKS, usb_pause_mtx(), UWRITE1, and UWRITE2.
Referenced by uhci_init(), uhci_pci_detach(), uhci_resume(), and uhci_suspend().
|
static |
Definition at line 277 of file uhci.c.
References usb_bus::bus_mtx, uhci_hw_softc::pframes_pc, uhci_softc::sc_bus, uhci_softc::sc_hw, UHCI_CMD, UHCI_CMD_MAXP, UHCI_CMD_RS, UHCI_FLBASEADDR, UHCI_STS, UHCI_STS_HCH, UHCICMD, UREAD2, USB_BUS_LOCK_ASSERT, usb_pause_mtx(), usbd_get_page(), and UWRITE4.
Referenced by uhci_portreset(), uhci_set_hw_power(), and uhci_start().
|
static |
Definition at line 678 of file uhci.c.
References uhci_softc::sc_bus, UHCI_CMD_FGR, uhci_do_poll(), uhci_reset(), uhci_start(), UHCICMD, USB_BUS_LOCK, and USB_BUS_UNLOCK.
Referenced by uhci_set_hw_power_sleep().
|
static |
Definition at line 2743 of file uhci.c.
References uhci_softc::sc_bus, uhci_softc::sc_hub_idata, uhci_softc::sc_root_intr, UHCI_PORTSC1, UHCI_PORTSC2, UHCI_PORTSC_CSC, UHCI_PORTSC_OCIC, UHCI_PORTSC_RD, uhci_root_intr(), uhub_root_intr(), UREAD2, USB_BUS_LOCK_ASSERT, and usb_callout_reset.
Referenced by uhci_root_intr(), and uhci_start().
|
static |
Definition at line 2418 of file uhci.c.
References usb_device::bus, usb_bus::bus_mtx, C, index, len, pptr, uhci_hub_desc::ps, req, uhci_softc::sc_addr, uhci_softc::sc_bus, uhci_softc::sc_conf, uhci_softc::sc_hub_desc, uhci_softc::sc_isreset, uhci_softc::sc_isresumed, uhci_softc::sc_vendor, uhci_hub_desc::stat, status, uhci_hub_desc::temp, UDESC_CONFIG, UDESC_DEVICE, UDESC_STRING, UDS_SELF_POWERED, UGETW, UHCI_BUS2SC, uhci_confd, uhci_devd, uhci_hubd_piix, UHCI_MAX_DEVICES, uhci_portreset(), UHCI_PORTSC1, UHCI_PORTSC2, UHCI_PORTSC_CCS, UHCI_PORTSC_CSC, UHCI_PORTSC_LS, UHCI_PORTSC_LS_SHIFT, UHCI_PORTSC_LSDA, UHCI_PORTSC_OCI, UHCI_PORTSC_OCIC, UHCI_PORTSC_PE, UHCI_PORTSC_POEDC, UHCI_PORTSC_PR, UHCI_PORTSC_RD, UHCI_PORTSC_SUSP, UHF_C_PORT_CONNECTION, UHF_C_PORT_ENABLE, UHF_C_PORT_OVER_CURRENT, UHF_C_PORT_RESET, UHF_C_PORT_SUSPEND, UHF_PORT_CONNECTION, UHF_PORT_ENABLE, UHF_PORT_LOW_SPEED, UHF_PORT_OVER_CURRENT, UHF_PORT_POWER, UHF_PORT_RESET, UHF_PORT_SUSPEND, UPS_C_CONNECT_STATUS, UPS_C_OVERCURRENT_INDICATOR, UPS_C_PORT_ENABLED, UPS_C_PORT_RESET, UPS_C_SUSPEND, UPS_CURRENT_CONNECT_STATUS, UPS_LOW_SPEED, UPS_OVERCURRENT_INDICATOR, UPS_PORT_ENABLED, UPS_PORT_POWER, UPS_SUSPEND, UR_CLEAR_FEATURE, UR_GET_BUS_STATE, UR_GET_CONFIG, UR_GET_DESCRIPTOR, UR_GET_INTERFACE, UR_GET_STATUS, UR_SET_ADDRESS, UR_SET_CONFIG, UR_SET_DESCRIPTOR, UR_SET_FEATURE, UR_SET_INTERFACE, UR_SYNCH_FRAME, UREAD2, URWMASK, USB_BUS_LOCK_ASSERT, USB_ERR_IOERROR, USB_ERR_NORMAL_COMPLETION, usb_make_str_desc(), usb_pause_mtx(), USETW, UT_READ_CLASS_DEVICE, UT_READ_CLASS_OTHER, UT_READ_DEVICE, UT_READ_ENDPOINT, UT_READ_INTERFACE, UT_WRITE_CLASS_DEVICE, UT_WRITE_CLASS_OTHER, UT_WRITE_DEVICE, UT_WRITE_ENDPOINT, UT_WRITE_INTERFACE, UWRITE2, value, usb_port_status::wPortChange, usb_port_status::wPortStatus, and usb_status::wStatus.
|
static |
Definition at line 3116 of file uhci.c.
References usb_bus::bdev, bus, DPRINTF, uhci_softc::sc_bus, UHCI_BUS2SC, UHCI_CMD_MAXP, uhci_restart(), UHCICMD, USB_BUS_LOCK, USB_BUS_UNLOCK, USB_HW_POWER_BULK, USB_HW_POWER_CONTROL, USB_HW_POWER_INTERRUPT, USB_HW_POWER_ISOC, and USB_HW_POWER_NON_ROOT_HUB.
|
static |
Definition at line 3098 of file uhci.c.
References bus, state, UHCI_BUS2SC, uhci_resume(), uhci_suspend(), USB_HW_POWER_RESUME, USB_HW_POWER_SHUTDOWN, and USB_HW_POWER_SUSPEND.
Definition at line 1643 of file uhci.c.
References usb_xfer::address, uhci_std_temp::average, uhci_mem_layout::buf_pc, usb_xfer_flags_int::control_act, usb_xfer_flags_int::control_hdr, usb_xfer_flags_int::control_xfr, usb_xfer_flags_int::curr_dma_set, DPRINTF, usb_xfer::endpoint, usb_xfer::endpointno, usb_xfer::flags, usb_xfer::flags_int, usb_xfer_flags::force_short_xfer, usb_xfer::frbuffers, usb_xfer::frlengths, uhci_std_temp::last_frame, uhci_std_temp::len, uhci_std_temp::max_frame_size, usb_xfer::max_frame_size, uhci_std_temp::ml, usb_xfer::nframes, uhci_td::page_cache, uhci_std_temp::setup_alt_next, usb_xfer_flags_int::short_frames_ok, uhci_std_temp::shortpkt, usb_device::speed, usb_xfer::sumlen, uhci_std_temp::td, uhci_std_temp::td_next, uhci_td::td_next, usb_xfer::td_start, uhci_std_temp::td_status, uhci_td::td_status, uhci_std_temp::td_token, usb_xfer::td_transfer_cache, usb_xfer::td_transfer_first, usb_xfer::td_transfer_last, usb_endpoint::toggle_next, usb_xfer_root::udev, UE_DIR_IN, UE_DIR_OUT, UE_GET_ADDR, UE_GET_DIR, uhci_mem_layout_init(), UHCI_PTR_T, uhci_setup_standard_chain_sub(), UHCI_TD_ACTIVE, UHCI_TD_IOC, UHCI_TD_LS, UHCI_TD_PID_IN, UHCI_TD_PID_OUT, UHCI_TD_PID_SETUP, UHCI_TD_SET_DEVADDR, UHCI_TD_SET_DT, UHCI_TD_SET_ENDPT, UHCI_TD_SET_ERRCNT, UHCI_TD_ZERO_ACTLEN, usb_pc_cpu_flush(), USB_SPEED_LOW, usbd_get_speed(), and usb_xfer::xroot.
Referenced by uhci_device_bulk_start(), uhci_device_ctrl_start(), and uhci_device_intr_start().
|
static |
Definition at line 1508 of file uhci.c.
References uhci_std_temp::average, uhci_mem_layout::buf_offset, uhci_td::fix_pc, uhci_std_temp::last_frame, uhci_std_temp::len, uhci_td::len, uhci_std_temp::ml, uhci_td::obj_next, uhci_td::page_cache, uhci_std_temp::setup_alt_next, uhci_std_temp::shortpkt, uhci_std_temp::td, uhci_td::td_buffer, td_next, uhci_std_temp::td_next, uhci_td::td_next, uhci_std_temp::td_status, uhci_td::td_status, uhci_std_temp::td_token, uhci_td::td_token, uhci_mem_layout_fixup(), UHCI_PTR_T, UHCI_TD_IOC, UHCI_TD_PID, UHCI_TD_PID_IN, UHCI_TD_SET_DT, UHCI_TD_SET_MAXLEN, UHCI_TD_SPD, and usb_pc_cpu_flush().
Referenced by uhci_setup_standard_chain().
|
static |
Definition at line 388 of file uhci.c.
References usb_bus::bdev, uhci_softc::sc_bus, UHCI_INTR, UHCI_INTR_IOCE, UHCI_INTR_RIE, UHCI_INTR_SPIE, UHCI_INTR_TOCRCIE, uhci_restart(), uhci_root_intr(), USB_BUS_LOCK_ASSERT, and UWRITE2.
Referenced by uhci_init(), and uhci_resume().
|
static |
Definition at line 656 of file uhci.c.
References uhci_softc::sc_bus, UHCI_CMD_EGSM, uhci_reset(), UHCICMD, USB_BUS_LOCK, and USB_BUS_UNLOCK.
Referenced by uhci_set_hw_power_sleep().
|
static |
Definition at line 1485 of file uhci.c.
References usb_xfer_root::bus, DPRINTF, uhci_device_done(), USB_BUS_LOCK_ASSERT, USB_ERR_TIMEOUT, and usb_xfer::xroot.
Referenced by uhci_transfer_intr_enqueue().
|
static |
Definition at line 874 of file uhci.c.
References usb_xfer_root::bus, usb_bus::intr_q, usb_xfer::timeout, uhci_check_transfer(), uhci_timeout(), usbd_transfer_enqueue(), usbd_transfer_timeout_ms(), and usb_xfer::xroot.
Referenced by uhci_device_bulk_start(), uhci_device_ctrl_start(), uhci_device_intr_start(), and uhci_device_isoc_start().
|
static |
Definition at line 2771 of file uhci.c.
References usb_setup_params::buf, usb_xfer::buf_fixup, usb_page_search::buffer, usb_setup_params::bufsize, usb_device::bus, usb_xfer_flags_int::curr_dma_set, usb_setup_params::curr_xfer, usb_setup_params::err, usb_xfer::flags_int, usb_setup_params::hc_max_frame_size, usb_setup_params::hc_max_packet_count, usb_setup_params::hc_max_packet_size, usb_xfer::max_data_length, usb_xfer::max_frame_size, usb_setup_params::methods, n, usb_xfer::nframes, uhci_td::obj_next, uhci_qh::obj_next, uhci_td::page_cache, uhci_qh::page_cache, uhci_qh::qh_self, usb_xfer::qh_start, uhci_td::td_self, usb_xfer::td_start, usb_setup_params::udev, UHCI_BUS2SC, uhci_device_bulk_methods, uhci_device_ctrl_methods, uhci_device_intr_methods, uhci_device_isoc_methods, UHCI_PTR_QH, UHCI_PTR_TD, UHCI_PTR_VF, UHCI_QH_ALIGN, UHCI_TD_ALIGN, USB_ERR_NOMEM, USB_PAGE_SIZE, usb_pc_cpu_flush(), usbd_get_page(), usbd_transfer_setup_sub(), and usbd_transfer_setup_sub_malloc().
|
static |
|
static |
Definition at line 152 of file uhci.c.
Referenced by uhci_init().
|
static |
Definition at line 2268 of file uhci.c.
Referenced by uhci_roothub_exec().
|
static |
Definition at line 2254 of file uhci.c.
Referenced by uhci_roothub_exec().
|
static |
Definition at line 153 of file uhci.c.
Referenced by uhci_device_done(), uhci_device_resume(), uhci_device_suspend(), uhci_ep_init(), and uhci_xfer_setup().
|
static |
Definition at line 154 of file uhci.c.
Referenced by uhci_device_done(), uhci_device_resume(), uhci_device_suspend(), uhci_ep_init(), and uhci_xfer_setup().
|
static |
Definition at line 155 of file uhci.c.
Referenced by uhci_device_done(), uhci_device_resume(), uhci_device_suspend(), uhci_ep_init(), and uhci_xfer_setup().
|
static |
Definition at line 156 of file uhci.c.
Referenced by uhci_check_transfer(), uhci_device_done(), uhci_ep_init(), and uhci_xfer_setup().
|
static |
Definition at line 2298 of file uhci.c.
Referenced by uhci_roothub_exec().