aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-05 13:09:07 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-05 13:09:07 -0500
commit3d412f60b71e588544e7b75861084f12aa1d7acd (patch)
treecd527e396da9e85dcf85e14c4fabfe29e61ff5d0 /net/bluetooth
parent3098a1801f8b92575a5cd69c77d9fa94ea504dde (diff)
parent3113e88c3cb3c0a22920b621f8e4d1f2ccc07f1e (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (21 commits) [PKT_SCHED]: vlan tag match [NET]: Add if_addrlabel.h to sanitized headers. [NET] rtnetlink.c: remove no longer used functions [ICMP]: Restore pskb_pull calls in receive function [INET]: Fix accidentally broken inet(6)_hash_connect's port offset calculations. [NET]: Remove further references to net-modules.txt bluetooth rfcomm tty: destroy before tty_close() bluetooth: blacklist another Broadcom BCM2035 device drivers/bluetooth/btsdio.c: fix double-free drivers/bluetooth/bpa10x.c: fix memleak bluetooth: uninlining bluetooth: hidp_process_hid_control remove unnecessary parameter dealing tun: impossible to deassert IFF_ONE_QUEUE or IFF_NO_PI hamradio: fix dmascc section mismatch [SCTP]: Fix kernel panic while received AUTH chunk with BAD shared key identifier [SCTP]: Fix kernel panic while received AUTH chunk while enabled auth [IPV4]: Formatting fix for /proc/net/fib_trie. [IPV6]: Fix sysctl compilation error. [NET_SCHED]: Add #ifdef CONFIG_NET_EMATCH in net/sched/cls_flow.c (latest git broken build) [IPV4]: Fix compile error building without CONFIG_FS_PROC ...
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hidp/core.c49
-rw-r--r--net/bluetooth/rfcomm/tty.c3
2 files changed, 22 insertions, 30 deletions
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 782a22602b86..519cdb920f93 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -135,8 +135,8 @@ static void __hidp_copy_session(struct hidp_session *session, struct hidp_connin
135 } 135 }
136} 136}
137 137
138static inline int hidp_queue_event(struct hidp_session *session, struct input_dev *dev, 138static int hidp_queue_event(struct hidp_session *session, struct input_dev *dev,
139 unsigned int type, unsigned int code, int value) 139 unsigned int type, unsigned int code, int value)
140{ 140{
141 unsigned char newleds; 141 unsigned char newleds;
142 struct sk_buff *skb; 142 struct sk_buff *skb;
@@ -243,7 +243,8 @@ static void hidp_input_report(struct hidp_session *session, struct sk_buff *skb)
243 input_sync(dev); 243 input_sync(dev);
244} 244}
245 245
246static inline int hidp_queue_report(struct hidp_session *session, unsigned char *data, int size) 246static int hidp_queue_report(struct hidp_session *session,
247 unsigned char *data, int size)
247{ 248{
248 struct sk_buff *skb; 249 struct sk_buff *skb;
249 250
@@ -287,7 +288,7 @@ static void hidp_idle_timeout(unsigned long arg)
287 hidp_schedule(session); 288 hidp_schedule(session);
288} 289}
289 290
290static inline void hidp_set_timer(struct hidp_session *session) 291static void hidp_set_timer(struct hidp_session *session)
291{ 292{
292 if (session->idle_to > 0) 293 if (session->idle_to > 0)
293 mod_timer(&session->timer, jiffies + HZ * session->idle_to); 294 mod_timer(&session->timer, jiffies + HZ * session->idle_to);
@@ -332,7 +333,8 @@ static inline int hidp_send_ctrl_message(struct hidp_session *session,
332 return err; 333 return err;
333} 334}
334 335
335static inline void hidp_process_handshake(struct hidp_session *session, unsigned char param) 336static void hidp_process_handshake(struct hidp_session *session,
337 unsigned char param)
336{ 338{
337 BT_DBG("session %p param 0x%02x", session, param); 339 BT_DBG("session %p param 0x%02x", session, param);
338 340
@@ -365,38 +367,23 @@ static inline void hidp_process_handshake(struct hidp_session *session, unsigned
365 } 367 }
366} 368}
367 369
368static inline void hidp_process_hid_control(struct hidp_session *session, unsigned char param) 370static void hidp_process_hid_control(struct hidp_session *session,
371 unsigned char param)
369{ 372{
370 BT_DBG("session %p param 0x%02x", session, param); 373 BT_DBG("session %p param 0x%02x", session, param);
371 374
372 switch (param) { 375 if (param == HIDP_CTRL_VIRTUAL_CABLE_UNPLUG) {
373 case HIDP_CTRL_NOP:
374 break;
375
376 case HIDP_CTRL_VIRTUAL_CABLE_UNPLUG:
377 /* Flush the transmit queues */ 376 /* Flush the transmit queues */
378 skb_queue_purge(&session->ctrl_transmit); 377 skb_queue_purge(&session->ctrl_transmit);
379 skb_queue_purge(&session->intr_transmit); 378 skb_queue_purge(&session->intr_transmit);
380 379
381 /* Kill session thread */ 380 /* Kill session thread */
382 atomic_inc(&session->terminate); 381 atomic_inc(&session->terminate);
383 break;
384
385 case HIDP_CTRL_HARD_RESET:
386 case HIDP_CTRL_SOFT_RESET:
387 case HIDP_CTRL_SUSPEND:
388 case HIDP_CTRL_EXIT_SUSPEND:
389 /* FIXME: We have to parse these and return no error */
390 break;
391
392 default:
393 __hidp_send_ctrl_message(session,
394 HIDP_TRANS_HANDSHAKE | HIDP_HSHK_ERR_INVALID_PARAMETER, NULL, 0);
395 break;
396 } 382 }
397} 383}
398 384
399static inline void hidp_process_data(struct hidp_session *session, struct sk_buff *skb, unsigned char param) 385static void hidp_process_data(struct hidp_session *session, struct sk_buff *skb,
386 unsigned char param)
400{ 387{
401 BT_DBG("session %p skb %p len %d param 0x%02x", session, skb, skb->len, param); 388 BT_DBG("session %p skb %p len %d param 0x%02x", session, skb, skb->len, param);
402 389
@@ -423,7 +410,8 @@ static inline void hidp_process_data(struct hidp_session *session, struct sk_buf
423 } 410 }
424} 411}
425 412
426static inline void hidp_recv_ctrl_frame(struct hidp_session *session, struct sk_buff *skb) 413static void hidp_recv_ctrl_frame(struct hidp_session *session,
414 struct sk_buff *skb)
427{ 415{
428 unsigned char hdr, type, param; 416 unsigned char hdr, type, param;
429 417
@@ -457,7 +445,8 @@ static inline void hidp_recv_ctrl_frame(struct hidp_session *session, struct sk_
457 kfree_skb(skb); 445 kfree_skb(skb);
458} 446}
459 447
460static inline void hidp_recv_intr_frame(struct hidp_session *session, struct sk_buff *skb) 448static void hidp_recv_intr_frame(struct hidp_session *session,
449 struct sk_buff *skb)
461{ 450{
462 unsigned char hdr; 451 unsigned char hdr;
463 452
@@ -625,7 +614,8 @@ static struct device *hidp_get_device(struct hidp_session *session)
625 return conn ? &conn->dev : NULL; 614 return conn ? &conn->dev : NULL;
626} 615}
627 616
628static inline int hidp_setup_input(struct hidp_session *session, struct hidp_connadd_req *req) 617static int hidp_setup_input(struct hidp_session *session,
618 struct hidp_connadd_req *req)
629{ 619{
630 struct input_dev *input = session->input; 620 struct input_dev *input = session->input;
631 int i; 621 int i;
@@ -702,7 +692,8 @@ static void hidp_setup_quirks(struct hid_device *hid)
702 hid->quirks = hidp_blacklist[n].quirks; 692 hid->quirks = hidp_blacklist[n].quirks;
703} 693}
704 694
705static inline void hidp_setup_hid(struct hidp_session *session, struct hidp_connadd_req *req) 695static void hidp_setup_hid(struct hidp_session *session,
696 struct hidp_connadd_req *req)
706{ 697{
707 struct hid_device *hid = session->hid; 698 struct hid_device *hid = session->hid;
708 struct hid_report *report; 699 struct hid_report *report;
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index 788c70321858..e4c779bb8d76 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -429,7 +429,8 @@ static int rfcomm_release_dev(void __user *arg)
429 if (dev->tty) 429 if (dev->tty)
430 tty_vhangup(dev->tty); 430 tty_vhangup(dev->tty);
431 431
432 rfcomm_dev_del(dev); 432 if (!test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags))
433 rfcomm_dev_del(dev);
433 rfcomm_dev_put(dev); 434 rfcomm_dev_put(dev);
434 return 0; 435 return 0;
435} 436}