Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 343115
b: refs/heads/master
c: 4529eef
h: refs/heads/master
i:
  343113: c63bd2c
  343111: 6915d46
v: v3
  • Loading branch information
Lamarque V. Souza authored and Jiri Kosina committed Dec 7, 2012
1 parent 4974032 commit 8d1ae93
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ae751fa82dd8e5a79932d6b55742e7e298afd733
refs/heads/master: 4529eefad087f97b33c0f31984d924b1f15d7bae
11 changes: 8 additions & 3 deletions trunk/drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2145,8 +2145,13 @@ static const struct hid_device_id hid_mouse_ignore_list[] = {
{ }
};

static bool hid_ignore(struct hid_device *hdev)
bool hid_ignore(struct hid_device *hdev)
{
if (hdev->quirks & HID_QUIRK_NO_IGNORE)
return false;
if (hdev->quirks & HID_QUIRK_IGNORE)
return true;

switch (hdev->vendor) {
case USB_VENDOR_ID_CODEMERCS:
/* ignore all Code Mercenaries IOWarrior devices */
Expand Down Expand Up @@ -2201,6 +2206,7 @@ static bool hid_ignore(struct hid_device *hdev)

return !!hid_match_id(hdev, hid_ignore_list);
}
EXPORT_SYMBOL_GPL(hid_ignore);

int hid_add_device(struct hid_device *hdev)
{
Expand All @@ -2212,8 +2218,7 @@ int hid_add_device(struct hid_device *hdev)

/* we need to kill them here, otherwise they will stay allocated to
* wait for coming driver */
if (!(hdev->quirks & HID_QUIRK_NO_IGNORE)
&& (hid_ignore(hdev) || (hdev->quirks & HID_QUIRK_IGNORE)))
if (hid_ignore(hdev))
return -ENODEV;

/*
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ struct hid_ll_driver {

extern int hid_debug;

extern bool hid_ignore(struct hid_device *);
extern int hid_add_device(struct hid_device *);
extern void hid_destroy_device(struct hid_device *);

Expand Down
9 changes: 8 additions & 1 deletion trunk/net/bluetooth/hidp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,13 @@ static int hidp_setup_hid(struct hidp_session *session,
hid->hid_get_raw_report = hidp_get_raw_report;
hid->hid_output_raw_report = hidp_output_raw_report;

/* True if device is blacklisted in drivers/hid/hid-core.c */
if (hid_ignore(hid)) {
hid_destroy_device(session->hid);
session->hid = NULL;
return -ENODEV;
}

return 0;

fault:
Expand Down Expand Up @@ -1013,7 +1020,7 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock,

if (req->rd_size > 0) {
err = hidp_setup_hid(session, req);
if (err)
if (err && err != -ENODEV)
goto purge;
}

Expand Down

0 comments on commit 8d1ae93

Please sign in to comment.