public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] [PATCH] bluetooth: reset unexpected connections
@ 2007-07-02 19:04 Ranulf Doswell
  2007-07-03  3:28 ` Marcel Holtmann
  0 siblings, 1 reply; 8+ messages in thread
From: Ranulf Doswell @ 2007-07-02 19:04 UTC (permalink / raw)
  To: cbe-oss-dev, bluez-devel


[-- Attachment #1.1: Type: text/plain, Size: 1344 bytes --]

From: Ranulf Doswell <ralf@ranulf.net>

Send a reset command to any device that sends us data when there is no
active
connection to that device. This hopefully discourages the device from
sending
any more data which causes the syslog to fill up rapidly otherwise.

Signed-off-by: Ranulf Doswell <ralf@ranulf.net>

---

An example device which causes this problem is the Sony Playstation six-axis
controller which continues sending data even after the host is rebooted as
the linux kernel stack returns before the controller's stack times out.

This patch is against 2.6.22-rc5

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 8943c93..fb99b95 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1340,6 +1340,12 @@ static inline void hci_acldata_packet(struct hci_dev
*hdev, struct sk_buff *skb)
        } else {
                BT_ERR("%s ACL packet for unknown connection handle %d",
                        hdev->name, handle);
+
+               /* Force the device to reset in the hope that it will then
+                * leave us alone. In some devices, a reboot doesn't provide
+                * enough time for the device's stack to time out, so it
keeps
+                * sending data until forcibly terminated. */
+               hci_reset_req(hdev, 0);
        }

        kfree_skb(skb);

[-- Attachment #1.2: Type: text/html, Size: 2231 bytes --]

[-- Attachment #2: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-07-05  8:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-02 19:04 [Bluez-devel] [PATCH] bluetooth: reset unexpected connections Ranulf Doswell
2007-07-03  3:28 ` Marcel Holtmann
2007-07-03 18:26   ` [Cbe-oss-dev] " Geoff Levand
2007-07-03 19:38   ` Ranulf Doswell
2007-07-04  1:55     ` Marcel Holtmann
2007-07-04  7:05       ` [Cbe-oss-dev] " Ranulf Doswell
2007-07-04  9:56     ` [Bluez-devel] [Cbe-oss-dev] " Geert Uytterhoeven
2007-07-05  8:11       ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox