Johan Hedberg | 7dec65c | 2012-07-16 16:12:02 +0300 | [diff] [blame^] | 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 | } |