History log of /haiku/src/add-ons/kernel/drivers/input/usb_hid/HIDReportItem.cpp
Revision Date Author Comments
# 26bebb13 23-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

usb_hid: Avoid read/writing past allocations with report items.

When extracting/inserting report items there might not be a full uint32
available in the report anymore. Only copy as many bytes as are actually
needed by the report item and guaranteed to be present in the report.


# 7e5b39b6 18-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Fix printf format warnings that were missed earlier (CIDs 715645-715657).


# 9028fd53 07-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Add HIDReportItem::ScaledRangeData() that scales the data into a pariticular
range.


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


# 6eabc833 05-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Add HIDReportItem::ScaledFloatData() which scales the data into a float range
from 0.0 to 1.0.


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


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

Also clear the sign extension when not changing signedness, as otherwise we'll
overwrite the values with the sign extension.


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


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

Also take the unsigned -> signed conversion into account.


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


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

Add a ScaledData() getter that scales the data to the desired bit width and
converts the signed-ness as specified.


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


# fd97180e 26-Jan-2010 Michael Lotz <mmlr@mlotz.ch>

Make the HID parser usable standalone in userland.


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


# 5ba33c51 21-May-2009 Michael Lotz <mmlr@mlotz.ch>

* Integrate reports/items some more.
* Reorganize how items are added to collections.
* Make collections useful for enumeration through that.
* Added printing out of collections, reports and report items for easier
verification of report parsing.


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


# aaeffcf7 07-May-2009 Michael Lotz <mmlr@mlotz.ch>

Adding missing license headers.


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


# e7fcf08d 07-May-2009 Michael Lotz <mmlr@mlotz.ch>

Adding a complete HID parser and report handling facility. This is generic code,
so should be reusable for bluethooth HID as well (which is the same). The only
missing part so far is the logical collections that would allow nicer
enumeration of the report structure but is otherwise not useful. It should
support all of the HID specs except for usage aliases (even long items that
aren't actually defined should just work if they ever are). Not integrated into
the USB specific device framework and there are no actual drivers making use
of provided functionallity. The parsing was tested and works for all of the 3
devices I had available, but actual interpretation of data is not tested as the
driver side is missing. Will close that gap as a next step and then port the
mouse and keyboard drivers to that framework. Eventually a generic driver that
makes unknown fields available to userland apps in some way should be fairly
easy to implement with that.


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


# 26bebb13a12d2ff89380e41ecae676a106675f67 23-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

usb_hid: Avoid read/writing past allocations with report items.

When extracting/inserting report items there might not be a full uint32
available in the report anymore. Only copy as many bytes as are actually
needed by the report item and guaranteed to be present in the report.


# 7e5b39b67273ea3a49be51d0af33369f7f1284e4 18-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Fix printf format warnings that were missed earlier (CIDs 715645-715657).


# 9028fd53bd68898ce00efb8d3186947d8a52c798 07-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Add HIDReportItem::ScaledRangeData() that scales the data into a pariticular
range.


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


# 6eabc833869d8181de827f07990068af672a8962 05-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Add HIDReportItem::ScaledFloatData() which scales the data into a float range
from 0.0 to 1.0.


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


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

Also clear the sign extension when not changing signedness, as otherwise we'll
overwrite the values with the sign extension.


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


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

Also take the unsigned -> signed conversion into account.


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


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

Add a ScaledData() getter that scales the data to the desired bit width and
converts the signed-ness as specified.


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


# fd97180e27b7d0d36876e8c04329fe11a1bd243d 26-Jan-2010 Michael Lotz <mmlr@mlotz.ch>

Make the HID parser usable standalone in userland.


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


# 5ba33c51f2ce94cddeed22b796bac9123cf296a9 21-May-2009 Michael Lotz <mmlr@mlotz.ch>

* Integrate reports/items some more.
* Reorganize how items are added to collections.
* Make collections useful for enumeration through that.
* Added printing out of collections, reports and report items for easier
verification of report parsing.


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


# aaeffcf7a6e28d2fda83bf59f370319805073449 07-May-2009 Michael Lotz <mmlr@mlotz.ch>

Adding missing license headers.


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


# e7fcf08d7661a3e0bd0684cd171d1f20a0c1f01a 07-May-2009 Michael Lotz <mmlr@mlotz.ch>

Adding a complete HID parser and report handling facility. This is generic code,
so should be reusable for bluethooth HID as well (which is the same). The only
missing part so far is the logical collections that would allow nicer
enumeration of the report structure but is otherwise not useful. It should
support all of the HID specs except for usage aliases (even long items that
aren't actually defined should just work if they ever are). Not integrated into
the USB specific device framework and there are no actual drivers making use
of provided functionallity. The parsing was tested and works for all of the 3
devices I had available, but actual interpretation of data is not tested as the
driver side is missing. Will close that gap as a next step and then port the
mouse and keyboard drivers to that framework. Eventually a generic driver that
makes unknown fields available to userland apps in some way should be fairly
easy to implement with that.


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