blob: a8c409b2f52f9ed96fc057b23e9d1bddb7c6848c [file] [log] [blame]
Nishad Kamdar2e759732020-03-28 16:41:15 +05301/* SPDX-License-Identifier: GPL-2.0 */
Andrzej Pietrasiewiczf466c632013-05-28 09:15:57 +02002/*
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 *
Andrzej Pietrasiewicz1b4a3b52018-12-13 14:24:57 +010010 * Author: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
Andrzej Pietrasiewiczf466c632013-05-28 09:15:57 +020011 */
12
13#ifndef U_RNDIS_H
14#define U_RNDIS_H
15
16#include <linux/usb/composite.h>
17
18struct 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;
Andrzej Pietrasiewiczb3df2fa2013-05-28 09:16:01 +020025
Andrew Gabbasovff747452017-09-30 08:54:52 -070026 struct config_group *rndis_interf_group;
Andrzej Pietrasiewiczde7a8d22014-05-08 14:06:24 +020027 struct usb_os_desc rndis_os_desc;
28 char rndis_ext_compat_id[16];
29
David Lechner73517cf2017-07-29 20:12:57 -050030 u8 class;
31 u8 subclass;
32 u8 protocol;
33
Andrzej Pietrasiewiczb3df2fa2013-05-28 09:16:01 +020034 /*
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;
Andrzej Pietrasiewiczf466c632013-05-28 09:15:57 +020042};
43
Andrzej Pietrasiewiczf466c632013-05-28 09:15:57 +020044void rndis_borrow_net(struct usb_function_instance *f, struct net_device *net);
45
46#endif /* U_RNDIS_H */