32 #include <linux/capability.h>
35 #define GENERIC_FILESIZE 64
38 static int get_integer(
const char *
buf,
size_t count)
40 char tmp[10 + 1] = { 0 };
45 count =
min(count, (
size_t)10);
52 static int get_boolean(
const char *
buf,
size_t count)
59 if (count >= 4 &&
memcmp(buf,
"true", 4) == 0)
61 if (count >= 5 &&
memcmp(buf,
"false", 5) == 0)
63 if (count >= 3 &&
memcmp(buf,
"yes", 3) == 0)
65 if (count >= 2 &&
memcmp(buf,
"no", 2) == 0)
67 if (count >= 2 &&
memcmp(buf,
"on", 2) == 0)
69 if (count >= 3 &&
memcmp(buf,
"off", 3) == 0)
87 switch (wldev->
phy.interfmode) {
109 static ssize_t b43legacy_attr_interfmode_store(
struct device *dev,
111 const char *buf,
size_t count)
121 mode = get_integer(buf, count);
145 "supported by device\n");
147 spin_unlock_irqrestore(&wldev->
wl->irq_lock, flags);
150 return err ? err :
count;
154 b43legacy_attr_interfmode_show,
155 b43legacy_attr_interfmode_store);
157 static ssize_t b43legacy_attr_preamble_show(
struct device *dev,
181 static ssize_t b43legacy_attr_preamble_store(
struct device *dev,
183 const char *buf,
size_t count)
192 value = get_boolean(buf, count);
200 spin_unlock_irqrestore(&wldev->
wl->irq_lock, flags);
207 b43legacy_attr_preamble_show,
208 b43legacy_attr_preamble_store);
223 goto err_remove_interfmode;
227 err_remove_interfmode: