linux/drivers/usb/usbip/stub.h

// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright (C) 2003-2008 Takahiro Hirofuchi
 */

#ifndef __USBIP_STUB_H
#define __USBIP_STUB_H

#include <linux/list.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/usb.h>
#include <linux/wait.h>

#define STUB_BUSID_OTHER
#define STUB_BUSID_REMOV
#define STUB_BUSID_ADDED
#define STUB_BUSID_ALLOC

struct stub_device {};

/* private data into urb->priv */
struct stub_priv {};

struct stub_unlink {};

/* same as SYSFS_BUS_ID_SIZE */
#define BUSID_SIZE

struct bus_id_priv {};

/* stub_priv is allocated from stub_priv_cache */
extern struct kmem_cache *stub_priv_cache;

/* stub_dev.c */
extern struct usb_device_driver stub_driver;

/* stub_main.c */
struct bus_id_priv *get_busid_priv(const char *busid);
void put_busid_priv(struct bus_id_priv *bid);
int del_match_busid(char *busid);
void stub_free_priv_and_urb(struct stub_priv *priv);
void stub_device_cleanup_urbs(struct stub_device *sdev);

/* stub_rx.c */
int stub_rx_loop(void *data);

/* stub_tx.c */
void stub_enqueue_ret_unlink(struct stub_device *sdev, __u32 seqnum,
			     __u32 status);
void stub_complete(struct urb *urb);
int stub_tx_loop(void *data);

#endif /* __USBIP_STUB_H */