diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2012-07-16 09:12:02 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-07-17 13:33:20 -0400 |
commit | 7dec65c8a7fdab87d23bcf3c7e7eff662d180853 (patch) | |
tree | 11c79d87b6aa1c3fa73c3ed0eddc867c744420e4 /drivers/bluetooth/hci_h5.c | |
parent | 83ce9a06b5307c8d759ddd8e4f49e2495fb321f7 (diff) |
Bluetooth: Initial skeleton for Three-wire UART (H5) support
This patch adds the initial skeleton for Three-wire UART (H5) support
and hooks it up to the HCI UART framework.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'drivers/bluetooth/hci_h5.c')
-rw-r--r-- | drivers/bluetooth/hci_h5.c | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c new file mode 100644 index 000000000000..6353d00ba864 --- /dev/null +++ b/drivers/bluetooth/hci_h5.c | |||
@@ -0,0 +1,88 @@ | |||
1 | /* | ||
2 | * | ||
3 | * Bluetooth HCI Three-wire UART driver | ||
4 | * | ||
5 | * Copyright (C) 2012 Intel Corporation | ||
6 | * | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #include <linux/kernel.h> | ||
25 | #include <linux/errno.h> | ||
26 | #include <linux/skbuff.h> | ||
27 | |||
28 | #include <net/bluetooth/bluetooth.h> | ||
29 | #include <net/bluetooth/hci_core.h> | ||
30 | |||
31 | #include "hci_uart.h" | ||
32 | |||
33 | static int h5_open(struct hci_uart *hu) | ||
34 | { | ||
35 | return -ENOSYS; | ||
36 | } | ||
37 | |||
38 | static int h5_close(struct hci_uart *hu) | ||
39 | { | ||
40 | return -ENOSYS; | ||
41 | } | ||
42 | |||
43 | static int h5_recv(struct hci_uart *hu, void *data, int count) | ||
44 | { | ||
45 | return -ENOSYS; | ||
46 | } | ||
47 | |||
48 | static int h5_enqueue(struct hci_uart *hu, struct sk_buff *skb) | ||
49 | { | ||
50 | return -ENOSYS; | ||
51 | } | ||
52 | |||
53 | static struct sk_buff *h5_dequeue(struct hci_uart *hu) | ||
54 | { | ||
55 | return NULL; | ||
56 | } | ||
57 | |||
58 | static int h5_flush(struct hci_uart *hu) | ||
59 | { | ||
60 | return -ENOSYS; | ||
61 | } | ||
62 | |||
63 | static struct hci_uart_proto h5p = { | ||
64 | .id = HCI_UART_3WIRE, | ||
65 | .open = h5_open, | ||
66 | .close = h5_close, | ||
67 | .recv = h5_recv, | ||
68 | .enqueue = h5_enqueue, | ||
69 | .dequeue = h5_dequeue, | ||
70 | .flush = h5_flush, | ||
71 | }; | ||
72 | |||
73 | int __init h5_init(void) | ||
74 | { | ||
75 | int err = hci_uart_register_proto(&h5p); | ||
76 | |||
77 | if (!err) | ||
78 | BT_INFO("HCI Three-wire UART (H5) protocol initialized"); | ||
79 | else | ||
80 | BT_ERR("HCI Three-wire UART (H5) protocol init failed"); | ||
81 | |||
82 | return err; | ||
83 | } | ||
84 | |||
85 | int __exit h5_deinit(void) | ||
86 | { | ||
87 | return hci_uart_unregister_proto(&h5p); | ||
88 | } | ||