HID: bring back possibility to specify vid/pid ignore on module load

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, April 3, 2009 - 6:03 pm

Gitweb:     http://git.kernel.org/linus/6f4303fb2ec68055e793b84887a7ae0f9ea7cc2d
Commit:     6f4303fb2ec68055e793b84887a7ae0f9ea7cc2d
Parent:     205adbec0d5159f23b235bbcd386dd1bcb6d0180
Author:     Jiri Kosina <jkosina@suse.cz>
AuthorDate: Thu Jan 29 00:15:51 2009 +0100
Committer:  Jiri Kosina <jkosina@suse.cz>
CommitDate: Mon Mar 30 15:12:52 2009 +0200

    HID: bring back possibility to specify vid/pid ignore on module load
    
    When hid quirks were converted to specialized driver, the HID_QUIRK_IGNORE
    has been moved completely, as the hid_ignore_list[] has been moved into the
    generic code.
    
    However userspace already got used to the possibility that modprobing
    usbhid with
    
    	'quirks=vid:pid:0x4'
    
    makes the device ignored by usbhid driver. So keep this quirk flag in place
    for backwards compatibility.
    
    Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
 drivers/hid/usbhid/hid-core.c |    3 +++
 include/linux/hid.h           |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index f0a0f72..eed05a3 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -711,6 +711,9 @@ static int usbhid_parse(struct hid_device *hid)
 	quirks = usbhid_lookup_quirk(le16_to_cpu(dev->descriptor.idVendor),
 			le16_to_cpu(dev->descriptor.idProduct));
 
+	if (quirks & HID_QUIRK_IGNORE)
+		return -ENODEV;
+
 	/* Many keyboards and mice don't like to be polled for reports,
 	 * so we will always set the HID_QUIRK_NOGET flag for them. */
 	if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT) {
diff --git a/include/linux/hid.h b/include/linux/hid.h
index fa8ee9c..a46cda4 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -270,6 +270,7 @@ struct hid_item {
 
 #define HID_QUIRK_INVERT			0x00000001
 #define HID_QUIRK_NOTOUCH			0x00000002
+#define HID_QUIRK_IGNORE			0x00000004
 #define HID_QUIRK_NOGET				0x00000008
 #define HID_QUIRK_BADPAD			0x00000020
 #define HID_QUIRK_MULTI_INPUT			0x00000040
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
HID: bring back possibility to specify vid/pid ignore on m ..., Linux Kernel Mailing ..., (Fri Apr 3, 6:03 pm)