#ifndef _SYS_USB_EHCI_XFER_H
#define _SYS_USB_EHCI_XFER_H
#ifdef __cplusplus
extern "C" {
#endif
extern ehci_qh_t *ehci_alloc_qh(
ehci_state_t *ehcip,
usba_pipe_handle_data_t *ph,
uint_t flag);
extern void ehci_insert_qh(
ehci_state_t *ehcip,
usba_pipe_handle_data_t *ph);
extern void ehci_remove_qh(
ehci_state_t *ehcip,
ehci_pipe_private_t *pp,
boolean_t reclaim);
extern void ehci_deallocate_qh(
ehci_state_t *ehcip,
ehci_qh_t *old_qh);
extern uint32_t ehci_qh_cpu_to_iommu(
ehci_state_t *ehcip,
ehci_qh_t *addr);
extern ehci_qh_t *ehci_qh_iommu_to_cpu(
ehci_state_t *ehcip,
uintptr_t addr);
extern ehci_trans_wrapper_t *ehci_allocate_ctrl_resources(
ehci_state_t *ehcip,
ehci_pipe_private_t *pp,
usb_ctrl_req_t *ctrl_reqp,
usb_flags_t usb_flags);
extern void ehci_insert_ctrl_req(
ehci_state_t *ehcip,
usba_pipe_handle_data_t *ph,
usb_ctrl_req_t *ctrl_reqp,
ehci_trans_wrapper_t *tw,
usb_flags_t usb_flags);
extern ehci_trans_wrapper_t *ehci_allocate_bulk_resources(
ehci_state_t *ehcip,
ehci_pipe_private_t *pp,
usb_bulk_req_t *bulk_reqp,
usb_flags_t usb_flags);
extern void ehci_insert_bulk_req(
ehci_state_t *ehcip,
usba_pipe_handle_data_t *ph,
usb_bulk_req_t *bulk_reqp,
ehci_trans_wrapper_t *tw,
usb_flags_t flags);
extern int ehci_start_periodic_pipe_polling(
ehci_state_t *ehcip,
usba_pipe_handle_data_t *ph,
usb_opaque_t periodic_in_reqp,
usb_flags_t flags);
extern ehci_trans_wrapper_t *ehci_allocate_intr_resources(
ehci_state_t *ehcip,
usba_pipe_handle_data_t *ph,
usb_intr_req_t *intr_reqp,
usb_flags_t usb_flags);
extern void ehci_insert_intr_req(
ehci_state_t *ehcip,
ehci_pipe_private_t *pp,
ehci_trans_wrapper_t *tw,
usb_flags_t flags);
extern int ehci_stop_periodic_pipe_polling(
ehci_state_t *ehcip,
usba_pipe_handle_data_t *ph,
usb_flags_t flags);
extern int ehci_insert_qtd(
ehci_state_t *ehcip,
uint32_t qtd_ctrl,
size_t qtd_dma_offs,
size_t qtd_length,
uint32_t qtd_flag,
ehci_pipe_private_t *pp,
ehci_trans_wrapper_t *tw);
extern void ehci_remove_qtd_from_active_qtd_list(
ehci_state_t *ehcip,
ehci_qtd_t *curr_qtd);
extern void ehci_deallocate_qtd(
ehci_state_t *ehcip,
ehci_qtd_t *old_qtd);
extern uint32_t ehci_qtd_cpu_to_iommu(
ehci_state_t *ehcip,
ehci_qtd_t *addr);
extern ehci_qtd_t *ehci_qtd_iommu_to_cpu(
ehci_state_t *ehcip,
uintptr_t addr);
extern int ehci_allocate_tds_for_tw(
ehci_state_t *ehcip,
ehci_pipe_private_t *pp,
ehci_trans_wrapper_t *tw,
size_t qtd_count);
extern void ehci_stop_xfer_timer(
ehci_state_t *ehcip,
ehci_trans_wrapper_t *tw,
uint_t flag);
extern void ehci_deallocate_tw(
ehci_state_t *ehcip,
ehci_pipe_private_t *pp,
ehci_trans_wrapper_t *tw);
extern void ehci_free_dma_resources(
ehci_state_t *ehcip,
usba_pipe_handle_data_t *ph);
extern int ehci_allocate_intr_in_resource(
ehci_state_t *ehcip,
ehci_pipe_private_t *pp,
ehci_trans_wrapper_t *tw,
usb_flags_t flags);
extern void ehci_deallocate_intr_in_resource(
ehci_state_t *ehcip,
ehci_pipe_private_t *pp,
ehci_trans_wrapper_t *tw);
extern void ehci_pipe_cleanup(
ehci_state_t *ehcip,
usba_pipe_handle_data_t *ph);
extern void ehci_check_for_transfers_completion(
ehci_state_t *ehcip,
ehci_pipe_private_t *pp);
extern void ehci_restore_data_toggle(
ehci_state_t *ehcip,
usba_pipe_handle_data_t *ph);
extern void ehci_handle_outstanding_requests(
ehci_state_t *ehcip,
ehci_pipe_private_t *pp);
extern void ehci_do_client_periodic_in_req_callback(
ehci_state_t *ehcip,
ehci_pipe_private_t *pp,
usb_cr_t completion_reason);
extern void ehci_hcdi_callback(
usba_pipe_handle_data_t *ph,
ehci_trans_wrapper_t *tw,
usb_cr_t completion_reason);
extern void ehci_handle_clear_tt_buffer(
ehci_state_t *ehcip,
ehci_pipe_private_t *pp,
ehci_trans_wrapper_t *tw,
ehci_qtd_t *qtd,
void *);
extern void ehci_handle_clear_tt_buffer_error(
ehci_state_t *ehcip,
ehci_pipe_private_t *hub_pp,
ehci_trans_wrapper_t *tw,
ehci_qtd_t *qtd,
void *,
usb_cr_t error);
#ifdef __cplusplus
}
#endif
#endif