FreeBSD kernel usb device Code
ohci.c File Reference
#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/ohci.h>
#include <dev/usb/controller/ohcireg.h>
Include dependency graph for ohci.c:

Go to the source code of this file.

Data Structures

struct  ohci_std_temp
 

Macros

#define USB_DEBUG_VAR   ohcidebug
 
#define OHCI_BUS2SC(bus)    __containerof(bus, ohci_softc_t, sc_bus)
 
#define OBARR(sc)
 
#define OWRITE1(sc, r, x)    do { OBARR(sc); bus_space_write_1((sc)->sc_io_tag, (sc)->sc_io_hdl, (r), (x)); } while (0)
 
#define OWRITE2(sc, r, x)    do { OBARR(sc); bus_space_write_2((sc)->sc_io_tag, (sc)->sc_io_hdl, (r), (x)); } while (0)
 
#define OWRITE4(sc, r, x)    do { OBARR(sc); bus_space_write_4((sc)->sc_io_tag, (sc)->sc_io_hdl, (r), (x)); } while (0)
 
#define OREAD1(sc, r)   (OBARR(sc), bus_space_read_1((sc)->sc_io_tag, (sc)->sc_io_hdl, (r)))
 
#define OREAD2(sc, r)   (OBARR(sc), bus_space_read_2((sc)->sc_io_tag, (sc)->sc_io_hdl, (r)))
 
#define OREAD4(sc, r)   (OBARR(sc), bus_space_read_4((sc)->sc_io_tag, (sc)->sc_io_hdl, (r)))
 
#define OHCI_INTR_ENDPT   1
 
#define OHCI_APPEND_QH(sed, last)   (last) = _ohci_append_qh(sed,last)
 
#define OHCI_REMOVE_QH(sed, last)   (last) = _ohci_remove_qh(sed,last)
 
#define C(x, y)   ((x) | ((y) << 8))
 

Functions

static void ohci_do_poll (struct usb_bus *bus)
 
static void ohci_device_done (struct usb_xfer *xfer, usb_error_t error)
 
static void ohci_timeout (void *arg)
 
static uint8_t ohci_check_transfer (struct usb_xfer *xfer)
 
static void ohci_root_intr (ohci_softc_t *sc)
 
static struct ohci_hccaohci_get_hcca (ohci_softc_t *sc)
 
void ohci_iterate_hw_softc (struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb)
 
static usb_error_t ohci_controller_init (ohci_softc_t *sc, int do_suspend)
 
static struct ohci_edohci_init_ed (struct usb_page_cache *pc)
 
usb_error_t ohci_init (ohci_softc_t *sc)
 
void ohci_detach (struct ohci_softc *sc)
 
static void ohci_suspend (ohci_softc_t *sc)
 
static void ohci_resume (ohci_softc_t *sc)
 
static void ohci_transfer_intr_enqueue (struct usb_xfer *xfer)
 
static ohci_ed_t_ohci_append_qh (ohci_ed_t *sed, ohci_ed_t *last)
 
static ohci_ed_t_ohci_remove_qh (ohci_ed_t *sed, ohci_ed_t *last)
 
static void ohci_isoc_done (struct usb_xfer *xfer)
 
static usb_error_t ohci_non_isoc_done_sub (struct usb_xfer *xfer)
 
static void ohci_non_isoc_done (struct usb_xfer *xfer)
 
static void ohci_check_transfer_sub (struct usb_xfer *xfer)
 
static void ohci_rhsc_enable (ohci_softc_t *sc)
 
static void ohci_interrupt_poll (ohci_softc_t *sc)
 
void ohci_interrupt (ohci_softc_t *sc)
 
static void ohci_setup_standard_chain_sub (struct ohci_std_temp *temp)
 
static void ohci_setup_standard_chain (struct usb_xfer *xfer, ohci_ed_t **ed_last)
 
static void ohci_device_bulk_open (struct usb_xfer *xfer)
 
static void ohci_device_bulk_close (struct usb_xfer *xfer)
 
static void ohci_device_bulk_enter (struct usb_xfer *xfer)
 
