History log of /haiku-fatelf/src/add-ons/kernel/drivers/input/usb_hid/ProtocolHandler.cpp
Revision Date Author Comments
# f46bc7f1 30-May-2011 Michael Lotz <mmlr@mlotz.ch>

* Add a JoystickProtocolHandler to usb_hid that supports the BJoystick protocol.
This includes input scaling, so the resulting input ranges should always match
the ones of the BJoystick data (hence no calibration should be required).
* It supports joysticks, gamepads and multi-axis controllers. I've only tested
it with a Microsoft SideWinder Gamepad Pro so far, which now works as expected
with stickit.
* Fixes #7429.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41851 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


# 305aff3f 28-May-2011 Michael Lotz <mmlr@mlotz.ch>

* Changed the way how devices are enumerated and protocol handlers are added to
handle the different device classes. Handlers are now added based on the
application collections that the HID descriptor describes instead of by
enumerating the different report items inside the reports. This means that a
device is now logically treated as a mouse when it comes with an application
collection that designates it as a mouse, instead of when there is a report
that contains an X and a Y axis. This resolves the conflicts that gamepads
and joysticks were added as mice due to them containing such elements. This
therefore fixes #4499 and opens up the way to properly handle other device
types like joysticks (#7429), gamepads, tablets (#7354, #5989 and #7481) and
so on. I'll work on gamepads/joysticks next and see where we stand for tablets
later.
* Added a few enumeration functions to HIDCollection to support the above.
* Fix the root collection handling. A device doesn't describe a single root
collection and then adds everything as a child. Instead it just has multiple
collections on level 0. We account for that now by always creating an empty
logical collection as the root collection where all the collections of the
descriptor get added.
* Rename the {Mouse|Keyboard}Device.{cpp|h} to
{Mouse|Keyboard}ProtocolHandler.{cpp|h} as that more clearly describes their
purpose. These classes are protocol handlers, i.e. they handle the ioctl based
mouse and keyboard protocol between the driver and the input_server add-ons.
* Change a lot of stuff to use references instead of pointers where it makes
sense (not necessarily complete yet).

I've tested this successfully on a keyboard with extended keys, a combo device
with a keyboard with extended keys and a mouse, a mouse and a gamepad (that now
doesn't do anything anymore) and found no regressions. However, since there are
a lot of very varied ways how to describe such functions with HID, it's not too
unlikely that some more curiously described devices will now stop working. These
have to be handled case by case and their usages have to be added to the added
to the appropriate handlers (or new handlers have to be written). Please test
and create bug reports (preferrably including the report descriptor that is
written out to /tmp).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41794 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


# 18074c28 09-Mar-2010 Michael Lotz <mmlr@mlotz.ch>

Reworked the handler adding to be based on input reports. This way multiple
handlers may be added to a single device if it provides more than one report
for a kind of device. Should fix #5549 where two mouse reports are present
and only the first one was picked up and made available as device.


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


# e65227c2 22-Sep-2009 Michael Lotz <mmlr@mlotz.ch>

* Error out on the num events ioctl in case the device was removed, otherwise
the original BeOS input_server will fail to detect the error and never close
the device.
* Remove the empty kernel_cpp header and use the one from kernel util instead.
* Add some missing headers for completeness.


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


# 3b1e4fd5 29-Jul-2009 Michael Lotz <mmlr@mlotz.ch>

Fix pointer access. Thanks to Blub for spotting, I would've certainly spent a
lot of time finding this one!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31940 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


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

* Add a JoystickProtocolHandler to usb_hid that supports the BJoystick protocol.
This includes input scaling, so the resulting input ranges should always match
the ones of the BJoystick data (hence no calibration should be required).
* It supports joysticks, gamepads and multi-axis controllers. I've only tested
it with a Microsoft SideWinder Gamepad Pro so far, which now works as expected
with stickit.
* Fixes #7429.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41851 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


# 305aff3f787ca5d2e0e5ef44fe3487ca3fb7adae 28-May-2011 Michael Lotz <mmlr@mlotz.ch>

* Changed the way how devices are enumerated and protocol handlers are added to
handle the different device classes. Handlers are now added based on the
application collections that the HID descriptor describes instead of by
enumerating the different report items inside the reports. This means that a
device is now logically treated as a mouse when it comes with an application
collection that designates it as a mouse, instead of when there is a report
that contains an X and a Y axis. This resolves the conflicts that gamepads
and joysticks were added as mice due to them containing such elements. This
therefore fixes #4499 and opens up the way to properly handle other device
types like joysticks (#7429), gamepads, tablets (#7354, #5989 and #7481) and
so on. I'll work on gamepads/joysticks next and see where we stand for tablets
later.
* Added a few enumeration functions to HIDCollection to support the above.
* Fix the root collection handling. A device doesn't describe a single root
collection and then adds everything as a child. Instead it just has multiple
collections on level 0. We account for that now by always creating an empty
logical collection as the root collection where all the collections of the
descriptor get added.
* Rename the {Mouse|Keyboard}Device.{cpp|h} to
{Mouse|Keyboard}ProtocolHandler.{cpp|h} as that more clearly describes their
purpose. These classes are protocol handlers, i.e. they handle the ioctl based
mouse and keyboard protocol between the driver and the input_server add-ons.
* Change a lot of stuff to use references instead of pointers where it makes
sense (not necessarily complete yet).

I've tested this successfully on a keyboard with extended keys, a combo device
with a keyboard with extended keys and a mouse, a mouse and a gamepad (that now
doesn't do anything anymore) and found no regressions. However, since there are
a lot of very varied ways how to describe such functions with HID, it's not too
unlikely that some more curiously described devices will now stop working. These
have to be handled case by case and their usages have to be added to the added
to the appropriate handlers (or new handlers have to be written). Please test
and create bug reports (preferrably including the report descriptor that is
written out to /tmp).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41794 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


# 18074c28fa91f22f504aaf9ab5a18a7d499f3d1f 09-Mar-2010 Michael Lotz <mmlr@mlotz.ch>

Reworked the handler adding to be based on input reports. This way multiple
handlers may be added to a single device if it provides more than one report
for a kind of device. Should fix #5549 where two mouse reports are present
and only the first one was picked up and made available as device.


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


# e65227c272a91f62ab385a51af0e0bc13e53e725 22-Sep-2009 Michael Lotz <mmlr@mlotz.ch>

* Error out on the num events ioctl in case the device was removed, otherwise
the original BeOS input_server will fail to detect the error and never close
the device.
* Remove the empty kernel_cpp header and use the one from kernel util instead.
* Add some missing headers for completeness.


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


# 3b1e4fd549f7242d657b10f2810d32555f67835c 29-Jul-2009 Michael Lotz <mmlr@mlotz.ch>

Fix pointer access. Thanks to Blub for spotting, I would've certainly spent a
lot of time finding this one!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31940 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