1*5fd54aceSGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0 200a2430fSAndrzej Pietrasiewicz /* 300a2430fSAndrzej Pietrasiewicz * u_ncm.h 400a2430fSAndrzej Pietrasiewicz * 500a2430fSAndrzej Pietrasiewicz * Utility definitions for the ncm function 600a2430fSAndrzej Pietrasiewicz * 700a2430fSAndrzej Pietrasiewicz * Copyright (c) 2013 Samsung Electronics Co., Ltd. 800a2430fSAndrzej Pietrasiewicz * http://www.samsung.com 900a2430fSAndrzej Pietrasiewicz * 1000a2430fSAndrzej Pietrasiewicz * Author: Andrzej Pietrasiewicz <andrzej.p@samsung.com> 1100a2430fSAndrzej Pietrasiewicz * 1200a2430fSAndrzej Pietrasiewicz * This program is free software; you can redistribute it and/or modify 1300a2430fSAndrzej Pietrasiewicz * it under the terms of the GNU General Public License version 2 as 1400a2430fSAndrzej Pietrasiewicz * published by the Free Software Foundation. 1500a2430fSAndrzej Pietrasiewicz */ 1600a2430fSAndrzej Pietrasiewicz 1700a2430fSAndrzej Pietrasiewicz #ifndef U_NCM_H 1800a2430fSAndrzej Pietrasiewicz #define U_NCM_H 1900a2430fSAndrzej Pietrasiewicz 2000a2430fSAndrzej Pietrasiewicz #include <linux/usb/composite.h> 2100a2430fSAndrzej Pietrasiewicz 2200a2430fSAndrzej Pietrasiewicz struct f_ncm_opts { 2300a2430fSAndrzej Pietrasiewicz struct usb_function_instance func_inst; 2400a2430fSAndrzej Pietrasiewicz struct net_device *net; 2500a2430fSAndrzej Pietrasiewicz bool bound; 2600a2430fSAndrzej Pietrasiewicz 2700a2430fSAndrzej Pietrasiewicz /* 2800a2430fSAndrzej Pietrasiewicz * Read/write access to configfs attributes is handled by configfs. 2900a2430fSAndrzej Pietrasiewicz * 3000a2430fSAndrzej Pietrasiewicz * This is to protect the data from concurrent access by read/write 3100a2430fSAndrzej Pietrasiewicz * and create symlink/remove symlink. 3200a2430fSAndrzej Pietrasiewicz */ 3300a2430fSAndrzej Pietrasiewicz struct mutex lock; 3400a2430fSAndrzej Pietrasiewicz int refcnt; 3500a2430fSAndrzej Pietrasiewicz }; 3600a2430fSAndrzej Pietrasiewicz 3700a2430fSAndrzej Pietrasiewicz #endif /* U_NCM_H */ 38