static void ohci_device_bulk_start (struct usb_xfer *xfer)
 
static void ohci_device_ctrl_open (struct usb_xfer *xfer)
 
static void ohci_device_ctrl_close (struct usb_xfer *xfer)
 
static void ohci_device_ctrl_enter (struct usb_xfer *xfer)
 
static void ohci_device_ctrl_start (struct usb_xfer *xfer)
 
static void ohci_device_intr_open (struct usb_xfer *xfer)
 
static void ohci_device_intr_close (struct usb_xfer *xfer)
 
static void ohci_device_intr_enter (struct usb_xfer *xfer)
 
static void ohci_device_intr_start (struct usb_xfer *xfer)
 
static void ohci_device_isoc_open (struct usb_xfer *xfer)
 
static void ohci_device_isoc_close (struct usb_xfer *xfer)
 
static void ohci_device_isoc_enter (struct usb_xfer *xfer)
 
static void ohci_device_isoc_start (struct usb_xfer *xfer)
 
static usb_error_t ohci_roothub_exec (struct usb_device *udev, struct usb_device_request *req, const void **pptr, uint16_t *plength)
 
static void ohci_xfer_setup (struct usb_setup_params *parm)
 
static void ohci_ep_init (struct usb_device *udev, struct usb_endpoint_descriptor *edesc, struct usb_endpoint *ep)
 
static void ohci_xfer_unsetup (struct usb_xfer *xfer)
 
static void ohci_get_dma_delay (struct usb_device *udev, uint32_t *pus)
 
static void ohci_device_resume (struct usb_device *udev)
 
static void ohci_device_suspend (struct usb_device *udev)
 
static void ohci_set_hw_power_sleep (struct usb_bus *bus, uint32_t state)
 
static void ohci_set_hw_power (struct usb_bus *bus)
 

Variables

static const struct usb_bus_methods ohci_bus_methods
 
static const struct usb_pipe_methods ohci_device_bulk_methods
 
static const struct usb_pipe_methods ohci_device_ctrl_methods
 
static const struct usb_pipe_methods ohci_device_intr_methods
 
static const struct usb_pipe_methods ohci_device_isoc_methods
 
static const struct usb_device_descriptor ohci_devd
 
static const struct ohci_config_desc ohci_confd
 
static const struct usb_hub_descriptor ohci_hubd
 

Macro Definition Documentation

◆ C

#define C (   x,
 
)    ((x) | ((y) << 8))

◆ OBARR

#define OBARR (   sc)
Value:
bus_space_barrier((sc)->sc_io_tag, (sc)->sc_io_hdl, 0, (sc)->sc_io_size, \
BUS_SPACE_BARRIER_READ|BUS_SPACE_BARRIER_WRITE)

Definition at line 101 of file ohci.c.

◆ OHCI_APPEND_QH

#define OHCI_APPEND_QH (   sed,
  last 
)    (last) = _ohci_append_qh(sed,last)

Definition at line 656 of file ohci.c.

◆ OHCI_BUS2SC

#define OHCI_BUS2SC (   bus)     __containerof(bus, ohci_softc_t, sc_bus)

Definition at line 81 of file ohci.c.

◆ OHCI_INTR_ENDPT

#define OHCI_INTR_ENDPT   1

Definition at line 113 of file ohci.c.

◆ OHCI_REMOVE_QH

#define OHCI_REMOVE_QH (   sed,
  last 
)    (last) = _ohci_remove_qh(sed,last)

Definition at line 689 of file ohci.c.

◆ OREAD1

#define OREAD1 (   sc,
  r 
)    (OBARR(sc), bus_space_read_1((sc)->sc_io_tag, (sc)->sc_io_hdl, (r)))

Definition at line 109 of file ohci.c.

◆ OREAD2

#define OREAD2 (   sc,
  r 
)    (OBARR(sc), bus_space_read_2((sc)->sc_io_tag, (sc)->sc_io_hdl, (r)))

Definition at line 110 of file ohci.c.

◆ OREAD4

