aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/bluetooth/af_bluetooth.c16
-rw-r--r--net/bluetooth/bnep/bnep.h18
-rw-r--r--net/bluetooth/bnep/core.c52
-rw-r--r--net/bluetooth/bnep/netdev.c34
-rw-r--r--net/bluetooth/bnep/sock.c26
-rw-r--r--net/bluetooth/cmtp/capi.c14
-rw-r--r--net/bluetooth/cmtp/cmtp.h12
-rw-r--r--net/bluetooth/cmtp/core.c14
-rw-r--r--net/bluetooth/cmtp/sock.c14
-rw-r--r--net/bluetooth/hci_conn.c20
-rw-r--r--net/bluetooth/hci_core.c36
-rw-r--r--net/bluetooth/hci_event.c26
-rw-r--r--net/bluetooth/hci_sock.c28
-rw-r--r--net/bluetooth/hidp/core.c14
-rw-r--r--net/bluetooth/hidp/hidp.h12
-rw-r--r--net/bluetooth/hidp/sock.c14
-rw-r--r--net/bluetooth/l2cap.c26
-rw-r--r--net/bluetooth/lib.c12
-rw-r--r--net/bluetooth/rfcomm/core.c56
-rw-r--r--net/bluetooth/rfcomm/sock.c20
-rw-r--r--net/bluetooth/rfcomm/tty.c46
-rw-r--r--net/bluetooth/sco.c30
22 files changed, 270 insertions, 270 deletions
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index 67df99e2e5c8..c7228cfc6218 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -1,4 +1,4 @@
1/* 1/*
2 BlueZ - Bluetooth protocol stack for Linux 2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2000-2001 Qualcomm Incorporated 3 Copyright (C) 2000-2001 Qualcomm Incorporated
4 4
@@ -12,13 +12,13 @@
12 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 12 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
14 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 14 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
15 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 15 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 19
20 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 20 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
22 SOFTWARE IS DISCLAIMED. 22 SOFTWARE IS DISCLAIMED.
23*/ 23*/
24 24
@@ -119,7 +119,7 @@ static int bt_sock_create(struct socket *sock, int proto)
119 119
120 read_unlock(&bt_proto_lock); 120 read_unlock(&bt_proto_lock);
121 121
122 return err; 122 return err;
123} 123}
124 124
125void bt_sock_link(struct bt_sock_list *l, struct sock *sk) 125void bt_sock_link(struct bt_sock_list *l, struct sock *sk)
@@ -265,7 +265,7 @@ unsigned int bt_sock_poll(struct file * file, struct socket *sock, poll_table *w
265 if (sk->sk_shutdown == SHUTDOWN_MASK) 265 if (sk->sk_shutdown == SHUTDOWN_MASK)
266 mask |= POLLHUP; 266 mask |= POLLHUP;
267 267
268 if (!skb_queue_empty(&sk->sk_receive_queue) || 268 if (!skb_queue_empty(&sk->sk_receive_queue) ||
269 (sk->sk_shutdown & RCV_SHUTDOWN)) 269 (sk->sk_shutdown & RCV_SHUTDOWN))
270 mask |= POLLIN | POLLRDNORM; 270 mask |= POLLIN | POLLRDNORM;
271 271
diff --git a/net/bluetooth/bnep/bnep.h b/net/bluetooth/bnep/bnep.h
index 0b6cd0e2528d..a2992280c3d1 100644
--- a/net/bluetooth/bnep/bnep.h
+++ b/net/bluetooth/bnep/bnep.h
@@ -1,7 +1,7 @@
1/* 1/*
2 BNEP protocol definition for Linux Bluetooth stack (BlueZ). 2 BNEP protocol definition for Linux Bluetooth stack (BlueZ).
3 Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com> 3 Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License, version 2, as 6 it under the terms of the GNU General Public License, version 2, as
7 published by the Free Software Foundation. 7 published by the Free Software Foundation.
@@ -60,7 +60,7 @@
60// Extension types 60// Extension types
61#define BNEP_EXT_CONTROL 0x00 61#define BNEP_EXT_CONTROL 0x00
62 62
63// Response messages 63// Response messages
64#define BNEP_SUCCESS 0x00 64#define BNEP_SUCCESS 0x00
65 65
66#define BNEP_CONN_INVALID_DST 0x01 66#define BNEP_CONN_INVALID_DST 0x01
@@ -81,7 +81,7 @@
81#define BNEP_CONNECT_TO 15 81#define BNEP_CONNECT_TO 15
82#define BNEP_FILTER_TO 15 82#define BNEP_FILTER_TO 15
83 83
84// Headers 84// Headers
85#define BNEP_TYPE_MASK 0x7f 85#define BNEP_TYPE_MASK 0x7f
86#define BNEP_EXT_HEADER 0x80 86#define BNEP_EXT_HEADER 0x80
87 87
@@ -132,7 +132,7 @@ struct bnep_conndel_req {
132struct bnep_conninfo { 132struct bnep_conninfo {
133 __u32 flags; 133 __u32 flags;
134 __u16 role; 134 __u16 role;
135 __u16 state; 135 __u16 state;
136 __u8 dst[ETH_ALEN]; 136 __u8 dst[ETH_ALEN];
137 char device[16]; 137 char device[16];
138}; 138};
@@ -155,10 +155,10 @@ int bnep_get_conninfo(struct bnep_conninfo *ci);
155// BNEP sessions 155// BNEP sessions
156struct bnep_session { 156struct bnep_session {
157 struct list_head list; 157 struct list_head list;
158 158
159 unsigned int role; 159 unsigned int role;
160 unsigned long state; 160 unsigned long state;
161 unsigned long flags; 161 unsigned long flags;
162 atomic_t killed; 162 atomic_t killed;
163 163
164 struct ethhdr eh; 164 struct ethhdr eh;
@@ -166,7 +166,7 @@ struct bnep_session {
166 166
167 struct bnep_proto_filter proto_filter[BNEP_MAX_PROTO_FILTERS]; 167 struct bnep_proto_filter proto_filter[BNEP_MAX_PROTO_FILTERS];
168 u64 mc_filter; 168 u64 mc_filter;
169 169
170 struct socket *sock; 170 struct socket *sock;
171 struct net_device *dev; 171 struct net_device *dev;
172 struct net_device_stats stats; 172 struct net_device_stats stats;
@@ -178,7 +178,7 @@ int bnep_sock_cleanup(void);
178 178
179static inline int bnep_mc_hash(__u8 *addr) 179static inline int bnep_mc_hash(__u8 *addr)
180{ 180{
181 return (crc32_be(~0, addr, ETH_ALEN) >> 26); 181 return (crc32_be(~0, addr, ETH_ALEN) >> 26);
182} 182}
183 183
184#endif 184#endif
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index 7ba6470dc507..b85d1492c357 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -1,4 +1,4 @@
1/* 1/*
2 BNEP implementation for Linux Bluetooth stack (BlueZ). 2 BNEP implementation for Linux Bluetooth stack (BlueZ).
3 Copyright (C) 2001-2002 Inventel Systemes 3 Copyright (C) 2001-2002 Inventel Systemes
4 Written 2001-2002 by 4 Written 2001-2002 by
@@ -15,19 +15,19 @@
15 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
17 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 17 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
18 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 18 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
21 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 21 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 22
23 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 23 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
24 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 24 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
25 SOFTWARE IS DISCLAIMED. 25 SOFTWARE IS DISCLAIMED.
26*/ 26*/
27 27
28/* 28/*
29 * $Id: core.c,v 1.20 2002/08/04 21:23:58 maxk Exp $ 29 * $Id: core.c,v 1.20 2002/08/04 21:23:58 maxk Exp $
30 */ 30 */
31 31
32#include <linux/module.h> 32#include <linux/module.h>
33 33
@@ -74,7 +74,7 @@ static struct bnep_session *__bnep_get_session(u8 *dst)
74 BT_DBG(""); 74 BT_DBG("");
75 75
76 list_for_each(p, &bnep_session_list) { 76 list_for_each(p, &bnep_session_list) {
77 s = list_entry(p, struct bnep_session, list); 77 s = list_entry(p, struct bnep_session, list);
78 if (!compare_ether_addr(dst, s->eh.h_source)) 78 if (!compare_ether_addr(dst, s->eh.h_source))
79 return s; 79 return s;
80 } 80 }
@@ -87,7 +87,7 @@ static void __bnep_link_session(struct bnep_session *s)
87 by the socket layer which has to hold the refference to this module. 87 by the socket layer which has to hold the refference to this module.
88 */ 88 */
89 __module_get(THIS_MODULE); 89 __module_get(THIS_MODULE);
90 list_add(&s->list, &bnep_session_list); 90 list_add(&s->list, &bnep_session_list);
91} 91}
92 92
93static void __bnep_unlink_session(struct bnep_session *s) 93static void __bnep_unlink_session(struct bnep_session *s)
@@ -203,7 +203,7 @@ static int bnep_ctrl_set_mcfilter(struct bnep_session *s, u8 *data, int len)
203 203
204 memcpy(a1, data, ETH_ALEN); data += ETH_ALEN; 204 memcpy(a1, data, ETH_ALEN); data += ETH_ALEN;
205 a2 = data; data += ETH_ALEN; 205 a2 = data; data += ETH_ALEN;
206 206
207 BT_DBG("mc filter %s -> %s", 207 BT_DBG("mc filter %s -> %s",
208 batostr((void *) a1), batostr((void *) a2)); 208 batostr((void *) a1), batostr((void *) a2));
209 209
@@ -277,7 +277,7 @@ static int bnep_rx_extension(struct bnep_session *s, struct sk_buff *skb)
277 } 277 }
278 278
279 BT_DBG("type 0x%x len %d", h->type, h->len); 279 BT_DBG("type 0x%x len %d", h->type, h->len);
280 280
281 switch (h->type & BNEP_TYPE_MASK) { 281 switch (h->type & BNEP_TYPE_MASK) {
282 case BNEP_EXT_CONTROL: 282 case BNEP_EXT_CONTROL:
283 bnep_rx_control(s, skb->data, skb->len); 283 bnep_rx_control(s, skb->data, skb->len);
@@ -293,7 +293,7 @@ static int bnep_rx_extension(struct bnep_session *s, struct sk_buff *skb)
293 break; 293 break;
294 } 294 }
295 } while (!err && (h->type & BNEP_EXT_HEADER)); 295 } while (!err && (h->type & BNEP_EXT_HEADER));
296 296
297 return err; 297 return err;
298} 298}
299 299
@@ -319,7 +319,7 @@ static inline int bnep_rx_frame(struct bnep_session *s, struct sk_buff *skb)
319 319
320 if ((type & BNEP_TYPE_MASK) > BNEP_RX_TYPES) 320 if ((type & BNEP_TYPE_MASK) > BNEP_RX_TYPES)
321 goto badframe; 321 goto badframe;
322 322
323 if ((type & BNEP_TYPE_MASK) == BNEP_CONTROL) { 323 if ((type & BNEP_TYPE_MASK) == BNEP_CONTROL) {
324 bnep_rx_control(s, skb->data, skb->len); 324 bnep_rx_control(s, skb->data, skb->len);
325 kfree_skb(skb); 325 kfree_skb(skb);
@@ -345,7 +345,7 @@ static inline int bnep_rx_frame(struct bnep_session *s, struct sk_buff *skb)
345 goto badframe; 345 goto badframe;
346 s->eh.h_proto = get_unaligned((__be16 *) (skb->data - 2)); 346 s->eh.h_proto = get_unaligned((__be16 *) (skb->data - 2));
347 } 347 }
348 348
349 /* We have to alloc new skb and copy data here :(. Because original skb 349 /* We have to alloc new skb and copy data here :(. Because original skb
350 * may not be modified and because of the alignment requirements. */ 350 * may not be modified and because of the alignment requirements. */
351 nskb = alloc_skb(2 + ETH_HLEN + skb->len, GFP_KERNEL); 351 nskb = alloc_skb(2 + ETH_HLEN + skb->len, GFP_KERNEL);
@@ -361,7 +361,7 @@ static inline int bnep_rx_frame(struct bnep_session *s, struct sk_buff *skb)
361 case BNEP_COMPRESSED: 361 case BNEP_COMPRESSED:
362 memcpy(__skb_put(nskb, ETH_HLEN), &s->eh, ETH_HLEN); 362 memcpy(__skb_put(nskb, ETH_HLEN), &s->eh, ETH_HLEN);
363 break; 363 break;
364 364
365 case BNEP_COMPRESSED_SRC_ONLY: 365 case BNEP_COMPRESSED_SRC_ONLY:
366 memcpy(__skb_put(nskb, ETH_ALEN), s->eh.h_dest, ETH_ALEN); 366 memcpy(__skb_put(nskb, ETH_ALEN), s->eh.h_dest, ETH_ALEN);
367 memcpy(__skb_put(nskb, ETH_ALEN), skb->mac.raw, ETH_ALEN); 367 memcpy(__skb_put(nskb, ETH_ALEN), skb->mac.raw, ETH_ALEN);
@@ -381,7 +381,7 @@ static inline int bnep_rx_frame(struct bnep_session *s, struct sk_buff *skb)
381 381
382 memcpy(__skb_put(nskb, skb->len), skb->data, skb->len); 382 memcpy(__skb_put(nskb, skb->len), skb->data, skb->len);
383 kfree_skb(skb); 383 kfree_skb(skb);
384 384
385 s->stats.rx_packets++; 385 s->stats.rx_packets++;
386 nskb->dev = dev; 386 nskb->dev = dev;
387 nskb->ip_summed = CHECKSUM_NONE; 387 nskb->ip_summed = CHECKSUM_NONE;
@@ -435,7 +435,7 @@ static inline int bnep_tx_frame(struct bnep_session *s, struct sk_buff *skb)
435 iv[il++] = (struct kvec) { eh->h_source, ETH_ALEN }; 435 iv[il++] = (struct kvec) { eh->h_source, ETH_ALEN };
436 len += ETH_ALEN; 436 len += ETH_ALEN;
437 break; 437 break;
438 438
439 case BNEP_COMPRESSED_DST_ONLY: 439 case BNEP_COMPRESSED_DST_ONLY:
440 iv[il++] = (struct kvec) { eh->h_dest, ETH_ALEN }; 440 iv[il++] = (struct kvec) { eh->h_dest, ETH_ALEN };
441 len += ETH_ALEN; 441 len += ETH_ALEN;
@@ -445,7 +445,7 @@ static inline int bnep_tx_frame(struct bnep_session *s, struct sk_buff *skb)
445send: 445send:
446 iv[il++] = (struct kvec) { skb->data, skb->len }; 446 iv[il++] = (struct kvec) { skb->data, skb->len };
447 len += skb->len; 447 len += skb->len;
448 448
449 /* FIXME: linearize skb */ 449 /* FIXME: linearize skb */
450 { 450 {
451 len = kernel_sendmsg(sock, &s->msg, iv, il, len); 451 len = kernel_sendmsg(sock, &s->msg, iv, il, len);
@@ -471,7 +471,7 @@ static int bnep_session(void *arg)
471 471
472 BT_DBG(""); 472 BT_DBG("");
473 473
474 daemonize("kbnepd %s", dev->name); 474 daemonize("kbnepd %s", dev->name);
475 set_user_nice(current, -15); 475 set_user_nice(current, -15);
476 current->flags |= PF_NOFREEZE; 476 current->flags |= PF_NOFREEZE;
477 477
@@ -488,13 +488,13 @@ static int bnep_session(void *arg)
488 488
489 if (sk->sk_state != BT_CONNECTED) 489 if (sk->sk_state != BT_CONNECTED)
490 break; 490 break;
491 491
492 // TX 492 // TX
493 while ((skb = skb_dequeue(&sk->sk_write_queue))) 493 while ((skb = skb_dequeue(&sk->sk_write_queue)))
494 if (bnep_tx_frame(s, skb)) 494 if (bnep_tx_frame(s, skb))
495 break; 495 break;
496 netif_wake_queue(dev); 496 netif_wake_queue(dev);
497 497
498 schedule(); 498 schedule();
499 } 499 }
500 set_current_state(TASK_RUNNING); 500 set_current_state(TASK_RUNNING);
@@ -573,7 +573,7 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
573 s->sock = sock; 573 s->sock = sock;
574 s->role = req->role; 574 s->role = req->role;
575 s->state = BT_CONNECTED; 575 s->state = BT_CONNECTED;
576 576
577 s->msg.msg_flags = MSG_NOSIGNAL; 577 s->msg.msg_flags = MSG_NOSIGNAL;
578 578
579#ifdef CONFIG_BT_BNEP_MC_FILTER 579#ifdef CONFIG_BT_BNEP_MC_FILTER
@@ -594,7 +594,7 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
594 } 594 }
595 595
596 __bnep_link_session(s); 596 __bnep_link_session(s);
597 597
598 err = kernel_thread(bnep_session, s, CLONE_KERNEL); 598 err = kernel_thread(bnep_session, s, CLONE_KERNEL);
599 if (err < 0) { 599 if (err < 0) {
600 /* Session thread start failed, gotta cleanup. */ 600 /* Session thread start failed, gotta cleanup. */
@@ -627,7 +627,7 @@ int bnep_del_connection(struct bnep_conndel_req *req)
627 /* Wakeup user-space which is polling for socket errors. 627 /* Wakeup user-space which is polling for socket errors.
628 * This is temporary hack untill we have shutdown in L2CAP */ 628 * This is temporary hack untill we have shutdown in L2CAP */
629 s->sock->sk->sk_err = EUNATCH; 629 s->sock->sk->sk_err = EUNATCH;
630 630
631 /* Kill session thread */ 631 /* Kill session thread */
632 atomic_inc(&s->killed); 632 atomic_inc(&s->killed);
633 wake_up_interruptible(s->sock->sk->sk_sleep); 633 wake_up_interruptible(s->sock->sk->sk_sleep);
@@ -661,7 +661,7 @@ int bnep_get_connlist(struct bnep_connlist_req *req)
661 s = list_entry(p, struct bnep_session, list); 661 s = list_entry(p, struct bnep_session, list);
662 662
663 __bnep_copy_ci(&ci, s); 663 __bnep_copy_ci(&ci, s);
664 664
665 if (copy_to_user(req->ci, &ci, sizeof(ci))) { 665 if (copy_to_user(req->ci, &ci, sizeof(ci))) {
666 err = -EFAULT; 666 err = -EFAULT;
667 break; 667 break;
@@ -696,7 +696,7 @@ int bnep_get_conninfo(struct bnep_conninfo *ci)
696} 696}
697 697
698static int __init bnep_init(void) 698static int __init bnep_init(void)
699{ 699{
700 char flt[50] = ""; 700 char flt[50] = "";
701 701
702 l2cap_load(); 702 l2cap_load();
diff --git a/net/bluetooth/bnep/netdev.c b/net/bluetooth/bnep/netdev.c
index 67a002a9751a..9092816f58de 100644
--- a/net/bluetooth/bnep/netdev.c
+++ b/net/bluetooth/bnep/netdev.c
@@ -1,4 +1,4 @@
1/* 1/*
2 BNEP implementation for Linux Bluetooth stack (BlueZ). 2 BNEP implementation for Linux Bluetooth stack (BlueZ).
3 Copyright (C) 2001-2002 Inventel Systemes 3 Copyright (C) 2001-2002 Inventel Systemes
4 Written 2001-2002 by 4 Written 2001-2002 by
@@ -15,19 +15,19 @@
15 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
17 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 17 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
18 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 18 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
21 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 21 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 22
23 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 23 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
24 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 24 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
25 SOFTWARE IS DISCLAIMED. 25 SOFTWARE IS DISCLAIMED.
26*/ 26*/
27 27
28/* 28/*
29 * $Id: netdev.c,v 1.8 2002/08/04 21:23:58 maxk Exp $ 29 * $Id: netdev.c,v 1.8 2002/08/04 21:23:58 maxk Exp $
30 */ 30 */
31 31
32#include <linux/module.h> 32#include <linux/module.h>
33 33
@@ -94,7 +94,7 @@ static void bnep_net_set_mc_list(struct net_device *dev)
94 r->type = BNEP_CONTROL; 94 r->type = BNEP_CONTROL;
95 r->ctrl = BNEP_FILTER_MULTI_ADDR_SET; 95 r->ctrl = BNEP_FILTER_MULTI_ADDR_SET;
96 96
97 if (dev->flags & (IFF_PROMISC | IFF_ALLMULTI)) { 97 if (dev->flags & (IFF_PROMISC | IFF_ALLMULTI)) {
98 u8 start[ETH_ALEN] = { 0x01 }; 98 u8 start[ETH_ALEN] = { 0x01 };
99 99
100 /* Request all addresses */ 100 /* Request all addresses */
@@ -102,14 +102,14 @@ static void bnep_net_set_mc_list(struct net_device *dev)
102 memcpy(__skb_put(skb, ETH_ALEN), dev->broadcast, ETH_ALEN); 102 memcpy(__skb_put(skb, ETH_ALEN), dev->broadcast, ETH_ALEN);
103 r->len = htons(ETH_ALEN * 2); 103 r->len = htons(ETH_ALEN * 2);
104 } else { 104 } else {
105 struct dev_mc_list *dmi = dev->mc_list; 105 struct dev_mc_list *dmi = dev->mc_list;
106 int i, len = skb->len; 106 int i, len = skb->len;
107 107
108 if (dev->flags & IFF_BROADCAST) { 108 if (dev->flags & IFF_BROADCAST) {
109 memcpy(__skb_put(skb, ETH_ALEN), dev->broadcast, ETH_ALEN); 109 memcpy(__skb_put(skb, ETH_ALEN), dev->broadcast, ETH_ALEN);
110 memcpy(__skb_put(skb, ETH_ALEN), dev->broadcast, ETH_ALEN); 110 memcpy(__skb_put(skb, ETH_ALEN), dev->broadcast, ETH_ALEN);
111 } 111 }
112 112
113 /* FIXME: We should group addresses here. */ 113 /* FIXME: We should group addresses here. */
114 114
115 for (i = 0; i < dev->mc_count && i < BNEP_MAX_MULTICAST_FILTERS; i++) { 115 for (i = 0; i < dev->mc_count && i < BNEP_MAX_MULTICAST_FILTERS; i++) {
@@ -159,13 +159,13 @@ static inline u16 bnep_net_eth_proto(struct sk_buff *skb)
159{ 159{
160 struct ethhdr *eh = (void *) skb->data; 160 struct ethhdr *eh = (void *) skb->data;
161 u16 proto = ntohs(eh->h_proto); 161 u16 proto = ntohs(eh->h_proto);
162 162
163 if (proto >= 1536) 163 if (proto >= 1536)
164 return proto; 164 return proto;
165 165
166 if (get_unaligned((__be16 *) skb->data) == htons(0xFFFF)) 166 if (get_unaligned((__be16 *) skb->data) == htons(0xFFFF))
167 return ETH_P_802_3; 167 return ETH_P_802_3;
168 168
169 return ETH_P_802_2; 169 return ETH_P_802_2;
170} 170}
171 171
@@ -174,7 +174,7 @@ static inline int bnep_net_proto_filter(struct sk_buff *skb, struct bnep_session
174 u16 proto = bnep_net_eth_proto(skb); 174 u16 proto = bnep_net_eth_proto(skb);
175 struct bnep_proto_filter *f = s->proto_filter; 175 struct bnep_proto_filter *f = s->proto_filter;
176 int i; 176 int i;
177 177
178 for (i = 0; i < BNEP_MAX_PROTO_FILTERS && f[i].end; i++) { 178 for (i = 0; i < BNEP_MAX_PROTO_FILTERS && f[i].end; i++) {
179 if (proto >= f[i].start && proto <= f[i].end) 179 if (proto >= f[i].start && proto <= f[i].end)
180 return 0; 180 return 0;
@@ -198,14 +198,14 @@ static int bnep_net_xmit(struct sk_buff *skb, struct net_device *dev)
198 return 0; 198 return 0;
199 } 199 }
200#endif 200#endif
201 201
202#ifdef CONFIG_BT_BNEP_PROTO_FILTER 202#ifdef CONFIG_BT_BNEP_PROTO_FILTER
203 if (bnep_net_proto_filter(skb, s)) { 203 if (bnep_net_proto_filter(skb, s)) {
204 kfree_skb(skb); 204 kfree_skb(skb);
205 return 0; 205 return 0;
206 } 206 }
207#endif 207#endif
208 208
209 /* 209 /*
210 * We cannot send L2CAP packets from here as we are potentially in a bh. 210 * We cannot send L2CAP packets from here as we are potentially in a bh.
211 * So we have to queue them and wake up session thread which is sleeping 211 * So we have to queue them and wake up session thread which is sleeping
diff --git a/net/bluetooth/bnep/sock.c b/net/bluetooth/bnep/sock.c
index 5563db1bf526..6d7311cee1b4 100644
--- a/net/bluetooth/bnep/sock.c
+++ b/net/bluetooth/bnep/sock.c
@@ -1,4 +1,4 @@
1/* 1/*
2 BNEP implementation for Linux Bluetooth stack (BlueZ). 2 BNEP implementation for Linux Bluetooth stack (BlueZ).
3 Copyright (C) 2001-2002 Inventel Systemes 3 Copyright (C) 2001-2002 Inventel Systemes
4 Written 2001-2002 by 4 Written 2001-2002 by
@@ -14,19 +14,19 @@
14 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 15 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
16 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 16 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
17 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 17 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
18 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 18 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 19 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
20 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 20 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 21
22 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 22 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
23 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 23 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
24 SOFTWARE IS DISCLAIMED. 24 SOFTWARE IS DISCLAIMED.
25*/ 25*/
26 26
27/* 27/*
28 * $Id: sock.c,v 1.4 2002/08/04 21:23:58 maxk Exp $ 28 * $Id: sock.c,v 1.4 2002/08/04 21:23:58 maxk Exp $
29 */ 29 */
30 30
31#include <linux/module.h> 31#include <linux/module.h>
32 32
@@ -89,7 +89,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
89 89
90 if (copy_from_user(&ca, argp, sizeof(ca))) 90 if (copy_from_user(&ca, argp, sizeof(ca)))
91 return -EFAULT; 91 return -EFAULT;
92 92
93 nsock = sockfd_lookup(ca.sock, &err); 93 nsock = sockfd_lookup(ca.sock, &err);
94 if (!nsock) 94 if (!nsock)
95 return err; 95 return err;
@@ -101,20 +101,20 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
101 101
102 err = bnep_add_connection(&ca, nsock); 102 err = bnep_add_connection(&ca, nsock);
103 if (!err) { 103 if (!err) {
104 if (copy_to_user(argp, &ca, sizeof(ca))) 104 if (copy_to_user(argp, &ca, sizeof(ca)))
105 err = -EFAULT; 105 err = -EFAULT;
106 } else 106 } else
107 fput(nsock->file); 107 fput(nsock->file);
108 108
109 return err; 109 return err;
110 110
111 case BNEPCONNDEL: 111 case BNEPCONNDEL:
112 if (!capable(CAP_NET_ADMIN)) 112 if (!capable(CAP_NET_ADMIN))
113 return -EACCES; 113 return -EACCES;
114 114
115 if (copy_from_user(&cd, argp, sizeof(cd))) 115 if (copy_from_user(&cd, argp, sizeof(cd)))
116 return -EFAULT; 116 return -EFAULT;
117 117
118 return bnep_del_connection(&cd); 118 return bnep_del_connection(&cd);
119 119
120 case BNEPGETCONNLIST: 120 case BNEPGETCONNLIST:
@@ -123,7 +123,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
123 123
124 if (cl.cnum <= 0) 124 if (cl.cnum <= 0)
125 return -EINVAL; 125 return -EINVAL;
126 126
127 err = bnep_get_connlist(&cl); 127 err = bnep_get_connlist(&cl);
128 if (!err && copy_to_user(argp, &cl, sizeof(cl))) 128 if (!err && copy_to_user(argp, &cl, sizeof(cl)))
129 return -EFAULT; 129 return -EFAULT;
@@ -163,7 +163,7 @@ static int bnep_sock_compat_ioctl(struct socket *sock, unsigned int cmd, unsigne
163 163
164 if (cl.cnum <= 0) 164 if (cl.cnum <= 0)
165 return -EINVAL; 165 return -EINVAL;
166 166
167 err = bnep_get_connlist(&cl); 167 err = bnep_get_connlist(&cl);
168 168
169 if (!err && put_user(cl.cnum, (uint32_t __user *) arg)) 169 if (!err && put_user(cl.cnum, (uint32_t __user *) arg))
diff --git a/net/bluetooth/cmtp/capi.c b/net/bluetooth/cmtp/capi.c
index ab166b48ce8d..3e9d5bb3fefb 100644
--- a/net/bluetooth/cmtp/capi.c
+++ b/net/bluetooth/cmtp/capi.c
@@ -1,4 +1,4 @@
1/* 1/*
2 CMTP implementation for Linux Bluetooth stack (BlueZ). 2 CMTP implementation for Linux Bluetooth stack (BlueZ).
3 Copyright (C) 2002-2003 Marcel Holtmann <marcel@holtmann.org> 3 Copyright (C) 2002-2003 Marcel Holtmann <marcel@holtmann.org>
4 4
@@ -10,13 +10,13 @@
10 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 10 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 11 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
12 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 12 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
13 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 13 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 17
18 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 18 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
19 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 19 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
20 SOFTWARE IS DISCLAIMED. 20 SOFTWARE IS DISCLAIMED.
21*/ 21*/
22 22
@@ -563,7 +563,7 @@ int cmtp_attach_device(struct cmtp_session *session)
563 563
564 ret = wait_event_interruptible_timeout(session->wait, 564 ret = wait_event_interruptible_timeout(session->wait,
565 session->ncontroller, CMTP_INTEROP_TIMEOUT); 565 session->ncontroller, CMTP_INTEROP_TIMEOUT);
566 566
567 BT_INFO("Found %d CAPI controller(s) on device %s", session->ncontroller, session->name); 567 BT_INFO("Found %d CAPI controller(s) on device %s", session->ncontroller, session->name);
568 568
569 if (!ret) 569 if (!ret)
diff --git a/net/bluetooth/cmtp/cmtp.h b/net/bluetooth/cmtp/cmtp.h
index 40e3dfec0cc8..e4663aa14d26 100644
--- a/net/bluetooth/cmtp/cmtp.h
+++ b/net/bluetooth/cmtp/cmtp.h
@@ -1,4 +1,4 @@
1/* 1/*
2 CMTP implementation for Linux Bluetooth stack (BlueZ). 2 CMTP implementation for Linux Bluetooth stack (BlueZ).
3 Copyright (C) 2002-2003 Marcel Holtmann <marcel@holtmann.org> 3 Copyright (C) 2002-2003 Marcel Holtmann <marcel@holtmann.org>
4 4
@@ -10,13 +10,13 @@
10 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 10 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 11 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
12 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 12 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
13 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 13 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 17
18 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 18 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
19 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 19 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
20 SOFTWARE IS DISCLAIMED. 20 SOFTWARE IS DISCLAIMED.
21*/ 21*/
22 22
diff --git a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c
index b81a01c64aea..3933608a9296 100644
--- a/net/bluetooth/cmtp/core.c
+++ b/net/bluetooth/cmtp/core.c
@@ -1,4 +1,4 @@
1/* 1/*
2 CMTP implementation for Linux Bluetooth stack (BlueZ). 2 CMTP implementation for Linux Bluetooth stack (BlueZ).
3 Copyright (C) 2002-2003 Marcel Holtmann <marcel@holtmann.org> 3 Copyright (C) 2002-2003 Marcel Holtmann <marcel@holtmann.org>
4 4
@@ -10,13 +10,13 @@
10 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 10 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 11 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
12 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 12 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
13 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 13 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 17
18 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 18 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
19 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 19 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
20 SOFTWARE IS DISCLAIMED. 20 SOFTWARE IS DISCLAIMED.
21*/ 21*/
22 22
@@ -336,7 +336,7 @@ int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock)
336 baswap(&dst, &bt_sk(sock->sk)->dst); 336 baswap(&dst, &bt_sk(sock->sk)->dst);
337 337
338 session = kzalloc(sizeof(struct cmtp_session), GFP_KERNEL); 338 session = kzalloc(sizeof(struct cmtp_session), GFP_KERNEL);
339 if (!session) 339 if (!session)
340 return -ENOMEM; 340 return -ENOMEM;
341 341
342 down_write(&cmtp_session_sem); 342 down_write(&cmtp_session_sem);
diff --git a/net/bluetooth/cmtp/sock.c b/net/bluetooth/cmtp/sock.c
index 53295d33dc5c..0c5ccd95517f 100644
--- a/net/bluetooth/cmtp/sock.c
+++ b/net/bluetooth/cmtp/sock.c
@@ -1,4 +1,4 @@
1/* 1/*
2 CMTP implementation for Linux Bluetooth stack (BlueZ). 2 CMTP implementation for Linux Bluetooth stack (BlueZ).
3 Copyright (C) 2002-2003 Marcel Holtmann <marcel@holtmann.org> 3 Copyright (C) 2002-2003 Marcel Holtmann <marcel@holtmann.org>
4 4
@@ -10,13 +10,13 @@
10 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 10 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 11 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
12 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 12 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
13 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 13 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 17
18 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 18 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
19 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 19 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
20 SOFTWARE IS DISCLAIMED. 20 SOFTWARE IS DISCLAIMED.
21*/ 21*/
22 22
@@ -154,7 +154,7 @@ static int cmtp_sock_compat_ioctl(struct socket *sock, unsigned int cmd, unsigne
154 154
155 if (cl.cnum <= 0) 155 if (cl.cnum <= 0)
156 return -EINVAL; 156 return -EINVAL;
157 157
158 err = cmtp_get_connlist(&cl); 158 err = cmtp_get_connlist(&cl);
159 159
160 if (!err && put_user(cl.cnum, (uint32_t __user *) arg)) 160 if (!err && put_user(cl.cnum, (uint32_t __user *) arg))
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 6cd5711fa28a..67ee0bd80f5f 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -1,4 +1,4 @@
1/* 1/*
2 BlueZ - Bluetooth protocol stack for Linux 2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2000-2001 Qualcomm Incorporated 3 Copyright (C) 2000-2001 Qualcomm Incorporated
4 4
@@ -12,13 +12,13 @@
12 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 12 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
14 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 14 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
15 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 15 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 19
20 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 20 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
22 SOFTWARE IS DISCLAIMED. 22 SOFTWARE IS DISCLAIMED.
23*/ 23*/
24 24
@@ -146,7 +146,7 @@ static void hci_conn_timeout(unsigned long arg)
146 case BT_CONNECT: 146 case BT_CONNECT:
147 hci_acl_connect_cancel(conn); 147 hci_acl_connect_cancel(conn);
148 break; 148 break;
149 case BT_CONNECTED: 149 case BT_CONNECTED:
150 hci_acl_disconn(conn, 0x13); 150 hci_acl_disconn(conn, 0x13);
151 break; 151 break;
152 default: 152 default:
@@ -272,7 +272,7 @@ struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src)
272 if (!test_bit(HCI_UP, &d->flags) || test_bit(HCI_RAW, &d->flags)) 272 if (!test_bit(HCI_UP, &d->flags) || test_bit(HCI_RAW, &d->flags))
273 continue; 273 continue;
274 274
275 /* Simple routing: 275 /* Simple routing:
276 * No source address - find interface with bdaddr != dst 276 * No source address - find interface with bdaddr != dst
277 * Source address - find interface with bdaddr == src 277 * Source address - find interface with bdaddr == src
278 */ 278 */
@@ -328,7 +328,7 @@ struct hci_conn * hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst)
328 328
329 hci_conn_hold(sco); 329 hci_conn_hold(sco);
330 330
331 if (acl->state == BT_CONNECTED && 331 if (acl->state == BT_CONNECTED &&
332 (sco->state == BT_OPEN || sco->state == BT_CLOSED)) 332 (sco->state == BT_OPEN || sco->state == BT_CLOSED))
333 hci_add_sco(sco, acl->handle); 333 hci_add_sco(sco, acl->handle);
334 334
@@ -370,7 +370,7 @@ int hci_conn_encrypt(struct hci_conn *conn)
370 if (hci_conn_auth(conn)) { 370 if (hci_conn_auth(conn)) {
371 struct hci_cp_set_conn_encrypt cp; 371 struct hci_cp_set_conn_encrypt cp;
372 cp.handle = __cpu_to_le16(conn->handle); 372 cp.handle = __cpu_to_le16(conn->handle);
373 cp.encrypt = 1; 373 cp.encrypt = 1;
374 hci_send_cmd(conn->hdev, OGF_LINK_CTL, OCF_SET_CONN_ENCRYPT, sizeof(cp), &cp); 374 hci_send_cmd(conn->hdev, OGF_LINK_CTL, OCF_SET_CONN_ENCRYPT, sizeof(cp), &cp);
375 } 375 }
376 return 0; 376 return 0;
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 338ae977a31b..4917919d86a6 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1,4 +1,4 @@
1/* 1/*
2 BlueZ - Bluetooth protocol stack for Linux 2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2000-2001 Qualcomm Incorporated 3 Copyright (C) 2000-2001 Qualcomm Incorporated
4 4
@@ -12,13 +12,13 @@
12 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 12 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
14 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 14 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
15 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 15 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 19
20 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 20 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
22 SOFTWARE IS DISCLAIMED. 22 SOFTWARE IS DISCLAIMED.
23*/ 23*/
24 24
@@ -116,7 +116,7 @@ static void hci_req_cancel(struct hci_dev *hdev, int err)
116} 116}
117 117
118/* Execute request and wait for completion. */ 118/* Execute request and wait for completion. */
119static int __hci_request(struct hci_dev *hdev, void (*req)(struct hci_dev *hdev, unsigned long opt), 119static int __hci_request(struct hci_dev *hdev, void (*req)(struct hci_dev *hdev, unsigned long opt),
120 unsigned long opt, __u32 timeout) 120 unsigned long opt, __u32 timeout)
121{ 121{
122 DECLARE_WAITQUEUE(wait, current); 122 DECLARE_WAITQUEUE(wait, current);
@@ -278,7 +278,7 @@ static void hci_encrypt_req(struct hci_dev *hdev, unsigned long opt)
278 hci_send_cmd(hdev, OGF_HOST_CTL, OCF_WRITE_ENCRYPT_MODE, 1, &encrypt); 278 hci_send_cmd(hdev, OGF_HOST_CTL, OCF_WRITE_ENCRYPT_MODE, 1, &encrypt);
279} 279}
280 280
281/* Get HCI device by index. 281/* Get HCI device by index.
282 * Device is held on return. */ 282 * Device is held on return. */
283struct hci_dev *hci_dev_get(int index) 283struct hci_dev *hci_dev_get(int index)
284{ 284{
@@ -405,7 +405,7 @@ int hci_inquiry(void __user *arg)
405 return -ENODEV; 405 return -ENODEV;
406 406
407 hci_dev_lock_bh(hdev); 407 hci_dev_lock_bh(hdev);
408 if (inquiry_cache_age(hdev) > INQUIRY_CACHE_AGE_MAX || 408 if (inquiry_cache_age(hdev) > INQUIRY_CACHE_AGE_MAX ||
409 inquiry_cache_empty(hdev) || 409 inquiry_cache_empty(hdev) ||
410 ir.flags & IREQ_CACHE_FLUSH) { 410 ir.flags & IREQ_CACHE_FLUSH) {
411 inquiry_cache_flush(hdev); 411 inquiry_cache_flush(hdev);
@@ -439,7 +439,7 @@ int hci_inquiry(void __user *arg)
439 if (copy_to_user(ptr, buf, sizeof(struct inquiry_info) * 439 if (copy_to_user(ptr, buf, sizeof(struct inquiry_info) *
440 ir.num_rsp)) 440 ir.num_rsp))
441 err = -EFAULT; 441 err = -EFAULT;
442 } else 442 } else
443 err = -EFAULT; 443 err = -EFAULT;
444 444
445 kfree(buf); 445 kfree(buf);
@@ -491,7 +491,7 @@ int hci_dev_open(__u16 dev)
491 hci_dev_hold(hdev); 491 hci_dev_hold(hdev);
492 set_bit(HCI_UP, &hdev->flags); 492 set_bit(HCI_UP, &hdev->flags);
493 hci_notify(hdev, HCI_DEV_UP); 493 hci_notify(hdev, HCI_DEV_UP);
494 } else { 494 } else {
495 /* Init failed, cleanup */ 495 /* Init failed, cleanup */
496 tasklet_kill(&hdev->rx_task); 496 tasklet_kill(&hdev->rx_task);
497 tasklet_kill(&hdev->tx_task); 497 tasklet_kill(&hdev->tx_task);
@@ -619,7 +619,7 @@ int hci_dev_reset(__u16 dev)
619 if (hdev->flush) 619 if (hdev->flush)
620 hdev->flush(hdev); 620 hdev->flush(hdev);
621 621
622 atomic_set(&hdev->cmd_cnt, 1); 622 atomic_set(&hdev->cmd_cnt, 1);
623 hdev->acl_cnt = 0; hdev->sco_cnt = 0; 623 hdev->acl_cnt = 0; hdev->sco_cnt = 0;
624 624
625 if (!test_bit(HCI_RAW, &hdev->flags)) 625 if (!test_bit(HCI_RAW, &hdev->flags))
@@ -841,7 +841,7 @@ int hci_register_dev(struct hci_dev *hdev)
841 break; 841 break;
842 head = p; id++; 842 head = p; id++;
843 } 843 }
844 844
845 sprintf(hdev->name, "hci%d", id); 845 sprintf(hdev->name, "hci%d", id);
846 hdev->id = id; 846 hdev->id = id;
847 list_add(&hdev->list, head); 847 list_add(&hdev->list, head);
@@ -1109,7 +1109,7 @@ int hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags)
1109 __skb_queue_tail(&conn->data_q, skb); 1109 __skb_queue_tail(&conn->data_q, skb);
1110 do { 1110 do {
1111 skb = list; list = list->next; 1111 skb = list; list = list->next;
1112 1112
1113 skb->dev = (void *) hdev; 1113 skb->dev = (void *) hdev;
1114 bt_cb(skb)->pkt_type = HCI_ACLDATA_PKT; 1114 bt_cb(skb)->pkt_type = HCI_ACLDATA_PKT;
1115 hci_add_acl_hdr(skb, conn->handle, flags | ACL_CONT); 1115 hci_add_acl_hdr(skb, conn->handle, flags | ACL_CONT);
@@ -1164,7 +1164,7 @@ static inline struct hci_conn *hci_low_sent(struct hci_dev *hdev, __u8 type, int
1164 int num = 0, min = ~0; 1164 int num = 0, min = ~0;
1165 struct list_head *p; 1165 struct list_head *p;
1166 1166
1167 /* We don't have to lock device here. Connections are always 1167 /* We don't have to lock device here. Connections are always
1168 * added and removed with TX task disabled. */ 1168 * added and removed with TX task disabled. */
1169 list_for_each(p, &h->list) { 1169 list_for_each(p, &h->list) {
1170 struct hci_conn *c; 1170 struct hci_conn *c;
@@ -1306,7 +1306,7 @@ static inline void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb)
1306 hci_dev_lock(hdev); 1306 hci_dev_lock(hdev);
1307 conn = hci_conn_hash_lookup_handle(hdev, handle); 1307 conn = hci_conn_hash_lookup_handle(hdev, handle);
1308 hci_dev_unlock(hdev); 1308 hci_dev_unlock(hdev);
1309 1309
1310 if (conn) { 1310 if (conn) {
1311 register struct hci_proto *hp; 1311 register struct hci_proto *hp;
1312 1312
@@ -1318,7 +1318,7 @@ static inline void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb)
1318 return; 1318 return;
1319 } 1319 }
1320 } else { 1320 } else {
1321 BT_ERR("%s ACL packet for unknown connection handle %d", 1321 BT_ERR("%s ACL packet for unknown connection handle %d",
1322 hdev->name, handle); 1322 hdev->name, handle);
1323 } 1323 }
1324 1324
@@ -1353,7 +1353,7 @@ static inline void hci_scodata_packet(struct hci_dev *hdev, struct sk_buff *skb)
1353 return; 1353 return;
1354 } 1354 }
1355 } else { 1355 } else {
1356 BT_ERR("%s SCO packet for unknown connection handle %d", 1356 BT_ERR("%s SCO packet for unknown connection handle %d",
1357 hdev->name, handle); 1357 hdev->name, handle);
1358 } 1358 }
1359 1359
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index bb94e6da223c..00d845e3d307 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1,4 +1,4 @@
1/* 1/*
2 BlueZ - Bluetooth protocol stack for Linux 2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2000-2001 Qualcomm Incorporated 3 Copyright (C) 2000-2001 Qualcomm Incorporated
4 4
@@ -12,13 +12,13 @@
12 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 12 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
14 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 14 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
15 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 15 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 19
20 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 20 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
22 SOFTWARE IS DISCLAIMED. 22 SOFTWARE IS DISCLAIMED.
23*/ 23*/
24 24
@@ -100,7 +100,7 @@ static void hci_cc_link_policy(struct hci_dev *hdev, __u16 ocf, struct sk_buff *
100 BT_DBG("%s ocf 0x%x", hdev->name, ocf); 100 BT_DBG("%s ocf 0x%x", hdev->name, ocf);
101 101
102 switch (ocf) { 102 switch (ocf) {
103 case OCF_ROLE_DISCOVERY: 103 case OCF_ROLE_DISCOVERY:
104 rd = (void *) skb->data; 104 rd = (void *) skb->data;
105 105
106 if (rd->status) 106 if (rd->status)
@@ -141,7 +141,7 @@ static void hci_cc_link_policy(struct hci_dev *hdev, __u16 ocf, struct sk_buff *
141 break; 141 break;
142 142
143 default: 143 default:
144 BT_DBG("%s: Command complete: ogf LINK_POLICY ocf %x", 144 BT_DBG("%s: Command complete: ogf LINK_POLICY ocf %x",
145 hdev->name, ocf); 145 hdev->name, ocf);
146 break; 146 break;
147 } 147 }
@@ -237,10 +237,10 @@ static void hci_cc_host_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb
237 if (!status) { 237 if (!status) {
238 clear_bit(HCI_PSCAN, &hdev->flags); 238 clear_bit(HCI_PSCAN, &hdev->flags);
239 clear_bit(HCI_ISCAN, &hdev->flags); 239 clear_bit(HCI_ISCAN, &hdev->flags);
240 if (param & SCAN_INQUIRY) 240 if (param & SCAN_INQUIRY)
241 set_bit(HCI_ISCAN, &hdev->flags); 241 set_bit(HCI_ISCAN, &hdev->flags);
242 242
243 if (param & SCAN_PAGE) 243 if (param & SCAN_PAGE)
244 set_bit(HCI_PSCAN, &hdev->flags); 244 set_bit(HCI_PSCAN, &hdev->flags);
245 } 245 }
246 hci_req_complete(hdev, status); 246 hci_req_complete(hdev, status);
@@ -343,7 +343,7 @@ static void hci_cc_info_param(struct hci_dev *hdev, __u16 ocf, struct sk_buff *s
343 343
344 memcpy(hdev->features, lf->features, sizeof(hdev->features)); 344 memcpy(hdev->features, lf->features, sizeof(hdev->features));
345 345
346 /* Adjust default settings according to features 346 /* Adjust default settings according to features
347 * supported by device. */ 347 * supported by device. */
348 if (hdev->features[0] & LMP_3SLOT) 348 if (hdev->features[0] & LMP_3SLOT)
349 hdev->pkt_type |= (HCI_DM3 | HCI_DH3); 349 hdev->pkt_type |= (HCI_DM3 | HCI_DH3);
@@ -491,7 +491,7 @@ static void hci_cs_link_ctl(struct hci_dev *hdev, __u16 ocf, __u8 status)
491 break; 491 break;
492 492
493 default: 493 default:
494 BT_DBG("%s Command status: ogf LINK_CTL ocf %x status %d", 494 BT_DBG("%s Command status: ogf LINK_CTL ocf %x status %d",
495 hdev->name, ocf, status); 495 hdev->name, ocf, status);
496 break; 496 break;
497 } 497 }
@@ -793,7 +793,7 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
793 if (!conn->out) { 793 if (!conn->out) {
794 struct hci_cp_change_conn_ptype cp; 794 struct hci_cp_change_conn_ptype cp;
795 cp.handle = ev->handle; 795 cp.handle = ev->handle;
796 cp.pkt_type = (conn->type == ACL_LINK) ? 796 cp.pkt_type = (conn->type == ACL_LINK) ?
797 __cpu_to_le16(hdev->pkt_type & ACL_PTYPE_MASK): 797 __cpu_to_le16(hdev->pkt_type & ACL_PTYPE_MASK):
798 __cpu_to_le16(hdev->pkt_type & SCO_PTYPE_MASK); 798 __cpu_to_le16(hdev->pkt_type & SCO_PTYPE_MASK);
799 799
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index dbf98c49dbaa..dc3ecb19a5cd 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -1,4 +1,4 @@
1/* 1/*
2 BlueZ - Bluetooth protocol stack for Linux 2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2000-2001 Qualcomm Incorporated 3 Copyright (C) 2000-2001 Qualcomm Incorporated
4 4
@@ -12,13 +12,13 @@
12 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 12 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
14 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 14 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
15 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 15 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 19
20 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 20 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
22 SOFTWARE IS DISCLAIMED. 22 SOFTWARE IS DISCLAIMED.
23*/ 23*/
24 24
@@ -170,7 +170,7 @@ static int hci_sock_release(struct socket *sock)
170 return 0; 170 return 0;
171} 171}
172 172
173/* Ioctls that require bound socket */ 173/* Ioctls that require bound socket */
174static inline int hci_sock_bound_ioctl(struct sock *sk, unsigned int cmd, unsigned long arg) 174static inline int hci_sock_bound_ioctl(struct sock *sk, unsigned int cmd, unsigned long arg)
175{ 175{
176 struct hci_dev *hdev = hci_pi(sk)->hdev; 176 struct hci_dev *hdev = hci_pi(sk)->hdev;
@@ -348,8 +348,8 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
348 put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, sizeof(tv), &tv); 348 put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, sizeof(tv), &tv);
349 } 349 }
350} 350}
351 351
352static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock, 352static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
353 struct msghdr *msg, size_t len, int flags) 353 struct msghdr *msg, size_t len, int flags)
354{ 354{
355 int noblock = flags & MSG_DONTWAIT; 355 int noblock = flags & MSG_DONTWAIT;
@@ -386,7 +386,7 @@ static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
386 return err ? : copied; 386 return err ? : copied;
387} 387}
388 388
389static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock, 389static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
390 struct msghdr *msg, size_t len) 390 struct msghdr *msg, size_t len)
391{ 391{
392 struct sock *sk = sock->sk; 392 struct sock *sk = sock->sk;
@@ -520,7 +520,7 @@ static int hci_sock_setsockopt(struct socket *sock, int level, int optname, char
520 *((u32 *) f->event_mask + 0) = uf.event_mask[0]; 520 *((u32 *) f->event_mask + 0) = uf.event_mask[0];
521 *((u32 *) f->event_mask + 1) = uf.event_mask[1]; 521 *((u32 *) f->event_mask + 1) = uf.event_mask[1];
522 } 522 }
523 break; 523 break;
524 524
525 default: 525 default:
526 err = -ENOPROTOOPT; 526 err = -ENOPROTOOPT;
@@ -535,7 +535,7 @@ static int hci_sock_getsockopt(struct socket *sock, int level, int optname, char
535{ 535{
536 struct hci_ufilter uf; 536 struct hci_ufilter uf;
537 struct sock *sk = sock->sk; 537 struct sock *sk = sock->sk;
538 int len, opt; 538 int len, opt;
539 539
540 if (get_user(len, optlen)) 540 if (get_user(len, optlen))
541 return -EFAULT; 541 return -EFAULT;
@@ -544,7 +544,7 @@ static int hci_sock_getsockopt(struct socket *sock, int level, int optname, char
544 case HCI_DATA_DIR: 544 case HCI_DATA_DIR:
545 if (hci_pi(sk)->cmsg_mask & HCI_CMSG_DIR) 545 if (hci_pi(sk)->cmsg_mask & HCI_CMSG_DIR)
546 opt = 1; 546 opt = 1;
547 else 547 else
548 opt = 0; 548 opt = 0;
549 549
550 if (put_user(opt, optval)) 550 if (put_user(opt, optval))
@@ -554,7 +554,7 @@ static int hci_sock_getsockopt(struct socket *sock, int level, int optname, char
554 case HCI_TIME_STAMP: 554 case HCI_TIME_STAMP:
555 if (hci_pi(sk)->cmsg_mask & HCI_CMSG_TSTAMP) 555 if (hci_pi(sk)->cmsg_mask & HCI_CMSG_TSTAMP)
556 opt = 1; 556 opt = 1;
557 else 557 else
558 opt = 0; 558 opt = 0;
559 559
560 if (put_user(opt, optval)) 560 if (put_user(opt, optval))
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 66782010f82c..4b99c5e4478d 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -1,4 +1,4 @@
1/* 1/*
2 HIDP implementation for Linux Bluetooth stack (BlueZ). 2 HIDP implementation for Linux Bluetooth stack (BlueZ).
3 Copyright (C) 2003-2004 Marcel Holtmann <marcel@holtmann.org> 3 Copyright (C) 2003-2004 Marcel Holtmann <marcel@holtmann.org>
4 4
@@ -10,13 +10,13 @@
10 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 10 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 11 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
12 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 12 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
13 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 13 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 17
18 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 18 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
19 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 19 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
20 SOFTWARE IS DISCLAIMED. 20 SOFTWARE IS DISCLAIMED.
21*/ 21*/
22 22
@@ -293,7 +293,7 @@ static inline void hidp_process_handshake(struct hidp_session *session, unsigned
293 293
294 case HIDP_HSHK_ERR_FATAL: 294 case HIDP_HSHK_ERR_FATAL:
295 /* Device requests a reboot, as this is the only way this error 295 /* Device requests a reboot, as this is the only way this error
296 * can be recovered. */ 296 * can be recovered. */
297 __hidp_send_ctrl_message(session, 297 __hidp_send_ctrl_message(session,
298 HIDP_TRANS_HID_CONTROL | HIDP_CTRL_SOFT_RESET, NULL, 0); 298 HIDP_TRANS_HID_CONTROL | HIDP_CTRL_SOFT_RESET, NULL, 0);
299 break; 299 break;
diff --git a/net/bluetooth/hidp/hidp.h b/net/bluetooth/hidp/hidp.h
index c8dfacd40a06..a326601c8f41 100644
--- a/net/bluetooth/hidp/hidp.h
+++ b/net/bluetooth/hidp/hidp.h
@@ -1,4 +1,4 @@
1/* 1/*
2 HIDP implementation for Linux Bluetooth stack (BlueZ). 2 HIDP implementation for Linux Bluetooth stack (BlueZ).
3 Copyright (C) 2003-2004 Marcel Holtmann <marcel@holtmann.org> 3 Copyright (C) 2003-2004 Marcel Holtmann <marcel@holtmann.org>
4 4
@@ -10,13 +10,13 @@
10 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 10 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 11 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
12 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 12 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
13 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 13 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 17
18 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 18 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
19 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 19 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
20 SOFTWARE IS DISCLAIMED. 20 SOFTWARE IS DISCLAIMED.
21*/ 21*/
22 22
diff --git a/net/bluetooth/hidp/sock.c b/net/bluetooth/hidp/sock.c
index 93cf9e586178..33bda40aceb8 100644
--- a/net/bluetooth/hidp/sock.c
+++ b/net/bluetooth/hidp/sock.c
@@ -1,4 +1,4 @@
1/* 1/*
2 HIDP implementation for Linux Bluetooth stack (BlueZ). 2 HIDP implementation for Linux Bluetooth stack (BlueZ).
3 Copyright (C) 2003-2004 Marcel Holtmann <marcel@holtmann.org> 3 Copyright (C) 2003-2004 Marcel Holtmann <marcel@holtmann.org>
4 4
@@ -10,13 +10,13 @@
10 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 10 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 11 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
12 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 12 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
13 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 13 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 17
18 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 18 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
19 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 19 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
20 SOFTWARE IS DISCLAIMED. 20 SOFTWARE IS DISCLAIMED.
21*/ 21*/
22 22
@@ -206,7 +206,7 @@ static int hidp_sock_compat_ioctl(struct socket *sock, unsigned int cmd, unsigne
206 put_user(ca.idle_to, &uca->idle_to) || 206 put_user(ca.idle_to, &uca->idle_to) ||
207 copy_to_user(&uca->name[0], &ca.name[0], 128)) 207 copy_to_user(&uca->name[0], &ca.name[0], 128))
208 return -EFAULT; 208 return -EFAULT;
209 209
210 arg = (unsigned long) uca; 210 arg = (unsigned long) uca;
211 211
212 /* Fall through. We don't actually write back any _changes_ 212 /* Fall through. We don't actually write back any _changes_
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index f8c25d500155..e83ee82440d3 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -1,4 +1,4 @@
1/* 1/*
2 BlueZ - Bluetooth protocol stack for Linux 2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2000-2001 Qualcomm Incorporated 3 Copyright (C) 2000-2001 Qualcomm Incorporated
4 4
@@ -12,13 +12,13 @@
12 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 12 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
14 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 14 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
15 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 15 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 19
20 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 20 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
22 SOFTWARE IS DISCLAIMED. 22 SOFTWARE IS DISCLAIMED.
23*/ 23*/
24 24
@@ -227,7 +227,7 @@ static void __l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, struct so
227 bt_accept_enqueue(parent, sk); 227 bt_accept_enqueue(parent, sk);
228} 228}
229 229
230/* Delete channel. 230/* Delete channel.
231 * Must be called on the locked socket. */ 231 * Must be called on the locked socket. */
232static void l2cap_chan_del(struct sock *sk, int err) 232static void l2cap_chan_del(struct sock *sk, int err)
233{ 233{
@@ -238,7 +238,7 @@ static void l2cap_chan_del(struct sock *sk, int err)
238 238
239 BT_DBG("sk %p, conn %p, err %d", sk, conn, err); 239 BT_DBG("sk %p, conn %p, err %d", sk, conn, err);
240 240
241 if (conn) { 241 if (conn) {
242 /* Unlink from channel list */ 242 /* Unlink from channel list */
243 l2cap_chan_unlink(&conn->chan_list, sk); 243 l2cap_chan_unlink(&conn->chan_list, sk);
244 l2cap_pi(sk)->conn = NULL; 244 l2cap_pi(sk)->conn = NULL;
@@ -590,7 +590,7 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_
590 err = -EACCES; 590 err = -EACCES;
591 goto done; 591 goto done;
592 } 592 }
593 593
594 write_lock_bh(&l2cap_sk_list.lock); 594 write_lock_bh(&l2cap_sk_list.lock);
595 595
596 if (la->l2_psm && __l2cap_get_sock_by_addr(la->l2_psm, &la->l2_bdaddr)) { 596 if (la->l2_psm && __l2cap_get_sock_by_addr(la->l2_psm, &la->l2_bdaddr)) {
@@ -890,7 +890,7 @@ static inline int l2cap_do_send(struct sock *sk, struct msghdr *msg, int len)
890 *frag = bt_skb_send_alloc(sk, count, msg->msg_flags & MSG_DONTWAIT, &err); 890 *frag = bt_skb_send_alloc(sk, count, msg->msg_flags & MSG_DONTWAIT, &err);
891 if (!*frag) 891 if (!*frag)
892 goto fail; 892 goto fail;
893 893
894 if (memcpy_fromiovec(skb_put(*frag, count), msg->msg_iov, count)) { 894 if (memcpy_fromiovec(skb_put(*frag, count), msg->msg_iov, count)) {
895 err = -EFAULT; 895 err = -EFAULT;
896 goto fail; 896 goto fail;
@@ -1267,7 +1267,7 @@ static inline int l2cap_get_conf_opt(void **ptr, int *type, int *olen, unsigned
1267 1267
1268static inline void l2cap_parse_conf_req(struct sock *sk, void *data, int len) 1268static inline void l2cap_parse_conf_req(struct sock *sk, void *data, int len)
1269{ 1269{
1270 int type, hint, olen; 1270 int type, hint, olen;
1271 unsigned long val; 1271 unsigned long val;
1272 void *ptr = data; 1272 void *ptr = data;
1273 1273
@@ -1414,7 +1414,7 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd
1414 1414
1415 /* Check for backlog size */ 1415 /* Check for backlog size */
1416 if (sk_acceptq_is_full(parent)) { 1416 if (sk_acceptq_is_full(parent)) {
1417 BT_DBG("backlog full %d", parent->sk_ack_backlog); 1417 BT_DBG("backlog full %d", parent->sk_ack_backlog);
1418 goto response; 1418 goto response;
1419 } 1419 }
1420 1420
@@ -1607,7 +1607,7 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr
1607 goto done; 1607 goto done;
1608 } 1608 }
1609 1609
1610 default: 1610 default:
1611 sk->sk_state = BT_DISCONN; 1611 sk->sk_state = BT_DISCONN;
1612 sk->sk_err = ECONNRESET; 1612 sk->sk_err = ECONNRESET;
1613 l2cap_sock_set_timer(sk, HZ * 5); 1613 l2cap_sock_set_timer(sk, HZ * 5);
diff --git a/net/bluetooth/lib.c b/net/bluetooth/lib.c
index e5fd0cb70ae9..ad2af5814e40 100644
--- a/net/bluetooth/lib.c
+++ b/net/bluetooth/lib.c
@@ -1,4 +1,4 @@
1/* 1/*
2 BlueZ - Bluetooth protocol stack for Linux 2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2000-2001 Qualcomm Incorporated 3 Copyright (C) 2000-2001 Qualcomm Incorporated
4 4
@@ -12,13 +12,13 @@
12 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 12 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
14 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 14 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
15 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 15 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 19
20 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 20 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
22 SOFTWARE IS DISCLAIMED. 22 SOFTWARE IS DISCLAIMED.
23*/ 23*/
24 24
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index 278c8676906a..94f457360560 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -1,4 +1,4 @@
1/* 1/*
2 RFCOMM implementation for Linux Bluetooth stack (BlueZ). 2 RFCOMM implementation for Linux Bluetooth stack (BlueZ).
3 Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com> 3 Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com>
4 Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org> 4 Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org>
@@ -11,13 +11,13 @@
11 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 11 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 12 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
13 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 13 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
14 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 14 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
15 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 18
19 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 19 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
20 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 20 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
21 SOFTWARE IS DISCLAIMED. 21 SOFTWARE IS DISCLAIMED.
22*/ 22*/
23 23
@@ -134,7 +134,7 @@ static inline void rfcomm_session_put(struct rfcomm_session *s)
134/* ---- RFCOMM FCS computation ---- */ 134/* ---- RFCOMM FCS computation ---- */
135 135
136/* reversed, 8-bit, poly=0x07 */ 136/* reversed, 8-bit, poly=0x07 */
137static unsigned char rfcomm_crc_table[256] = { 137static unsigned char rfcomm_crc_table[256] = {
138 0x00, 0x91, 0xe3, 0x72, 0x07, 0x96, 0xe4, 0x75, 138 0x00, 0x91, 0xe3, 0x72, 0x07, 0x96, 0xe4, 0x75,
139 0x0e, 0x9f, 0xed, 0x7c, 0x09, 0x98, 0xea, 0x7b, 139 0x0e, 0x9f, 0xed, 0x7c, 0x09, 0x98, 0xea, 0x7b,
140 0x1c, 0x8d, 0xff, 0x6e, 0x1b, 0x8a, 0xf8, 0x69, 140 0x1c, 0x8d, 0xff, 0x6e, 0x1b, 0x8a, 0xf8, 0x69,
@@ -179,13 +179,13 @@ static unsigned char rfcomm_crc_table[256] = {
179/* CRC on 2 bytes */ 179/* CRC on 2 bytes */
180#define __crc(data) (rfcomm_crc_table[rfcomm_crc_table[0xff ^ data[0]] ^ data[1]]) 180#define __crc(data) (rfcomm_crc_table[rfcomm_crc_table[0xff ^ data[0]] ^ data[1]])
181 181
182/* FCS on 2 bytes */ 182/* FCS on 2 bytes */
183static inline u8 __fcs(u8 *data) 183static inline u8 __fcs(u8 *data)
184{ 184{
185 return (0xff - __crc(data)); 185 return (0xff - __crc(data));
186} 186}
187 187
188/* FCS on 3 bytes */ 188/* FCS on 3 bytes */
189static inline u8 __fcs2(u8 *data) 189static inline u8 __fcs2(u8 *data)
190{ 190{
191 return (0xff - rfcomm_crc_table[__crc(data) ^ data[2]]); 191 return (0xff - rfcomm_crc_table[__crc(data) ^ data[2]]);
@@ -288,7 +288,7 @@ struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio)
288 atomic_set(&d->refcnt, 1); 288 atomic_set(&d->refcnt, 1);
289 289
290 rfcomm_dlc_clear_state(d); 290 rfcomm_dlc_clear_state(d);
291 291
292 BT_DBG("%p", d); 292 BT_DBG("%p", d);
293 293
294 return d; 294 return d;
@@ -345,7 +345,7 @@ static int __rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst,
345 int err = 0; 345 int err = 0;
346 u8 dlci; 346 u8 dlci;
347 347
348 BT_DBG("dlc %p state %ld %s %s channel %d", 348 BT_DBG("dlc %p state %ld %s %s channel %d",
349 d, d->state, batostr(src), batostr(dst), channel); 349 d, d->state, batostr(src), batostr(dst), channel);
350 350
351 if (channel < 1 || channel > 30) 351 if (channel < 1 || channel > 30)
@@ -489,21 +489,21 @@ void fastcall __rfcomm_dlc_unthrottle(struct rfcomm_dlc *d)
489 rfcomm_schedule(RFCOMM_SCHED_TX); 489 rfcomm_schedule(RFCOMM_SCHED_TX);
490} 490}
491 491
492/* 492/*
493 Set/get modem status functions use _local_ status i.e. what we report 493 Set/get modem status functions use _local_ status i.e. what we report
494 to the other side. 494 to the other side.
495 Remote status is provided by dlc->modem_status() callback. 495 Remote status is provided by dlc->modem_status() callback.
496 */ 496 */
497int rfcomm_dlc_set_modem_status(struct rfcomm_dlc *d, u8 v24_sig) 497int rfcomm_dlc_set_modem_status(struct rfcomm_dlc *d, u8 v24_sig)
498{ 498{
499 BT_DBG("dlc %p state %ld v24_sig 0x%x", 499 BT_DBG("dlc %p state %ld v24_sig 0x%x",
500 d, d->state, v24_sig); 500 d, d->state, v24_sig);
501 501
502 if (test_bit(RFCOMM_RX_THROTTLED, &d->flags)) 502 if (test_bit(RFCOMM_RX_THROTTLED, &d->flags))
503 v24_sig |= RFCOMM_V24_FC; 503 v24_sig |= RFCOMM_V24_FC;
504 else 504 else
505 v24_sig &= ~RFCOMM_V24_FC; 505 v24_sig &= ~RFCOMM_V24_FC;
506 506
507 d->v24_sig = v24_sig; 507 d->v24_sig = v24_sig;
508 508
509 if (!test_and_set_bit(RFCOMM_MSC_PENDING, &d->flags)) 509 if (!test_and_set_bit(RFCOMM_MSC_PENDING, &d->flags))
@@ -514,7 +514,7 @@ int rfcomm_dlc_set_modem_status(struct rfcomm_dlc *d, u8 v24_sig)
514 514
515int rfcomm_dlc_get_modem_status(struct rfcomm_dlc *d, u8 *v24_sig) 515int rfcomm_dlc_get_modem_status(struct rfcomm_dlc *d, u8 *v24_sig)
516{ 516{
517 BT_DBG("dlc %p state %ld v24_sig 0x%x", 517 BT_DBG("dlc %p state %ld v24_sig 0x%x",
518 d, d->state, d->v24_sig); 518 d, d->state, d->v24_sig);
519 519
520 *v24_sig = d->v24_sig; 520 *v24_sig = d->v24_sig;
@@ -576,7 +576,7 @@ static struct rfcomm_session *rfcomm_session_get(bdaddr_t *src, bdaddr_t *dst)
576 struct bt_sock *sk; 576 struct bt_sock *sk;
577 list_for_each_safe(p, n, &session_list) { 577 list_for_each_safe(p, n, &session_list) {
578 s = list_entry(p, struct rfcomm_session, list); 578 s = list_entry(p, struct rfcomm_session, list);
579 sk = bt_sk(s->sock->sk); 579 sk = bt_sk(s->sock->sk);
580 580
581 if ((!bacmp(src, BDADDR_ANY) || !bacmp(&sk->src, src)) && 581 if ((!bacmp(src, BDADDR_ANY) || !bacmp(&sk->src, src)) &&
582 !bacmp(&sk->dst, dst)) 582 !bacmp(&sk->dst, dst))
@@ -825,7 +825,7 @@ static int rfcomm_send_pn(struct rfcomm_session *s, int cr, struct rfcomm_dlc *d
825 825
826int rfcomm_send_rpn(struct rfcomm_session *s, int cr, u8 dlci, 826int rfcomm_send_rpn(struct rfcomm_session *s, int cr, u8 dlci,
827 u8 bit_rate, u8 data_bits, u8 stop_bits, 827 u8 bit_rate, u8 data_bits, u8 stop_bits,
828 u8 parity, u8 flow_ctrl_settings, 828 u8 parity, u8 flow_ctrl_settings,
829 u8 xon_char, u8 xoff_char, u16 param_mask) 829 u8 xon_char, u8 xoff_char, u16 param_mask)
830{ 830{
831 struct rfcomm_hdr *hdr; 831 struct rfcomm_hdr *hdr;
@@ -834,8 +834,8 @@ int rfcomm_send_rpn(struct rfcomm_session *s, int cr, u8 dlci,
834 u8 buf[16], *ptr = buf; 834 u8 buf[16], *ptr = buf;
835 835
836 BT_DBG("%p cr %d dlci %d bit_r 0x%x data_b 0x%x stop_b 0x%x parity 0x%x" 836 BT_DBG("%p cr %d dlci %d bit_r 0x%x data_b 0x%x stop_b 0x%x parity 0x%x"
837 " flwc_s 0x%x xon_c 0x%x xoff_c 0x%x p_mask 0x%x", 837 " flwc_s 0x%x xon_c 0x%x xoff_c 0x%x p_mask 0x%x",
838 s, cr, dlci, bit_rate, data_bits, stop_bits, parity, 838 s, cr, dlci, bit_rate, data_bits, stop_bits, parity,
839 flow_ctrl_settings, xon_char, xoff_char, param_mask); 839 flow_ctrl_settings, xon_char, xoff_char, param_mask);
840 840
841 hdr = (void *) ptr; ptr += sizeof(*hdr); 841 hdr = (void *) ptr; ptr += sizeof(*hdr);
@@ -1120,9 +1120,9 @@ static int rfcomm_recv_disc(struct rfcomm_session *s, u8 dlci)
1120 1120
1121 d->state = BT_CLOSED; 1121 d->state = BT_CLOSED;
1122 __rfcomm_dlc_close(d, err); 1122 __rfcomm_dlc_close(d, err);
1123 } else 1123 } else
1124 rfcomm_send_dm(s, dlci); 1124 rfcomm_send_dm(s, dlci);
1125 1125
1126 } else { 1126 } else {
1127 rfcomm_send_ua(s, 0); 1127 rfcomm_send_ua(s, 0);
1128 1128
@@ -1230,7 +1230,7 @@ static int rfcomm_apply_pn(struct rfcomm_dlc *d, int cr, struct rfcomm_pn *pn)
1230{ 1230{
1231 struct rfcomm_session *s = d->session; 1231 struct rfcomm_session *s = d->session;
1232 1232
1233 BT_DBG("dlc %p state %ld dlci %d mtu %d fc 0x%x credits %d", 1233 BT_DBG("dlc %p state %ld dlci %d mtu %d fc 0x%x credits %d",
1234 d, d->state, d->dlci, pn->mtu, pn->flow_ctrl, pn->credits); 1234 d, d->state, d->dlci, pn->mtu, pn->flow_ctrl, pn->credits);
1235 1235
1236 if ((pn->flow_ctrl == 0xf0 && s->cfc != RFCOMM_CFC_DISABLED) || 1236 if ((pn->flow_ctrl == 0xf0 && s->cfc != RFCOMM_CFC_DISABLED) ||
@@ -1454,7 +1454,7 @@ static int rfcomm_recv_msc(struct rfcomm_session *s, int cr, struct sk_buff *skb
1454 if (d->modem_status) 1454 if (d->modem_status)
1455 d->modem_status(d, msc->v24_sig); 1455 d->modem_status(d, msc->v24_sig);
1456 rfcomm_dlc_unlock(d); 1456 rfcomm_dlc_unlock(d);
1457 1457
1458 rfcomm_send_msc(s, 0, dlci, msc->v24_sig); 1458 rfcomm_send_msc(s, 0, dlci, msc->v24_sig);
1459 1459
1460 d->mscex |= RFCOMM_MSCEX_RX; 1460 d->mscex |= RFCOMM_MSCEX_RX;
@@ -1641,18 +1641,18 @@ static inline int rfcomm_process_tx(struct rfcomm_dlc *d)
1641 struct sk_buff *skb; 1641 struct sk_buff *skb;
1642 int err; 1642 int err;
1643 1643
1644 BT_DBG("dlc %p state %ld cfc %d rx_credits %d tx_credits %d", 1644 BT_DBG("dlc %p state %ld cfc %d rx_credits %d tx_credits %d",
1645 d, d->state, d->cfc, d->rx_credits, d->tx_credits); 1645 d, d->state, d->cfc, d->rx_credits, d->tx_credits);
1646 1646
1647 /* Send pending MSC */ 1647 /* Send pending MSC */
1648 if (test_and_clear_bit(RFCOMM_MSC_PENDING, &d->flags)) 1648 if (test_and_clear_bit(RFCOMM_MSC_PENDING, &d->flags))
1649 rfcomm_send_msc(d->session, 1, d->dlci, d->v24_sig); 1649 rfcomm_send_msc(d->session, 1, d->dlci, d->v24_sig);
1650 1650
1651 if (d->cfc) { 1651 if (d->cfc) {
1652 /* CFC enabled. 1652 /* CFC enabled.
1653 * Give them some credits */ 1653 * Give them some credits */
1654 if (!test_bit(RFCOMM_RX_THROTTLED, &d->flags) && 1654 if (!test_bit(RFCOMM_RX_THROTTLED, &d->flags) &&
1655 d->rx_credits <= (d->cfc >> 2)) { 1655 d->rx_credits <= (d->cfc >> 2)) {
1656 rfcomm_send_credits(d->session, d->addr, d->cfc - d->rx_credits); 1656 rfcomm_send_credits(d->session, d->addr, d->cfc - d->rx_credits);
1657 d->rx_credits = d->cfc; 1657 d->rx_credits = d->cfc;
1658 } 1658 }
@@ -1876,7 +1876,7 @@ static int rfcomm_add_listener(bdaddr_t *ba)
1876 1876
1877 /* Create socket */ 1877 /* Create socket */
1878 err = rfcomm_l2sock_create(&sock); 1878 err = rfcomm_l2sock_create(&sock);
1879 if (err < 0) { 1879 if (err < 0) {
1880 BT_ERR("Create socket failed %d", err); 1880 BT_ERR("Create socket failed %d", err);
1881 return err; 1881 return err;
1882 } 1882 }
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index cb7e855f0828..30586ab9e878 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -1,4 +1,4 @@
1/* 1/*
2 RFCOMM implementation for Linux Bluetooth stack (BlueZ). 2 RFCOMM implementation for Linux Bluetooth stack (BlueZ).
3 Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com> 3 Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com>
4 Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org> 4 Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org>
@@ -11,13 +11,13 @@
11 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 11 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 12 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
13 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 13 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
14 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 14 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
15 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 18
19 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 19 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
20 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 20 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
21 SOFTWARE IS DISCLAIMED. 21 SOFTWARE IS DISCLAIMED.
22*/ 22*/
23 23
@@ -130,7 +130,7 @@ static struct sock *__rfcomm_get_sock_by_addr(u8 channel, bdaddr_t *src)
130 struct hlist_node *node; 130 struct hlist_node *node;
131 131
132 sk_for_each(sk, node, &rfcomm_sk_list.head) { 132 sk_for_each(sk, node, &rfcomm_sk_list.head) {
133 if (rfcomm_pi(sk)->channel == channel && 133 if (rfcomm_pi(sk)->channel == channel &&
134 !bacmp(&bt_sk(sk)->src, src)) 134 !bacmp(&bt_sk(sk)->src, src))
135 break; 135 break;
136 } 136 }
@@ -572,7 +572,7 @@ static int rfcomm_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
572 while (len) { 572 while (len) {
573 size_t size = min_t(size_t, len, d->mtu); 573 size_t size = min_t(size_t, len, d->mtu);
574 int err; 574 int err;
575 575
576 skb = sock_alloc_send_skb(sk, size + RFCOMM_SKB_RESERVE, 576 skb = sock_alloc_send_skb(sk, size + RFCOMM_SKB_RESERVE,
577 msg->msg_flags & MSG_DONTWAIT, &err); 577 msg->msg_flags & MSG_DONTWAIT, &err);
578 if (!skb) 578 if (!skb)
@@ -843,7 +843,7 @@ static int rfcomm_sock_release(struct socket *sock)
843 return err; 843 return err;
844} 844}
845 845
846/* ---- RFCOMM core layer callbacks ---- 846/* ---- RFCOMM core layer callbacks ----
847 * 847 *
848 * called under rfcomm_lock() 848 * called under rfcomm_lock()
849 */ 849 */
@@ -864,7 +864,7 @@ int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc *
864 864
865 /* Check for backlog size */ 865 /* Check for backlog size */
866 if (sk_acceptq_is_full(parent)) { 866 if (sk_acceptq_is_full(parent)) {
867 BT_DBG("backlog full %d", parent->sk_ack_backlog); 867 BT_DBG("backlog full %d", parent->sk_ack_backlog);
868 goto done; 868 goto done;
869 } 869 }
870 870
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index eb2b52484c70..8cd82dce5008 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -1,4 +1,4 @@
1/* 1/*
2 RFCOMM implementation for Linux Bluetooth stack (BlueZ). 2 RFCOMM implementation for Linux Bluetooth stack (BlueZ).
3 Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com> 3 Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com>
4 Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org> 4 Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org>
@@ -11,13 +11,13 @@
11 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 11 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 12 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
13 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 13 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
14 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 14 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
15 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 18
19 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 19 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
20 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 20 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
21 SOFTWARE IS DISCLAIMED. 21 SOFTWARE IS DISCLAIMED.
22*/ 22*/
23 23
@@ -110,7 +110,7 @@ static void rfcomm_dev_destruct(struct rfcomm_dev *dev)
110 110
111 kfree(dev); 111 kfree(dev);
112 112
113 /* It's safe to call module_put() here because socket still 113 /* It's safe to call module_put() here because socket still
114 holds reference to this module. */ 114 holds reference to this module. */
115 module_put(THIS_MODULE); 115 module_put(THIS_MODULE);
116} 116}
@@ -185,7 +185,7 @@ static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)
185 int err = 0; 185 int err = 0;
186 186
187 BT_DBG("id %d channel %d", req->dev_id, req->channel); 187 BT_DBG("id %d channel %d", req->dev_id, req->channel);
188 188
189 dev = kzalloc(sizeof(struct rfcomm_dev), GFP_KERNEL); 189 dev = kzalloc(sizeof(struct rfcomm_dev), GFP_KERNEL);
190 if (!dev) 190 if (!dev)
191 return -ENOMEM; 191 return -ENOMEM;
@@ -234,7 +234,7 @@ static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)
234 bacpy(&dev->dst, &req->dst); 234 bacpy(&dev->dst, &req->dst);
235 dev->channel = req->channel; 235 dev->channel = req->channel;
236 236
237 dev->flags = req->flags & 237 dev->flags = req->flags &
238 ((1 << RFCOMM_RELEASE_ONHUP) | (1 << RFCOMM_REUSE_DLC)); 238 ((1 << RFCOMM_RELEASE_ONHUP) | (1 << RFCOMM_REUSE_DLC));
239 239
240 init_waitqueue_head(&dev->wait); 240 init_waitqueue_head(&dev->wait);
@@ -249,7 +249,7 @@ static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)
249 dev->dlc = dlc; 249 dev->dlc = dlc;
250 rfcomm_dlc_unlock(dlc); 250 rfcomm_dlc_unlock(dlc);
251 251
252 /* It's safe to call __module_get() here because socket already 252 /* It's safe to call __module_get() here because socket already
253 holds reference to this module. */ 253 holds reference to this module. */
254 __module_get(THIS_MODULE); 254 __module_get(THIS_MODULE);
255 255
@@ -487,7 +487,7 @@ static void rfcomm_dev_data_ready(struct rfcomm_dlc *dlc, struct sk_buff *skb)
487{ 487{
488 struct rfcomm_dev *dev = dlc->owner; 488 struct rfcomm_dev *dev = dlc->owner;
489 struct tty_struct *tty; 489 struct tty_struct *tty;
490 490
491 if (!dev || !(tty = dev->tty)) { 491 if (!dev || !(tty = dev->tty)) {
492 kfree_skb(skb); 492 kfree_skb(skb);
493 return; 493 return;
@@ -506,7 +506,7 @@ static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err)
506 struct rfcomm_dev *dev = dlc->owner; 506 struct rfcomm_dev *dev = dlc->owner;
507 if (!dev) 507 if (!dev)
508 return; 508 return;
509 509
510 BT_DBG("dlc %p dev %p err %d", dlc, dev, err); 510 BT_DBG("dlc %p dev %p err %d", dlc, dev, err);
511 511
512 dev->err = err; 512 dev->err = err;
@@ -525,7 +525,7 @@ static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err)
525 rfcomm_dev_put(dev); 525 rfcomm_dev_put(dev);
526 rfcomm_dlc_lock(dlc); 526 rfcomm_dlc_lock(dlc);
527 } 527 }
528 } else 528 } else
529 tty_hangup(dev->tty); 529 tty_hangup(dev->tty);
530 } 530 }
531} 531}
@@ -543,7 +543,7 @@ static void rfcomm_dev_modem_status(struct rfcomm_dlc *dlc, u8 v24_sig)
543 tty_hangup(dev->tty); 543 tty_hangup(dev->tty);
544 } 544 }
545 545
546 dev->modem_status = 546 dev->modem_status =
547 ((v24_sig & RFCOMM_V24_RTC) ? (TIOCM_DSR | TIOCM_DTR) : 0) | 547 ((v24_sig & RFCOMM_V24_RTC) ? (TIOCM_DSR | TIOCM_DTR) : 0) |
548 ((v24_sig & RFCOMM_V24_RTR) ? (TIOCM_RTS | TIOCM_CTS) : 0) | 548 ((v24_sig & RFCOMM_V24_RTR) ? (TIOCM_RTS | TIOCM_CTS) : 0) |
549 ((v24_sig & RFCOMM_V24_IC) ? TIOCM_RI : 0) | 549 ((v24_sig & RFCOMM_V24_IC) ? TIOCM_RI : 0) |
@@ -561,7 +561,7 @@ static void rfcomm_tty_wakeup(unsigned long arg)
561 BT_DBG("dev %p tty %p", dev, tty); 561 BT_DBG("dev %p tty %p", dev, tty);
562 562
563 if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags) && tty->ldisc.write_wakeup) 563 if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags) && tty->ldisc.write_wakeup)
564 (tty->ldisc.write_wakeup)(tty); 564 (tty->ldisc.write_wakeup)(tty);
565 565
566 wake_up_interruptible(&tty->write_wait); 566 wake_up_interruptible(&tty->write_wait);
567#ifdef SERIAL_HAVE_POLL_WAIT 567#ifdef SERIAL_HAVE_POLL_WAIT
@@ -576,7 +576,7 @@ static int rfcomm_tty_open(struct tty_struct *tty, struct file *filp)
576 struct rfcomm_dlc *dlc; 576 struct rfcomm_dlc *dlc;
577 int err, id; 577 int err, id;
578 578
579 id = tty->index; 579 id = tty->index;
580 580
581 BT_DBG("tty %p id %d", tty, id); 581 BT_DBG("tty %p id %d", tty, id);
582 582
@@ -670,7 +670,7 @@ static int rfcomm_tty_write(struct tty_struct *tty, const unsigned char *buf, in
670 size = min_t(uint, count, dlc->mtu); 670 size = min_t(uint, count, dlc->mtu);
671 671
672 skb = rfcomm_wmalloc(dev, size + RFCOMM_SKB_RESERVE, GFP_ATOMIC); 672 skb = rfcomm_wmalloc(dev, size + RFCOMM_SKB_RESERVE, GFP_ATOMIC);
673 673
674 if (!skb) 674 if (!skb)
675 break; 675 break;
676 676
@@ -773,7 +773,7 @@ static void rfcomm_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
773 return; 773 return;
774 774
775 /* Handle turning off CRTSCTS */ 775 /* Handle turning off CRTSCTS */
776 if ((old->c_cflag & CRTSCTS) && !(new->c_cflag & CRTSCTS)) 776 if ((old->c_cflag & CRTSCTS) && !(new->c_cflag & CRTSCTS))
777 BT_DBG("Turning off CRTSCTS unsupported"); 777 BT_DBG("Turning off CRTSCTS unsupported");
778 778
779 /* Parity on/off and when on, odd/even */ 779 /* Parity on/off and when on, odd/even */
@@ -830,7 +830,7 @@ static void rfcomm_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
830 } 830 }
831 831
832 /* Handle number of data bits [5-8] */ 832 /* Handle number of data bits [5-8] */
833 if ((old->c_cflag & CSIZE) != (new->c_cflag & CSIZE)) 833 if ((old->c_cflag & CSIZE) != (new->c_cflag & CSIZE))
834 changes |= RFCOMM_RPN_PM_DATA; 834 changes |= RFCOMM_RPN_PM_DATA;
835 835
836 switch (new->c_cflag & CSIZE) { 836 switch (new->c_cflag & CSIZE) {
@@ -868,7 +868,7 @@ static void rfcomm_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
868 case 9600: 868 case 9600:
869 baud = RFCOMM_RPN_BR_9600; 869 baud = RFCOMM_RPN_BR_9600;
870 break; 870 break;
871 case 19200: 871 case 19200:
872 baud = RFCOMM_RPN_BR_19200; 872 baud = RFCOMM_RPN_BR_19200;
873 break; 873 break;
874 case 38400: 874 case 38400:
@@ -887,7 +887,7 @@ static void rfcomm_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
887 /* 9600 is standard accordinag to the RFCOMM specification */ 887 /* 9600 is standard accordinag to the RFCOMM specification */
888 baud = RFCOMM_RPN_BR_9600; 888 baud = RFCOMM_RPN_BR_9600;
889 break; 889 break;
890 890
891 } 891 }
892 892
893 if (changes) 893 if (changes)
@@ -978,11 +978,11 @@ static int rfcomm_tty_read_proc(char *buf, char **start, off_t offset, int len,
978 978
979static int rfcomm_tty_tiocmget(struct tty_struct *tty, struct file *filp) 979static int rfcomm_tty_tiocmget(struct tty_struct *tty, struct file *filp)
980{ 980{
981 struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; 981 struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data;
982 982
983 BT_DBG("tty %p dev %p", tty, dev); 983 BT_DBG("tty %p dev %p", tty, dev);
984 984
985 return dev->modem_status; 985 return dev->modem_status;
986} 986}
987 987
988static int rfcomm_tty_tiocmset(struct tty_struct *tty, struct file *filp, unsigned int set, unsigned int clear) 988static int rfcomm_tty_tiocmset(struct tty_struct *tty, struct file *filp, unsigned int set, unsigned int clear)
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 5d13d4f31753..ae4391440950 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -1,4 +1,4 @@
1/* 1/*
2 BlueZ - Bluetooth protocol stack for Linux 2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2000-2001 Qualcomm Incorporated 3 Copyright (C) 2000-2001 Qualcomm Incorporated
4 4
@@ -12,13 +12,13 @@
12 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 12 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
14 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 14 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
15 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 15 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 19
20 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 20 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
22 SOFTWARE IS DISCLAIMED. 22 SOFTWARE IS DISCLAIMED.
23*/ 23*/
24 24
@@ -149,7 +149,7 @@ static int sco_conn_del(struct hci_conn *hcon, int err)
149 struct sco_conn *conn; 149 struct sco_conn *conn;
150 struct sock *sk; 150 struct sock *sk;
151 151
152 if (!(conn = hcon->sco_data)) 152 if (!(conn = hcon->sco_data))
153 return 0; 153 return 0;
154 154
155 BT_DBG("hcon %p conn %p, err %d", hcon, conn, err); 155 BT_DBG("hcon %p conn %p, err %d", hcon, conn, err);
@@ -404,7 +404,7 @@ static void sco_sock_init(struct sock *sk, struct sock *parent)
404{ 404{
405 BT_DBG("sk %p", sk); 405 BT_DBG("sk %p", sk);
406 406
407 if (parent) 407 if (parent)
408 sk->sk_type = parent->sk_type; 408 sk->sk_type = parent->sk_type;
409} 409}
410 410
@@ -522,7 +522,7 @@ static int sco_sock_connect(struct socket *sock, struct sockaddr *addr, int alen
522 if ((err = sco_connect(sk))) 522 if ((err = sco_connect(sk)))
523 goto done; 523 goto done;
524 524
525 err = bt_sock_wait_state(sk, BT_CONNECTED, 525 err = bt_sock_wait_state(sk, BT_CONNECTED,
526 sock_sndtimeo(sk, flags & O_NONBLOCK)); 526 sock_sndtimeo(sk, flags & O_NONBLOCK));
527 527
528done: 528done:
@@ -627,7 +627,7 @@ static int sco_sock_getname(struct socket *sock, struct sockaddr *addr, int *len
627 return 0; 627 return 0;
628} 628}
629 629
630static int sco_sock_sendmsg(struct kiocb *iocb, struct socket *sock, 630static int sco_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
631 struct msghdr *msg, size_t len) 631 struct msghdr *msg, size_t len)
632{ 632{
633 struct sock *sk = sock->sk; 633 struct sock *sk = sock->sk;
@@ -677,7 +677,7 @@ static int sco_sock_getsockopt(struct socket *sock, int level, int optname, char
677 struct sock *sk = sock->sk; 677 struct sock *sk = sock->sk;
678 struct sco_options opts; 678 struct sco_options opts;
679 struct sco_conninfo cinfo; 679 struct sco_conninfo cinfo;
680 int len, err = 0; 680 int len, err = 0;
681 681
682 BT_DBG("sk %p", sk); 682 BT_DBG("sk %p", sk);
683 683
@@ -761,7 +761,7 @@ static void __sco_chan_add(struct sco_conn *conn, struct sock *sk, struct sock *
761 bt_accept_enqueue(parent, sk); 761 bt_accept_enqueue(parent, sk);
762} 762}
763 763
764/* Delete channel. 764/* Delete channel.
765 * Must be called on the locked socket. */ 765 * Must be called on the locked socket. */
766static void sco_chan_del(struct sock *sk, int err) 766static void sco_chan_del(struct sock *sk, int err)
767{ 767{
@@ -771,7 +771,7 @@ static void sco_chan_del(struct sock *sk, int err)
771 771
772 BT_DBG("sk %p, conn %p, err %d", sk, conn, err); 772 BT_DBG("sk %p, conn %p, err %d", sk, conn, err);
773 773
774 if (conn) { 774 if (conn) {
775 sco_conn_lock(conn); 775 sco_conn_lock(conn);
776 conn->sk = NULL; 776 conn->sk = NULL;
777 sco_pi(sk)->conn = NULL; 777 sco_pi(sk)->conn = NULL;
@@ -855,7 +855,7 @@ static int sco_connect_cfm(struct hci_conn *hcon, __u8 status)
855 conn = sco_conn_add(hcon, status); 855 conn = sco_conn_add(hcon, status);
856 if (conn) 856 if (conn)
857 sco_conn_ready(conn); 857 sco_conn_ready(conn);
858 } else 858 } else
859 sco_conn_del(hcon, bt_err(status)); 859 sco_conn_del(hcon, bt_err(status));
860 860
861 return 0; 861 return 0;
@@ -887,7 +887,7 @@ static int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb)
887 } 887 }
888 888
889drop: 889drop:
890 kfree_skb(skb); 890 kfree_skb(skb);
891 return 0; 891 return 0;
892} 892}
893 893