blob: 75d9d9be15ccb390b6655a57661b3f129c09a223 [file] [log] [blame]
#ifndef _UBM_EXPORT_INC
#define _UBM_EXPORT_INC
#include "ubm_type.h"
#include "usbc_custom.h"
#include "lhif_if.h"
#ifndef __UBM_UT__
#include "hif_common.h"
#include "hifusb_qmu.h"
#endif
/* Init */
void ubm_init();
/* FHB */
kal_uint8 ubm_set_fhb(const void* headerPattern, kal_uint8 size, const char* headerName);
kal_bool ubm_update_fhb(const void* headerPattern, kal_uint8 size, const char* headerName);
kal_bool ubm_clean_fhb(const char* headerName);
kal_uint8 ubm_get_fhb_type(const char* headerName);
/* NFHB */
kal_uint8* ubm_allocate_nfhb(kal_uint8 txQueNo, kal_uint32 allocSize);
void ubm_release_nfhb(kal_uint8 txQueNo, void* nfhbAddr, kal_uint32 relSize);
/* VRB address virtual/physical translate */
ubm_vrb_phy_addr ubm_addr_vir2phy_and_save(kal_uint8 txQueNo, kal_uint32 virAddr, kal_uint16 virLen);
kal_uint32 ubm_addr_phy2vir_and_delete(kal_uint8 txQueNo, kal_uint32 phyAddr);
/* VRB release */
void ubm_vrb_virtual_addr_release(void* vrbVirAddr, kal_uint16 relLen);
/* DRB */
void ubm_drb_init_properties();
kal_bool ubm_drb_quest_unused(kal_uint8 txQueNo, kal_uint32 alloCount);
kal_bool ubm_drb_submit(kal_uint8 txQueNo, kal_uint32 submitCount);
void ubm_drb_repay(kal_uint8 txQueNo);
kal_bool ubm_drb_release(kal_uint8 txQueNo, kal_uint32 headIdx, kal_uint32 relCount);
kal_uint32 ubm_drb_poll(kal_uint8 txQueNo, kal_uint32* headIdx, kal_uint32* tailIdx);
kal_bool ubm_drb_get_one_writable_Idx(kal_uint8 txQueNo, kal_uint32* writeIdx);
kal_bool ubm_drb_revert_one_write(kal_uint8 txQueNo);
usbq_dl_pd_drb* ubm_drb_idx2addr(kal_uint8 txQueNo, kal_uint32 drbIndex);
kal_uint32 ubm_drb_addr2idx(kal_uint8 txQueNo, usbq_dl_pd_drb* drbPtr);
kal_bool ubm_drb_flush(kal_uint8 txQueNo, kal_uint32* headIdx, kal_uint32* tailIdx, kal_uint32* num);
/* XIT */
kal_bool ubm_xit_release(kal_uint8 rxQueNo, kal_uint16 headIdx, kal_uint32 relCount);
kal_uint32 ubm_xit_poll(kal_uint8 rxQueNo, kal_uint16* headIdx, kal_uint16* tailIdx, kal_uint16* relIdx);
usbq_ul_xit* ubm_xit_idx2addr(kal_uint8 rxQueNo, kal_uint32 xitIndex);
kal_uint32 ubm_xit_addr2idx(kal_uint8 rxQueNo, usbq_ul_xit* xitPtr);
kal_uint32 ubm_xit_get_next_idx(kal_uint8 rxQueNo, kal_uint32 xitIndex);
kal_bool ubm_xit_flush(kal_uint8 rxQueNo, kal_uint32* headIdx, kal_uint32* tailIdx, kal_uint32* num);
/* UL META */
lhif_meta_tbl_t* ubm_ul_meta_idx2addr(kal_uint8 rxQueNo, kal_uint16 xitIndex);
kal_uint16 ubm_ul_meta_get_next_idx(kal_uint8 rxQueNo, kal_uint16 xitIndex);
void ubm_ul_meta_init_properties();
LHIF_NET_TYPE ubm_ul_meta_get_lhif_net_type(kal_uint8 rxQueNo, usb_class_type_e classType);
kal_bool ubm_ul_meta_enqueue_lhif_ul_queue(kal_uint8 rxQueNo, LHIF_NET_TYPE lhifNetType,kal_uint8 usbclassDevId, void* dataAddr, kal_uint16 dataLen);
kal_bool ubm_ul_meta_enqueue_lhif_ul_queue_did(kal_uint8 rxQueNo, LHIF_NET_TYPE lhifNetType, kal_uint8 usbclassDevId, LHIF_NET_IF net_if, void* did);
lhif_meta_tbl_t* ubm_ul_meta_get_base();
/****************************************************************************/
#endif /* _UBM_EXPORT_INC */