FreeBSD kernel usb device Code
|
Go to the source code of this file.
Data Structures | |
struct | ohci_hcca |
struct | ohci_ed |
struct | ohci_td |
struct | ohci_itd |
struct | ohci_hw_softc |
struct | ohci_config_desc |
union | ohci_hub_desc |
struct | ohci_softc |
Macros | |
#define | OHCI_MAX_DEVICES MIN(USB_MAX_DEVICES, 128) |
#define | OHCI_NO_INTRS 32 |
#define | OHCI_HCCA_SIZE 256 |
#define | OHCI_HCCA_ALIGN 256 |
#define | OHCI_ED_ALIGN 16 |
#define | OHCI_TD_ALIGN 16 |
#define | OHCI_ITD_ALIGN 32 |
#define | OHCI_PAGE_SIZE 0x1000 |
#define | OHCI_PAGE(x) ((x) &~ 0xfff) |
#define | OHCI_PAGE_OFFSET(x) ((x) & 0xfff) |
#define | OHCI_PAGE_MASK(x) ((x) & 0xfff) |
#define | OHCI_VIRTUAL_FRAMELIST_COUNT 128/* dummy */ |
#define | OHCI_DONE_INTRS 1 |
#define | OHCI_ED_GET_FA(s) ((s) & 0x7f) |
#define | OHCI_ED_ADDRMASK 0x0000007f |
#define | OHCI_ED_SET_FA(s) (s) |
#define | OHCI_ED_GET_EN(s) (((s) >> 7) & 0xf) |
#define | OHCI_ED_SET_EN(s) ((s) << 7) |
#define | OHCI_ED_DIR_MASK 0x00001800 |
#define | OHCI_ED_DIR_TD 0x00000000 |
#define | OHCI_ED_DIR_OUT 0x00000800 |
#define | OHCI_ED_DIR_IN 0x00001000 |
#define | OHCI_ED_SPEED 0x00002000 |
#define | OHCI_ED_SKIP 0x00004000 |
#define | OHCI_ED_FORMAT_GEN 0x00000000 |
#define | OHCI_ED_FORMAT_ISO 0x00008000 |
#define | OHCI_ED_GET_MAXP(s) (((s) >> 16) & 0x07ff) |
#define | OHCI_ED_SET_MAXP(s) ((s) << 16) |
#define | OHCI_ED_MAXPMASK (0x7ff << 16) |
#define | OHCI_HALTED 0x00000001 |
#define | OHCI_TOGGLECARRY 0x00000002 |
#define | OHCI_HEADMASK 0xfffffffc |
#define | OHCI_TD_R 0x00040000 /* Buffer Rounding */ |
#define | OHCI_TD_DP_MASK 0x00180000 /* Direction / PID */ |
#define | OHCI_TD_SETUP 0x00000000 |
#define | OHCI_TD_OUT 0x00080000 |
#define | OHCI_TD_IN 0x00100000 |
#define | OHCI_TD_GET_DI(x) (((x) >> 21) & 7) /* Delay Interrupt */ |
#define | OHCI_TD_SET_DI(x) ((x) << 21) |
#define | OHCI_TD_NOINTR 0x00e00000 |
#define | OHCI_TD_INTR_MASK 0x00e00000 |
#define | OHCI_TD_TOGGLE_CARRY 0x00000000 |
#define | OHCI_TD_TOGGLE_0 0x02000000 |
#define | OHCI_TD_TOGGLE_1 0x03000000 |
#define | OHCI_TD_TOGGLE_MASK 0x03000000 |
#define | OHCI_TD_GET_EC(x) (((x) >> 26) & 3) /* Error Count */ |
#define | OHCI_TD_GET_CC(x) ((x) >> 28) /* Condition Code */ |
#define | OHCI_TD_SET_CC(x) ((x) << 28) |
#define | OHCI_TD_NOCC 0xf0000000 |
#define | OHCI_TD_NEXT_END 0 |
#define | OHCI_ITD_GET_SF(x) ((x) & 0x0000ffff) |
#define | OHCI_ITD_SET_SF(x) ((x) & 0xffff) |
#define | OHCI_ITD_GET_DI(x) (((x) >> 21) & 7) /* Delay Interrupt */ |
#define | OHCI_ITD_SET_DI(x) ((x) << 21) |
#define | OHCI_ITD_NOINTR 0x00e00000 |
#define | OHCI_ITD_GET_FC(x) ((((x) >> 24) & 7)+1) /* Frame Count */ |
#define | OHCI_ITD_SET_FC(x) (((x)-1) << 24) |
#define | OHCI_ITD_GET_CC(x) ((x) >> 28) /* Condition Code */ |
#define | OHCI_ITD_NOCC 0xf0000000 |
#define | OHCI_ITD_NOFFSET 8 |
#define | OHCI_ITD_PAGE_SELECT 0x00001000 |
#define | OHCI_ITD_MK_OFFS(len) (0xe000 | ((len) & 0x1fff)) |
#define | OHCI_ITD_PSW_LENGTH(x) ((x) & 0xfff) /* Transfer length */ |
#define | OHCI_ITD_PSW_GET_CC(x) ((x) >> 12) /* Condition Code */ |
#define | OHCI_CC_NO_ERROR 0 |
#define | OHCI_CC_CRC 1 |
#define | OHCI_CC_BIT_STUFFING 2 |
#define | OHCI_CC_DATA_TOGGLE_MISMATCH 3 |
#define | OHCI_CC_STALL 4 |
#define | OHCI_CC_DEVICE_NOT_RESPONDING 5 |
#define | OHCI_CC_PID_CHECK_FAILURE 6 |
#define | OHCI_CC_UNEXPECTED_PID 7 |
#define | OHCI_CC_DATA_OVERRUN 8 |
#define | OHCI_CC_DATA_UNDERRUN 9 |
#define | OHCI_CC_BUFFER_OVERRUN 12 |
#define | OHCI_CC_BUFFER_UNDERRUN 13 |
#define | OHCI_CC_NOT_ACCESSED 15 |
#define | OHCI_ENABLE_POWER_DELAY 5 |
#define | OHCI_READ_DESC_DELAY 5 |
#define | OHCI_NO_EDS (2*OHCI_NO_INTRS) |
Typedefs | |
typedef struct ohci_hcca | ohci_hcca_t |
typedef struct ohci_ed | ohci_ed_t |
typedef struct ohci_td | ohci_td_t |
typedef struct ohci_itd | ohci_itd_t |
typedef struct ohci_softc | ohci_softc_t |
Functions | |
struct ohci_hcca | __aligned (OHCI_HCCA_ALIGN) |
struct ohci_ed | __aligned (OHCI_ED_ALIGN) |
struct ohci_td | __aligned (OHCI_TD_ALIGN) |
struct ohci_itd | __aligned (OHCI_ITD_ALIGN) |
usb_error_t | ohci_init (ohci_softc_t *sc) |
void | ohci_detach (struct ohci_softc *sc) |
void | ohci_interrupt (ohci_softc_t *sc) |
Variables | |
volatile uint32_t | hcca_interrupt_table [OHCI_NO_INTRS] |
volatile uint32_t | hcca_frame_number |
volatile uint32_t | hcca_done_head |
volatile uint32_t | ed_flags |
volatile uint32_t | ed_tailp |
volatile uint32_t | ed_headp |
volatile uint32_t | ed_next |
struct ohci_ed * | next |
struct ohci_ed * | prev |
struct ohci_ed * | obj_next |
struct usb_page_cache * | page_cache |
uint32_t | ed_self |
volatile uint32_t | td_flags |
volatile uint32_t | td_cbp |
volatile uint32_t | td_next |
volatile uint32_t | td_be |
struct ohci_td * | alt_next |
uint32_t | td_self |
uint16_t | len |
volatile uint32_t | itd_flags |
volatile uint32_t | itd_bp0 |
volatile uint32_t | itd_next |
volatile uint32_t | itd_be |
volatile uint16_t | itd_offset [OHCI_ITD_NOFFSET] |
uint32_t | itd_self |
uint8_t | frames |
struct ohci_hw_softc | __aligned |
struct ohci_config_desc | __packed |
usb_bus_mem_cb_t | ohci_iterate_hw_softc |
#define OHCI_ITD_GET_DI | ( | x | ) | (((x) >> 21) & 7) /* Delay Interrupt */ |
#define OHCI_ITD_GET_FC | ( | x | ) | ((((x) >> 24) & 7)+1) /* Frame Count */ |
#define OHCI_ITD_PSW_GET_CC | ( | x | ) | ((x) >> 12) /* Condition Code */ |
#define OHCI_ITD_PSW_LENGTH | ( | x | ) | ((x) & 0xfff) /* Transfer length */ |
#define OHCI_MAX_DEVICES MIN(USB_MAX_DEVICES, 128) |
#define OHCI_NO_EDS (2*OHCI_NO_INTRS) |
#define OHCI_TD_GET_DI | ( | x | ) | (((x) >> 21) & 7) /* Delay Interrupt */ |
#define OHCI_TD_GET_EC | ( | x | ) | (((x) >> 26) & 3) /* Error Count */ |
typedef struct ohci_hcca ohci_hcca_t |
typedef struct ohci_itd ohci_itd_t |
typedef struct ohci_softc ohci_softc_t |
struct ohci_ed __aligned | ( | OHCI_ED_ALIGN | ) |
struct ohci_hcca __aligned | ( | OHCI_HCCA_ALIGN | ) |
struct ohci_itd __aligned | ( | OHCI_ITD_ALIGN | ) |
struct ohci_td __aligned | ( | OHCI_TD_ALIGN | ) |
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().
usb_error_t ohci_init | ( | ohci_softc_t * | sc | ) |
Definition at line 323 of file ohci.c.
References usb_page_search::buffer, ohci_hw_softc::bulk_start_pc, usb_bus::bus_mtx, ohci_hw_softc::ctrl_start_pc, DPRINTF, ohci_ed::ed_next, ed_self, ohci_ed::ed_self, ohci_hcca::hcca_interrupt_table, ohci_hw_softc::hcca_pc, ohci_hw_softc::intr_start_pc, ohci_hw_softc::isoc_start_pc, usb_bus::methods, ohci_ed::next, ohci_bus_methods, ohci_controller_init(), ohci_do_poll(), ohci_init_ed(), ohci_iterate_hw_softc(), OHCI_NO_EDS, OHCI_NO_INTRS, OHCI_NORMAL_INTRS, ohci_softc::sc_bulk_p_last, ohci_softc::sc_bus, ohci_softc::sc_ctrl_p_last, ohci_softc::sc_eintrs, ohci_softc::sc_hcca_p, ohci_softc::sc_hw, ohci_softc::sc_intr_p_last, ohci_softc::sc_isoc_p_last, ohci_softc::sc_tmo_rhsc, usb_bus_mem_flush_all(), usb_callout_init_mtx, USB_ERR_INVAL, USB_ERR_NORMAL_COMPLETION, USB_REV_1_0, usbd_get_page(), and usb_bus::usbrev.
Referenced by generic_ohci_attach(), and ohci_pci_attach().
void ohci_interrupt | ( | ohci_softc_t * | sc | ) |
Definition at line 1106 of file ohci.c.
References ohci_hcca::hcca_done_head, ohci_hw_softc::hcca_pc, OHCI_CONTROL, OHCI_DONE_INTRS, ohci_get_hcca(), OHCI_HCFS_RESET, OHCI_INTERRUPT_DISABLE, ohci_interrupt_poll(), OHCI_INTERRUPT_STATUS, OHCI_RD, OHCI_RHSC, ohci_rhsc_enable(), ohci_root_intr(), OHCI_SO, OHCI_UE, OHCI_WDH, OREAD4, OWRITE4, ohci_softc::sc_bus, ohci_softc::sc_eintrs, ohci_softc::sc_hw, ohci_softc::sc_tmo_rhsc, status, USB_BUS_LOCK, USB_BUS_UNLOCK, usb_callout_reset, and usb_pc_cpu_flush().
Referenced by generic_ohci_attach(), and ohci_pci_attach().
struct ohci_hw_softc __aligned |
struct ohci_config_desc __packed |
volatile uint32_t ed_flags |
Definition at line 0 of file ohci.h.
Referenced by ohci_device_isoc_enter(), and ohci_setup_standard_chain().
volatile uint32_t ed_headp |
Definition at line 18 of file ohci.h.
Referenced by ohci_check_transfer().
uint32_t ed_self |
Definition at line 30 of file ohci.h.
Referenced by ohci_init().
volatile uint32_t ed_tailp |
Definition at line 17 of file ohci.h.
Referenced by ohci_check_transfer().
volatile uint32_t hcca_interrupt_table[OHCI_NO_INTRS] |
volatile uint16_t itd_offset[OHCI_ITD_NOFFSET] |
Definition at line 14 of file ohci.h.
Referenced by ehci_device_isoc_hs_enter(), and ohci_device_isoc_enter().
usb_bus_mem_cb_t ohci_iterate_hw_softc |
Definition at line 259 of file ohci.h.
Referenced by generic_ohci_attach(), generic_ohci_detach(), ohci_pci_attach(), and ohci_pci_detach().
struct usb_page_cache* page_cache |
volatile uint32_t td_flags |
Definition at line 0 of file ohci.h.
Referenced by ohci_check_transfer_sub(), and ohci_non_isoc_done_sub().
volatile uint32_t td_next |
Definition at line 19 of file ohci.h.
Referenced by ehci_setup_standard_chain_sub(), ohci_check_transfer_sub(), ohci_setup_standard_chain_sub(), uhci_setup_standard_chain_sub(), and xhci_setup_generic_chain_sub().
uint32_t td_self |
Definition at line 28 of file ohci.h.
Referenced by uhci_check_transfer_sub().