[PATCH 1/4] HID: add hid_type - Kernel

This is a discussion on [PATCH 1/4] HID: add hid_type - Kernel ; 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 ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: [PATCH 1/4] HID: add hid_type

  1. [PATCH 1/4] HID: add hid_type

    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: Jiri Slaby
    ---
    drivers/hid/usbhid/hid-core.c | 3 +++
    include/linux/hid.h | 6 ++++++
    2 files changed, 9 insertions(+), 0 deletions(-)

    diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
    index 1d3b8a3..1dc341a 100644
    --- a/drivers/hid/usbhid/hid-core.c
    +++ b/drivers/hid/usbhid/hid-core.c
    @@ -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->product = le16_to_cpu(dev->descriptor.idProduct);
    hid->name[0] = 0;
    + if (intf->cur_altsetting->desc.bInterfaceProtocol ==
    + USB_INTERFACE_PROTOCOL_MOUSE)
    + hid->type = HID_TYPE_USBMOUSE;

    if (dev->manufacturer)
    strlcpy(hid->name, dev->manufacturer, sizeof(hid->name));
    diff --git a/include/linux/hid.h b/include/linux/hid.h
    index f13bca2..5355ca4 100644
    --- a/include/linux/hid.h
    +++ b/include/linux/hid.h
    @@ -417,6 +417,11 @@ struct hid_input {
    struct input_dev *input;
    };

    +enum hid_type {
    + HID_TYPE_OTHER = 0,
    + HID_TYPE_USBMOUSE
    +};
    +
    struct hid_driver;
    struct hid_ll_driver;

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

    --
    1.6.0.2

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: [PATCH 2/4] HID: fix appletouch regression

    On Tue, 21 Oct 2008, Jiri Slaby wrote:

    > The appletouch mouse devices are grabbed by the hid bus and not
    > released even if apple driver says ENODEV (as expected).
    > Move the ignoration one level upper to deny the hid layer to grab
    > the device and return error to the usb hid which, as a result,
    > releases the device.


    Applied, thanks.

    --
    Jiri Kosina
    SUSE Labs
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  3. Re: [PATCH 1/4] HID: add hid_type

    On Tue, 21 Oct 2008, Jiri Slaby wrote:

    > 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.


    Applied, thanks.

    --
    Jiri Kosina
    SUSE Labs
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread