Skip to contentSkip to conversation

bluetooth: hidp+hidraw disconnect

PATCH In review SephirXV 2 participants 2 messages Sep 10, 2009 Bluetooth drivers

lore
Share & tools
lore

SephirXV

author
#0 lore raw

PATCH 1/3 bluetooth: hidp+hidraw disconnect

From: Christopher Olson <[email protected]>

Somewhere between 2.6.26 and 2.6.28, hidraw began connecting to HIDP devices which don't strictly define their behavior in the HID usage table, and without any patching on my part. These non-compliant devices wouldn't automatically disconnect, leaving hidraw files which did nothing.

---

bluetooth/hidp/core.c.1 2009-09-10 09:31:37.000000000 -0500 renamed from bluetooth/hidp/core.c 2009-09-10 09:32:20.000000000 -0500 +3 -0
@@ -40,6 +40,7 @@
 
 #include <linux/input.h>
 #include <linux/hid.h>
+#include <linux/hidraw.h>
 
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
@@ -736,6 +737,8 @@ static void hidp_stop(struct hid_device
 
        if (hid->claimed & HID_CLAIMED_INPUT)
                hidinput_disconnect(hid);
+       if (hid->claimed & HID_CLAIMED_HIDRAW)
+               hidraw_disconnect(hid);
        hid->claimed = 0;
 }
maintainer
#1 lore raw

Hi Christopher,

Quoted 21 lines

Somewhere between 2.6.26 and 2.6.28, hidraw began connecting to HIDP devices which don't strictly define their behavior in the HID usage table, and without any patching on my part. These non-compliant devices wouldn't automatically disconnect, leaving hidraw files which did nothing.

---

bluetooth/hidp/core.c.1 2009-09-10 09:31:37.000000000 -0500 renamed from bluetooth/hidp/core.c 2009-09-10 09:32:20.000000000 -0500 +1 -0
@@ -40,6 +40,7 @@
 
 #include <linux/input.h>
 #include <linux/hid.h>
+#include <linux/hidraw.h>
 
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>

bluetooth/hidp/core.c.1 2009-09-10 09:31:37.000000000 -0500 static void hidp_stop(struct hid_device · line 743

Quoted 7 lines
bluetooth/hidp/core.c.1 2009-09-10 09:31:37.000000000 -0500 renamed from bluetooth/hidp/core.c 2009-09-10 09:32:20.000000000 -0500 +2 -0
@@ -736,6 +737,8 @@ static void hidp_stop(struct hid_device
 
        if (hid->claimed & HID_CLAIMED_INPUT)
                hidinput_disconnect(hid);
+       if (hid->claimed & HID_CLAIMED_HIDRAW)
+               hidraw_disconnect(hid);
        hid->claimed = 0;
 }

I am pretty sure such a patch or similar is in net-next-2.6 already.

Regards

Marcel