xref: /linux/drivers/usb/gadget/function/u_rndis.h (revision 5fd54ace4721fc5ce2bb5aef6318fcf17f421460)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * u_rndis.h
4  *
5  * Utility definitions for the subset function
6  *
7  * Copyright (c) 2013 Samsung Electronics Co., Ltd.
8  *		http://www.samsung.com
9  *
10  * Author: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License version 2 as
14  * published by the Free Software Foundation.
15  */
16 
17 #ifndef U_RNDIS_H
18 #define U_RNDIS_H
19 
20 #include <linux/usb/composite.h>
21 
22 struct f_rndis_opts {
23 	struct usb_function_instance	func_inst;
24 	u32				vendor_id;
25 	const char			*manufacturer;
26 	struct net_device		*net;
27 	bool				bound;
28 	bool				borrowed_net;
29 
30 	struct config_group		*rndis_interf_group;
31 	struct usb_os_desc		rndis_os_desc;
32 	char				rndis_ext_compat_id[16];
33 
34 	u8				class;
35 	u8				subclass;
36 	u8				protocol;
37 
38 	/*
39 	 * Read/write access to configfs attributes is handled by configfs.
40 	 *
41 	 * This is to protect the data from concurrent access by read/write
42 	 * and create symlink/remove symlink.
43 	 */
44 	struct mutex			lock;
45 	int				refcnt;
46 };
47 
48 void rndis_borrow_net(struct usb_function_instance *f, struct net_device *net);
49 
50 #endif /* U_RNDIS_H */
51