drivers/net/tulip/eeprom.c: fix bogus "(null)" in tulip init messages
[safe/jmp/linux-2.6] / net / bluetooth / hci_sock.c
index e7395f2..38f08f6 100644 (file)
@@ -329,6 +329,9 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
        }
 
        if (mask & HCI_CMSG_TSTAMP) {
+#ifdef CONFIG_COMPAT
+               struct compat_timeval ctv;
+#endif
                struct timeval tv;
                void *data;
                int len;
@@ -339,7 +342,6 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
                len = sizeof(tv);
 #ifdef CONFIG_COMPAT
                if (msg->msg_flags & MSG_CMSG_COMPAT) {
-                       struct compat_timeval ctv;
                        ctv.tv_sec = tv.tv_sec;
                        ctv.tv_usec = tv.tv_usec;
                        data = &ctv;
@@ -414,6 +416,11 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
                goto done;
        }
 
+       if (!test_bit(HCI_UP, &hdev->flags)) {
+               err = -ENETDOWN;
+               goto done;
+       }
+
        if (!(skb = bt_skb_send_alloc(sk, len, msg->msg_flags & MSG_DONTWAIT, &err)))
                goto done;
 
@@ -440,10 +447,10 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
 
                if (test_bit(HCI_RAW, &hdev->flags) || (ogf == 0x3f)) {
                        skb_queue_tail(&hdev->raw_q, skb);
-                       hci_sched_tx(hdev);
+                       tasklet_schedule(&hdev->tx_task);
                } else {
                        skb_queue_tail(&hdev->cmd_q, skb);
-                       hci_sched_cmd(hdev);
+                       tasklet_schedule(&hdev->cmd_task);
                }
        } else {
                if (!capable(CAP_NET_RAW)) {
@@ -452,7 +459,7 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
                }
 
                skb_queue_tail(&hdev->raw_q, skb);
-               hci_sched_tx(hdev);
+               tasklet_schedule(&hdev->tx_task);
        }
 
        err = len;
@@ -621,7 +628,8 @@ static struct proto hci_sk_proto = {
        .obj_size       = sizeof(struct hci_pinfo)
 };
 
-static int hci_sock_create(struct net *net, struct socket *sock, int protocol)
+static int hci_sock_create(struct net *net, struct socket *sock, int protocol,
+                          int kern)
 {
        struct sock *sk;