summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/6lowpan.c
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2014-06-18 09:37:09 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 11:42:44 -0400
commit5547e48c09d51ad21948c8090a34339939651450 (patch)
tree4d534775784bf5c96778ed386e4828dffbd4b215 /net/bluetooth/6lowpan.c
parent6b8d4a6a03144c5996f98db7f8256267b0d72a3a (diff)
Bluetooth: 6LoWPAN: Create a kernel module
Instead of adding the 6LoWPAN functionality to Bluetooth module, we create a separate kernel module for it. Usage: In the slave side do this: $ modprobe bluetooth_6lowpan $ echo 62 > /sys/kernel/debug/bluetooth/6lowpan_psm $ hciconfig hci0 leadv In the master side do this: $ modprobe bluetooth_6lowpan $ echo 62 > /sys/kernel/debug/bluetooth/6lowpan_psm $ echo 'connect E0:06:E6:B7:2A:73 1' > \ /sys/kernel/debug/bluetooth/6lowpan_control The 6LoWPAN functionality can be controlled by psm value. If it is left to 0, then the module is disabled and all the 6LoWPAN connections are dropped if there were any. In the above example, the psm value is just an example and not a real value for 6LoWPAN service. The real psm value is yet to be defined in Bluetooth specification. The 6lowpan controlling interface is a temporary solution until the specifications are ready. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/6lowpan.c')
-rw-r--r--net/bluetooth/6lowpan.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index bdb01eb3bfcc..ceffe20fcbaa 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -14,6 +14,7 @@
14#include <linux/if_arp.h> 14#include <linux/if_arp.h>
15#include <linux/netdevice.h> 15#include <linux/netdevice.h>
16#include <linux/etherdevice.h> 16#include <linux/etherdevice.h>
17#include <linux/module.h>
17#include <linux/debugfs.h> 18#include <linux/debugfs.h>
18 19
19#include <net/ipv6.h> 20#include <net/ipv6.h>
@@ -1212,7 +1213,7 @@ static struct notifier_block bt_6lowpan_dev_notifier = {
1212 .notifier_call = device_event, 1213 .notifier_call = device_event,
1213}; 1214};
1214 1215
1215int bt_6lowpan_init(void) 1216static int __init bt_6lowpan_init(void)
1216{ 1217{
1217 lowpan_psm_debugfs = debugfs_create_file("6lowpan_psm", 0644, 1218 lowpan_psm_debugfs = debugfs_create_file("6lowpan_psm", 0644,
1218 bt_debugfs, NULL, 1219 bt_debugfs, NULL,
@@ -1224,7 +1225,7 @@ int bt_6lowpan_init(void)
1224 return register_netdevice_notifier(&bt_6lowpan_dev_notifier); 1225 return register_netdevice_notifier(&bt_6lowpan_dev_notifier);
1225} 1226}
1226 1227
1227void bt_6lowpan_exit(void) 1228static void __exit bt_6lowpan_exit(void)
1228{ 1229{
1229 debugfs_remove(lowpan_psm_debugfs); 1230 debugfs_remove(lowpan_psm_debugfs);
1230 debugfs_remove(lowpan_control_debugfs); 1231 debugfs_remove(lowpan_control_debugfs);
@@ -1236,3 +1237,11 @@ void bt_6lowpan_exit(void)
1236 1237
1237 unregister_netdevice_notifier(&bt_6lowpan_dev_notifier); 1238 unregister_netdevice_notifier(&bt_6lowpan_dev_notifier);
1238} 1239}
1240
1241module_init(bt_6lowpan_init);
1242module_exit(bt_6lowpan_exit);
1243
1244MODULE_AUTHOR("Jukka Rissanen <jukka.rissanen@linux.intel.com>");
1245MODULE_DESCRIPTION("Bluetooth 6LoWPAN");
1246MODULE_VERSION(VERSION);
1247MODULE_LICENSE("GPL");