linux/drivers/usb/usbip/vudc.h

// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright (C) 2015 Karol Kosik <[email protected]>
 * Copyright (C) 2015-2016 Samsung Electronics
 *               Igor Kotrasinski <[email protected]>
 *               Krzysztof Opasiak <[email protected]>
 */

#ifndef __USBIP_VUDC_H
#define __USBIP_VUDC_H

#include <linux/platform_device.h>
#include <linux/usb.h>
#include <linux/usb/gadget.h>
#include <linux/usb/ch9.h>
#include <linux/list.h>
#include <linux/timer.h>
#include <linux/time.h>
#include <linux/sysfs.h>

#include "usbip_common.h"

#define GADGET_NAME

struct vep {};

struct vrequest {};

struct urbp {};

struct v_unlink {};

enum tx_type {};

struct tx_item {};

enum tr_state {};

struct transfer_timer {};

struct vudc {};

struct vudc_device {};

extern const struct attribute_group *vudc_groups[];

/* visible everywhere */

static inline struct vep *to_vep(struct usb_ep *_ep)
{}

static inline struct vrequest *to_vrequest(
	struct usb_request *_req)
{}

static inline struct vudc *usb_gadget_to_vudc(
	struct usb_gadget *_gadget)
{}

static inline struct vudc *ep_to_vudc(struct vep *ep)
{}

/* vudc_sysfs.c */

int get_gadget_descs(struct vudc *udc);

/* vudc_tx.c */

int v_tx_loop(void *data);
void v_enqueue_ret_unlink(struct vudc *udc, __u32 seqnum, __u32 status);
void v_enqueue_ret_submit(struct vudc *udc, struct urbp *urb_p);

/* vudc_rx.c */

int v_rx_loop(void *data);

/* vudc_transfer.c */

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);

/* vudc_dev.c */

struct urbp *alloc_urbp(void);
void free_urbp_and_urb(struct urbp *urb_p);

struct vep *vudc_find_endpoint(struct vudc *udc, u8 address);

struct vudc_device *alloc_vudc_device(int devid);
void put_vudc_device(struct vudc_device *udc_dev);

int vudc_probe(struct platform_device *pdev);
void vudc_remove(struct platform_device *pdev);

#endif /* __USBIP_VUDC_H */