patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / net / bluetooth / af_bluetooth.c
index 74b70f7..e111cf3 100644 (file)
    SOFTWARE IS DISCLAIMED.
 */
 
-/*
- *  Bluetooth address family and sockets.
- *
- * $Id: af_bluetooth.c,v 1.3 2002/04/17 17:37:15 maxk Exp $
- */
-#define VERSION "2.4"
+/* Bluetooth address family and sockets. */
 
 #include <linux/config.h>
 #include <linux/module.h>
 
 #ifndef CONFIG_BT_SOCK_DEBUG
 #undef  BT_DBG
-#define BT_DBG( A... )
+#define BT_DBG(D...)
 #endif
 
+#define VERSION "2.5"
+
 struct proc_dir_entry *proc_bt;
+EXPORT_SYMBOL(proc_bt);
 
 /* Bluetooth sockets */
-#define BT_MAX_PROTO   6
+#define BT_MAX_PROTO   7
 static struct net_proto_family *bt_proto[BT_MAX_PROTO];
 
 static kmem_cache_t *bt_sock_cache;
@@ -75,6 +73,7 @@ int bt_sock_register(int proto, struct net_proto_family *ops)
        bt_proto[proto] = ops;
        return 0;
 }
+EXPORT_SYMBOL(bt_sock_register);
 
 int bt_sock_unregister(int proto)
 {
@@ -87,6 +86,7 @@ int bt_sock_unregister(int proto)
        bt_proto[proto] = NULL;
        return 0;
 }
+EXPORT_SYMBOL(bt_sock_unregister);
 
 static int bt_sock_create(struct socket *sock, int proto)
 {
@@ -116,7 +116,7 @@ struct sock *bt_sock_alloc(struct socket *sock, int proto, int pi_size, int prio
        sk = sk_alloc(PF_BLUETOOTH, prio, sizeof(struct bt_sock), bt_sock_cache);
        if (!sk)
                return NULL;
-       
+
        if (pi_size) {
                pi = kmalloc(pi_size, prio);
                if (!pi) {
@@ -129,13 +129,14 @@ struct sock *bt_sock_alloc(struct socket *sock, int proto, int pi_size, int prio
 
        sock_init_data(sock, sk);
        INIT_LIST_HEAD(&bt_sk(sk)->accept_q);
-       
+
        sk->sk_zapped   = 0;
        sk->sk_protocol = proto;
        sk->sk_state    = BT_OPEN;
 
        return sk;
 }
+EXPORT_SYMBOL(bt_sock_alloc);
 
 void bt_sock_link(struct bt_sock_list *l, struct sock *sk)
 {
@@ -143,6 +144,7 @@ void bt_sock_link(struct bt_sock_list *l, struct sock *sk)
        sk_add_node(sk, &l->head);
        write_unlock_bh(&l->lock);
 }
+EXPORT_SYMBOL(bt_sock_link);
 
 void bt_sock_unlink(struct bt_sock_list *l, struct sock *sk)
 {
@@ -150,6 +152,7 @@ void bt_sock_unlink(struct bt_sock_list *l, struct sock *sk)
        sk_del_node_init(sk);
        write_unlock_bh(&l->lock);
 }
+EXPORT_SYMBOL(bt_sock_unlink);
 
 void bt_accept_enqueue(struct sock *parent, struct sock *sk)
 {
@@ -160,6 +163,7 @@ void bt_accept_enqueue(struct sock *parent, struct sock *sk)
        bt_sk(sk)->parent = parent;
        parent->sk_ack_backlog++;
 }
+EXPORT_SYMBOL(bt_accept_enqueue);
 
 static void bt_accept_unlink(struct sock *sk)
 {
@@ -175,19 +179,19 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
 {
        struct list_head *p, *n;
        struct sock *sk;
-       
+
        BT_DBG("parent %p", parent);
 
        list_for_each_safe(p, n, &bt_sk(parent)->accept_q) {
                sk = (struct sock *) list_entry(p, struct bt_sock, accept_q);
-               
+
                lock_sock(sk);
                if (sk->sk_state == BT_CLOSED) {
                        release_sock(sk);
                        bt_accept_unlink(sk);
                        continue;
                }
-               
+
                if (sk->sk_state == BT_CONNECTED || !newsock) {
                        bt_accept_unlink(sk);
                        if (newsock)
@@ -199,6 +203,7 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
        }
        return NULL;
 }
+EXPORT_SYMBOL(bt_accept_dequeue);
 
 int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
        struct msghdr *msg, size_t len, int flags)
@@ -235,6 +240,7 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
 
        return err ? : copied;
 }
+EXPORT_SYMBOL(bt_sock_recvmsg);
 
 static inline unsigned int bt_accept_poll(struct sock *parent)
 {
@@ -287,6 +293,7 @@ unsigned int bt_sock_poll(struct file * file, struct socket *sock, poll_table *w
 
        return mask;
 }
+EXPORT_SYMBOL(bt_sock_poll);
 
 int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo)
 {
@@ -322,9 +329,10 @@ int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo)
        remove_wait_queue(sk->sk_sleep, &wait);
        return err;
 }
+EXPORT_SYMBOL(bt_sock_wait_state);
 
 static struct net_proto_family bt_sock_family_ops = {
-       .owner  = THIS_MODULE,
+       .owner  = THIS_MODULE,
        .family = PF_BLUETOOTH,
        .create = bt_sock_create,
 };
@@ -342,7 +350,7 @@ static int __init bt_init(void)
        proc_bt = proc_mkdir("bluetooth", NULL);
        if (proc_bt)
                proc_bt->owner = THIS_MODULE;
-       
+
        /* Init socket cache */
        bt_sock_cache = kmem_cache_create("bt_sock",
                        sizeof(struct bt_sock), 0,
@@ -352,7 +360,7 @@ static int __init bt_init(void)
                BT_ERR("Socket cache creation failed");
                return -ENOMEM;
        }
-       
+
        sock_register(&bt_sock_family_ops);
 
        BT_INFO("HCI device and connection manager initialized");