linux/drivers/usb/c67x00/c67x00-sched.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * c67x00-sched.c: Cypress C67X00 USB Host Controller Driver - TD scheduling
 *
 * Copyright (C) 2006-2008 Barco N.V.
 *    Derived from the Cypress cy7c67200/300 ezusb linux driver and
 *    based on multiple host controller drivers inside the linux kernel.
 */

#include <linux/kthread.h>
#include <linux/slab.h>

#include "c67x00.h"
#include "c67x00-hcd.h"

/*
 * These are the stages for a control urb, they are kept
 * in both urb->interval and td->privdata.
 */
#define SETUP_STAGE
#define DATA_STAGE
#define STATUS_STAGE

/* -------------------------------------------------------------------------- */

/*
 * struct c67x00_ep_data: Host endpoint data structure
 */
struct c67x00_ep_data {};

/*
 * struct c67x00_td
 *
 * Hardware parts are little endiannes, SW in CPU endianess.
 */
struct c67x00_td {};

struct c67x00_urb_priv {};

#define td_udev(td)

#define CY_TD_SIZE

#define TD_PIDEP_OFFSET
#define TD_PIDEPMASK_PID
#define TD_PIDEPMASK_EP
#define TD_PORTLENMASK_DL
#define TD_PORTLENMASK_PN

#define TD_STATUS_OFFSET
#define TD_STATUSMASK_ACK
#define TD_STATUSMASK_ERR
#define TD_STATUSMASK_TMOUT
#define TD_STATUSMASK_SEQ
#define TD_STATUSMASK_SETUP
#define TD_STATUSMASK_OVF
#define TD_STATUSMASK_NAK
#define TD_STATUSMASK_STALL

#define TD_ERROR_MASK

#define TD_RETRYCNT_OFFSET
#define TD_RETRYCNTMASK_ACT_FLG
#define TD_RETRYCNTMASK_TX_TYPE
#define TD_RETRYCNTMASK_RTY_CNT

#define TD_RESIDUE_OVERFLOW

#define TD_PID_IN

/* Residue: signed 8bits, neg -> OVERFLOW, pos -> UNDERFLOW */
#define td_residue(td)
#define td_ly_base_addr(td)
#define td_port_length(td)
#define td_next_td_addr(td)

#define td_active(td)
#define td_length(td)

#define td_sequence_ok(td)

#define td_acked(td)
#define td_actual_bytes(td)

/* -------------------------------------------------------------------------- */

/*
 * dbg_td - Dump the contents of the TD
 */
static void dbg_td(struct c67x00_hcd *c67x00, struct c67x00_td *td, char *msg)
{}

/* -------------------------------------------------------------------------- */
/* Helper functions */

static inline u16 c67x00_get_current_frame_number(struct c67x00_hcd *c67x00)
{}

/*
 * frame_add
 * Software wraparound for framenumbers.
 */
static inline u16 frame_add(u16 a, u16 b)
{}

/*
 * frame_after - is frame a after frame b
 */
static inline int frame_after(u16 a, u16 b)
{}

/*
 * frame_after_eq - is frame a after or equal to frame b
 */
static inline int frame_after_eq(u16 a, u16 b)
{}

/* -------------------------------------------------------------------------- */

/*
 * c67x00_release_urb - remove link from all tds to this urb
 * Disconnects the urb from it's tds, so that it can be given back.
 * pre: urb->hcpriv != NULL
 */
static void c67x00_release_urb(struct c67x00_hcd *c67x00, struct urb *urb)
{}

/* -------------------------------------------------------------------------- */

static struct c67x00_ep_data *
c67x00_ep_data_alloc(struct c67x00_hcd *c67x00, struct urb *urb)
{}

static int c67x00_ep_data_free(struct usb_host_endpoint *hep)
{}

void c67x00_endpoint_disable(struct usb_hcd *hcd, struct usb_host_endpoint *ep)
{}

/* -------------------------------------------------------------------------- */

static inline int get_root_port(struct usb_device *dev)
{}

