[Cbe-oss-dev] [PATCH] bluetooth: reset unexpected connections

Ranulf Doswell cbe at ranulf.net
Tue Jul 3 05:04:35 EST 2007


From: Ranulf Doswell <ralf at 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 at 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);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/cbe-oss-dev/attachments/20070702/ac8bd7c3/attachment.htm>


More information about the cbe-oss-dev mailing list