]> err.no Git - linux-2.6/blobdiff - drivers/bluetooth/hci_vhci.c
Merge trivial low-risk suspend hotkey bugzilla-5918 into release
[linux-2.6] / drivers / bluetooth / hci_vhci.c
index 4aa5dfff12bea0ebef4de44cbc3698ec07421236..aac67a3a6019958a5ad77347aa0dcc11c6609c99 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
@@ -107,7 +106,7 @@ static int vhci_send_frame(struct sk_buff *skb)
 
        vhci = hdev->driver_data;
 
-       memcpy(skb_push(skb, 1), &skb->pkt_type, 1);
+       memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
        skb_queue_tail(&vhci->readq, skb);
 
        if (vhci->flags & VHCI_FASYNC)
@@ -141,7 +140,7 @@ static inline ssize_t vhci_get_user(struct vhci_data *vhci,
        }
 
        skb->dev = (void *) vhci->hdev;
-       skb->pkt_type = *((__u8 *) skb->data);
+       bt_cb(skb)->pkt_type = *((__u8 *) skb->data);
        skb_pull(skb, 1);
 
        hci_recv_frame(skb);
@@ -164,18 +163,18 @@ static inline ssize_t vhci_put_user(struct vhci_data *vhci,
 
        vhci->hdev->stat.byte_tx += len;
 
-       switch (skb->pkt_type) {
-               case HCI_COMMAND_PKT:
-                       vhci->hdev->stat.cmd_tx++;
-                       break;
+       switch (bt_cb(skb)->pkt_type) {
+       case HCI_COMMAND_PKT:
+               vhci->hdev->stat.cmd_tx++;
+               break;
 
-               case HCI_ACLDATA_PKT:
-                       vhci->hdev->stat.acl_tx++;
-                       break;
+       case HCI_ACLDATA_PKT:
+               vhci->hdev->stat.acl_tx++;
+               break;
 
-               case HCI_SCODATA_PKT:
-                       vhci->hdev->stat.cmd_tx++;
-                       break;
+       case HCI_SCODATA_PKT:
+               vhci->hdev->stat.cmd_tx++;
+               break;
        };
 
        return total;
@@ -261,12 +260,10 @@ static int vhci_open(struct inode *inode, struct file *file)
        struct vhci_data *vhci;
        struct hci_dev *hdev;
 
-       vhci = kmalloc(sizeof(struct vhci_data), GFP_KERNEL);
+       vhci = kzalloc(sizeof(struct vhci_data), GFP_KERNEL);
        if (!vhci)
                return -ENOMEM;
 
-       memset(vhci, 0, sizeof(struct vhci_data));
-
        skb_queue_head_init(&vhci->readq);
        init_waitqueue_head(&vhci->read_wait);
 
@@ -280,7 +277,6 @@ static int vhci_open(struct inode *inode, struct file *file)
 
        hdev->type = HCI_VHCI;
        hdev->driver_data = vhci;
-       SET_HCIDEV_DEV(hdev, vhci_miscdev.dev);
 
        hdev->open     = vhci_open_dev;
        hdev->close    = vhci_close_dev;