Marcel, Patch for adding nlbluetooth.c for netlink support . let me know if anything needs modification. Thanks, Alok.
From bb509e62c9209af1e2b2a86272155afa6453262e Mon Sep 17 00:00:00 2001 From: Alok Barsode <alok.barsode@xxxxxxxxxx> Date: Mon, 27 Oct 2008 11:30:48 +0530 Subject: [PATCH] Adding net/bluetooth/nlbluetooth.c for netlink support. Signed-off-by: Alok Barsode <alok.barsode@xxxxxxxxxx> --- include/net/bluetooth/bluetooth.h | 3 +++ net/bluetooth/Makefile | 2 +- net/bluetooth/af_bluetooth.c | 6 ++++++ net/bluetooth/nlbluetooth.c | 24 ++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletions(-) create mode 100644 net/bluetooth/nlbluetooth.c diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 6f8418b..b02c7aa 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h @@ -178,4 +178,7 @@ extern void bt_sysfs_cleanup(void); extern struct class *bt_class; +extern int nlbluetooth_init(void); +extern void nlbluetooth_cleanup(void); + #endif /* __BLUETOOTH_H */ diff --git a/net/bluetooth/Makefile b/net/bluetooth/Makefile index d1e433f..c48f176 100644 --- a/net/bluetooth/Makefile +++ b/net/bluetooth/Makefile @@ -10,4 +10,4 @@ obj-$(CONFIG_BT_BNEP) += bnep/ obj-$(CONFIG_BT_CMTP) += cmtp/ obj-$(CONFIG_BT_HIDP) += hidp/ -bluetooth-objs := af_bluetooth.o hci_core.o hci_conn.o hci_event.o hci_sock.o hci_sysfs.o lib.o +bluetooth-objs := af_bluetooth.o hci_core.o hci_conn.o hci_event.o hci_sock.o hci_sysfs.o lib.o nlbluetooth.o diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index 8907eff..b6487dc 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c @@ -436,6 +436,10 @@ static int __init bt_init(void) if (err < 0) return err; + err = nlbluetooth_init(); + if (err < 0) + return err; + err = sock_register(&bt_sock_family_ops); if (err < 0) { bt_sysfs_cleanup(); @@ -456,6 +460,8 @@ static void __exit bt_exit(void) sock_unregister(PF_BLUETOOTH); bt_sysfs_cleanup(); + + nlbluetooth_cleanup(); } subsys_initcall(bt_init); diff --git a/net/bluetooth/nlbluetooth.c b/net/bluetooth/nlbluetooth.c new file mode 100644 index 0000000..4606bbc --- /dev/null +++ b/net/bluetooth/nlbluetooth.c @@ -0,0 +1,24 @@ +/* + * This is the netlink-based bluetooth interface. + * + * Copyright 2008 Alok Barsode <alok.barsode@xxxxxxxxxx> + */ + +#include <net/genetlink.h> +#include <linux/module.h> +#include <linux/kernel.h> + +#include <net/bluetooth/bluetooth.h> +#include <net/bluetooth/hci_core.h> + +/* initialisation/exit functions */ + +int __init nlbluetooth_init(void) +{ + return 0; +} + +void nlbluetooth_cleanup(void) +{ + +} -- 1.5.4.3