#define OREAD4 (   sc,
  r 
)    (OBARR(sc), bus_space_read_4((sc)->sc_io_tag, (sc)->sc_io_hdl, (r)))

Definition at line 111 of file ohci.c.

◆ OWRITE1

#define OWRITE1 (   sc,
  r,
 
)     do { OBARR(sc); bus_space_write_1((sc)->sc_io_tag, (sc)->sc_io_hdl, (r), (x)); } while (0)

Definition at line 103 of file ohci.c.

◆ OWRITE2

#define OWRITE2 (   sc,
  r,
 
)     do { OBARR(sc); bus_space_write_2((sc)->sc_io_tag, (sc)->sc_io_hdl, (r), (x)); } while (0)

Definition at line 105 of file ohci.c.

◆ OWRITE4

#define OWRITE4 (   sc,
  r,
 
)     do { OBARR(sc); bus_space_write_4((sc)->sc_io_tag, (sc)->sc_io_hdl, (r), (x)); } while (0)

Definition at line 107 of file ohci.c.

◆ USB_DEBUG_VAR

#define USB_DEBUG_VAR   ohcidebug

Definition at line 63 of file ohci.c.

Function Documentation

◆ _ohci_append_qh()

static ohci_ed_t * _ohci_append_qh ( ohci_ed_t sed,
ohci_ed_t last 
)
static

Definition at line 658 of file ohci.c.

References ohci_ed::ed_next, ohci_ed::ed_self, ohci_ed::ed_tailp, ohci_ed::next, ohci_ed::page_cache, ohci_ed::prev, and usb_pc_cpu_flush().

Here is the call graph for this function:

◆ _ohci_remove_qh()

static ohci_ed_t * _ohci_remove_qh ( ohci_ed_t sed,
ohci_ed_t last 
)
static

Definition at line 691 of file ohci.c.

References ohci_ed::ed_next, ohci_ed::next, ohci_ed::page_cache, ohci_ed::prev, and usb_pc_cpu_flush().

Here is the call graph for this function:

◆ ohci_check_transfer()

◆ ohci_check_transfer_sub()

◆ ohci_controller_init()

◆ ohci_detach()

void ohci_detach ( struct ohci_softc sc)

Definition at line 437 of file ohci.c.

References OHCI_ALL_INTRS, OHCI_CONTROL, OHCI_HCFS_RESET, OHCI_INTERRUPT_DISABLE, OWRITE4, ohci_softc::sc_bus, ohci_softc::sc_tmo_rhsc, USB_BUS_LOCK, USB_BUS_UNLOCK, usb_callout_drain, usb_callout_stop, and usb_pause_mtx().

Referenced by generic_ohci_detach(), and ohci_pci_detach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ohci_device_bulk_close()

static void ohci_device_bulk_close ( struct usb_xfer xfer)
static

Definition at line 1659 of file ohci.c.

References ohci_device_done(), and USB_ERR_CANCELLED.

Here is the call graph for this function:

◆ ohci_device_bulk_enter()

static void ohci_device_bulk_enter ( struct usb_xfer xfer)
static

Definition at line 1665 of file ohci.c.

◆ ohci_device_bulk_open()

static void ohci_device_bulk_open ( struct usb_xfer xfer)
static

Definition at line 1653 of file ohci.c.

◆ ohci_device_bulk_start()

static void ohci_device_bulk_start ( struct usb_xfer xfer)
static

Definition at line 1671 of file ohci.c.

References usb_xfer_root::bus, OHCI_BUS2SC, ohci_setup_standard_chain(), ohci_transfer_intr_enqueue(), ohci_softc::sc_bulk_p_last, and usb_xfer::xroot.

Here is the call graph for this function:

◆ ohci_device_ctrl_close()

static void ohci_device_ctrl_close ( struct usb_xfer xfer)
static

Definition at line 1700 of file ohci.c.

References ohci_device_done(), and USB_ERR_CANCELLED.

Here is the call graph for this function:

◆ ohci_device_ctrl_enter()

static void ohci_device_ctrl_enter ( struct usb_xfer xfer)
static

Definition at line 1706 of file ohci.c.