int c67x00_urb_enqueue(struct usb_hcd *hcd,
		       struct urb *urb, gfp_t mem_flags)
{}

int c67x00_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
{}

/* -------------------------------------------------------------------------- */

/*
 * pre: c67x00 locked, urb unlocked
 */
static void
c67x00_giveback_urb(struct c67x00_hcd *c67x00, struct urb *urb, int status)
{}

/* -------------------------------------------------------------------------- */

static int c67x00_claim_frame_bw(struct c67x00_hcd *c67x00, struct urb *urb,
				 int len, int periodic)
{}

/* -------------------------------------------------------------------------- */

/*
 * td_addr and buf_addr must be word aligned
 */
static int c67x00_create_td(struct c67x00_hcd *c67x00, struct urb *urb,
			    void *data, int len, int pid, int toggle,
			    unsigned long privdata)
{}

static inline void c67x00_release_td(struct c67x00_td *td)
{}

/* -------------------------------------------------------------------------- */

static int c67x00_add_data_urb(struct c67x00_hcd *c67x00, struct urb *urb)
{}

/*
 * return 0 in case more bandwidth is available, else errorcode
 */
static int c67x00_add_ctrl_urb(struct c67x00_hcd *c67x00, struct urb *urb)
{}

/*
 * return 0 in case more bandwidth is available, else errorcode
 */
static int c67x00_add_int_urb(struct c67x00_hcd *c67x00, struct urb *urb)
{}

static int c67x00_add_iso_urb(struct c67x00_hcd *c67x00, struct urb *urb)
{}

/* -------------------------------------------------------------------------- */

static void c67x00_fill_from_list(struct c67x00_hcd *c67x00, int type,
				  int (*add)(struct c67x00_hcd *, struct urb *))
{}

static void c67x00_fill_frame(struct c67x00_hcd *c67x00)
{}

/* -------------------------------------------------------------------------- */

/*
 * Get TD from C67X00
 */
static inline void
c67x00_parse_td(struct c67x00_hcd *c67x00, struct c67x00_td *td)
{}

static int c67x00_td_to_error(struct c67x00_hcd *c67x00, struct c67x00_td *td)
{}

static inline int c67x00_end_of_data(struct c67x00_td *td)
{}

/* -------------------------------------------------------------------------- */

/* Remove all td's from the list which come
 * after last_td and are meant for the same pipe.
 * This is used when a short packet has occurred */
static inline void c67x00_clear_pipe(struct c67x00_hcd *c67x00,
				     struct c67x00_td *last_td)
{}

/* -------------------------------------------------------------------------- */

static void c67x00_handle_successful_td(struct c67x00_hcd *c67x00,
					struct c67x00_td *td)
{}

static void c67x00_handle_isoc(struct c67x00_hcd *c67x00, struct c67x00_td *td)
{}

/* -------------------------------------------------------------------------- */

/*
 * c67x00_check_td_list - handle tds which have been processed by the c67x00
 * pre: current_td == 0
 */
static inline void c67x00_check_td_list(struct c67x00_hcd *c67x00)
{}

/* -------------------------------------------------------------------------- */

static inline int c67x00_all_tds_processed(struct c67x00_hcd *c67x00)
{}

/*
 * Send td to C67X00
 */
static void c67x00_send_td(struct c67x00_hcd *c67x00, struct c67x00_td *td)
{}

static void c67x00_send_frame(struct c67x00_hcd *c67x00)
{}

/* -------------------------------------------------------------------------- */

/*
 * c67x00_do_work - Schedulers state machine
 */
static void c67x00_do_work(struct c67x00_hcd *c67x00)
{}

/* -------------------------------------------------------------------------- */

static void c67x00_sched_work(struct work_struct *work)
{}

void c67x00_sched_kick(struct c67x00_hcd *c67x00)
{}

int c67x00_sched_start_scheduler(struct c67x00_hcd *c67x00)
{}

void c67x00_sched_stop_scheduler(struct c67x00_hcd *c67x00)
{}