// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (C) 2015 Karol Kosik <[email protected]> * Copyright (C) 2015-2016 Samsung Electronics * Igor Kotrasinski <[email protected]> * * Based on dummy_hcd.c, which is: * Copyright (C) 2003 David Brownell * Copyright (C) 2003-2005 Alan Stern */ #include <linux/usb.h> #include <linux/timer.h> #include <linux/usb/ch9.h> #include "vudc.h" #define DEV_REQUEST … #define DEV_INREQUEST … #define INTF_REQUEST … #define INTF_INREQUEST … #define EP_REQUEST … #define EP_INREQUEST … static int get_frame_limit(enum usb_device_speed speed) { … } /* * handle_control_request() - handles all control transfers * @udc: pointer to vudc * @urb: the urb request to handle * @setup: pointer to the setup data for a USB device control * request * @status: pointer to request handling status * * Return 0 - if the request was handled * 1 - if the request wasn't handles * error code on error * * Adapted from drivers/usb/gadget/udc/dummy_hcd.c */ static int handle_control_request(struct vudc *udc, struct urb *urb, struct usb_ctrlrequest *setup, int *status) { … } /* Adapted from dummy_hcd.c ; caller must hold lock */ static int transfer(struct vudc *udc, struct urb *urb, struct vep *ep, int limit) { … } static void v_timer(struct timer_list *t) { … } /* All timer functions are run with udc->lock held */ void v_init_timer(struct vudc *udc) { … } void v_start_timer(struct vudc *udc) { … } void v_kick_timer(struct vudc *udc, unsigned long time) { … } void v_stop_timer(struct vudc *udc) { … }