Linux bluetooth development
 help / color / mirror / Atom feed
* [RFC 1/2] Bluetooth: Allow to change type for virtual HCI
@ 2011-11-11 14:14 Emeltchenko Andrei
  2011-11-11 14:14 ` [RFC 2/2] Bluetooth: Do not set HCI_RAW when HS enabled Emeltchenko Andrei
  2011-11-11 14:28 ` [RFC 1/2] Bluetooth: Allow to change type for virtual HCI Marcel Holtmann
  0 siblings, 2 replies; 5+ messages in thread
From: Emeltchenko Andrei @ 2011-11-11 14:14 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Type can be changed during module loading.
---
 drivers/bluetooth/hci_vhci.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 2e302a1..4c4aec3 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -41,6 +41,8 @@
 
 #define VERSION "1.3"
 
+static ushort type;
+
 struct vhci_data {
 	struct hci_dev *hdev;
 
@@ -239,6 +241,11 @@ static int vhci_open(struct inode *inode, struct file *file)
 	hdev->bus = HCI_VIRTUAL;
 	hdev->driver_data = data;
 
+	if (type > HCI_AMP)
+		type = HCI_BREDR;
+
+	hdev->dev_type = type;
+
 	hdev->open     = vhci_open_dev;
 	hdev->close    = vhci_close_dev;
 	hdev->flush    = vhci_flush;
@@ -303,6 +310,9 @@ static void __exit vhci_exit(void)
 module_init(vhci_init);
 module_exit(vhci_exit);
 
+module_param(type, ushort, 0444);
+MODULE_PARM_DESC(type, "HCI device type");
+
 MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
 MODULE_DESCRIPTION("Bluetooth virtual HCI driver ver " VERSION);
 MODULE_VERSION(VERSION);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-11-11 14:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-11 14:14 [RFC 1/2] Bluetooth: Allow to change type for virtual HCI Emeltchenko Andrei
2011-11-11 14:14 ` [RFC 2/2] Bluetooth: Do not set HCI_RAW when HS enabled Emeltchenko Andrei
2011-11-11 14:29   ` Marcel Holtmann
2011-11-11 14:43     ` Emeltchenko Andrei
2011-11-11 14:28 ` [RFC 1/2] Bluetooth: Allow to change type for virtual HCI Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox