History log of /haiku/src/add-ons/kernel/drivers/input/usb_hid/Driver.cpp
Revision Date Author Comments
# afe965f4 31-Oct-2022 Zelenoviy <zelenoviy@gmail.com>

usb_hid: properly device remove handling

Small fix to device remove handling, when multiple hid-devices published on multiple interfaces.

Fixes #18008.

Change-Id: I64e1a9fb6cbac503e3d55b51ee0539bb6f1908e4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5773
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# 177c832d 09-Sep-2022 Augustin Cavalier <waddlesplash@gmail.com>

Add missing NULL checks to USB drivers.

Should fix #17276, #17846.


# 1e0d4ffa 06-Apr-2020 Jérôme Duval <jerome.duval@gmail.com>

usb_hid: fix trace build, use a macro for device path suffix

no functional change

Change-Id: If8a147727214c8d40853058c033d241c284eec84
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2462
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# 04ba34b0 15-Aug-2018 Adrien Destugues <pulkomandy@pulkomandy.tk>

usb_hid: blacklist Silicon Labs EC3.

Definitely not an HID device. Programming tools use libusb.


# df4bea7d 09-Apr-2018 Jérôme Duval <jerome.duval@gmail.com>

usb_hid: add a list blacklisted devices


# 7f440923 15-Mar-2015 Ithamar R. Adema <ithamar@upgrade-android.com>

usb_hid: make sure removed devices do not get published

On many SMP systems, publish_devices() would get called before the
free() hook was triggered, resulting in removed devices still being
published.

Fix sponsered by http://www.izcorp.com


# 44672ada 04-Aug-2012 Rene Gollent <anevilyak@gmail.com>

Add usb_hid to image and get it building/working.


# 4ca60b96 06-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Move the quirky device detection out of the HIDDevice constructor and into the
usb_hid_device_added hook so that we can actually detect non-HID devices at all.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42002 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c67c6b53 06-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

* Add device class, subclass and protocol to the quirky device structure.
* Add these to the usb_support_descriptor when adding from the quirky devices.
* Extend the SIXAXIS comment a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42000 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cac918be 06-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Add devices we have explicit quirky device support for to the support
descriptor. This allows us to support devices that aren't strictly HID or only
provide vendor specific interfaces by constructing report descriptors for their
data format.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41992 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b5274bc4 30-May-2011 Michael Lotz <mmlr@mlotz.ch>

