From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <18a15270707021204o3ffc0021pc3f0d4b0ec278c39@mail.gmail.com> Date: Mon, 2 Jul 2007 20:04:35 +0100 From: "Ranulf Doswell" To: cbe-oss-dev@ozlabs.org, bluez-devel@lists.sf.net MIME-Version: 1.0 Subject: [Bluez-devel] [PATCH] bluetooth: reset unexpected connections Reply-To: BlueZ development List-Id: BlueZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1633505838==" Sender: bluez-devel-bounces@lists.sourceforge.net Errors-To: bluez-devel-bounces@lists.sourceforge.net --===============1633505838== Content-Type: multipart/alternative; boundary="----=_Part_88086_15425107.1183403075189" ------=_Part_88086_15425107.1183403075189 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline From: Ranulf Doswell 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 --- 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); ------=_Part_88086_15425107.1183403075189 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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);

------=_Part_88086_15425107.1183403075189-- --===============1633505838== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- 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/ --===============1633505838== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel --===============1633505838==--