◆ ohci_device_ctrl_open()

static void ohci_device_ctrl_open ( struct usb_xfer xfer)
static

Definition at line 1694 of file ohci.c.

◆ ohci_device_ctrl_start()

static void ohci_device_ctrl_start ( struct usb_xfer xfer)
static

Definition at line 1712 of file ohci.c.

References usb_xfer_root::bus, OHCI_BUS2SC, ohci_setup_standard_chain(), ohci_transfer_intr_enqueue(), ohci_softc::sc_ctrl_p_last, and usb_xfer::xroot.

Here is the call graph for this function:

◆ ohci_device_done()

◆ ohci_device_intr_close()

static void ohci_device_intr_close ( struct usb_xfer xfer)
static

Definition at line 1768 of file ohci.c.

References usb_xfer_root::bus, OHCI_BUS2SC, ohci_device_done(), usb_xfer::qh_pos, ohci_softc::sc_intr_stat, USB_ERR_CANCELLED, and usb_xfer::xroot.

Here is the call graph for this function:

◆ ohci_device_intr_enter()

static void ohci_device_intr_enter ( struct usb_xfer xfer)
static

Definition at line 1778 of file ohci.c.

◆ ohci_device_intr_open()

static void ohci_device_intr_open ( struct usb_xfer xfer)
static

◆ ohci_device_intr_start()

static void ohci_device_intr_start ( struct usb_xfer xfer)
static

Definition at line 1784 of file ohci.c.

References usb_xfer_root::bus, OHCI_BUS2SC, ohci_setup_standard_chain(), ohci_transfer_intr_enqueue(), usb_xfer::qh_pos, ohci_softc::sc_intr_p_last, and usb_xfer::xroot.

Here is the call graph for this function:

◆ ohci_device_isoc_close()

static void ohci_device_isoc_close ( struct usb_xfer xfer)
static

Definition at line 1813 of file ohci.c.

References ohci_device_done(), and USB_ERR_CANCELLED.

Here is the call graph for this function:

◆ ohci_device_isoc_enter()

◆ ohci_device_isoc_open()

static void ohci_device_isoc_open ( struct usb_xfer xfer)
static

Definition at line 1807 of file ohci.c.

◆ ohci_device_isoc_start()

static void ohci_device_isoc_start ( struct usb_xfer xfer)
static

Definition at line 1975 of file ohci.c.

References ohci_transfer_intr_enqueue().

Here is the call graph for this function:

◆ ohci_device_resume()

◆ ohci_device_suspend()

◆ ohci_do_poll()

static void ohci_do_poll ( struct usb_bus bus)
static

Definition at line 1231 of file ohci.c.

References bus, OHCI_BUS2SC, ohci_interrupt_poll(), ohci_softc::sc_bus, USB_BUS_LOCK, and USB_BUS_UNLOCK.

Referenced by ohci_init(), and ohci_resume().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ohci_ep_init()

◆ ohci_get_dma_delay()

static void ohci_get_dma_delay ( struct usb_device udev,
uint32_t *  pus 
)
static

Definition at line 2543 of file ohci.c.

◆ ohci_get_hcca()

static struct ohci_hcca * ohci_get_hcca ( ohci_softc_t sc)
static

Definition at line 141 of file ohci.c.

References ohci_hw_softc::hcca_pc, ohci_softc::sc_hcca_p, ohci_softc::sc_hw, and usb_pc_cpu_invalidate().

Referenced by ohci_device_isoc_enter(), and ohci_interrupt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ohci_init()

◆ ohci_init_ed()

static struct ohci_ed * ohci_init_ed ( struct usb_page_cache pc)
static

Definition at line 306 of file ohci.c.

References usb_page_search::buffer, ohci_ed::ed_flags, ohci_ed::ed_self, OHCI_ED_SKIP, ohci_ed::page_cache, and usbd_get_page().

Referenced by ohci_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ohci_interrupt()

◆ ohci_interrupt_poll()

static void ohci_interrupt_poll ( ohci_softc_t sc)
static

Definition at line 1082 of file ohci.c.

