Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a73a6370 authored by Jiri Slaby's avatar Jiri Slaby Committed by Jiri Kosina
Browse files

HID: add hid_type to general hid struct



Add type to the hid structure to distinguish to which device type
(now only mouse) we are talking to. Needed for per device type ignore
list support.

Note: this patch leaves the type as unknown for bluetooth devices,
there is not support for this in the hidp code.

Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent ac2d9899
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -972,6 +972,9 @@ static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id)
	hid->vendor = le16_to_cpu(dev->descriptor.idVendor);
	hid->vendor = le16_to_cpu(dev->descriptor.idVendor);
	hid->product = le16_to_cpu(dev->descriptor.idProduct);
	hid->product = le16_to_cpu(dev->descriptor.idProduct);
	hid->name[0] = 0;
	hid->name[0] = 0;
	if (intf->cur_altsetting->desc.bInterfaceProtocol ==
			USB_INTERFACE_PROTOCOL_MOUSE)
		hid->type = HID_TYPE_USBMOUSE;


	if (dev->manufacturer)
	if (dev->manufacturer)
		strlcpy(hid->name, dev->manufacturer, sizeof(hid->name));
		strlcpy(hid->name, dev->manufacturer, sizeof(hid->name));
+6 −0
Original line number Original line Diff line number Diff line
@@ -417,6 +417,11 @@ struct hid_input {
	struct input_dev *input;
	struct input_dev *input;
};
};


enum hid_type {
	HID_TYPE_OTHER = 0,
	HID_TYPE_USBMOUSE
};

struct hid_driver;
struct hid_driver;
struct hid_ll_driver;
struct hid_ll_driver;


@@ -431,6 +436,7 @@ struct hid_device { /* device report descriptor */
	__u32 vendor;							/* Vendor ID */
	__u32 vendor;							/* Vendor ID */
	__u32 product;							/* Product ID */
	__u32 product;							/* Product ID */
	__u32 version;							/* HID version */
	__u32 version;							/* HID version */
	enum hid_type type;						/* device type (mouse, kbd, ...) */
	unsigned country;						/* HID country */
	unsigned country;						/* HID country */
	struct hid_report_enum report_enum[HID_REPORT_TYPES];
	struct hid_report_enum report_enum[HID_REPORT_TYPES];