GNU Linux-libre 4.19.264-gnu1
[releases.git] / drivers / usb / gadget / function / u_rndis.h
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
13 #ifndef U_RNDIS_H
14 #define U_RNDIS_H
15
16 #include <linux/usb/composite.h>
17
18 struct f_rndis_opts {
19         struct usb_function_instance    func_inst;
20         u32                             vendor_id;
21         const char                      *manufacturer;
22         struct net_device               *net;
23         bool                            bound;
24         bool                            borrowed_net;
25
26         struct config_group             *rndis_interf_group;
27         struct usb_os_desc              rndis_os_desc;
28         char                            rndis_ext_compat_id[16];
29
30         u8                              class;
31         u8                              subclass;
32         u8                              protocol;
33
34         /*
35          * Read/write access to configfs attributes is handled by configfs.
36          *
37          * This is to protect the data from concurrent access by read/write
38          * and create symlink/remove symlink.
39          */
40         struct mutex                    lock;
41         int                             refcnt;
42 };
43
44 void rndis_borrow_net(struct usb_function_instance *f, struct net_device *net);
45
46 #endif /* U_RNDIS_H */