aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/uwb
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/uwb
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/uwb')
-rw-r--r--drivers/uwb/address.c1
-rw-r--r--drivers/uwb/allocator.c1
-rw-r--r--drivers/uwb/beacon.c1
-rw-r--r--drivers/uwb/driver.c5
-rw-r--r--drivers/uwb/drp-ie.c1
-rw-r--r--drivers/uwb/drp.c1
-rw-r--r--drivers/uwb/est.c1
-rw-r--r--drivers/uwb/hwa-rc.c3
-rw-r--r--drivers/uwb/i1480/dfu/mac.c1
-rw-r--r--drivers/uwb/i1480/dfu/usb.c15
-rw-r--r--drivers/uwb/i1480/i1480-est.c4
-rw-r--r--drivers/uwb/i1480/i1480u-wlp/lc.c1
-rw-r--r--drivers/uwb/i1480/i1480u-wlp/netdev.c1
-rw-r--r--drivers/uwb/i1480/i1480u-wlp/rx.c1
-rw-r--r--drivers/uwb/i1480/i1480u-wlp/tx.c1
-rw-r--r--drivers/uwb/ie.c1
-rw-r--r--drivers/uwb/lc-dev.c1
-rw-r--r--drivers/uwb/lc-rc.c1
-rw-r--r--drivers/uwb/neh.c3
-rw-r--r--drivers/uwb/reset.c1
-rw-r--r--drivers/uwb/rsv.c1
-rw-r--r--drivers/uwb/scan.c1
-rw-r--r--drivers/uwb/umc-bus.c4
-rw-r--r--drivers/uwb/umc-dev.c1
-rw-r--r--drivers/uwb/uwb-internal.h4
-rw-r--r--drivers/uwb/uwbd.c3
-rw-r--r--drivers/uwb/whc-rc.c1
-rw-r--r--drivers/uwb/whci.c1
-rw-r--r--drivers/uwb/wlp/eda.c1
-rw-r--r--drivers/uwb/wlp/messages.c107
-rw-r--r--drivers/uwb/wlp/sysfs.c3
-rw-r--r--drivers/uwb/wlp/txrx.c3
-rw-r--r--drivers/uwb/wlp/wlp-lc.c1
-rw-r--r--drivers/uwb/wlp/wss-lc.c1
34 files changed, 113 insertions, 64 deletions
diff --git a/drivers/uwb/address.c b/drivers/uwb/address.c
index ad21b1d7218c..973321327c44 100644
--- a/drivers/uwb/address.c
+++ b/drivers/uwb/address.c
@@ -23,6 +23,7 @@
23 * FIXME: docs 23 * FIXME: docs
24 */ 24 */
25 25
26#include <linux/slab.h>
26#include <linux/errno.h> 27#include <linux/errno.h>
27#include <linux/module.h> 28#include <linux/module.h>
28#include <linux/device.h> 29#include <linux/device.h>
diff --git a/drivers/uwb/allocator.c b/drivers/uwb/allocator.c
index c13cec7dcbc5..436e4f7110cb 100644
--- a/drivers/uwb/allocator.c
+++ b/drivers/uwb/allocator.c
@@ -16,6 +16,7 @@
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */ 17 */
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/slab.h>
19#include <linux/uwb.h> 20#include <linux/uwb.h>
20 21
21#include "uwb-internal.h" 22#include "uwb-internal.h"
diff --git a/drivers/uwb/beacon.c b/drivers/uwb/beacon.c
index 36bc3158006f..dcdd59bfcd09 100644
--- a/drivers/uwb/beacon.c
+++ b/drivers/uwb/beacon.c
@@ -28,6 +28,7 @@
28#include <linux/device.h> 28#include <linux/device.h>
29#include <linux/err.h> 29#include <linux/err.h>
30#include <linux/kdev_t.h> 30#include <linux/kdev_t.h>
31#include <linux/slab.h>
31 32
32#include "uwb-internal.h" 33#include "uwb-internal.h"
33 34
diff --git a/drivers/uwb/driver.c b/drivers/uwb/driver.c
index da77e41de990..08bd6dbfd4a6 100644
--- a/drivers/uwb/driver.c
+++ b/drivers/uwb/driver.c
@@ -74,13 +74,16 @@
74unsigned long beacon_timeout_ms = 500; 74unsigned long beacon_timeout_ms = 500;
75 75
76static 76static
77ssize_t beacon_timeout_ms_show(struct class *class, char *buf) 77ssize_t beacon_timeout_ms_show(struct class *class,
78 struct class_attribute *attr,
79 char *buf)
78{ 80{
79 return scnprintf(buf, PAGE_SIZE, "%lu\n", beacon_timeout_ms); 81 return scnprintf(buf, PAGE_SIZE, "%lu\n", beacon_timeout_ms);
80} 82}
81 83
82static 84static
83ssize_t beacon_timeout_ms_store(struct class *class, 85ssize_t beacon_timeout_ms_store(struct class *class,
86 struct class_attribute *attr,
84 const char *buf, size_t size) 87 const char *buf, size_t size)
85{ 88{
86 unsigned long bt; 89 unsigned long bt;
diff --git a/drivers/uwb/drp-ie.c b/drivers/uwb/drp-ie.c
index 2840d7bf9e67..520673109a7e 100644
--- a/drivers/uwb/drp-ie.c
+++ b/drivers/uwb/drp-ie.c
@@ -18,6 +18,7 @@
18 */ 18 */
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/random.h> 20#include <linux/random.h>
21#include <linux/slab.h>
21#include <linux/uwb.h> 22#include <linux/uwb.h>
22 23
23#include "uwb-internal.h" 24#include "uwb-internal.h"
diff --git a/drivers/uwb/drp.c b/drivers/uwb/drp.c
index 4f5ca99a04b9..a8d83e25e3b6 100644
--- a/drivers/uwb/drp.c
+++ b/drivers/uwb/drp.c
@@ -20,6 +20,7 @@
20 */ 20 */
21#include <linux/kthread.h> 21#include <linux/kthread.h>
22#include <linux/freezer.h> 22#include <linux/freezer.h>
23#include <linux/slab.h>
23#include <linux/delay.h> 24#include <linux/delay.h>
24#include "uwb-internal.h" 25#include "uwb-internal.h"
25 26
diff --git a/drivers/uwb/est.c b/drivers/uwb/est.c
index 328fcc2b6099..a2eaa3c33b0b 100644
--- a/drivers/uwb/est.c
+++ b/drivers/uwb/est.c
@@ -40,6 +40,7 @@
40 * uwb_est_get_size() 40 * uwb_est_get_size()
41 */ 41 */
42#include <linux/spinlock.h> 42#include <linux/spinlock.h>
43#include <linux/slab.h>
43 44
44#include "uwb-internal.h" 45#include "uwb-internal.h"
45 46
diff --git a/drivers/uwb/hwa-rc.c b/drivers/uwb/hwa-rc.c
index e7eeb63fab23..2babcd4fbfc1 100644
--- a/drivers/uwb/hwa-rc.c
+++ b/drivers/uwb/hwa-rc.c
@@ -53,6 +53,7 @@
53 */ 53 */
54#include <linux/init.h> 54#include <linux/init.h>
55#include <linux/module.h> 55#include <linux/module.h>
56#include <linux/slab.h>
56#include <linux/usb.h> 57#include <linux/usb.h>
57#include <linux/usb/wusb.h> 58#include <linux/usb/wusb.h>
58#include <linux/usb/wusb-wa.h> 59#include <linux/usb/wusb-wa.h>
@@ -891,7 +892,7 @@ static int hwarc_post_reset(struct usb_interface *iface)
891} 892}
892 893
893/** USB device ID's that we handle */ 894/** USB device ID's that we handle */
894static struct usb_device_id hwarc_id_table[] = { 895static const struct usb_device_id hwarc_id_table[] = {
895 /* D-Link DUB-1210 */ 896 /* D-Link DUB-1210 */
896 { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3d02, 0xe0, 0x01, 0x02), 897 { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3d02, 0xe0, 0x01, 0x02),
897 .driver_info = WUSB_QUIRK_WHCI_CMD_EVT }, 898 .driver_info = WUSB_QUIRK_WHCI_CMD_EVT },
diff --git a/drivers/uwb/i1480/dfu/mac.c b/drivers/uwb/i1480/dfu/mac.c
index 694d0daf88ab..6ec14f5fcde4 100644
--- a/drivers/uwb/i1480/dfu/mac.c
+++ b/drivers/uwb/i1480/dfu/mac.c
@@ -28,6 +28,7 @@
28 */ 28 */
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/firmware.h> 30#include <linux/firmware.h>
31#include <linux/slab.h>
31#include <linux/uwb.h> 32#include <linux/uwb.h>
32#include "i1480-dfu.h" 33#include "i1480-dfu.h"
33 34
diff --git a/drivers/uwb/i1480/dfu/usb.c b/drivers/uwb/i1480/dfu/usb.c
index c7080d497311..ba8664328afa 100644
--- a/drivers/uwb/i1480/dfu/usb.c
+++ b/drivers/uwb/i1480/dfu/usb.c
@@ -37,6 +37,7 @@
37#include <linux/module.h> 37#include <linux/module.h>
38#include <linux/usb.h> 38#include <linux/usb.h>
39#include <linux/interrupt.h> 39#include <linux/interrupt.h>
40#include <linux/slab.h>
40#include <linux/delay.h> 41#include <linux/delay.h>
41#include <linux/uwb.h> 42#include <linux/uwb.h>
42#include <linux/usb/wusb.h> 43#include <linux/usb/wusb.h>
@@ -120,8 +121,7 @@ int i1480_usb_write(struct i1480 *i1480, u32 memory_address,
120 result = usb_control_msg( 121 result = usb_control_msg(
121 i1480_usb->usb_dev, usb_sndctrlpipe(i1480_usb->usb_dev, 0), 122 i1480_usb->usb_dev, usb_sndctrlpipe(i1480_usb->usb_dev, 0),
122 0xf0, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 123 0xf0, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
123 cpu_to_le16(memory_address & 0xffff), 124 memory_address, (memory_address >> 16),
124 cpu_to_le16((memory_address >> 16) & 0xffff),
125 i1480->cmd_buf, buffer_size, 100 /* FIXME: arbitrary */); 125 i1480->cmd_buf, buffer_size, 100 /* FIXME: arbitrary */);
126 if (result < 0) 126 if (result < 0)
127 break; 127 break;
@@ -166,8 +166,7 @@ int i1480_usb_read(struct i1480 *i1480, u32 addr, size_t size)
166 result = usb_control_msg( 166 result = usb_control_msg(
167 i1480_usb->usb_dev, usb_rcvctrlpipe(i1480_usb->usb_dev, 0), 167 i1480_usb->usb_dev, usb_rcvctrlpipe(i1480_usb->usb_dev, 0),
168 0xf0, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 168 0xf0, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
169 cpu_to_le16(itr_addr & 0xffff), 169 itr_addr, (itr_addr >> 16),
170 cpu_to_le16((itr_addr >> 16) & 0xffff),
171 i1480->cmd_buf + itr, itr_size, 170 i1480->cmd_buf + itr, itr_size,
172 100 /* FIXME: arbitrary */); 171 100 /* FIXME: arbitrary */);
173 if (result < 0) { 172 if (result < 0) {
@@ -229,7 +228,7 @@ void i1480_usb_neep_cb(struct urb *urb)
229 * will verify it. 228 * will verify it.
230 * 229 *
231 * Set i1480->evt_result with the result of getting the event or its 230 * Set i1480->evt_result with the result of getting the event or its
232 * size (if succesful). 231 * size (if successful).
233 * 232 *
234 * Delivers the data directly to i1480->evt_buf 233 * Delivers the data directly to i1480->evt_buf
235 */ 234 */
@@ -413,6 +412,10 @@ error:
413 return result; 412 return result;
414} 413}
415 414
415MODULE_FIRMWARE("i1480-pre-phy-0.0.bin");
416MODULE_FIRMWARE("i1480-usb-0.0.bin");
417MODULE_FIRMWARE("i1480-phy-0.0.bin");
418
416#define i1480_USB_DEV(v, p) \ 419#define i1480_USB_DEV(v, p) \
417{ \ 420{ \
418 .match_flags = USB_DEVICE_ID_MATCH_DEVICE \ 421 .match_flags = USB_DEVICE_ID_MATCH_DEVICE \
@@ -430,7 +433,7 @@ error:
430 433
431 434
432/** USB device ID's that we handle */ 435/** USB device ID's that we handle */
433static struct usb_device_id i1480_usb_id_table[] = { 436static const struct usb_device_id i1480_usb_id_table[] = {
434 i1480_USB_DEV(0x8086, 0xdf3b), 437 i1480_USB_DEV(0x8086, 0xdf3b),
435 i1480_USB_DEV(0x15a9, 0x0005), 438 i1480_USB_DEV(0x15a9, 0x0005),
436 i1480_USB_DEV(0x07d1, 0x3802), 439 i1480_USB_DEV(0x07d1, 0x3802),
diff --git a/drivers/uwb/i1480/i1480-est.c b/drivers/uwb/i1480/i1480-est.c
index 7bf8c6febae7..f2eb4d8b76c9 100644
--- a/drivers/uwb/i1480/i1480-est.c
+++ b/drivers/uwb/i1480/i1480-est.c
@@ -54,7 +54,7 @@ static struct uwb_est_entry i1480_est_fd01[] = {
54 .size = sizeof(struct i1480_rceb) + 2 }, 54 .size = sizeof(struct i1480_rceb) + 2 },
55}; 55};
56 56
57static int i1480_est_init(void) 57static int __init i1480_est_init(void)
58{ 58{
59 int result = uwb_est_register(i1480_CET_VS1, 0x00, 0x8086, 0x0c3b, 59 int result = uwb_est_register(i1480_CET_VS1, 0x00, 0x8086, 0x0c3b,
60 i1480_est_fd00, 60 i1480_est_fd00,
@@ -73,7 +73,7 @@ static int i1480_est_init(void)
73} 73}
74module_init(i1480_est_init); 74module_init(i1480_est_init);
75 75
76static void i1480_est_exit(void) 76static void __exit i1480_est_exit(void)
77{ 77{
78 uwb_est_unregister(i1480_CET_VS1, 0x00, 0x8086, 0x0c3b, 78 uwb_est_unregister(i1480_CET_VS1, 0x00, 0x8086, 0x0c3b,
79 i1480_est_fd00, ARRAY_SIZE(i1480_est_fd00)); 79 i1480_est_fd00, ARRAY_SIZE(i1480_est_fd00));
diff --git a/drivers/uwb/i1480/i1480u-wlp/lc.c b/drivers/uwb/i1480/i1480u-wlp/lc.c
index f272dfe54d49..def778cf2216 100644
--- a/drivers/uwb/i1480/i1480u-wlp/lc.c
+++ b/drivers/uwb/i1480/i1480u-wlp/lc.c
@@ -55,6 +55,7 @@
55 * is being removed. 55 * is being removed.
56 * i1480u_rm() 56 * i1480u_rm()
57 */ 57 */
58#include <linux/gfp.h>
58#include <linux/if_arp.h> 59#include <linux/if_arp.h>
59#include <linux/etherdevice.h> 60#include <linux/etherdevice.h>
60 61
diff --git a/drivers/uwb/i1480/i1480u-wlp/netdev.c b/drivers/uwb/i1480/i1480u-wlp/netdev.c
index b236e6969942..f98f6ce8b9e7 100644
--- a/drivers/uwb/i1480/i1480u-wlp/netdev.c
+++ b/drivers/uwb/i1480/i1480u-wlp/netdev.c
@@ -39,6 +39,7 @@
39 * i1480u_set_config(): 39 * i1480u_set_config():
40 */ 40 */
41 41
42#include <linux/slab.h>
42#include <linux/if_arp.h> 43#include <linux/if_arp.h>
43#include <linux/etherdevice.h> 44#include <linux/etherdevice.h>
44 45
diff --git a/drivers/uwb/i1480/i1480u-wlp/rx.c b/drivers/uwb/i1480/i1480u-wlp/rx.c
index 25a2758beb61..d4e51e108aa4 100644
--- a/drivers/uwb/i1480/i1480u-wlp/rx.c
+++ b/drivers/uwb/i1480/i1480u-wlp/rx.c
@@ -64,6 +64,7 @@
64 * 64 *
65 */ 65 */
66 66
67#include <linux/gfp.h>
67#include <linux/netdevice.h> 68#include <linux/netdevice.h>
68#include <linux/etherdevice.h> 69#include <linux/etherdevice.h>
69#include "i1480u-wlp.h" 70#include "i1480u-wlp.h"
diff --git a/drivers/uwb/i1480/i1480u-wlp/tx.c b/drivers/uwb/i1480/i1480u-wlp/tx.c
index 3db3449dbda4..3c117a364564 100644
--- a/drivers/uwb/i1480/i1480u-wlp/tx.c
+++ b/drivers/uwb/i1480/i1480u-wlp/tx.c
@@ -54,6 +54,7 @@
54 * the times the MTU will be smaller than one page... 54 * the times the MTU will be smaller than one page...
55 */ 55 */
56 56
57#include <linux/slab.h>
57#include "i1480u-wlp.h" 58#include "i1480u-wlp.h"
58 59
59enum { 60enum {
diff --git a/drivers/uwb/ie.c b/drivers/uwb/ie.c
index ab976686175b..30acec740425 100644
--- a/drivers/uwb/ie.c
+++ b/drivers/uwb/ie.c
@@ -24,6 +24,7 @@
24 * FIXME: docs 24 * FIXME: docs
25 */ 25 */
26 26
27#include <linux/slab.h>
27#include "uwb-internal.h" 28#include "uwb-internal.h"
28 29
29/** 30/**
diff --git a/drivers/uwb/lc-dev.c b/drivers/uwb/lc-dev.c
index 1097e81b56d0..90113bafefca 100644
--- a/drivers/uwb/lc-dev.c
+++ b/drivers/uwb/lc-dev.c
@@ -23,6 +23,7 @@
23 * FIXME: docs 23 * FIXME: docs
24 */ 24 */
25#include <linux/kernel.h> 25#include <linux/kernel.h>
26#include <linux/slab.h>
26#include <linux/device.h> 27#include <linux/device.h>
27#include <linux/err.h> 28#include <linux/err.h>
28#include <linux/kdev_t.h> 29#include <linux/kdev_t.h>
diff --git a/drivers/uwb/lc-rc.c b/drivers/uwb/lc-rc.c
index 9611ef3b787a..b0091c771b9a 100644
--- a/drivers/uwb/lc-rc.c
+++ b/drivers/uwb/lc-rc.c
@@ -35,6 +35,7 @@
35#include <linux/kdev_t.h> 35#include <linux/kdev_t.h>
36#include <linux/etherdevice.h> 36#include <linux/etherdevice.h>
37#include <linux/usb.h> 37#include <linux/usb.h>
38#include <linux/slab.h>
38 39
39#include "uwb-internal.h" 40#include "uwb-internal.h"
40 41
diff --git a/drivers/uwb/neh.c b/drivers/uwb/neh.c
index 0af8916d9bef..697e56a5bcdd 100644
--- a/drivers/uwb/neh.c
+++ b/drivers/uwb/neh.c
@@ -83,6 +83,7 @@
83 */ 83 */
84#include <linux/kernel.h> 84#include <linux/kernel.h>
85#include <linux/timer.h> 85#include <linux/timer.h>
86#include <linux/slab.h>
86#include <linux/err.h> 87#include <linux/err.h>
87 88
88#include "uwb-internal.h" 89#include "uwb-internal.h"
@@ -150,7 +151,7 @@ void uwb_rc_neh_put(struct uwb_rc_neh *neh)
150 * 0xff is invalid, so they must not be used. Initialization 151 * 0xff is invalid, so they must not be used. Initialization
151 * fills up those two in the bitmap so they are not allocated. 152 * fills up those two in the bitmap so they are not allocated.
152 * 153 *
153 * We spread the allocation around to reduce the posiblity of two 154 * We spread the allocation around to reduce the possibility of two
154 * consecutive opened @neh's getting the same context ID assigned (to 155 * consecutive opened @neh's getting the same context ID assigned (to
155 * avoid surprises with late events that timed out long time ago). So 156 * avoid surprises with late events that timed out long time ago). So
156 * first we search from where @rc->ctx_roll is, if not found, we 157 * first we search from where @rc->ctx_roll is, if not found, we
diff --git a/drivers/uwb/reset.c b/drivers/uwb/reset.c
index 7f0512e43d9d..27849292b552 100644
--- a/drivers/uwb/reset.c
+++ b/drivers/uwb/reset.c
@@ -30,6 +30,7 @@
30 */ 30 */
31#include <linux/kernel.h> 31#include <linux/kernel.h>
32#include <linux/err.h> 32#include <linux/err.h>
33#include <linux/slab.h>
33#include <linux/delay.h> 34#include <linux/delay.h>
34 35
35#include "uwb-internal.h" 36#include "uwb-internal.h"
diff --git a/drivers/uwb/rsv.c b/drivers/uwb/rsv.c
index 6b76f4bb4cc7..78c892233cf1 100644
--- a/drivers/uwb/rsv.c
+++ b/drivers/uwb/rsv.c
@@ -17,6 +17,7 @@
17 */ 17 */
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/uwb.h> 19#include <linux/uwb.h>
20#include <linux/slab.h>
20#include <linux/random.h> 21#include <linux/random.h>
21 22
22#include "uwb-internal.h" 23#include "uwb-internal.h"
diff --git a/drivers/uwb/scan.c b/drivers/uwb/scan.c
index 2d270748f32b..76a1a1ed7d3e 100644
--- a/drivers/uwb/scan.c
+++ b/drivers/uwb/scan.c
@@ -35,6 +35,7 @@
35 35
36#include <linux/device.h> 36#include <linux/device.h>
37#include <linux/err.h> 37#include <linux/err.h>
38#include <linux/slab.h>
38#include "uwb-internal.h" 39#include "uwb-internal.h"
39 40
40 41
diff --git a/drivers/uwb/umc-bus.c b/drivers/uwb/umc-bus.c
index cdd6c8efc9f8..5fad4e791b3e 100644
--- a/drivers/uwb/umc-bus.c
+++ b/drivers/uwb/umc-bus.c
@@ -62,12 +62,12 @@ int umc_controller_reset(struct umc_dev *umc)
62 struct device *parent = umc->dev.parent; 62 struct device *parent = umc->dev.parent;
63 int ret = 0; 63 int ret = 0;
64 64
65 if(down_trylock(&parent->sem)) 65 if (device_trylock(parent))
66 return -EAGAIN; 66 return -EAGAIN;
67 ret = device_for_each_child(parent, parent, umc_bus_pre_reset_helper); 67 ret = device_for_each_child(parent, parent, umc_bus_pre_reset_helper);
68 if (ret >= 0) 68 if (ret >= 0)
69 ret = device_for_each_child(parent, parent, umc_bus_post_reset_helper); 69 ret = device_for_each_child(parent, parent, umc_bus_post_reset_helper);
70 up(&parent->sem); 70 device_unlock(parent);
71 71
72 return ret; 72 return ret;
73} 73}
diff --git a/drivers/uwb/umc-dev.c b/drivers/uwb/umc-dev.c
index 1fc7d8270bb8..43ea9982e687 100644
--- a/drivers/uwb/umc-dev.c
+++ b/drivers/uwb/umc-dev.c
@@ -6,6 +6,7 @@
6 * This file is released under the GNU GPL v2. 6 * This file is released under the GNU GPL v2.
7 */ 7 */
8#include <linux/kernel.h> 8#include <linux/kernel.h>
9#include <linux/slab.h>
9#include <linux/uwb/umc.h> 10#include <linux/uwb/umc.h>
10 11
11static void umc_device_release(struct device *dev) 12static void umc_device_release(struct device *dev)
diff --git a/drivers/uwb/uwb-internal.h b/drivers/uwb/uwb-internal.h
index d5bcfc1c227a..157485c862c0 100644
--- a/drivers/uwb/uwb-internal.h
+++ b/drivers/uwb/uwb-internal.h
@@ -366,12 +366,12 @@ struct dentry *uwb_dbg_create_pal_dir(struct uwb_pal *pal);
366 366
367static inline void uwb_dev_lock(struct uwb_dev *uwb_dev) 367static inline void uwb_dev_lock(struct uwb_dev *uwb_dev)
368{ 368{
369 down(&uwb_dev->dev.sem); 369 device_lock(&uwb_dev->dev);
370} 370}
371 371
372static inline void uwb_dev_unlock(struct uwb_dev *uwb_dev) 372static inline void uwb_dev_unlock(struct uwb_dev *uwb_dev)
373{ 373{
374 up(&uwb_dev->dev.sem); 374 device_unlock(&uwb_dev->dev);
375} 375}
376 376
377#endif /* #ifndef __UWB_INTERNAL_H__ */ 377#endif /* #ifndef __UWB_INTERNAL_H__ */
diff --git a/drivers/uwb/uwbd.c b/drivers/uwb/uwbd.c
index 5a777d8624da..001c8b4020a8 100644
--- a/drivers/uwb/uwbd.c
+++ b/drivers/uwb/uwbd.c
@@ -43,7 +43,7 @@
43 * 43 *
44 * EVENTS 44 * EVENTS
45 * 45 *
46 * Events have a type, a subtype, a lenght, some other stuff and the 46 * Events have a type, a subtype, a length, some other stuff and the
47 * data blob, which depends on the event. The header is 'struct 47 * data blob, which depends on the event. The header is 'struct
48 * uwb_event'; for payloads, see 'struct uwbd_evt_*'. 48 * uwb_event'; for payloads, see 'struct uwbd_evt_*'.
49 * 49 *
@@ -69,6 +69,7 @@
69 * Handler functions are called normally uwbd_evt_handle_*(). 69 * Handler functions are called normally uwbd_evt_handle_*().
70 */ 70 */
71#include <linux/kthread.h> 71#include <linux/kthread.h>
72#include <linux/slab.h>
72#include <linux/module.h> 73#include <linux/module.h>
73#include <linux/freezer.h> 74#include <linux/freezer.h>
74 75
diff --git a/drivers/uwb/whc-rc.c b/drivers/uwb/whc-rc.c
index 01950c62dc8d..73495583c444 100644
--- a/drivers/uwb/whc-rc.c
+++ b/drivers/uwb/whc-rc.c
@@ -45,6 +45,7 @@
45#include <linux/sched.h> 45#include <linux/sched.h>
46#include <linux/dma-mapping.h> 46#include <linux/dma-mapping.h>
47#include <linux/interrupt.h> 47#include <linux/interrupt.h>
48#include <linux/slab.h>
48#include <linux/workqueue.h> 49#include <linux/workqueue.h>
49#include <linux/uwb.h> 50#include <linux/uwb.h>
50#include <linux/uwb/whci.h> 51#include <linux/uwb/whci.h>
diff --git a/drivers/uwb/whci.c b/drivers/uwb/whci.c
index 2e2784627ad6..b221142446a2 100644
--- a/drivers/uwb/whci.c
+++ b/drivers/uwb/whci.c
@@ -9,6 +9,7 @@
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/pci.h> 10#include <linux/pci.h>
11#include <linux/dma-mapping.h> 11#include <linux/dma-mapping.h>
12#include <linux/slab.h>
12#include <linux/uwb/whci.h> 13#include <linux/uwb/whci.h>
13#include <linux/uwb/umc.h> 14#include <linux/uwb/umc.h>
14 15
diff --git a/drivers/uwb/wlp/eda.c b/drivers/uwb/wlp/eda.c
index 69e020039718..086fc0cf9401 100644
--- a/drivers/uwb/wlp/eda.c
+++ b/drivers/uwb/wlp/eda.c
@@ -53,6 +53,7 @@
53 53
54#include <linux/netdevice.h> 54#include <linux/netdevice.h>
55#include <linux/etherdevice.h> 55#include <linux/etherdevice.h>
56#include <linux/slab.h>
56#include <linux/wlp.h> 57#include <linux/wlp.h>
57#include "wlp-internal.h" 58#include "wlp-internal.h"
58 59
diff --git a/drivers/uwb/wlp/messages.c b/drivers/uwb/wlp/messages.c
index aa42fcee4c4f..3a8e033dce21 100644
--- a/drivers/uwb/wlp/messages.c
+++ b/drivers/uwb/wlp/messages.c
@@ -24,6 +24,7 @@
24 */ 24 */
25 25
26#include <linux/wlp.h> 26#include <linux/wlp.h>
27#include <linux/slab.h>
27 28
28#include "wlp-internal.h" 29#include "wlp-internal.h"
29 30
@@ -259,6 +260,63 @@ out:
259} 260}
260 261
261 262
263static ssize_t wlp_get_attribute(struct wlp *wlp, u16 type_code,
264 struct wlp_attr_hdr *attr_hdr, void *value, ssize_t value_len,
265 ssize_t buflen)
266{
267 struct device *dev = &wlp->rc->uwb_dev.dev;
268 ssize_t attr_len = sizeof(*attr_hdr) + value_len;
269 if (buflen < 0)
270 return -EINVAL;
271 if (buflen < attr_len) {
272 dev_err(dev, "WLP: Not enough space in buffer to parse"
273 " attribute field. Need %d, received %zu\n",
274 (int)attr_len, buflen);
275 return -EIO;
276 }
277 if (wlp_check_attr_hdr(wlp, attr_hdr, type_code, value_len) < 0) {
278 dev_err(dev, "WLP: Header verification failed. \n");
279 return -EINVAL;
280 }
281 memcpy(value, (void *)attr_hdr + sizeof(*attr_hdr), value_len);
282 return attr_len;
283}
284
285static ssize_t wlp_vget_attribute(struct wlp *wlp, u16 type_code,
286 struct wlp_attr_hdr *attr_hdr, void *value, ssize_t max_value_len,
287 ssize_t buflen)
288{
289 struct device *dev = &wlp->rc->uwb_dev.dev;
290 size_t len;
291 if (buflen < 0)
292 return -EINVAL;
293 if (buflen < sizeof(*attr_hdr)) {
294 dev_err(dev, "WLP: Not enough space in buffer to parse"
295 " header.\n");
296 return -EIO;
297 }
298 if (le16_to_cpu(attr_hdr->type) != type_code) {
299 dev_err(dev, "WLP: Unexpected attribute type. Got %u, "
300 "expected %u.\n", le16_to_cpu(attr_hdr->type),
301 type_code);
302 return -EINVAL;
303 }
304 len = le16_to_cpu(attr_hdr->length);
305 if (len > max_value_len) {
306 dev_err(dev, "WLP: Attribute larger than maximum "
307 "allowed. Received %zu, max is %d.\n", len,
308 (int)max_value_len);
309 return -EFBIG;
310 }
311 if (buflen < sizeof(*attr_hdr) + len) {
312 dev_err(dev, "WLP: Not enough space in buffer to parse "
313 "variable data.\n");
314 return -EIO;
315 }
316 memcpy(value, (void *)attr_hdr + sizeof(*attr_hdr), len);
317 return sizeof(*attr_hdr) + len;
318}
319
262/** 320/**
263 * Get value of attribute from fixed size attribute field. 321 * Get value of attribute from fixed size attribute field.
264 * 322 *
@@ -274,22 +332,8 @@ out:
274ssize_t wlp_get_##name(struct wlp *wlp, struct wlp_attr_##name *attr, \ 332ssize_t wlp_get_##name(struct wlp *wlp, struct wlp_attr_##name *attr, \
275 type *value, ssize_t buflen) \ 333 type *value, ssize_t buflen) \
276{ \ 334{ \
277 struct device *dev = &wlp->rc->uwb_dev.dev; \ 335 return wlp_get_attribute(wlp, (type_code), &attr->hdr, \
278 if (buflen < 0) \ 336 value, sizeof(*value), buflen); \
279 return -EINVAL; \
280 if (buflen < sizeof(*attr)) { \
281 dev_err(dev, "WLP: Not enough space in buffer to parse" \
282 " attribute field. Need %d, received %zu\n", \
283 (int)sizeof(*attr), buflen); \
284 return -EIO; \
285 } \
286 if (wlp_check_attr_hdr(wlp, &attr->hdr, type_code, \
287 sizeof(attr->name)) < 0) { \
288 dev_err(dev, "WLP: Header verification failed. \n"); \
289 return -EINVAL; \
290 } \
291 *value = attr->name; \
292 return sizeof(*attr); \
293} 337}
294 338
295#define wlp_get_sparse(type, type_code, name) \ 339#define wlp_get_sparse(type, type_code, name) \
@@ -313,35 +357,8 @@ static ssize_t wlp_get_##name(struct wlp *wlp, \
313 struct wlp_attr_##name *attr, \ 357 struct wlp_attr_##name *attr, \
314 type_val *value, ssize_t buflen) \ 358 type_val *value, ssize_t buflen) \
315{ \ 359{ \
316 struct device *dev = &wlp->rc->uwb_dev.dev; \ 360 return wlp_vget_attribute(wlp, (type_code), &attr->hdr, \
317 size_t len; \ 361 value, (max), buflen); \
318 if (buflen < 0) \
319 return -EINVAL; \
320 if (buflen < sizeof(*attr)) { \
321 dev_err(dev, "WLP: Not enough space in buffer to parse" \
322 " header.\n"); \
323 return -EIO; \
324 } \
325 if (le16_to_cpu(attr->hdr.type) != type_code) { \
326 dev_err(dev, "WLP: Unexpected attribute type. Got %u, " \
327 "expected %u.\n", le16_to_cpu(attr->hdr.type), \
328 type_code); \
329 return -EINVAL; \
330 } \
331 len = le16_to_cpu(attr->hdr.length); \
332 if (len > max) { \
333 dev_err(dev, "WLP: Attribute larger than maximum " \
334 "allowed. Received %zu, max is %d.\n", len, \
335 (int)max); \
336 return -EFBIG; \
337 } \
338 if (buflen < sizeof(*attr) + len) { \
339 dev_err(dev, "WLP: Not enough space in buffer to parse "\
340 "variable data.\n"); \
341 return -EIO; \
342 } \
343 memcpy(value, (void *) attr + sizeof(*attr), len); \
344 return sizeof(*attr) + len; \
345} 362}
346 363
347wlp_get(u8, WLP_ATTR_WLP_VER, version) 364wlp_get(u8, WLP_ATTR_WLP_VER, version)
diff --git a/drivers/uwb/wlp/sysfs.c b/drivers/uwb/wlp/sysfs.c
index 0370399ff4bb..6627c94cc854 100644
--- a/drivers/uwb/wlp/sysfs.c
+++ b/drivers/uwb/wlp/sysfs.c
@@ -615,8 +615,7 @@ ssize_t wlp_wss_attr_store(struct kobject *kobj, struct attribute *attr,
615 return ret; 615 return ret;
616} 616}
617 617
618static 618static const struct sysfs_ops wss_sysfs_ops = {
619struct sysfs_ops wss_sysfs_ops = {
620 .show = wlp_wss_attr_show, 619 .show = wlp_wss_attr_show,
621 .store = wlp_wss_attr_store, 620 .store = wlp_wss_attr_store,
622}; 621};
diff --git a/drivers/uwb/wlp/txrx.c b/drivers/uwb/wlp/txrx.c
index 86a853b84119..05dde44b3592 100644
--- a/drivers/uwb/wlp/txrx.c
+++ b/drivers/uwb/wlp/txrx.c
@@ -25,6 +25,7 @@
25 */ 25 */
26 26
27#include <linux/etherdevice.h> 27#include <linux/etherdevice.h>
28#include <linux/slab.h>
28#include <linux/wlp.h> 29#include <linux/wlp.h>
29 30
30#include "wlp-internal.h" 31#include "wlp-internal.h"
@@ -282,7 +283,7 @@ EXPORT_SYMBOL_GPL(wlp_receive_frame);
282 * and transmission will be done by the calling function. 283 * and transmission will be done by the calling function.
283 * @dst: On return this will contain the device address to which the 284 * @dst: On return this will contain the device address to which the
284 * frame is destined. 285 * frame is destined.
285 * @returns: 0 on success no tx : WLP header sucessfully applied to skb buffer, 286 * @returns: 0 on success no tx : WLP header successfully applied to skb buffer,
286 * calling function can proceed with tx 287 * calling function can proceed with tx
287 * 1 on success with tx : WLP will take over transmission of this 288 * 1 on success with tx : WLP will take over transmission of this
288 * frame 289 * frame
diff --git a/drivers/uwb/wlp/wlp-lc.c b/drivers/uwb/wlp/wlp-lc.c
index 13db739c4e39..7f6a630bf26c 100644
--- a/drivers/uwb/wlp/wlp-lc.c
+++ b/drivers/uwb/wlp/wlp-lc.c
@@ -22,6 +22,7 @@
22 * FIXME: docs 22 * FIXME: docs
23 */ 23 */
24#include <linux/wlp.h> 24#include <linux/wlp.h>
25#include <linux/slab.h>
25 26
26#include "wlp-internal.h" 27#include "wlp-internal.h"
27 28
diff --git a/drivers/uwb/wlp/wss-lc.c b/drivers/uwb/wlp/wss-lc.c
index 5913c7a5d922..90accdd54c07 100644
--- a/drivers/uwb/wlp/wss-lc.c
+++ b/drivers/uwb/wlp/wss-lc.c
@@ -45,6 +45,7 @@
45 */ 45 */
46#include <linux/etherdevice.h> /* for is_valid_ether_addr */ 46#include <linux/etherdevice.h> /* for is_valid_ether_addr */
47#include <linux/skbuff.h> 47#include <linux/skbuff.h>
48#include <linux/slab.h>
48#include <linux/wlp.h> 49#include <linux/wlp.h>
49 50
50#include "wlp-internal.h" 51#include "wlp-internal.h"