GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / drivers / net / wimax / i2400m / sysfs.c
blob881da0f2cfbcf148595f8bdae2e917547e8466be
1 /*
2 * Intel Wireless WiMAX Connection 2400m
3 * Sysfs interfaces to show driver and device information
6 * Copyright (C) 2007 Intel Corporation <linux-wimax@intel.com>
7 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
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.
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.
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.
24 #include <linux/netdevice.h>
25 #include <linux/etherdevice.h>
26 #include <linux/spinlock.h>
27 #include <linux/device.h>
28 #include "i2400m.h"
31 #define D_SUBMODULE sysfs
32 #include "debug-levels.h"
35 static
36 ssize_t i2400m_idle_timeout_store(struct device *dev,
37 struct device_attribute *attr,
38 const char *buf, size_t size)
40 ssize_t result;
41 struct i2400m *i2400m = net_dev_to_i2400m(to_net_dev(dev));
42 unsigned val;
44 result = -EINVAL;
45 if (sscanf(buf, "%u\n", &val) != 1)
46 goto error_no_unsigned;
47 if (val != 0 && (val < 100 || val > 300000 || val % 100 != 0)) {
48 dev_err(dev, "idle_timeout: %u: invalid msecs specification; "
49 "valid values are 0, 100-300000 in 100 increments\n",
50 val);
51 goto error_bad_value;
53 result = i2400m_set_idle_timeout(i2400m, val);
54 if (result >= 0)
55 result = size;
56 error_no_unsigned:
57 error_bad_value:
58 return result;
61 static
62 DEVICE_ATTR(i2400m_idle_timeout, S_IWUSR,
63 NULL, i2400m_idle_timeout_store);
65 static
66 struct attribute *i2400m_dev_attrs[] = {
67 &dev_attr_i2400m_idle_timeout.attr,
68 NULL,
71 struct attribute_group i2400m_dev_attr_group = {
72 .name = NULL, /* we want them in the same directory */
73 .attrs = i2400m_dev_attrs,