Skip to contentSkip to conversation

Reboot notifier

Bluez-devel Milind Dumbare 3 participants 9 messages Aug 1, 2006 – Aug 8, 2006 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi all,
I think bluetooth stack for linux needs reboot notifier. I am thinking
of writing it. Shall I?

Signature · 13 lines
-Milind
"There is no place like 127.0.0.1"


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
#1 lore raw

Hi Milind,

Quoted 2 lines · Milind Dumbare

I think bluetooth stack for linux needs reboot notifier. I am thinking
of writing it. Shall I?

Sorry, but I don't know what this "reboot notifier" feature really is. Do you mind explaining it, please?

-- Ulisses

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#2 lore raw

Hi,
Reboot notifier will register bluetooth driver to reboot notification
list of kernel. Whenever machine will get rebooted bluetooth drvier will get notified by type of reboot(Halt/reboot/poweroff). We can do interesting things after we get notified that reboot will be there.

Quoted 22 lines · Ulisses Furquim

Hi Milind,

Quoted 2 lines · Milind Dumbare

I think bluetooth stack for linux needs reboot notifier. I am thinking
of writing it. Shall I?

Sorry, but I don't know what this "reboot notifier" feature really is. Do you mind explaining it, please?

-- Ulisses

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

Signature · 13 lines
-Milind
"There is no place like 127.0.0.1"


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
maintainer
#3 lore raw

Hi Milind,

Quoted 4 lines

Reboot notifier will register bluetooth driver to reboot notification
list of kernel. Whenever machine will get rebooted bluetooth drvier will get notified by type of reboot(Halt/reboot/poweroff). We can do interesting things after we get notified that reboot will be there.

you must be more specific, because I don't see any need for such a notifier. What do we get from knowing such events.

Regards

Marcel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#4 lore raw

The first most useful think is doing module cleanup while rebooting. About other things, you will know them more deeply. May be like keeping informing user level utilities to do some interesting stuff like. Keeping connection settings live post reboot or other.

Quoted 27 lines · Marcel Holtmann

Hi Milind,

Quoted 4 lines

Reboot notifier will register bluetooth driver to reboot notification
list of kernel. Whenever machine will get rebooted bluetooth drvier will get notified by type of reboot(Halt/reboot/poweroff). We can do interesting things after we get notified that reboot will be there.

you must be more specific, because I don't see any need for such a notifier. What do we get from knowing such events.

Regards

Marcel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

Signature · 13 lines
-Milind
"There is no place like 127.0.0.1"


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
maintainer
#5 lore raw

Hi Milind,

Quoted 4 lines

The first most useful think is doing module cleanup while rebooting. About other things, you will know them more deeply. May be like keeping informing user level utilities to do some interesting stuff like. Keeping connection settings live post reboot or other.

there is no need for a module cleanup. And unloading of kernel modules still has to be considered as a race condition.

Once you reset the USB bus for example all USB Bluetooth dongles will disconnect and be powered off and all connections will go away anyway. There is no real chance to keep connections over reboot.

So I don't see any need for this, but feel free to send in patches for it and convince me otherwise.

Regards

Marcel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#6 lore raw
Quoted 7 lines · Marcel Holtmann

Hi Milind,

Quoted 4 lines

The first most useful think is doing module cleanup while rebooting. About other things, you will know them more deeply. May be like keeping informing user level utilities to do some interesting stuff like. Keeping connection settings live post reboot or other.

Quoted 9 lines

there is no need for a module cleanup. And unloading of kernel modules still has to be considered as a race condition.

Once you reset the USB bus for example all USB Bluetooth dongles will disconnect and be powered off and all connections will go away anyway. There is no real chance to keep connections over reboot.
So I don't see any need for this, but feel free to send in patches for it and convince me otherwise.

I will definitly. Give me some time. :-)

Quoted 17 lines

Regards

Marcel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

