linux/drivers/usb/mtu3/mtu3_gadget_ep0.c

// SPDX-License-Identifier: GPL-2.0
/*
 * mtu3_gadget_ep0.c - MediaTek USB3 DRD peripheral driver ep0 handling
 *
 * Copyright (c) 2016 MediaTek Inc.
 *
 * Author:  Chunfeng.Yun <[email protected]>
 */

#include <linux/iopoll.h>
#include <linux/usb/composite.h>

#include "mtu3.h"
#include "mtu3_debug.h"
#include "mtu3_trace.h"

/* ep0 is always mtu3->in_eps[0] */
#define next_ep0_request(mtu)

/* for high speed test mode; see USB 2.0 spec 7.1.20 */
static const u8 mtu3_test_packet[53] =;

static char *decode_ep0_state(struct mtu3 *mtu)
{}

static void ep0_req_giveback(struct mtu3 *mtu, struct usb_request *req)
{}

static int
forward_to_driver(struct mtu3 *mtu, const struct usb_ctrlrequest *setup)
__releases(mtu->lock)
__acquires(mtu->lock)
{}

static void ep0_write_fifo(struct mtu3_ep *mep, const u8 *src, u16 len)
{}

static void ep0_read_fifo(struct mtu3_ep *mep, u8 *dst, u16 len)
{}

static void ep0_load_test_packet(struct mtu3 *mtu)
{}

/*
 * A. send STALL for setup transfer without data stage:
 *		set SENDSTALL and SETUPPKTRDY at the same time;
 * B. send STALL for other cases:
 *		set SENDSTALL only.
 */
static void ep0_stall_set(struct mtu3_ep *mep0, bool set, u32 pktrdy)
{}

static void ep0_do_status_stage(struct mtu3 *mtu)
{}

static int ep0_queue(struct mtu3_ep *mep0, struct mtu3_request *mreq);

static void ep0_dummy_complete(struct usb_ep *ep, struct usb_request *req)
{}

static void ep0_set_sel_complete(struct usb_ep *ep, struct usb_request *req)
{}

/* queue data stage to handle 6 byte SET_SEL request */
static int ep0_set_sel(struct mtu3 *mtu, struct usb_ctrlrequest *setup)
{}

static int
ep0_get_status(struct mtu3 *mtu, const struct usb_ctrlrequest *setup)
{}

static int handle_test_mode(struct mtu3 *mtu, struct usb_ctrlrequest *setup)
{}

static int ep0_handle_feature_dev(struct mtu3 *mtu,
		struct usb_ctrlrequest *setup, bool set)
{}

static int ep0_handle_feature(struct mtu3 *mtu,
		struct usb_ctrlrequest *setup, bool set)
{}

/*
 * handle all control requests can be handled
 * returns:
 *	negative errno - error happened
 *	zero - need delegate SETUP to gadget driver
 *	positive - already handled
 */
static int handle_standard_request(struct mtu3 *mtu,
			  struct usb_ctrlrequest *setup)
{}

/* receive an data packet (OUT) */
static void ep0_rx_state(struct mtu3 *mtu)
{}

/* transmitting to the host (IN) */
static void ep0_tx_state(struct mtu3 *mtu)
{}

static void ep0_read_setup(struct mtu3 *mtu, struct usb_ctrlrequest *setup)
{}

static int ep0_handle_setup(struct mtu3 *mtu)
__releases(mtu->lock)
__acquires(mtu->lock)
{}

irqreturn_t mtu3_ep0_isr(struct mtu3 *mtu)
{}


static int mtu3_ep0_enable(struct usb_ep *ep,
	const struct usb_endpoint_descriptor *desc)
{}

static int mtu3_ep0_disable(struct usb_ep *ep)
{}

static int ep0_queue(struct mtu3_ep *mep, struct mtu3_request *mreq)
{}

static int mtu3_ep0_queue(struct usb_ep *ep,
	struct usb_request *req, gfp_t gfp)
{}

static int mtu3_ep0_dequeue(struct usb_ep *ep, struct usb_request *req)
{}

static int mtu3_ep0_halt(struct usb_ep *ep, int value)
{}

const struct usb_ep_ops mtu3_ep0_ops =;