aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/bnep
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2007-02-09 09:24:33 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-02-11 02:19:20 -0500
commit8e87d14255acffeee36873de226dc25c11b5f46d (patch)
treee11c179c8db4ae3ad56ea02d583bc041dcc686b6 /net/bluetooth/bnep
parent528930b91ee89a05a6264629cf99109652c19ca8 (diff)
[NET] BLUETOOTH: Fix whitespace errors.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bluetooth/bnep')
-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
4 files changed, 65 insertions, 65 deletions
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))