162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * u_rndis.h
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Utility definitions for the subset function
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * Copyright (c) 2013 Samsung Electronics Co., Ltd.
862306a36Sopenharmony_ci *		http://www.samsung.com
962306a36Sopenharmony_ci *
1062306a36Sopenharmony_ci * Author: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
1162306a36Sopenharmony_ci */
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci#ifndef U_RNDIS_H
1462306a36Sopenharmony_ci#define U_RNDIS_H
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci#include <linux/usb/composite.h>
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_cistruct f_rndis_opts {
1962306a36Sopenharmony_ci	struct usb_function_instance	func_inst;
2062306a36Sopenharmony_ci	u32				vendor_id;
2162306a36Sopenharmony_ci	const char			*manufacturer;
2262306a36Sopenharmony_ci	struct net_device		*net;
2362306a36Sopenharmony_ci	bool				bound;
2462306a36Sopenharmony_ci	bool				borrowed_net;
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci	struct config_group		*rndis_interf_group;
2762306a36Sopenharmony_ci	struct usb_os_desc		rndis_os_desc;
2862306a36Sopenharmony_ci	char				rndis_ext_compat_id[16];
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci	u8				class;
3162306a36Sopenharmony_ci	u8				subclass;
3262306a36Sopenharmony_ci	u8				protocol;
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci	/*
3562306a36Sopenharmony_ci	 * Read/write access to configfs attributes is handled by configfs.
3662306a36Sopenharmony_ci	 *
3762306a36Sopenharmony_ci	 * This is to protect the data from concurrent access by read/write
3862306a36Sopenharmony_ci	 * and create symlink/remove symlink.
3962306a36Sopenharmony_ci	 */
4062306a36Sopenharmony_ci	struct mutex			lock;
4162306a36Sopenharmony_ci	int				refcnt;
4262306a36Sopenharmony_ci};
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_civoid rndis_borrow_net(struct usb_function_instance *f, struct net_device *net);
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci#endif /* U_RNDIS_H */
47