~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/net/wimax/wimax-internal.h

Version: ~ [ linux-5.17-rc1 ] ~ [ linux-5.16.2 ] ~ [ linux-5.15.16 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.93 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.173 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.225 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.262 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.297 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.299 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Linux WiMAX
  3  * Internal API for kernel space WiMAX stack
  4  *
  5  *
  6  * Copyright (C) 2007 Intel Corporation <linux-wimax@intel.com>
  7  * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
  8  *
  9  * This program is free software; you can redistribute it and/or
 10  * modify it under the terms of the GNU General Public License version
 11  * 2 as published by the Free Software Foundation.
 12  *
 13  * This program is distributed in the hope that it will be useful,
 14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 16  * GNU General Public License for more details.
 17  *
 18  * You should have received a copy of the GNU General Public License
 19  * along with this program; if not, write to the Free Software
 20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 21  * 02110-1301, USA.
 22  *
 23  *
 24  * This header file is for declarations and definitions internal to
 25  * the WiMAX stack. For public APIs and documentation, see
 26  * include/net/wimax.h and include/linux/wimax.h.
 27  */
 28 
 29 #ifndef __WIMAX_INTERNAL_H__
 30 #define __WIMAX_INTERNAL_H__
 31 #ifdef __KERNEL__
 32 
 33 #include <linux/device.h>
 34 #include <net/wimax.h>
 35 
 36 
 37 /*
 38  * Decide if a (locked) device is ready for use
 39  *
 40  * Before using the device structure, it must be locked
 41  * (wimax_dev->mutex). As well, most operations need to call this
 42  * function to check if the state is the right one.
 43  *
 44  * An error value will be returned if the state is not the right
 45  * one. In that case, the caller should not attempt to use the device
 46  * and just unlock it.
 47  */
 48 static inline __must_check
 49 int wimax_dev_is_ready(struct wimax_dev *wimax_dev)
 50 {
 51         if (wimax_dev->state == __WIMAX_ST_NULL)
 52                 return -EINVAL; /* Device is not even registered! */
 53         if (wimax_dev->state == WIMAX_ST_DOWN)
 54                 return -ENOMEDIUM;
 55         if (wimax_dev->state == __WIMAX_ST_QUIESCING)
 56                 return -ESHUTDOWN;
 57         return 0;
 58 }
 59 
 60 
 61 static inline
 62 void __wimax_state_set(struct wimax_dev *wimax_dev, enum wimax_st state)
 63 {
 64         wimax_dev->state = state;
 65 }
 66 extern void __wimax_state_change(struct wimax_dev *, enum wimax_st);
 67 
 68 #ifdef CONFIG_DEBUG_FS
 69 extern int wimax_debugfs_add(struct wimax_dev *);
 70 extern void wimax_debugfs_rm(struct wimax_dev *);
 71 #else
 72 static inline int wimax_debugfs_add(struct wimax_dev *wimax_dev)
 73 {
 74         return 0;
 75 }
 76 static inline void wimax_debugfs_rm(struct wimax_dev *wimax_dev) {}
 77 #endif
 78 
 79 extern void wimax_id_table_add(struct wimax_dev *);
 80 extern struct wimax_dev *wimax_dev_get_by_genl_info(struct genl_info *, int);
 81 extern void wimax_id_table_rm(struct wimax_dev *);
 82 extern void wimax_id_table_release(void);
 83 
 84 extern int wimax_rfkill_add(struct wimax_dev *);
 85 extern void wimax_rfkill_rm(struct wimax_dev *);
 86 
 87 extern struct genl_family wimax_gnl_family;
 88 extern struct genl_multicast_group wimax_gnl_mcg;
 89 
 90 #endif /* #ifdef __KERNEL__ */
 91 #endif /* #ifndef __WIMAX_INTERNAL_H__ */
 92 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp