18 #include <linux/hid.h>
19 #include <linux/export.h>
20 #include <linux/slab.h>
22 #include "../hid-ids.h"
28 static const struct hid_blacklist {
132 static struct hid_blacklist *usbhid_exists_dquirk(
const u16 idVendor,
136 struct hid_blacklist *bl_entry =
NULL;
146 if (bl_entry !=
NULL)
147 dbg_hid(
"Found dynamic quirk 0x%x for USB HID vendor 0x%hx prod 0x%hx\n",
148 bl_entry->quirks, bl_entry->idVendor,
149 bl_entry->idProduct);
168 static int usbhid_modify_dquirk(
const u16 idVendor,
const u16 idProduct,
175 dbg_hid(
"Cannot add a quirk with idVendor = 0\n");
181 dbg_hid(
"Could not allocate quirks_list_struct\n");
196 list_replace(&q->
node, &q_new->
node);
221 static void usbhid_remove_all_dquirks(
void)
239 u16 idVendor, idProduct;
245 m =
sscanf(quirks_param[n],
"0x%hx:0x%hx:0x%x",
246 &idVendor, &idProduct, &quirks);
249 usbhid_modify_dquirk(idVendor, idProduct, quirks) != 0) {
251 "Could not parse HID quirk module param %s\n",
270 usbhid_remove_all_dquirks();
284 static const struct hid_blacklist *usbhid_exists_squirk(
const u16 idVendor,
287 const struct hid_blacklist *bl_entry =
NULL;
290 for (; hid_blacklist[
n].idVendor; n++)
291 if (hid_blacklist[n].idVendor == idVendor &&
292 hid_blacklist[n].idProduct == idProduct)
293 bl_entry = &hid_blacklist[
n];
295 if (bl_entry !=
NULL)
296 dbg_hid(
"Found squirk 0x%x for USB HID vendor 0x%hx prod 0x%hx\n",
297 bl_entry->quirks, bl_entry->idVendor,
298 bl_entry->idProduct);
316 const struct hid_blacklist *bl_entry =
NULL;
325 bl_entry = usbhid_exists_dquirk(idVendor, idProduct);
327 bl_entry = usbhid_exists_squirk(idVendor, idProduct);
329 quirks = bl_entry->quirks;