References usb_bus::intr_q, ohci_check_transfer(), and ohci_softc::sc_bus.

Referenced by ohci_do_poll(), and ohci_interrupt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ohci_isoc_done()

static void ohci_isoc_done ( struct usb_xfer xfer)
static

◆ ohci_iterate_hw_softc()

◆ ohci_non_isoc_done()

static void ohci_non_isoc_done ( struct usb_xfer xfer)
static

◆ ohci_non_isoc_done_sub()

◆ ohci_resume()

static void ohci_resume ( ohci_softc_t sc)
static

Definition at line 469 of file ohci.c.

References DPRINTF, ohci_controller_init(), ohci_do_poll(), and ohci_softc::sc_bus.

Referenced by ohci_set_hw_power_sleep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ohci_rhsc_enable()

static void ohci_rhsc_enable ( ohci_softc_t sc)
static

Definition at line 1066 of file ohci.c.

References OHCI_INTERRUPT_ENABLE, OHCI_INTERRUPT_STATUS, OHCI_RHSC, ohci_root_intr(), OWRITE4, ohci_softc::sc_bus, ohci_softc::sc_eintrs, and USB_BUS_LOCK_ASSERT.

Referenced by ohci_interrupt(), and ohci_roothub_exec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ohci_root_intr()

static void ohci_root_intr ( ohci_softc_t sc)
static

Definition at line 1579 of file ohci.c.

References DPRINTF, OHCI_RH_PORT_STATUS, OHCI_RH_STATUS, OREAD4, ohci_softc::sc_bus, ohci_softc::sc_hub_idata, ohci_softc::sc_noport, uhub_root_intr(), and USB_BUS_LOCK_ASSERT.

Referenced by ohci_interrupt(), and ohci_rhsc_enable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ohci_roothub_exec()

static usb_error_t ohci_roothub_exec ( struct usb_device udev,
struct usb_device_request req,
const void **  pptr,
uint16_t *  plength 
)
static

Definition at line 2049 of file ohci.c.

References usb_hub_descriptor::bDescLength, usb_hub_descriptor::bNbrPorts, usb_hub_descriptor::bPwrOn2PwrGood, usb_device::bus, usb_bus::bus_mtx, C, usb_hub_descriptor::DeviceRemovable, ohci_hub_desc::hubd, index, len, OHCI_BUS2SC, ohci_confd, ohci_devd, OHCI_GET_POTPGT, ohci_hubd, OHCI_MAX_DEVICES, OHCI_NPS, OHCI_PSM, OHCI_RH_DESCRIPTOR_A, OHCI_RH_DESCRIPTOR_B, OHCI_RH_PORT_STATUS, ohci_rhsc_enable(), OREAD4, OWRITE4, pptr, ohci_hub_desc::ps, req, ohci_softc::sc_addr, ohci_softc::sc_bus, ohci_softc::sc_conf, ohci_softc::sc_hub_desc, ohci_softc::sc_noport, ohci_softc::sc_vendor, ohci_hub_desc::stat, ohci_hub_desc::temp, UDESC_CONFIG, UDESC_DEVICE, UDESC_STRING, UDS_SELF_POWERED, UGETW, UHD_PWR_GANGED, UHD_PWR_INDIVIDUAL, UHD_PWR_NO_SWITCH, UHF_C_PORT_CONNECTION, UHF_C_PORT_ENABLE, UHF_C_PORT_OVER_CURRENT, UHF_C_PORT_RESET, UHF_C_PORT_SUSPEND, UHF_PORT_ENABLE, 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_RESET, UPS_SUSPEND, UR_CLEAR_FEATURE, 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, USB_BUS_LOCK_ASSERT, USB_ERR_IOERROR, USB_ERR_TIMEOUT, usb_make_str_desc(), USB_MS_TO_TICKS, usb_pause_mtx(), usb_port_root_reset_delay, 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, value, usb_hub_descriptor::wHubCharacteristics, usb_port_status::wPortChange, usb_port_status::wPortStatus, and usb_status::wStatus.

Here is the call graph for this function:

◆ ohci_set_hw_power()

static void ohci_set_hw_power ( struct usb_bus bus)
static

◆ ohci_set_hw_power_sleep()

static void ohci_set_hw_power_sleep ( struct usb_bus bus,
uint32_t  state 
)
static

Definition at line 2623 of file ohci.c.

References bus, OHCI_BUS2SC, ohci_resume(), ohci_suspend(), state, USB_HW_POWER_RESUME, USB_HW_POWER_SHUTDOWN, and USB_HW_POWER_SUSPEND.

Here is the call graph for this function:

◆ ohci_setup_standard_chain()

static void ohci_setup_standard_chain ( struct usb_xfer xfer,
ohci_ed_t **  ed_last 
)
static

Definition at line 1380 of file ohci.c.

References usb_xfer::address, ohci_std_temp::average, usb_xfer_root::bus, 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, ed_flags, ohci_ed::ed_flags, ohci_ed::ed_headp, usb_xfer::endpoint, usb_xfer::endpointno, usb_xfer::flags, usb_device::flags, usb_xfer::flags_int, usb_xfer_flags::force_short_xfer, usb_xfer::frbuffers, usb_xfer::frlengths, ohci_std_temp::last_frame, ohci_std_temp::len, ohci_std_temp::max_frame_size, usb_xfer::max_frame_size, usb_xfer::max_hc_frame_size, usb_endpoint::methods, usb_xfer::nframes, OHCI_APPEND_QH, OHCI_BLF, OHCI_BUS2SC, OHCI_CLF, OHCI_COMMAND_STATUS, ohci_device_bulk_methods, ohci_device_ctrl_methods, OHCI_ED_DIR_TD, OHCI_ED_FORMAT_GEN, OHCI_ED_SET_EN, OHCI_ED_SET_FA, OHCI_ED_SET_MAXP, OHCI_ED_SPEED, ohci_setup_standard_chain_sub(), OHCI_TD_IN, OHCI_TD_INTR_MASK, OHCI_TD_NEXT_END, OHCI_TD_NOCC, OHCI_TD_NOINTR, OHCI_TD_OUT, OHCI_TD_SET_DI, OHCI_TD_SETUP, OHCI_TD_TOGGLE_0, OHCI_TD_TOGGLE_1, OWRITE4, ohci_ed::page_cache, ohci_td::page_cache, ohci_std_temp::pc, usb_xfer::qh_start, usb_device_flags::self_suspended, ohci_std_temp::setup_alt_next, usb_xfer_flags_int::short_frames_ok, ohci_std_temp::shortpkt, usb_device::speed, usb_xfer::sumlen, ohci_std_temp::td, ohci_std_temp::td_flags, ohci_td::td_flags, ohci_std_temp::td_next, ohci_td::td_next, ohci_td::td_self, usb_xfer::td_start, 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_GET_ADDR, UE_GET_DIR, usb_pc_cpu_flush(), USB_SPEED_LOW, usbd_get_speed(), and usb_xfer::xroot.

Referenced by ohci_device_bulk_start(), ohci_device_ctrl_start(), and ohci_device_intr_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ohci_setup_standard_chain_sub()

◆ ohci_suspend()

static void ohci_suspend ( ohci_softc_t sc)
static

Definition at line 455 of file ohci.c.

References DPRINTF, and ohci_controller_init().

Referenced by ohci_set_hw_power_sleep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ohci_timeout()

static void ohci_timeout ( void *  arg)
static

Definition at line 1218 of file ohci.c.

References usb_xfer_root::bus, DPRINTF, ohci_device_done(), USB_BUS_LOCK_ASSERT, USB_ERR_TIMEOUT, and usb_xfer::xroot.

Referenced by ohci_transfer_intr_enqueue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ohci_transfer_intr_enqueue()

static void ohci_transfer_intr_enqueue ( struct usb_xfer xfer)
static

Definition at line 641 of file ohci.c.

References usb_xfer_root::bus, usb_bus::intr_q, ohci_check_transfer(), ohci_timeout(), usb_xfer::timeout, usbd_transfer_enqueue(), usbd_transfer_timeout_ms(), and usb_xfer::xroot.

