blob: 65e41c1d760f062776da35a30d7cf36498f21403 [file] [log] [blame]
Thomas Gleixner1a59d1b82019-05-27 08:55:05 +02001// SPDX-License-Identifier: GPL-2.0-or-later
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
Marcel Holtmann4aa769b2005-08-09 20:27:37 -07004 * Bluetooth virtual HCI driver
5 *
Marcel Holtmann9c724352006-07-06 15:45:23 +02006 * Copyright (C) 2000-2001 Qualcomm Incorporated
7 * Copyright (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.com>
8 * Copyright (C) 2004-2006 Marcel Holtmann <marcel@holtmann.org>
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070010
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#include <linux/module.h>
Marcel Holtmann23424c02013-09-02 10:41:39 -070012#include <asm/unaligned.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
Linus Torvalds1da177e2005-04-16 15:20:36 -070014#include <linux/kernel.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#include <linux/init.h>
Marcel Holtmann4aa769b2005-08-09 20:27:37 -070016#include <linux/slab.h>
17#include <linux/types.h>
18#include <linux/errno.h>
19#include <linux/sched.h>
20#include <linux/poll.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
22#include <linux/skbuff.h>
23#include <linux/miscdevice.h>
24
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#include <net/bluetooth/bluetooth.h>
26#include <net/bluetooth/hci_core.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
Marcel Holtmann82a30cf2014-07-03 01:35:10 +020028#define VERSION "1.5"
Marcel Holtmann4aa769b2005-08-09 20:27:37 -070029
Andrei Emeltchenko36acbb12011-11-14 12:42:48 +020030static bool amp;
31
Marcel Holtmann4aa769b2005-08-09 20:27:37 -070032struct vhci_data {
33 struct hci_dev *hdev;
34
Marcel Holtmann4aa769b2005-08-09 20:27:37 -070035 wait_queue_head_t read_wait;
36 struct sk_buff_head readq;
Marcel Holtmann23424c02013-09-02 10:41:39 -070037
Takashi Iwaic7c999c2016-04-14 17:32:19 +020038 struct mutex open_mutex;
Marcel Holtmann23424c02013-09-02 10:41:39 -070039 struct delayed_work open_timeout;
Marcel Holtmann4aa769b2005-08-09 20:27:37 -070040};
41
Marcel Holtmann4aa769b2005-08-09 20:27:37 -070042static int vhci_open_dev(struct hci_dev *hdev)
Linus Torvalds1da177e2005-04-16 15:20:36 -070043{
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 return 0;
45}
46
Marcel Holtmann4aa769b2005-08-09 20:27:37 -070047static int vhci_close_dev(struct hci_dev *hdev)
Linus Torvalds1da177e2005-04-16 15:20:36 -070048{
David Herrmann155961e2012-02-09 21:58:32 +010049 struct vhci_data *data = hci_get_drvdata(hdev);
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
Marcel Holtmann9c724352006-07-06 15:45:23 +020051 skb_queue_purge(&data->readq);
Marcel Holtmann4aa769b2005-08-09 20:27:37 -070052
Linus Torvalds1da177e2005-04-16 15:20:36 -070053 return 0;
54}
55
Marcel Holtmann4aa769b2005-08-09 20:27:37 -070056static int vhci_flush(struct hci_dev *hdev)
Linus Torvalds1da177e2005-04-16 15:20:36 -070057{
David Herrmann155961e2012-02-09 21:58:32 +010058 struct vhci_data *data = hci_get_drvdata(hdev);
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
Marcel Holtmann9c724352006-07-06 15:45:23 +020060 skb_queue_purge(&data->readq);
Linus Torvalds1da177e2005-04-16 15:20:36 -070061
Marcel Holtmann4aa769b2005-08-09 20:27:37 -070062 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070063}
64
Marcel Holtmann7bd8f092013-10-11 06:19:18 -070065static int vhci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
Linus Torvalds1da177e2005-04-16 15:20:36 -070066{
Marcel Holtmann60298772013-10-11 07:01:04 -070067 struct vhci_data *data = hci_get_drvdata(hdev);
Linus Torvalds1da177e2005-04-16 15:20:36 -070068
Marcel Holtmann618e8bc2015-11-05 07:33:56 +010069 memcpy(skb_push(skb, 1), &hci_skb_pkt_type(skb), 1);
Marcel Holtmann9c724352006-07-06 15:45:23 +020070 skb_queue_tail(&data->readq, skb);
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
Marcel Holtmann9c724352006-07-06 15:45:23 +020072 wake_up_interruptible(&data->read_wait);
Marcel Holtmann23424c02013-09-02 10:41:39 -070073 return 0;
74}
Linus Torvalds1da177e2005-04-16 15:20:36 -070075
Takashi Iwaic7c999c2016-04-14 17:32:19 +020076static int __vhci_create_device(struct vhci_data *data, __u8 opcode)
Marcel Holtmann23424c02013-09-02 10:41:39 -070077{
78 struct hci_dev *hdev;
79 struct sk_buff *skb;
Marcel Holtmann82a30cf2014-07-03 01:35:10 +020080 __u8 dev_type;
81
Takashi Iwaic7c999c2016-04-14 17:32:19 +020082 if (data->hdev)
83 return -EBADFD;
84
Marcel Holtmannca8bee52016-07-05 14:30:14 +020085 /* bits 0-1 are dev_type (Primary or AMP) */
Marcel Holtmann82a30cf2014-07-03 01:35:10 +020086 dev_type = opcode & 0x03;
87
Marcel Holtmannca8bee52016-07-05 14:30:14 +020088 if (dev_type != HCI_PRIMARY && dev_type != HCI_AMP)
Marcel Holtmann82a30cf2014-07-03 01:35:10 +020089 return -EINVAL;
90
Marcel Holtmann0ad184e2014-07-04 17:23:35 +020091 /* bits 2-5 are reserved (must be zero) */
92 if (opcode & 0x3c)
Marcel Holtmann82a30cf2014-07-03 01:35:10 +020093 return -EINVAL;
Marcel Holtmann23424c02013-09-02 10:41:39 -070094
95 skb = bt_skb_alloc(4, GFP_KERNEL);
96 if (!skb)
97 return -ENOMEM;
98
99 hdev = hci_alloc_dev();
100 if (!hdev) {
101 kfree_skb(skb);
102 return -ENOMEM;
103 }
104
105 data->hdev = hdev;
106
107 hdev->bus = HCI_VIRTUAL;
108 hdev->dev_type = dev_type;
109 hci_set_drvdata(hdev, data);
110
111 hdev->open = vhci_open_dev;
112 hdev->close = vhci_close_dev;
113 hdev->flush = vhci_flush;
114 hdev->send = vhci_send_frame;
115
Marcel Holtmann0ad184e2014-07-04 17:23:35 +0200116 /* bit 6 is for external configuration */
117 if (opcode & 0x40)
118 set_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks);
119
Marcel Holtmann82a30cf2014-07-03 01:35:10 +0200120 /* bit 7 is for raw device */
121 if (opcode & 0x80)
122 set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);
123
Marcel Holtmann23424c02013-09-02 10:41:39 -0700124 if (hci_register_dev(hdev) < 0) {
125 BT_ERR("Can't register HCI device");
126 hci_free_dev(hdev);
127 data->hdev = NULL;
128 kfree_skb(skb);
129 return -EBUSY;
130 }
131
Marcel Holtmann618e8bc2015-11-05 07:33:56 +0100132 hci_skb_pkt_type(skb) = HCI_VENDOR_PKT;
Marcel Holtmann23424c02013-09-02 10:41:39 -0700133
Johannes Berg634fef62017-06-16 14:29:24 +0200134 skb_put_u8(skb, 0xff);
135 skb_put_u8(skb, opcode);
Marcel Holtmann23424c02013-09-02 10:41:39 -0700136 put_unaligned_le16(hdev->id, skb_put(skb, 2));
137 skb_queue_tail(&data->readq, skb);
138
139 wake_up_interruptible(&data->read_wait);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140 return 0;
141}
142
Takashi Iwaic7c999c2016-04-14 17:32:19 +0200143static int vhci_create_device(struct vhci_data *data, __u8 opcode)
144{
145 int err;
146
147 mutex_lock(&data->open_mutex);
148 err = __vhci_create_device(data, opcode);
149 mutex_unlock(&data->open_mutex);
150
151 return err;
152}
153
Marcel Holtmann9c724352006-07-06 15:45:23 +0200154static inline ssize_t vhci_get_user(struct vhci_data *data,
Al Viro512b2262014-08-23 11:28:14 -0400155 struct iov_iter *from)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700156{
Al Viro512b2262014-08-23 11:28:14 -0400157 size_t len = iov_iter_count(from);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700158 struct sk_buff *skb;
Marcel Holtmann82a30cf2014-07-03 01:35:10 +0200159 __u8 pkt_type, opcode;
Marcel Holtmann23424c02013-09-02 10:41:39 -0700160 int ret;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161
Marcel Holtmann5bc00b52013-12-28 21:57:14 -0800162 if (len < 2 || len > HCI_MAX_FRAME_SIZE)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163 return -EINVAL;
164
Marcel Holtmann5bc00b52013-12-28 21:57:14 -0800165 skb = bt_skb_alloc(len, GFP_KERNEL);
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700166 if (!skb)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167 return -ENOMEM;
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700168
Al Virocbbd26b2016-11-01 22:09:04 -0400169 if (!copy_from_iter_full(skb_put(skb, len), len, from)) {
Al Viro512b2262014-08-23 11:28:14 -0400170 kfree_skb(skb);
171 return -EFAULT;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700172 }
173
Marcel Holtmann23424c02013-09-02 10:41:39 -0700174 pkt_type = *((__u8 *) skb->data);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175 skb_pull(skb, 1);
176
Marcel Holtmann23424c02013-09-02 10:41:39 -0700177 switch (pkt_type) {
178 case HCI_EVENT_PKT:
179 case HCI_ACLDATA_PKT:
180 case HCI_SCODATA_PKT:
181 if (!data->hdev) {
182 kfree_skb(skb);
183 return -ENODEV;
184 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700185
Marcel Holtmann618e8bc2015-11-05 07:33:56 +0100186 hci_skb_pkt_type(skb) = pkt_type;
Marcel Holtmann23424c02013-09-02 10:41:39 -0700187
Marcel Holtmanne1a26172013-10-10 16:52:43 -0700188 ret = hci_recv_frame(data->hdev, skb);
Marcel Holtmann23424c02013-09-02 10:41:39 -0700189 break;
190
191 case HCI_VENDOR_PKT:
Jiri Slaby373a32c2016-03-19 11:05:18 +0100192 cancel_delayed_work_sync(&data->open_timeout);
193
Marcel Holtmann82a30cf2014-07-03 01:35:10 +0200194 opcode = *((__u8 *) skb->data);
Marcel Holtmann23424c02013-09-02 10:41:39 -0700195 skb_pull(skb, 1);
196
197 if (skb->len > 0) {
198 kfree_skb(skb);
199 return -EINVAL;
200 }
201
202 kfree_skb(skb);
203
Marcel Holtmann82a30cf2014-07-03 01:35:10 +0200204 ret = vhci_create_device(data, opcode);
Marcel Holtmann23424c02013-09-02 10:41:39 -0700205 break;
206
207 default:
208 kfree_skb(skb);
209 return -EINVAL;
210 }
211
Marcel Holtmann5bc00b52013-12-28 21:57:14 -0800212 return (ret < 0) ? ret : len;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700213}
214
Marcel Holtmann9c724352006-07-06 15:45:23 +0200215static inline ssize_t vhci_put_user(struct vhci_data *data,
Marcel Holtmann23424c02013-09-02 10:41:39 -0700216 struct sk_buff *skb,
217 char __user *buf, int count)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700219 char __user *ptr = buf;
Marcel Holtmann23424c02013-09-02 10:41:39 -0700220 int len;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700221
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700222 len = min_t(unsigned int, skb->len, count);
223
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224 if (copy_to_user(ptr, skb->data, len))
225 return -EFAULT;
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700226
Marcel Holtmann23424c02013-09-02 10:41:39 -0700227 if (!data->hdev)
228 return len;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700229
Marcel Holtmann9c724352006-07-06 15:45:23 +0200230 data->hdev->stat.byte_tx += len;
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700231
Marcel Holtmann618e8bc2015-11-05 07:33:56 +0100232 switch (hci_skb_pkt_type(skb)) {
Marcel Holtmann0d48d932005-08-09 20:30:28 -0700233 case HCI_COMMAND_PKT:
Marcel Holtmann9c724352006-07-06 15:45:23 +0200234 data->hdev->stat.cmd_tx++;
Marcel Holtmann0d48d932005-08-09 20:30:28 -0700235 break;
Marcel Holtmann0d48d932005-08-09 20:30:28 -0700236 case HCI_ACLDATA_PKT:
Marcel Holtmann9c724352006-07-06 15:45:23 +0200237 data->hdev->stat.acl_tx++;
Marcel Holtmann0d48d932005-08-09 20:30:28 -0700238 break;
Marcel Holtmann0d48d932005-08-09 20:30:28 -0700239 case HCI_SCODATA_PKT:
Gustavo F. Padovan4f7ac182010-05-01 16:15:34 -0300240 data->hdev->stat.sco_tx++;
Marcel Holtmann0d48d932005-08-09 20:30:28 -0700241 break;
Peter Senna Tschudin2c24d452012-09-07 17:24:47 +0200242 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700243
Marcel Holtmann23424c02013-09-02 10:41:39 -0700244 return len;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700245}
246
Marcel Holtmann9c724352006-07-06 15:45:23 +0200247static ssize_t vhci_read(struct file *file,
Marcel Holtmann23424c02013-09-02 10:41:39 -0700248 char __user *buf, size_t count, loff_t *pos)
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700249{
Marcel Holtmann9c724352006-07-06 15:45:23 +0200250 struct vhci_data *data = file->private_data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251 struct sk_buff *skb;
252 ssize_t ret = 0;
253
Linus Torvalds1da177e2005-04-16 15:20:36 -0700254 while (count) {
Marcel Holtmann9c724352006-07-06 15:45:23 +0200255 skb = skb_dequeue(&data->readq);
Marcel Holtmann4db75892009-06-08 14:13:57 +0200256 if (skb) {
257 ret = vhci_put_user(data, skb, buf, count);
258 if (ret < 0)
259 skb_queue_head(&data->readq, skb);
260 else
261 kfree_skb(skb);
262 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700263 }
264
Marcel Holtmann4db75892009-06-08 14:13:57 +0200265 if (file->f_flags & O_NONBLOCK) {
266 ret = -EAGAIN;
267 break;
268 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700269
Marcel Holtmann4db75892009-06-08 14:13:57 +0200270 ret = wait_event_interruptible(data->read_wait,
Marcel Holtmann23424c02013-09-02 10:41:39 -0700271 !skb_queue_empty(&data->readq));
Marcel Holtmann4db75892009-06-08 14:13:57 +0200272 if (ret < 0)
273 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700274 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700275
276 return ret;
277}
278
Al Viro512b2262014-08-23 11:28:14 -0400279static ssize_t vhci_write(struct kiocb *iocb, struct iov_iter *from)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700280{
Marcel Holtmann5bc00b52013-12-28 21:57:14 -0800281 struct file *file = iocb->ki_filp;
Marcel Holtmann9c724352006-07-06 15:45:23 +0200282 struct vhci_data *data = file->private_data;
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700283
Al Viro512b2262014-08-23 11:28:14 -0400284 return vhci_get_user(data, from);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700285}
286
Al Viroafc9a422017-07-03 06:39:46 -0400287static __poll_t vhci_poll(struct file *file, poll_table *wait)
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700288{
Marcel Holtmann9c724352006-07-06 15:45:23 +0200289 struct vhci_data *data = file->private_data;
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700290
Marcel Holtmann9c724352006-07-06 15:45:23 +0200291 poll_wait(file, &data->read_wait, wait);
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700292
Marcel Holtmann9c724352006-07-06 15:45:23 +0200293 if (!skb_queue_empty(&data->readq))
Linus Torvaldsa9a08842018-02-11 14:34:03 -0800294 return EPOLLIN | EPOLLRDNORM;
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700295
Linus Torvaldsa9a08842018-02-11 14:34:03 -0800296 return EPOLLOUT | EPOLLWRNORM;
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700297}
298
Marcel Holtmann23424c02013-09-02 10:41:39 -0700299static void vhci_open_timeout(struct work_struct *work)
300{
301 struct vhci_data *data = container_of(work, struct vhci_data,
302 open_timeout.work);
303
Marcel Holtmannca8bee52016-07-05 14:30:14 +0200304 vhci_create_device(data, amp ? HCI_AMP : HCI_PRIMARY);
Marcel Holtmann23424c02013-09-02 10:41:39 -0700305}
306
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700307static int vhci_open(struct inode *inode, struct file *file)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700308{
Marcel Holtmann9c724352006-07-06 15:45:23 +0200309 struct vhci_data *data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700310
Marcel Holtmann9c724352006-07-06 15:45:23 +0200311 data = kzalloc(sizeof(struct vhci_data), GFP_KERNEL);
312 if (!data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313 return -ENOMEM;
314
Marcel Holtmann9c724352006-07-06 15:45:23 +0200315 skb_queue_head_init(&data->readq);
316 init_waitqueue_head(&data->read_wait);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317
Takashi Iwaic7c999c2016-04-14 17:32:19 +0200318 mutex_init(&data->open_mutex);
Marcel Holtmann23424c02013-09-02 10:41:39 -0700319 INIT_DELAYED_WORK(&data->open_timeout, vhci_open_timeout);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700320
Marcel Holtmann9c724352006-07-06 15:45:23 +0200321 file->private_data = data;
David Herrmann0dea0142012-03-28 11:48:42 +0200322 nonseekable_open(inode, file);
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700323
Marcel Holtmann23424c02013-09-02 10:41:39 -0700324 schedule_delayed_work(&data->open_timeout, msecs_to_jiffies(1000));
325
David Herrmann0dea0142012-03-28 11:48:42 +0200326 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700327}
328
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700329static int vhci_release(struct inode *inode, struct file *file)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700330{
Marcel Holtmann9c724352006-07-06 15:45:23 +0200331 struct vhci_data *data = file->private_data;
Jiri Slaby373a32c2016-03-19 11:05:18 +0100332 struct hci_dev *hdev;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700333
Marcel Holtmann23424c02013-09-02 10:41:39 -0700334 cancel_delayed_work_sync(&data->open_timeout);
335
Jiri Slaby373a32c2016-03-19 11:05:18 +0100336 hdev = data->hdev;
337
Marcel Holtmann23424c02013-09-02 10:41:39 -0700338 if (hdev) {
339 hci_unregister_dev(hdev);
340 hci_free_dev(hdev);
341 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700342
Jiri Slaby13407372016-03-19 11:49:43 +0100343 skb_queue_purge(&data->readq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700344 file->private_data = NULL;
David Herrmannbf18c712012-01-07 15:47:14 +0100345 kfree(data);
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700346
Linus Torvalds1da177e2005-04-16 15:20:36 -0700347 return 0;
348}
349
Arjan van de Ven2b8693c2007-02-12 00:55:32 -0800350static const struct file_operations vhci_fops = {
Marcel Holtmannfed4c252009-12-03 18:07:28 +0100351 .owner = THIS_MODULE,
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700352 .read = vhci_read,
Al Viro512b2262014-08-23 11:28:14 -0400353 .write_iter = vhci_write,
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700354 .poll = vhci_poll,
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700355 .open = vhci_open,
356 .release = vhci_release,
Arnd Bergmann6038f372010-08-15 18:52:59 +0200357 .llseek = no_llseek,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700358};
359
Prasanna Karthik4eeab592015-06-02 10:50:15 +0000360static struct miscdevice vhci_miscdev = {
Marcel Holtmannac284942009-06-07 18:09:57 +0200361 .name = "vhci",
362 .fops = &vhci_fops,
Lucas De Marchib075dd42014-02-18 02:19:26 -0300363 .minor = VHCI_MINOR,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700364};
PrasannaKumar Muralidharand6a38c02016-08-25 22:30:50 +0530365module_misc_device(vhci_miscdev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700366
Andrei Emeltchenko36acbb12011-11-14 12:42:48 +0200367module_param(amp, bool, 0644);
368MODULE_PARM_DESC(amp, "Create AMP controller device");
369
Marcel Holtmann63fbd242008-08-18 13:23:53 +0200370MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
Marcel Holtmann4aa769b2005-08-09 20:27:37 -0700371MODULE_DESCRIPTION("Bluetooth virtual HCI driver ver " VERSION);
372MODULE_VERSION(VERSION);
373MODULE_LICENSE("GPL");
Marcel Holtmannbfacbb92013-08-26 22:02:38 -0700374MODULE_ALIAS("devname:vhci");
Lucas De Marchib075dd42014-02-18 02:19:26 -0300375MODULE_ALIAS_MISCDEV(VHCI_MINOR);