c1f2f5b
Bugzilla: 1051748
c1f2f5b
Upstream-status: Queued for 3.15
c1f2f5b
c1f2f5b
From b075dd40c95d11c2c8690f6c4d6232fc0d9e7f56 Mon Sep 17 00:00:00 2001
c1f2f5b
From: Lucas De Marchi <lucas.demarchi@intel.com>
c1f2f5b
Date: Tue, 18 Feb 2014 05:19:26 +0000
c1f2f5b
Subject: Bluetooth: allocate static minor for vhci
c1f2f5b
c1f2f5b
Commit bfacbb9 (Bluetooth: Use devname:vhci module alias for virtual HCI
c1f2f5b
driver) added the module alias to hci_vhci module so it's possible to
c1f2f5b
create the /dev/vhci node. However creating an alias without
c1f2f5b
specifying the minor doesn't allow us to create the node ahead,
c1f2f5b
triggerring module auto-load when it's first accessed.
c1f2f5b
c1f2f5b
Starting with depmod from kmod 16 we started to warn if there's a
c1f2f5b
devname alias without specifying the major and minor.
c1f2f5b
c1f2f5b
Let's do the same done for uhid, kvm, fuse and others, specifying a
c1f2f5b
fixed minor. In systems with systemd as the init the following will
c1f2f5b
happen: on early boot systemd will call "kmod static-nodes" to read
c1f2f5b
/lib/modules/$(uname -r)/modules.devname and then create the nodes. When
c1f2f5b
first accessed these "dead" nodes will trigger the module loading.
c1f2f5b
c1f2f5b
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
c1f2f5b
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
c1f2f5b
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
c1f2f5b
---
933f9f7
diff --git a/Documentation/devices.txt b/Documentation/devices.txt
933f9f7
index 10378cc..04356f5 100644
933f9f7
--- a/Documentation/devices.txt
933f9f7
+++ b/Documentation/devices.txt
933f9f7
@@ -353,6 +353,7 @@ Your cooperation is appreciated.
933f9f7
 		133 = /dev/exttrp	External device trap
933f9f7
 		134 = /dev/apm_bios	Advanced Power Management BIOS
933f9f7
 		135 = /dev/rtc		Real Time Clock
933f9f7
+		137 = /dev/vhci		Bluetooth virtual HCI driver
933f9f7
 		139 = /dev/openprom	SPARC OpenBoot PROM
933f9f7
 		140 = /dev/relay8	Berkshire Products Octal relay card
933f9f7
 		141 = /dev/relay16	Berkshire Products ISO-16 relay card
c1f2f5b
diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
c1f2f5b
index 1ef6990..add1c6a 100644
c1f2f5b
--- a/drivers/bluetooth/hci_vhci.c
c1f2f5b
+++ b/drivers/bluetooth/hci_vhci.c
c1f2f5b
@@ -359,7 +359,7 @@ static const struct file_operations vhci_fops = {
c1f2f5b
 static struct miscdevice vhci_miscdev= {
c1f2f5b
 	.name	= "vhci",
c1f2f5b
 	.fops	= &vhci_fops,
c1f2f5b
-	.minor	= MISC_DYNAMIC_MINOR,
c1f2f5b
+	.minor	= VHCI_MINOR,
c1f2f5b
 };
c1f2f5b
 
c1f2f5b
 static int __init vhci_init(void)
c1f2f5b
@@ -385,3 +385,4 @@ MODULE_DESCRIPTION("Bluetooth virtual HCI driver ver " VERSION);
c1f2f5b
 MODULE_VERSION(VERSION);
c1f2f5b
 MODULE_LICENSE("GPL");
c1f2f5b
 MODULE_ALIAS("devname:vhci");
c1f2f5b
+MODULE_ALIAS_MISCDEV(VHCI_MINOR);
933f9f7
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
933f9f7
index 3737f72..7bb6148 100644
933f9f7
--- a/include/linux/miscdevice.h
933f9f7
+++ b/include/linux/miscdevice.h
933f9f7
@@ -23,6 +23,7 @@
933f9f7
 #define TEMP_MINOR		131	/* Temperature Sensor */
933f9f7
 #define RTC_MINOR		135
933f9f7
 #define EFI_RTC_MINOR		136	/* EFI Time services */
933f9f7
+#define VHCI_MINOR		137
933f9f7
 #define SUN_OPENPROM_MINOR	139
933f9f7
 #define DMAPI_MINOR		140	/* DMAPI */
933f9f7
 #define NVRAM_MINOR		144
c1f2f5b
--
c1f2f5b
cgit v0.9.2