The function does not take any argument, so the device ignores it,
but valgrind complains.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
And remove the spurious comments that have been introduced in
f759cbdcef ("drivers: do not declare defines that are used only once").
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This driver is really a driver for HID++ 2.0 devices, not just for devices on
the unifying receiver.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The 2.0 GetProtocolVersion request will fail on 1.0 devices but there is no
equivalent for 1.0. The doc even suggests to detect this error to determine
whether a device is a 1.0 device. Thus, make it conditional on whether we
print the error or not (log it as debug message if turned off).
This should be reconsidered when we have everything in place and can think
about refacturing.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
0x8 was a random SW number picked, add that consistently and automatically so
it doesn't look like the command names require this.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
There is no gain at declaring the PID of the mice we support in
libratbag-private.h
Make it per driver, and remove the extra declarations.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Lokks like the G500 needs a device_idx of 0x00, and the MX Master while on
Bluetooth only answers to report longs
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
The Logitech devices talk HID++, and we need a lib to handle that.
The first implemented command is the get protocol version which allows
to know if the device is using hid++ 1.0 or 2.0.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
The M705 talks HID++ 1.0 but the actual button toggle is not persistent.
So there is no real need to support this in libratbag for now.
This will allow to properly address the other devices.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Starting with kernel v3.19, the hidraw node associated to the input node
talks the the actual device, no matter which device index is given.
There is no need to really know which device has which index thus.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
There is not much available now, but the mouse should provide configurable
DPI and buttons, which is a perfect test for libratbag.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
hidraw_devinfo.product is 16-bit signed, input_id.product is 16 bit unsigned.
Move the hidraw info over to a input_id, then compare.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Note that this doesn't do anything yet, it's stubbed out everywhere except for
the button mapping bit where we already had some testing code from uLogitech.
This also adds the ID for the m570 trackball - a device I have available here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The vid/pid combo for the hidraw device is that of the receiver, not that of
the device (which we get from the event node).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>