#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include "xhci.h"
#include "xhci-mtk.h"
#define SSP_BW_BOUNDARY …
#define SS_BW_BOUNDARY …
#define HS_BW_BOUNDARY …
#define FS_PAYLOAD_MAX …
#define LS_PAYLOAD_MAX …
#define FS_BW_BOUNDARY …
#define LS_BW_BOUNDARY …
#define TT_MICROFRAMES_MAX …
#define CS_OFFSET …
#define DBG_BUF_EN …
#define ESCH_SS_Y6 …
#define ESCH_SS_OVERLAP …
#define ESCH_CS_OVERFLOW …
#define ESCH_BW_OVERFLOW …
#define ESCH_FIXME …
#define EP_BPKTS(p) …
#define EP_BCSCOUNT(p) …
#define EP_BBM(p) …
#define EP_BOFFSET(p) …
#define EP_BREPEAT(p) …
static char *sch_error_string(int err_num)
{ … }
static int is_fs_or_ls(enum usb_device_speed speed)
{ … }
static const char *
decode_ep(struct usb_host_endpoint *ep, enum usb_device_speed speed)
{ … }
static u32 get_bw_boundary(enum usb_device_speed speed)
{ … }
static struct mu3h_sch_bw_info *
get_bw_info(struct xhci_hcd_mtk *mtk, struct usb_device *udev,
struct usb_host_endpoint *ep)
{ … }
static u32 get_esit(struct xhci_ep_ctx *ep_ctx)
{ … }
static struct mu3h_sch_tt *find_tt(struct usb_device *udev)
{ … }
static void drop_tt(struct usb_device *udev)
{ … }
static struct mu3h_sch_ep_info *
create_sch_ep(struct xhci_hcd_mtk *mtk, struct usb_device *udev,
struct usb_host_endpoint *ep, struct xhci_ep_ctx *ep_ctx)
{ … }
static void setup_sch_info(struct xhci_ep_ctx *ep_ctx,
struct mu3h_sch_ep_info *sch_ep)
{ … }
static u32 get_max_bw(struct mu3h_sch_bw_info *sch_bw,
struct mu3h_sch_ep_info *sch_ep, u32 offset)
{ … }
static u16 get_fs_bw(struct mu3h_sch_ep_info *sch_ep, int offset)
{ … }
static void update_bus_bw(struct mu3h_sch_bw_info *sch_bw,
struct mu3h_sch_ep_info *sch_ep, bool used)
{ … }
static int check_ls_budget_microframes(struct mu3h_sch_ep_info *sch_ep, int offset)
{ … }
static int check_fs_budget_microframes(struct mu3h_sch_ep_info *sch_ep, int offset)
{ … }
static int check_fs_budget_frames(struct mu3h_sch_ep_info *sch_ep, int offset)
{ … }
static int check_fs_bus_bw(struct mu3h_sch_ep_info *sch_ep, int offset)
{ … }
static int check_ss_and_cs(struct mu3h_sch_ep_info *sch_ep, u32 offset)
{ … }
static int check_isoc_ss_overlap(struct mu3h_sch_ep_info *sch_ep, u32 offset)
{ … }
static int check_sch_tt_budget(struct mu3h_sch_ep_info *sch_ep, u32 offset)
{ … }
static int alloc_sch_portion_of_frame(struct mu3h_sch_ep_info *sch_ep)
{ … }
static void update_sch_tt(struct mu3h_sch_ep_info *sch_ep, bool used)
{ … }
static int load_ep_bw(struct mu3h_sch_bw_info *sch_bw,
struct mu3h_sch_ep_info *sch_ep, bool loaded)
{ … }
static int alloc_sch_microframes(struct mu3h_sch_ep_info *sch_ep)
{ … }
static int check_sch_bw(struct mu3h_sch_ep_info *sch_ep)
{ … }
static void destroy_sch_ep(struct xhci_hcd_mtk *mtk, struct usb_device *udev,
struct mu3h_sch_ep_info *sch_ep)
{ … }
static bool need_bw_sch(struct usb_device *udev,
struct usb_host_endpoint *ep)
{ … }
int xhci_mtk_sch_init(struct xhci_hcd_mtk *mtk)
{ … }
void xhci_mtk_sch_exit(struct xhci_hcd_mtk *mtk)
{ … }
static int add_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev,
struct usb_host_endpoint *ep)
{ … }
static void drop_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev,
struct usb_host_endpoint *ep)
{ … }
int xhci_mtk_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
{ … }
void xhci_mtk_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
{ … }
int xhci_mtk_add_ep(struct usb_hcd *hcd, struct usb_device *udev,
struct usb_host_endpoint *ep)
{ … }
int xhci_mtk_drop_ep(struct usb_hcd *hcd, struct usb_device *udev,
struct usb_host_endpoint *ep)
{ … }