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

TOMOYO Linux Cross Reference
Linux/net/wimax/op-state-get.c

Version: ~ [ linux-5.2-rc5 ] ~ [ linux-5.1.12 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.53 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.128 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.182 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.182 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.68 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ 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  * Implement and export a method for getting a WiMAX device current state
  4  *
  5  * Copyright (C) 2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
  6  *
  7  * Based on previous WiMAX core work by:
  8  *  Copyright (C) 2008 Intel Corporation <linux-wimax@intel.com>
  9  *  Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
 10  *
 11  * This program is free software; you can redistribute it and/or
 12  * modify it under the terms of the GNU General Public License version
 13  * 2 as published by the Free Software Foundation.
 14  *
 15  * This program is distributed in the hope that it will be useful,
 16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 18  * GNU General Public License for more details.
 19  *
 20  * You should have received a copy of the GNU General Public License
 21  * along with this program; if not, write to the Free Software
 22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 23  * 02110-1301, USA.
 24  */
 25 
 26 #include <net/wimax.h>
 27 #include <net/genetlink.h>
 28 #include <linux/wimax.h>
 29 #include <linux/security.h>
 30 #include "wimax-internal.h"
 31 
 32 #define D_SUBMODULE op_state_get
 33 #include "debug-levels.h"
 34 
 35 
 36 /*
 37  * Exporting to user space over generic netlink
 38  *
 39  * Parse the state get command from user space, return a combination
 40  * value that describe the current state.
 41  *
 42  * No attributes.
 43  */
 44 int wimax_gnl_doit_state_get(struct sk_buff *skb, struct genl_info *info)
 45 {
 46         int result, ifindex;
 47         struct wimax_dev *wimax_dev;
 48 
 49         d_fnstart(3, NULL, "(skb %p info %p)\n", skb, info);
 50         result = -ENODEV;
 51         if (info->attrs[WIMAX_GNL_STGET_IFIDX] == NULL) {
 52                 pr_err("WIMAX_GNL_OP_STATE_GET: can't find IFIDX attribute\n");
 53                 goto error_no_wimax_dev;
 54         }
 55         ifindex = nla_get_u32(info->attrs[WIMAX_GNL_STGET_IFIDX]);
 56         wimax_dev = wimax_dev_get_by_genl_info(info, ifindex);
 57         if (wimax_dev == NULL)
 58                 goto error_no_wimax_dev;
 59         /* Execute the operation and send the result back to user space */
 60         result = wimax_state_get(wimax_dev);
 61         dev_put(wimax_dev->net_dev);
 62 error_no_wimax_dev:
 63         d_fnend(3, NULL, "(skb %p info %p) = %d\n", skb, info, result);
 64         return result;
 65 }
 66 

~ [ 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