#ifndef _SYS_USB_EHCI_ISOCH_UTIL_H
#define _SYS_USB_EHCI_ISOCH_UTIL_H
#ifdef __cplusplus
extern "C" {
#endif
extern int ehci_allocate_isoc_pools(
ehci_state_t *ehcip);
extern int ehci_get_itd_pool_size();
extern ehci_isoc_xwrapper_t *ehci_allocate_itw_resources(
ehci_state_t *ehcip,
ehci_pipe_private_t *pp,
size_t itw_length,
usb_flags_t usb_flags,
size_t pkt_count);
extern void ehci_deallocate_itw(
ehci_state_t *ehcip,
ehci_pipe_private_t *pp,
ehci_isoc_xwrapper_t *itw);
extern ehci_itd_t *ehci_allocate_itd(
ehci_state_t *ehcip);
extern void ehci_deallocate_itd(
ehci_state_t *ehcip,
ehci_isoc_xwrapper_t *itw,
ehci_itd_t *old_itd);
extern uint_t ehci_calc_num_itds(
ehci_isoc_xwrapper_t *itw,
size_t pkt_count);
extern int ehci_allocate_itds_for_itw(
ehci_state_t *ehcip,
ehci_isoc_xwrapper_t *itw,
uint_t itd_count);
extern void ehci_insert_itd_on_itw(
ehci_state_t *ehcip,
ehci_isoc_xwrapper_t *itw,
ehci_itd_t *itd);
extern void ehci_insert_itd_into_active_list(
ehci_state_t *ehcip,
ehci_itd_t *itd);
extern void ehci_remove_itd_from_active_list(
ehci_state_t *ehcip,
ehci_itd_t *itd);
extern ehci_itd_t *ehci_create_done_itd_list(
ehci_state_t *ehcip);
extern int ehci_insert_isoc_to_pfl(
ehci_state_t *ehcip,
ehci_pipe_private_t *pp,
ehci_isoc_xwrapper_t *itw);
extern void ehci_remove_isoc_from_pfl(
ehci_state_t *ehcip,
ehci_itd_t *curr_itd);
extern int ehci_allocate_isoc_in_resource(
ehci_state_t *ehcip,
ehci_pipe_private_t *pp,
ehci_isoc_xwrapper_t *tw,
usb_flags_t flags);
extern void ehci_deallocate_isoc_in_resource(
ehci_state_t *ehcip,
ehci_pipe_private_t *pp,
ehci_isoc_xwrapper_t *itw);
extern uint32_t ehci_itd_cpu_to_iommu(
ehci_state_t *ehcip,
ehci_itd_t *addr);
extern ehci_itd_t *ehci_itd_iommu_to_cpu(
ehci_state_t *ehcip,
uintptr_t addr);
extern void ehci_parse_isoc_error(
ehci_state_t *ehcip,
ehci_isoc_xwrapper_t *itw,
ehci_itd_t *itd);
extern void ehci_print_itd(
ehci_state_t *ehcip,
ehci_itd_t *itd);
extern void ehci_print_sitd(
ehci_state_t *ehcip,
ehci_itd_t *itd);
#ifdef __cplusplus
}
#endif
#endif