Pass read and write calls to the protocol handlers as well, moving the default
of returning B_ERROR to the ProtocolHandler base class. Not used yet, but will
be used for the BJoystick <-> JoystickProtocolHandler.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41835 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 70895141 15-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Pass the cookie to ProtocolHandler::Close() as well.
* Removed superfluous semicolons.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36280 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 48450caa 14-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Prepared driver for the implementation of the debugger mode: there is now a
uint32 cookie that is saved per file handle and passed to the ProtocolHandler
objects.
* Beware that the output of the driver no longer shows the handler as pointer,
but the internal device cookie.
* Added handling of KB_SET_DEBUG_READER to the KeyboardDevice class (it just
doesn't do anything with that).
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36274 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6522cd60 26-Jul-2009 Michael Lotz <mmlr@mlotz.ch>

Remove unused variable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31792 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8e1857f7 26-Jul-2009 Michael Lotz <mmlr@mlotz.ch>

* Completely rework the USB HID driver to make use of the HID framework
introduced earlier.
* Reworked the previous device classes to make them ProtocolHandlers handling
their respective input_server <-> driver protocol.
* Implement setting report item data and building/sending reports based on that.
* Remove the old HID parsing code.

This enables us to use all HID devices as we now parse and use the HID
descriptors/reports. Non-boot-porotocol devices should therefore work.

The next step will be to implement a generic input/output framework in userland
that can communicate with a generic protocol handler in usb_hid. This will then
enable applications to make use of all the non-mapped HID stuff directly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31790 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 11b9aad7 12-Sep-2008 Michael Lotz <mmlr@mlotz.ch>

* Use new(std::nothrow) everywhere (NULL checks were already there).
* Fix a warning if trace output is not enabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27456 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 56ff2527 03-Sep-2008 Jérôme Duval <korli@users.berlios.de>

* on freeing, only remove the device when it is removed
* check if the device is still opened when waiting for data


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27310 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a92156e1 06-Jun-2008 Michael Lotz <mmlr@mlotz.ch>

Initialize the mutex before using it.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25830 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3c72cf64 26-May-2008 Michael Lotz <mmlr@mlotz.ch>

Fix extern/static declaration of usb_hid_device_* functions. Should fix GCC4 build.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25665 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9e48bf8e 25-May-2008 Michael Lotz <mmlr@mlotz.ch>

Rewriting the usb_hid driver. It has now gotten a driver part and a device part
structured into the HIDDevice base class and KeyboardDevice and MouseDevice
subclasses. This can be extended easily to support more device types like game
controllers, joysticks and other HID devices. The parsing code remains untouched
while the interpretation code has been integrated into the device classes.
The driver should work much the same way as before including the boot protocol
only keyboard limitation. On the other hand composite devices that combine
multiple devices should now work, as long as they expose those devices as two
seperate interfaces.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25657 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7f440923c899626f39cb56c6a923ecf4b61566dd 15-Mar-2015 Ithamar R. Adema <ithamar@upgrade-android.com>

usb_hid: make sure removed devices do not get published

On many SMP systems, publish_devices() would get called before the
free() hook was triggered, resulting in removed devices still being
published.

Fix sponsered by http://www.izcorp.com


# 44672ada83568d55e0bc5bdf60ad932161e13e2c 04-Aug-2012 Rene Gollent <anevilyak@gmail.com>

Add usb_hid to image and get it building/working.


# 4ca60b965f3b0d3aa28092cc2e6529d9d49f8b2d 06-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Move the quirky device detection out of the HIDDevice constructor and into the
usb_hid_device_added hook so that we can actually detect non-HID devices at all.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42002 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c67c6b5300e2f9e34fe2f25e2d2c3dfe84bfce9d 06-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

* Add device class, subclass and protocol to the quirky device structure.
* Add these to the usb_support_descriptor when adding from the quirky devices.
* Extend the SIXAXIS comment a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42000 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cac918bed02b2067288550a657aa9ab06c0fb2ea 06-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Add devices we have explicit quirky device support for to the support
descriptor. This allows us to support devices that aren't strictly HID or only
provide vendor specific interfaces by constructing report descriptors for their
data format.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41992 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b5274bc4f678959858b745b29872b2804e7fdeea 30-May-2011 Michael Lotz <mmlr@mlotz.ch>

Pass read and write calls to the protocol handlers as well, moving the default
of returning B_ERROR to the ProtocolHandler base class. Not used yet, but will
be used for the BJoystick <-> JoystickProtocolHandler.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41835 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 708951413875b6d4180271c8c0b81438eaf044a1 15-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Pass the cookie to ProtocolHandler::Close() as well.
* Removed superfluous semicolons.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36280 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 48450caac5e0de5ada49bb185b24fd6a7f6420bf 14-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Prepared driver for the implementation of the debugger mode: there is now a
uint32 cookie that is saved per file handle and passed to the ProtocolHandler
objects.
* Beware that the output of the driver no longer shows the handler as pointer,
but the internal device cookie.
* Added handling of KB_SET_DEBUG_READER to the KeyboardDevice class (it just
doesn't do anything with that).
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36274 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6522cd609042851100e90cfb3c557d4aedd46ced 26-Jul-2009 Michael Lotz <mmlr@mlotz.ch>

Remove unused variable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31792 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8e1857f79521285ff4ecf2ab2a258191dd4aa0a8 26-Jul-2009 Michael Lotz <mmlr@mlotz.ch>

* Completely rework the USB HID driver to make use of the HID framework
introduced earlier.
* Reworked the previous device classes to make them ProtocolHandlers handling
their respective input_server <-> driver protocol.
* Implement setting report item data and building/sending reports based on that.
* Remove the old HID parsing code.

This enables us to use all HID devices as we now parse and use the HID
descriptors/reports. Non-boot-porotocol devices should therefore work.

The next step will be to implement a generic input/output framework in userland
that can communicate with a generic protocol handler in usb_hid. This will then
enable applications to make use of all the non-mapped HID stuff directly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31790 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 11b9aad7f7f16e9320ea9edc4a353a5ec6c7d588 12-Sep-2008 Michael Lotz <mmlr@mlotz.ch>

* Use new(std::nothrow) everywhere (NULL checks were already there).
* Fix a warning if trace output is not enabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27456 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 56ff2527e924161061cf884640d7b21794dd5184 03-Sep-2008 Jérôme Duval <korli@users.berlios.de>

* on freeing, only remove the device when it is removed
* check if the device is still opened when waiting for data


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27310 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a92156e1cf9fbf530ddc964a2a8fcd8b3c38bc61 06-Jun-2008 Michael Lotz <mmlr@mlotz.ch>

Initialize the mutex before using it.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25830 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3c72cf643a288543f50fcf682b35aae362fdbe69 26-May-2008 Michael Lotz <mmlr@mlotz.ch>

Fix extern/static declaration of usb_hid_device_* functions. Should fix GCC4 build.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25665 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9e48bf8e429c4939c2c80cae1b6615b9af5bdda2 25-May-2008 Michael Lotz <mmlr@mlotz.ch>

Rewriting the usb_hid driver. It has now gotten a driver part and a device part
structured into the HIDDevice base class and KeyboardDevice and MouseDevice
subclasses. This can be extended easily to support more device types like game
controllers, joysticks and other HID devices. The parsing code remains untouched
while the interpretation code has been integrated into the device classes.
The driver should work much the same way as before including the boot protocol
only keyboard limitation. On the other hand composite devices that combine
multiple devices should now work, as long as they expose those devices as two
seperate interfaces.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25657 a95241bf-73f2-0310-859d-f6bbb57e9c96