patch-2.4.21 linux-2.4.21/net/bluetooth/hci_core.c
Next file: linux-2.4.21/net/bluetooth/hci_sock.c
Previous file: linux-2.4.21/net/bluetooth/hci_conn.c
Back to the patch index
Back to the overall index
- Lines: 82
- Date:
2003-06-13 07:51:39.000000000 -0700
- Orig file:
linux-2.4.20/net/bluetooth/hci_core.c
- Orig date:
2002-11-28 15:53:15.000000000 -0800
diff -urN linux-2.4.20/net/bluetooth/hci_core.c linux-2.4.21/net/bluetooth/hci_core.c
@@ -717,7 +717,7 @@
if (!dev_num)
return -EINVAL;
- size = dev_num * sizeof(struct hci_dev_req) + sizeof(__u16);
+ size = dev_num * sizeof(*dr) + sizeof(*dl);
if (verify_area(VERIFY_WRITE, (void *) arg, size))
return -EFAULT;
@@ -738,7 +738,7 @@
read_unlock_bh(&hdev_list_lock);
dl->dev_num = n;
- size = n * sizeof(struct hci_dev_req) + sizeof(__u16);
+ size = n * sizeof(*dr) + sizeof(*dl);
copy_to_user((void *) arg, dl, size);
kfree(dl);
@@ -864,6 +864,22 @@
return 0;
}
+/* Suspend HCI device */
+int hci_suspend_dev(struct hci_dev *hdev)
+{
+ hci_notify(hdev, HCI_DEV_SUSPEND);
+ hci_run_hotplug(hdev->name, "suspend");
+ return 0;
+}
+
+/* Resume HCI device */
+int hci_resume_dev(struct hci_dev *hdev)
+{
+ hci_notify(hdev, HCI_DEV_RESUME);
+ hci_run_hotplug(hdev->name, "resume");
+ return 0;
+}
+
/* Receive frame from HCI drivers */
int hci_recv_frame(struct sk_buff *skb)
{
@@ -959,40 +975,6 @@
return hdev->send(skb);
}
-/* Send raw HCI frame */
-int hci_send_raw(struct sk_buff *skb)
-{
- struct hci_dev *hdev = (struct hci_dev *) skb->dev;
-
- if (!hdev) {
- kfree_skb(skb);
- return -ENODEV;
- }
-
- BT_DBG("%s type %d len %d", hdev->name, skb->pkt_type, skb->len);
-
- if (!test_bit(HCI_RAW, &hdev->flags)) {
- /* Queue frame according it's type */
- switch (skb->pkt_type) {
- case HCI_COMMAND_PKT:
- skb_queue_tail(&hdev->cmd_q, skb);
- hci_sched_cmd(hdev);
- return 0;
-
- case HCI_ACLDATA_PKT:
- case HCI_SCODATA_PKT:
- /* FIXME:
- * Check header here and queue to apropriate connection.
- */
- break;
- }
- }
-
- skb_queue_tail(&hdev->raw_q, skb);
- hci_sched_tx(hdev);
- return 0;
-}
-
/* Send HCI command */
int hci_send_cmd(struct hci_dev *hdev, __u16 ogf, __u16 ocf, __u32 plen, void *param)
{
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)