Merge branch 'p-ti-linux-3.8.y' into p-ti-android-3.8.y
[android-sdk/kernel-video.git] / net / bluetooth / af_bluetooth.c
1 /*
2    BlueZ - Bluetooth protocol stack for Linux
3    Copyright (C) 2000-2001 Qualcomm Incorporated
5    Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License version 2 as
9    published by the Free Software Foundation;
11    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
12    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
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
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
17    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20    ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
21    COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
22    SOFTWARE IS DISCLAIMED.
23 */
25 /* Bluetooth address family and sockets. */
27 #include <linux/module.h>
28 #include <asm/ioctls.h>
30 #include <net/bluetooth/bluetooth.h>
31 #include <linux/proc_fs.h>
33 #ifndef CONFIG_BT_SOCK_DEBUG
34 #undef  BT_DBG
35 #define BT_DBG(D...)
36 #endif
38 #define VERSION "2.16"
40 /* Bluetooth sockets */
41 #define BT_MAX_PROTO    8
42 static const struct net_proto_family *bt_proto[BT_MAX_PROTO];
43 static DEFINE_RWLOCK(bt_proto_lock);
45 static struct lock_class_key bt_lock_key[BT_MAX_PROTO];
46 static const char *const bt_key_strings[BT_MAX_PROTO] = {
47         "sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP",
48         "sk_lock-AF_BLUETOOTH-BTPROTO_HCI",
49         "sk_lock-AF_BLUETOOTH-BTPROTO_SCO",
50         "sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM",
51         "sk_lock-AF_BLUETOOTH-BTPROTO_BNEP",
52         "sk_lock-AF_BLUETOOTH-BTPROTO_CMTP",
53         "sk_lock-AF_BLUETOOTH-BTPROTO_HIDP",
54         "sk_lock-AF_BLUETOOTH-BTPROTO_AVDTP",
55 };
57 static struct lock_class_key bt_slock_key[BT_MAX_PROTO];
58 static const char *const bt_slock_key_strings[BT_MAX_PROTO] = {
59         "slock-AF_BLUETOOTH-BTPROTO_L2CAP",
60         "slock-AF_BLUETOOTH-BTPROTO_HCI",
61         "slock-AF_BLUETOOTH-BTPROTO_SCO",
62         "slock-AF_BLUETOOTH-BTPROTO_RFCOMM",
63         "slock-AF_BLUETOOTH-BTPROTO_BNEP",
64         "slock-AF_BLUETOOTH-BTPROTO_CMTP",
65         "slock-AF_BLUETOOTH-BTPROTO_HIDP",
66         "slock-AF_BLUETOOTH-BTPROTO_AVDTP",
67 };
69 void bt_sock_reclassify_lock(struct sock *sk, int proto)
70 {
71         BUG_ON(!sk);
72         BUG_ON(sock_owned_by_user(sk));
74         sock_lock_init_class_and_name(sk,
75                         bt_slock_key_strings[proto], &bt_slock_key[proto],
76                                 bt_key_strings[proto], &bt_lock_key[proto]);
77 }
78 EXPORT_SYMBOL(bt_sock_reclassify_lock);
80 int bt_sock_register(int proto, const struct net_proto_family *ops)
81 {
82         int err = 0;
84         if (proto < 0 || proto >= BT_MAX_PROTO)
85                 return -EINVAL;
87         write_lock(&bt_proto_lock);
89         if (bt_proto[proto])
90                 err = -EEXIST;
91         else
92                 bt_proto[proto] = ops;
94         write_unlock(&bt_proto_lock);
96         return err;
97 }
98 EXPORT_SYMBOL(bt_sock_register);
100 int bt_sock_unregister(int proto)
102         int err = 0;
104         if (proto < 0 || proto >= BT_MAX_PROTO)
105                 return -EINVAL;
107         write_lock(&bt_proto_lock);
109         if (!bt_proto[proto])
110                 err = -ENOENT;
111         else
112                 bt_proto[proto] = NULL;
114         write_unlock(&bt_proto_lock);
116         return err;
118 EXPORT_SYMBOL(bt_sock_unregister);
120 #ifdef CONFIG_PARANOID_NETWORK
121 static inline int current_has_bt_admin(void)
123         return !current_euid();
126 static inline int current_has_bt(void)
128         return current_has_bt_admin();
130 # else
131 static inline int current_has_bt_admin(void)
133         return 1;
136 static inline int current_has_bt(void)
138         return 1;
140 #endif
142 static int bt_sock_create(struct net *net, struct socket *sock, int proto,
143                           int kern)
145         int err;
147         if (proto == BTPROTO_RFCOMM || proto == BTPROTO_SCO ||
148                         proto == BTPROTO_L2CAP) {
149                 if (!current_has_bt())
150                         return -EPERM;
151         } else if (!current_has_bt_admin())
152                 return -EPERM;
154         if (net != &init_net)
155                 return -EAFNOSUPPORT;
157         if (proto < 0 || proto >= BT_MAX_PROTO)
158                 return -EINVAL;
160         if (!bt_proto[proto])
161                 request_module("bt-proto-%d", proto);
163         err = -EPROTONOSUPPORT;
165         read_lock(&bt_proto_lock);
167         if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) {
168                 err = bt_proto[proto]->create(net, sock, proto, kern);
169                 if (!err)
170                         bt_sock_reclassify_lock(sock->sk, proto);
171                 module_put(bt_proto[proto]->owner);
172         }
174         read_unlock(&bt_proto_lock);
176         return err;
179 void bt_sock_link(struct bt_sock_list *l, struct sock *sk)
181         write_lock(&l->lock);
182         sk_add_node(sk, &l->head);
183         write_unlock(&l->lock);
185 EXPORT_SYMBOL(bt_sock_link);
187 void bt_sock_unlink(struct bt_sock_list *l, struct sock *sk)
189         write_lock(&l->lock);
190         sk_del_node_init(sk);
191         write_unlock(&l->lock);
193 EXPORT_SYMBOL(bt_sock_unlink);
195 void bt_accept_enqueue(struct sock *parent, struct sock *sk)
197         BT_DBG("parent %p, sk %p", parent, sk);
199         sock_hold(sk);
200         list_add_tail(&bt_sk(sk)->accept_q, &bt_sk(parent)->accept_q);
201         bt_sk(sk)->parent = parent;
202         parent->sk_ack_backlog++;
204 EXPORT_SYMBOL(bt_accept_enqueue);
206 void bt_accept_unlink(struct sock *sk)
208         BT_DBG("sk %p state %d", sk, sk->sk_state);
210         list_del_init(&bt_sk(sk)->accept_q);
211         bt_sk(sk)->parent->sk_ack_backlog--;
212         bt_sk(sk)->parent = NULL;
213         sock_put(sk);
215 EXPORT_SYMBOL(bt_accept_unlink);
217 struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
219         struct list_head *p, *n;
220         struct sock *sk;
222         BT_DBG("parent %p", parent);
224         list_for_each_safe(p, n, &bt_sk(parent)->accept_q) {
225                 sk = (struct sock *) list_entry(p, struct bt_sock, accept_q);
227                 lock_sock(sk);
229                 /* FIXME: Is this check still needed */
230                 if (sk->sk_state == BT_CLOSED) {
231                         release_sock(sk);
232                         bt_accept_unlink(sk);
233                         continue;
234                 }
236                 if (sk->sk_state == BT_CONNECTED || !newsock ||
237                     test_bit(BT_SK_DEFER_SETUP, &bt_sk(parent)->flags)) {
238                         bt_accept_unlink(sk);
239                         if (newsock)
240                                 sock_graft(sk, newsock);
242                         release_sock(sk);
243                         return sk;
244                 }
246                 release_sock(sk);
247         }
249         return NULL;
251 EXPORT_SYMBOL(bt_accept_dequeue);
253 int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
254                                 struct msghdr *msg, size_t len, int flags)
256         int noblock = flags & MSG_DONTWAIT;
257         struct sock *sk = sock->sk;
258         struct sk_buff *skb;
259         size_t copied;
260         int err;
262         BT_DBG("sock %p sk %p len %zu", sock, sk, len);
264         if (flags & (MSG_OOB))
265                 return -EOPNOTSUPP;
267         msg->msg_namelen = 0;
269         skb = skb_recv_datagram(sk, flags, noblock, &err);
270         if (!skb) {
271                 if (sk->sk_shutdown & RCV_SHUTDOWN)
272                         return 0;
273                 return err;
274         }
276         copied = skb->len;
277         if (len < copied) {
278                 msg->msg_flags |= MSG_TRUNC;
279                 copied = len;
280         }
282         skb_reset_transport_header(skb);
283         err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
284         if (err == 0)
285                 sock_recv_ts_and_drops(msg, sk, skb);
287         skb_free_datagram(sk, skb);
289         return err ? : copied;
291 EXPORT_SYMBOL(bt_sock_recvmsg);
293 static long bt_sock_data_wait(struct sock *sk, long timeo)
295         DECLARE_WAITQUEUE(wait, current);
297         add_wait_queue(sk_sleep(sk), &wait);
298         for (;;) {
299                 set_current_state(TASK_INTERRUPTIBLE);
301                 if (!skb_queue_empty(&sk->sk_receive_queue))
302                         break;
304                 if (sk->sk_err || (sk->sk_shutdown & RCV_SHUTDOWN))
305                         break;
307                 if (signal_pending(current) || !timeo)
308                         break;
310                 set_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
311                 release_sock(sk);
312                 timeo = schedule_timeout(timeo);
313                 lock_sock(sk);
314                 clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
315         }
317         __set_current_state(TASK_RUNNING);
318         remove_wait_queue(sk_sleep(sk), &wait);
319         return timeo;
322 int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
323                                struct msghdr *msg, size_t size, int flags)
325         struct sock *sk = sock->sk;
326         int err = 0;
327         size_t target, copied = 0;
328         long timeo;
330         if (flags & MSG_OOB)
331                 return -EOPNOTSUPP;
333         msg->msg_namelen = 0;
335         BT_DBG("sk %p size %zu", sk, size);
337         lock_sock(sk);
339         target = sock_rcvlowat(sk, flags & MSG_WAITALL, size);
340         timeo  = sock_rcvtimeo(sk, flags & MSG_DONTWAIT);
342         do {
343                 struct sk_buff *skb;
344                 int chunk;
346                 skb = skb_dequeue(&sk->sk_receive_queue);
347                 if (!skb) {
348                         if (copied >= target)
349                                 break;
351                         err = sock_error(sk);
352                         if (err)
353                                 break;
354                         if (sk->sk_shutdown & RCV_SHUTDOWN)
355                                 break;
357                         err = -EAGAIN;
358                         if (!timeo)
359                                 break;
361                         timeo = bt_sock_data_wait(sk, timeo);
363                         if (signal_pending(current)) {
364                                 err = sock_intr_errno(timeo);
365                                 goto out;
366                         }
367                         continue;
368                 }
370                 chunk = min_t(unsigned int, skb->len, size);
371                 if (skb_copy_datagram_iovec(skb, 0, msg->msg_iov, chunk)) {
372                         skb_queue_head(&sk->sk_receive_queue, skb);
373                         if (!copied)
374                                 copied = -EFAULT;
375                         break;
376                 }
377                 copied += chunk;
378                 size   -= chunk;
380                 sock_recv_ts_and_drops(msg, sk, skb);
382                 if (!(flags & MSG_PEEK)) {
383                         int skb_len = skb_headlen(skb);
385                         if (chunk <= skb_len) {
386                                 __skb_pull(skb, chunk);
387                         } else {
388                                 struct sk_buff *frag;
390                                 __skb_pull(skb, skb_len);
391                                 chunk -= skb_len;
393                                 skb_walk_frags(skb, frag) {
394                                         if (chunk <= frag->len) {
395                                                 /* Pulling partial data */
396                                                 skb->len -= chunk;
397                                                 skb->data_len -= chunk;
398                                                 __skb_pull(frag, chunk);
399                                                 break;
400                                         } else if (frag->len) {
401                                                 /* Pulling all frag data */
402                                                 chunk -= frag->len;
403                                                 skb->len -= frag->len;
404                                                 skb->data_len -= frag->len;
405                                                 __skb_pull(frag, frag->len);
406                                         }
407                                 }
408                         }
410                         if (skb->len) {
411                                 skb_queue_head(&sk->sk_receive_queue, skb);
412                                 break;
413                         }
414                         kfree_skb(skb);
416                 } else {
417                         /* put message back and return */
418                         skb_queue_head(&sk->sk_receive_queue, skb);
419                         break;
420                 }
421         } while (size);
423 out:
424         release_sock(sk);
425         return copied ? : err;
427 EXPORT_SYMBOL(bt_sock_stream_recvmsg);
429 static inline unsigned int bt_accept_poll(struct sock *parent)
431         struct list_head *p, *n;
432         struct sock *sk;
434         list_for_each_safe(p, n, &bt_sk(parent)->accept_q) {
435                 sk = (struct sock *) list_entry(p, struct bt_sock, accept_q);
436                 if (sk->sk_state == BT_CONNECTED ||
437                     (test_bit(BT_SK_DEFER_SETUP, &bt_sk(parent)->flags) &&
438                      sk->sk_state == BT_CONNECT2))
439                         return POLLIN | POLLRDNORM;
440         }
442         return 0;
445 unsigned int bt_sock_poll(struct file *file, struct socket *sock,
446                           poll_table *wait)
448         struct sock *sk = sock->sk;
449         unsigned int mask = 0;
451         BT_DBG("sock %p, sk %p", sock, sk);
453         poll_wait(file, sk_sleep(sk), wait);
455         if (sk->sk_state == BT_LISTEN)
456                 return bt_accept_poll(sk);
458         if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
459                 mask |= POLLERR;
461         if (sk->sk_shutdown & RCV_SHUTDOWN)
462                 mask |= POLLRDHUP | POLLIN | POLLRDNORM;
464         if (sk->sk_shutdown == SHUTDOWN_MASK)
465                 mask |= POLLHUP;
467         if (!skb_queue_empty(&sk->sk_receive_queue))
468                 mask |= POLLIN | POLLRDNORM;
470         if (sk->sk_state == BT_CLOSED)
471                 mask |= POLLHUP;
473         if (sk->sk_state == BT_CONNECT ||
474                         sk->sk_state == BT_CONNECT2 ||
475                         sk->sk_state == BT_CONFIG)
476                 return mask;
478         if (!test_bit(BT_SK_SUSPEND, &bt_sk(sk)->flags) && sock_writeable(sk))
479                 mask |= POLLOUT | POLLWRNORM | POLLWRBAND;
480         else
481                 set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
483         return mask;
485 EXPORT_SYMBOL(bt_sock_poll);
487 int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
489         struct sock *sk = sock->sk;
490         struct sk_buff *skb;
491         long amount;
492         int err;
494         BT_DBG("sk %p cmd %x arg %lx", sk, cmd, arg);
496         switch (cmd) {
497         case TIOCOUTQ:
498                 if (sk->sk_state == BT_LISTEN)
499                         return -EINVAL;
501                 amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
502                 if (amount < 0)
503                         amount = 0;
504                 err = put_user(amount, (int __user *) arg);
505                 break;
507         case TIOCINQ:
508                 if (sk->sk_state == BT_LISTEN)
509                         return -EINVAL;
511                 lock_sock(sk);
512                 skb = skb_peek(&sk->sk_receive_queue);
513                 amount = skb ? skb->len : 0;
514                 release_sock(sk);
515                 err = put_user(amount, (int __user *) arg);
516                 break;
518         case SIOCGSTAMP:
519                 err = sock_get_timestamp(sk, (struct timeval __user *) arg);
520                 break;
522         case SIOCGSTAMPNS:
523                 err = sock_get_timestampns(sk, (struct timespec __user *) arg);
524                 break;
526         default:
527                 err = -ENOIOCTLCMD;
528                 break;
529         }
531         return err;
533 EXPORT_SYMBOL(bt_sock_ioctl);
535 int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo)
537         DECLARE_WAITQUEUE(wait, current);
538         int err = 0;
540         BT_DBG("sk %p", sk);
542         add_wait_queue(sk_sleep(sk), &wait);
543         set_current_state(TASK_INTERRUPTIBLE);
544         while (sk->sk_state != state) {
545                 if (!timeo) {
546                         err = -EINPROGRESS;
547                         break;
548                 }
550                 if (signal_pending(current)) {
551                         err = sock_intr_errno(timeo);
552                         break;
553                 }
555                 release_sock(sk);
556                 timeo = schedule_timeout(timeo);
557                 lock_sock(sk);
558                 set_current_state(TASK_INTERRUPTIBLE);
560                 err = sock_error(sk);
561                 if (err)
562                         break;
563         }
564         __set_current_state(TASK_RUNNING);
565         remove_wait_queue(sk_sleep(sk), &wait);
566         return err;
568 EXPORT_SYMBOL(bt_sock_wait_state);
570 #ifdef CONFIG_PROC_FS
571 struct bt_seq_state {
572         struct bt_sock_list *l;
573 };
575 static void *bt_seq_start(struct seq_file *seq, loff_t *pos)
576         __acquires(seq->private->l->lock)
578         struct bt_seq_state *s = seq->private;
579         struct bt_sock_list *l = s->l;
581         read_lock(&l->lock);
582         return seq_hlist_start_head(&l->head, *pos);
585 static void *bt_seq_next(struct seq_file *seq, void *v, loff_t *pos)
587         struct bt_seq_state *s = seq->private;
588         struct bt_sock_list *l = s->l;
590         return seq_hlist_next(v, &l->head, pos);
593 static void bt_seq_stop(struct seq_file *seq, void *v)
594         __releases(seq->private->l->lock)
596         struct bt_seq_state *s = seq->private;
597         struct bt_sock_list *l = s->l;
599         read_unlock(&l->lock);
602 static int bt_seq_show(struct seq_file *seq, void *v)
604         struct bt_seq_state *s = seq->private;
605         struct bt_sock_list *l = s->l;
607         if (v == SEQ_START_TOKEN) {
608                 seq_puts(seq ,"sk               RefCnt Rmem   Wmem   User   Inode  Src Dst Parent");
610                 if (l->custom_seq_show) {
611                         seq_putc(seq, ' ');
612                         l->custom_seq_show(seq, v);
613                 }
615                 seq_putc(seq, '\n');
616         } else {
617                 struct sock *sk = sk_entry(v);
618                 struct bt_sock *bt = bt_sk(sk);
620                 seq_printf(seq,
621                            "%pK %-6d %-6u %-6u %-6u %-6lu %pMR %pMR %-6lu",
622                            sk,
623                            atomic_read(&sk->sk_refcnt),
624                            sk_rmem_alloc_get(sk),
625                            sk_wmem_alloc_get(sk),
626                            from_kuid(seq_user_ns(seq), sock_i_uid(sk)),
627                            sock_i_ino(sk),
628                            &bt->src,
629                            &bt->dst,
630                            bt->parent? sock_i_ino(bt->parent): 0LU);
632                 if (l->custom_seq_show) {
633                         seq_putc(seq, ' ');
634                         l->custom_seq_show(seq, v);
635                 }
637                 seq_putc(seq, '\n');
638         }
639         return 0;
642 static struct seq_operations bt_seq_ops = {
643         .start = bt_seq_start,
644         .next  = bt_seq_next,
645         .stop  = bt_seq_stop,
646         .show  = bt_seq_show,
647 };
649 static int bt_seq_open(struct inode *inode, struct file *file)
651         struct bt_sock_list *sk_list;
652         struct bt_seq_state *s;
654         sk_list = PDE(inode)->data;
655         s = __seq_open_private(file, &bt_seq_ops,
656                                sizeof(struct bt_seq_state));
657         if (!s)
658                 return -ENOMEM;
660         s->l = sk_list;
661         return 0;
664 int bt_procfs_init(struct module* module, struct net *net, const char *name,
665                    struct bt_sock_list* sk_list,
666                    int (* seq_show)(struct seq_file *, void *))
668         struct proc_dir_entry * pde;
670         sk_list->custom_seq_show = seq_show;
672         sk_list->fops.owner     = module;
673         sk_list->fops.open      = bt_seq_open;
674         sk_list->fops.read      = seq_read;
675         sk_list->fops.llseek    = seq_lseek;
676         sk_list->fops.release   = seq_release_private;
678         pde = proc_net_fops_create(net, name, 0, &sk_list->fops);
679         if (!pde)
680                 return -ENOMEM;
682         pde->data = sk_list;
684         return 0;
687 void bt_procfs_cleanup(struct net *net, const char *name)
689         proc_net_remove(net, name);
691 #else
692 int bt_procfs_init(struct module* module, struct net *net, const char *name,
693                    struct bt_sock_list* sk_list,
694                    int (* seq_show)(struct seq_file *, void *))
696         return 0;
699 void bt_procfs_cleanup(struct net *net, const char *name)
702 #endif
703 EXPORT_SYMBOL(bt_procfs_init);
704 EXPORT_SYMBOL(bt_procfs_cleanup);
706 static struct net_proto_family bt_sock_family_ops = {
707         .owner  = THIS_MODULE,
708         .family = PF_BLUETOOTH,
709         .create = bt_sock_create,
710 };
712 static int __init bt_init(void)
714         int err;
716         BT_INFO("Core ver %s", VERSION);
718         err = bt_sysfs_init();
719         if (err < 0)
720                 return err;
722         err = sock_register(&bt_sock_family_ops);
723         if (err < 0) {
724                 bt_sysfs_cleanup();
725                 return err;
726         }
728         BT_INFO("HCI device and connection manager initialized");
730         err = hci_sock_init();
731         if (err < 0)
732                 goto error;
734         err = l2cap_init();
735         if (err < 0)
736                 goto sock_err;
738         err = sco_init();
739         if (err < 0) {
740                 l2cap_exit();
741                 goto sock_err;
742         }
744         return 0;
746 sock_err:
747         hci_sock_cleanup();
749 error:
750         sock_unregister(PF_BLUETOOTH);
751         bt_sysfs_cleanup();
753         return err;
756 static void __exit bt_exit(void)
759         sco_exit();
761         l2cap_exit();
763         hci_sock_cleanup();
765         sock_unregister(PF_BLUETOOTH);
767         bt_sysfs_cleanup();
770 subsys_initcall(bt_init);
771 module_exit(bt_exit);
773 MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
774 MODULE_DESCRIPTION("Bluetooth Core ver " VERSION);
775 MODULE_VERSION(VERSION);
776 MODULE_LICENSE("GPL");
777 MODULE_ALIAS_NETPROTO(PF_BLUETOOTH);