Signature · 13 lines
-Milind
"There is no place like 127.0.0.1"


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
#7 lore raw
In reply to Marcel Holtmann

Hi Marcel,
I have attached patch for reboot notifier. Any suggestions are
appreciated.

Thanks

Quoted 34 lines · Marcel Holtmann

Hi Milind,

Quoted 4 lines

The first most useful think is doing module cleanup while rebooting. About other things, you will know them more deeply. May be like keeping informing user level utilities to do some interesting stuff like. Keeping connection settings live post reboot or other.

there is no need for a module cleanup. And unloading of kernel modules still has to be considered as a race condition.

Once you reset the USB bus for example all USB Bluetooth dongles will disconnect and be powered off and all connections will go away anyway. There is no real chance to keep connections over reboot.

So I don't see any need for this, but feel free to send in patches for it and convince me otherwise.

Regards

Marcel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

Signature · 2 lines
-Milind
"There is no place like 127.0.0.1"

Singed Off: Milind Dumbare <[email protected]>

 hci_usb.c |   32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)
drivers/bluetooth/hci_usb.c +31 -1
Index: linux-2.6.15-pre3/drivers/bluetooth/hci_usb.c
===================================================================
@@ -46,6 +46,9 @@
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/skbuff.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+
 
 #include <linux/usb.h>
 
@@ -133,6 +136,13 @@
 	{ }	/* Terminating entry */
 };
 
+static int hci_usb_notify_reboot(struct notifier_block *this,
+		unsigned long code ,void *x);
+
+static struct notifier_block hci_usb_reboot_notifier = {
+		.notifier_call  = hci_usb_notify_reboot,
+	};
+
 static struct _urb *_urb_alloc(int isoc, gfp_t gfp)
 {
 	struct _urb *_urb = kmalloc(sizeof(struct _urb) +
@@ -1053,10 +1063,15 @@
 
 static int __init hci_usb_init(void)
 {
-	int err;
+	int err, ret;
 
 	BT_INFO("HCI USB driver ver %s", VERSION);
 
+	ret = register_reboot_notifier(&hci_usb_reboot_notifier);
+	if(ret) 
+		BT_ERR("Could not register to reboot notifier list");
+	
+		
 	if ((err = usb_register(&hci_usb_driver)) < 0)
 		BT_ERR("Failed to register HCI USB driver");
 
@@ -1068,6 +1083,21 @@
 	usb_deregister(&hci_usb_driver);
 }
 
+static int hci_usb_notify_reboot(struct notifier_block *this,
+		unsigned long event ,void *unused)
+{
+		switch(event) {
+			/*FIXME*/
+		case SYS_RESTART:
+		case SYS_HALT:
+		case SYS_POWER_OFF:
+		default:
+			hci_usb_exit();
+		break;
+		}
+
+		return NOTIFY_DONE;
+}
 module_init(hci_usb_init);
 module_exit(hci_usb_exit);
 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#8 lore raw

Marcel,
I didn't get any reply.

Quoted 46 lines · Milind Dumbare

Hi Marcel,
I have attached patch for reboot notifier. Any suggestions are
appreciated.

Thanks

Quoted 23 lines · Marcel Holtmann

Hi Milind,

Quoted 4 lines

The first most useful think is doing module cleanup while rebooting. About other things, you will know them more deeply. May be like keeping informing user level utilities to do some interesting stuff like. Keeping connection settings live post reboot or other.

there is no need for a module cleanup. And unloading of kernel modules still has to be considered as a race condition.

Once you reset the USB bus for example all USB Bluetooth dongles will disconnect and be powered off and all connections will go away anyway. There is no real chance to keep connections over reboot.

So I don't see any need for this, but feel free to send in patches for it and convince me otherwise.

Regards

Marcel

Quoted 11 lines

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Bluez-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bluez-devel

Signature · 13 lines
-Milind
"There is no place like 127.0.0.1"


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel