xref: /openbmc/linux/drivers/usb/gadget/function/u_ncm.h (revision 00a2430ff07d4e0e0e7e24e02fd8adede333b797)
1*00a2430fSAndrzej Pietrasiewicz /*
2*00a2430fSAndrzej Pietrasiewicz  * u_ncm.h
3*00a2430fSAndrzej Pietrasiewicz  *
4*00a2430fSAndrzej Pietrasiewicz  * Utility definitions for the ncm function
5*00a2430fSAndrzej Pietrasiewicz  *
6*00a2430fSAndrzej Pietrasiewicz  * Copyright (c) 2013 Samsung Electronics Co., Ltd.
7*00a2430fSAndrzej Pietrasiewicz  *		http://www.samsung.com
8*00a2430fSAndrzej Pietrasiewicz  *
9*00a2430fSAndrzej Pietrasiewicz  * Author: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
10*00a2430fSAndrzej Pietrasiewicz  *
11*00a2430fSAndrzej Pietrasiewicz  * This program is free software; you can redistribute it and/or modify
12*00a2430fSAndrzej Pietrasiewicz  * it under the terms of the GNU General Public License version 2 as
13*00a2430fSAndrzej Pietrasiewicz  * published by the Free Software Foundation.
14*00a2430fSAndrzej Pietrasiewicz  */
15*00a2430fSAndrzej Pietrasiewicz 
16*00a2430fSAndrzej Pietrasiewicz #ifndef U_NCM_H
17*00a2430fSAndrzej Pietrasiewicz #define U_NCM_H
18*00a2430fSAndrzej Pietrasiewicz 
19*00a2430fSAndrzej Pietrasiewicz #include <linux/usb/composite.h>
20*00a2430fSAndrzej Pietrasiewicz 
21*00a2430fSAndrzej Pietrasiewicz struct f_ncm_opts {
22*00a2430fSAndrzej Pietrasiewicz 	struct usb_function_instance	func_inst;
23*00a2430fSAndrzej Pietrasiewicz 	struct net_device		*net;
24*00a2430fSAndrzej Pietrasiewicz 	bool				bound;
25*00a2430fSAndrzej Pietrasiewicz 
26*00a2430fSAndrzej Pietrasiewicz 	/*
27*00a2430fSAndrzej Pietrasiewicz 	 * Read/write access to configfs attributes is handled by configfs.
28*00a2430fSAndrzej Pietrasiewicz 	 *
29*00a2430fSAndrzej Pietrasiewicz 	 * This is to protect the data from concurrent access by read/write
30*00a2430fSAndrzej Pietrasiewicz 	 * and create symlink/remove symlink.
31*00a2430fSAndrzej Pietrasiewicz 	 */
32*00a2430fSAndrzej Pietrasiewicz 	struct mutex			lock;
33*00a2430fSAndrzej Pietrasiewicz 	int				refcnt;
34*00a2430fSAndrzej Pietrasiewicz };
35*00a2430fSAndrzej Pietrasiewicz 
36*00a2430fSAndrzej Pietrasiewicz #endif /* U_NCM_H */
37