From: Milind Dumbare <milind@linsyssoft.com>
To: BlueZ development <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] Reboot notifier
Date: Wed, 02 Aug 2006 19:51:59 +0530 [thread overview]
Message-ID: <1154528519.2302.22.camel@shadowfox.linsyssoft.com> (raw)
In-Reply-To: <1154525531.3905.45.camel@aeonflux.holtmann.net>
[-- Attachment #1: Type: text/plain, Size: 1508 bytes --]
Hi Marcel,
I have attached patch for reboot notifier. Any suggestions are
appreciated.
Thanks
On Wed, 2006-08-02 at 15:32 +0200, Marcel Holtmann wrote:
> Hi Milind,
>
> > 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
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
>
--
-Milind
"There is no place like 127.0.0.1"
[-- Attachment #2: blue_reboot.patch --]
[-- Type: text/x-patch, Size: 1779 bytes --]
Singed Off: Milind Dumbare <milind@linsyssoft.com>
hci_usb.c | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
Index: linux-2.6.15-pre3/drivers/bluetooth/hci_usb.c
===================================================================
--- linux-2.6.15-pre3.orig/drivers/bluetooth/hci_usb.c 2006-08-02 08:44:42.000000000 -0500
+++ linux-2.6.15-pre3/drivers/bluetooth/hci_usb.c 2006-08-02 09:15:22.000000000 -0500
@@ -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);
[-- Attachment #3: Type: text/plain, Size: 348 bytes --]
-------------------------------------------------------------------------
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
[-- Attachment #4: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next prev parent reply other threads:[~2006-08-02 14:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-01 14:17 [Bluez-devel] Reboot notifier Milind Dumbare
2006-08-01 17:15 ` Ulisses Furquim
2006-08-02 6:11 ` Milind Dumbare
2006-08-02 10:34 ` Marcel Holtmann
2006-08-02 8:51 ` Milind Dumbare
2006-08-02 13:32 ` Marcel Holtmann
2006-08-02 12:08 ` Milind Dumbare
2006-08-02 14:21 ` Milind Dumbare [this message]
2006-08-08 10:19 ` Milind Dumbare
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1154528519.2302.22.camel@shadowfox.linsyssoft.com \
--to=milind@linsyssoft.com \
--cc=bluez-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.