Referenced by ohci_device_bulk_start(), ohci_device_ctrl_start(), ohci_device_intr_start(), and ohci_device_isoc_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ohci_xfer_setup()

◆ ohci_xfer_unsetup()

static void ohci_xfer_unsetup ( struct usb_xfer xfer)
static

Definition at line 2537 of file ohci.c.

Variable Documentation

◆ ohci_bus_methods

static const struct usb_bus_methods ohci_bus_methods
static
Initial value:
=
{
.endpoint_init = ohci_ep_init,
.xfer_setup = ohci_xfer_setup,
.xfer_unsetup = ohci_xfer_unsetup,
.get_dma_delay = ohci_get_dma_delay,
.device_resume = ohci_device_resume,
.device_suspend = ohci_device_suspend,
.set_hw_power = ohci_set_hw_power,
.set_hw_power_sleep = ohci_set_hw_power_sleep,
.roothub_exec = ohci_roothub_exec,
.xfer_poll = ohci_do_poll,
}
static void ohci_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc, struct usb_endpoint *ep)
Definition: ohci.c:2503
static void ohci_set_hw_power_sleep(struct usb_bus *bus, uint32_t state)
Definition: ohci.c:2623
static void ohci_set_hw_power(struct usb_bus *bus)
Definition: ohci.c:2641
static void ohci_device_suspend(struct usb_device *udev)
Definition: ohci.c:2589
static void ohci_get_dma_delay(struct usb_device *udev, uint32_t *pus)
Definition: ohci.c:2543
static void ohci_do_poll(struct usb_bus *bus)
Definition: ohci.c:1231
static void ohci_device_resume(struct usb_device *udev)
Definition: ohci.c:2553
static void ohci_xfer_setup(struct usb_setup_params *parm)
Definition: ohci.c:2342
static usb_error_t ohci_roothub_exec(struct usb_device *udev, struct usb_device_request *req, const void **pptr, uint16_t *plength)
Definition: ohci.c:2049
static void ohci_xfer_unsetup(struct usb_xfer *xfer)
Definition: ohci.c:2537

Definition at line 115 of file ohci.c.

Referenced by ohci_init().

◆ ohci_confd

const struct ohci_config_desc ohci_confd
static
Initial value:
=
{
.confd = {
.bLength = sizeof(struct usb_config_descriptor),
.wTotalLength[0] = sizeof(ohci_confd),
.bMaxPower = 0,
},
.ifcd = {
.bLength = sizeof(struct usb_interface_descriptor),
.bNumEndpoints = 1,
.bInterfaceClass = UICLASS_HUB,
.bInterfaceSubClass = UISUBCLASS_HUB,
.bInterfaceProtocol = 0,
},
.endpd = {
.bLength = sizeof(struct usb_endpoint_descriptor),
.bEndpointAddress = UE_DIR_IN | OHCI_INTR_ENDPT,
.bmAttributes = UE_INTERRUPT,
.wMaxPacketSize[0] = 32,
.bInterval = 255,
},
}
#define OHCI_INTR_ENDPT
Definition: ohci.c:113
static const struct ohci_config_desc ohci_confd
Definition: ohci.c:2011
uByte bDescriptorType
Definition: usb.h:387
uByte bNumInterface
Definition: usb.h:389
uByte bmAttributes
Definition: usb.h:393
uByte iConfiguration
Definition: usb.h:392
uByte bConfigurationValue
Definition: usb.h:390
uByte bDescriptorType
Definition: usb.h:527
#define UE_INTERRUPT
Definition: usb.h:544
#define UC_SELF_POWERED
Definition: usb.h:395
#define UISUBCLASS_HUB
Definition: usb.h:480
#define UDESC_CONFIG
Definition: usb.h:196
#define UDESC_ENDPOINT
Definition: usb.h:200
#define UE_DIR_IN
Definition: usb.h:531
#define UICLASS_HUB
Definition: usb.h:479
#define UDESC_INTERFACE
Definition: usb.h:199

Definition at line 2011 of file ohci.c.

Referenced by ohci_roothub_exec().

◆ ohci_devd

const struct usb_device_descriptor ohci_devd
static
Initial value:
=
{
sizeof(struct usb_device_descriptor),
{0x00, 0x01},
64,
{0}, {0}, {0x00, 0x01},
1, 2, 0,
1
}
#define UDSUBCLASS_HUB
Definition: usb.h:374
#define UDCLASS_HUB
Definition: usb.h:373
#define UDESC_DEVICE
Definition: usb.h:195
#define UDPROTO_FSHUB
Definition: usb.h:375

Definition at line 1996 of file ohci.c.

Referenced by ohci_roothub_exec().

◆ ohci_device_bulk_methods

static const struct usb_pipe_methods ohci_device_bulk_methods
static
Initial value:
=
{
}
static void ohci_device_bulk_close(struct usb_xfer *xfer)
Definition: ohci.c:1659
static void ohci_device_bulk_start(struct usb_xfer *xfer)
Definition: ohci.c:1671
static void ohci_device_bulk_open(struct usb_xfer *xfer)
Definition: ohci.c:1653
static void ohci_device_bulk_enter(struct usb_xfer *xfer)
Definition: ohci.c:1665

Definition at line 116 of file ohci.c.

Referenced by ohci_check_transfer_sub(), ohci_device_done(), ohci_device_resume(), ohci_device_suspend(), ohci_ep_init(), ohci_setup_standard_chain(), and ohci_xfer_setup().

◆ ohci_device_ctrl_methods

static const struct usb_pipe_methods ohci_device_ctrl_methods
static
Initial value:
=
{
}
static void ohci_device_ctrl_start(struct usb_xfer *xfer)
Definition: ohci.c:1712
static void ohci_device_ctrl_open(struct usb_xfer *xfer)
Definition: ohci.c:1694
static void ohci_device_ctrl_close(struct usb_xfer *xfer)
Definition: ohci.c:1700
static void ohci_device_ctrl_enter(struct usb_xfer *xfer)
Definition: ohci.c:1706

Definition at line 117 of file ohci.c.

Referenced by ohci_check_transfer_sub(), ohci_device_done(), ohci_device_resume(), ohci_device_suspend(), ohci_ep_init(), ohci_setup_standard_chain(), and ohci_xfer_setup().

◆ ohci_device_intr_methods

static const struct usb_pipe_methods ohci_device_intr_methods
static
Initial value:
=
{
}
static void ohci_device_intr_open(struct usb_xfer *xfer)
Definition: ohci.c:1735
static void ohci_device_intr_close(struct usb_xfer *xfer)
Definition: ohci.c:1768
static void ohci_device_intr_start(struct usb_xfer *xfer)
Definition: ohci.c:1784
static void ohci_device_intr_enter(struct usb_xfer *xfer)
Definition: ohci.c:1778

Definition at line 118 of file ohci.c.

Referenced by ohci_device_done(), ohci_device_resume(), ohci_device_suspend(), ohci_ep_init(), and ohci_xfer_setup().

◆ ohci_device_isoc_methods

static const struct usb_pipe_methods ohci_device_isoc_methods
static
Initial value:
=
{
}
static void ohci_device_isoc_start(struct usb_xfer *xfer)
Definition: ohci.c:1975
static void ohci_device_isoc_open(struct usb_xfer *xfer)
Definition: ohci.c:1807
static void ohci_device_isoc_enter(struct usb_xfer *xfer)
Definition: ohci.c:1820
static void ohci_device_isoc_close(struct usb_xfer *xfer)
Definition: ohci.c:1813

Definition at line 119 of file ohci.c.

Referenced by ohci_check_transfer(), ohci_device_done(), ohci_ep_init(), and ohci_xfer_setup().

◆ ohci_hubd

const struct usb_hub_descriptor ohci_hubd
static
Initial value:
=
{
.bDescLength = 0,
.bDescriptorType = UDESC_HUB,
}
#define UDESC_HUB
Definition: usb.h:214

Definition at line 2042 of file ohci.c.

Referenced by ohci_roothub_exec().