[haiku-commits] haiku: hrev49097 - in src/add-ons: kernel/drivers/input/usb_hid input_server/devices/keyboard

  • From: mmlr@xxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 23 Apr 2015 22:50:45 +0200 (CEST)

hrev49097 adds 6 changesets to branch 'master'
old head: 6653e748736ad95dd8e13f9f36cb802753741ea7
new head: c14658c763507689b8b62a9294b50cb15c6630f8
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=c14658c76350+%5E6653e748736a

----------------------------------------------------------------------------

25f723de8570: usb_hid: Let protocol handlers know of their closing.

On close a flag is set in the cookie of this user of a protocol handler
and the device cancels its pending transfer. This wakes up any possible
listeners. When the closed flag is set, an error code is returned from
_ReadReport() which causes the retry loop to be left. Handlers listening
on the same device which were not closed just retry the transfer.

This ensures that closing a device will cause pending control requests
to complete with a sensible error code.

127092c59441: usb_hid: Rename cookie flag define to be more descriptive.

0034a3c5153f: usb_hid: 80 character limit cleanup.

87c27f4f274b: usb_hid: Fix copy length of key state array.

Twice the size was copied due to a missed adjustment in hrev31839,
reading past the key state array. This didn't cause any corruption
because the overwritten state wasn't used anymore later on and the
write didn't overrun. It could cause a crash however if the read went
past the allocated area.

26bebb13a12d: 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.

c14658c76350: keyboard input device: Fix 64 bit debug build.

[ Michael Lotz <mmlr@xxxxxxxx> ]

----------------------------------------------------------------------------

14 files changed, 58 insertions(+), 31 deletions(-)
.../devices/keyboard/KeyboardInputDevice.cpp | 7 ++---
.../kernel/drivers/input/usb_hid/HIDDevice.cpp | 13 ++++++---
.../kernel/drivers/input/usb_hid/HIDReport.cpp | 4 +--
.../drivers/input/usb_hid/HIDReportItem.cpp | 7 ++---
.../kernel/drivers/input/usb_hid/HIDReportItem.h | 1 +
.../input/usb_hid/JoystickProtocolHandler.cpp | 3 +++
.../input/usb_hid/KeyboardProtocolHandler.cpp | 28 +++++++++++---------
.../input/usb_hid/KeyboardProtocolHandler.h | 2 +-
.../input/usb_hid/MouseProtocolHandler.cpp | 7 +++--
.../drivers/input/usb_hid/MouseProtocolHandler.h | 2 +-
.../drivers/input/usb_hid/ProtocolHandler.cpp | 3 +++
.../drivers/input/usb_hid/ProtocolHandler.h | 3 +++
.../input/usb_hid/TabletProtocolHandler.cpp | 7 +++--
.../input/usb_hid/TabletProtocolHandler.h | 2 +-

############################################################################

Commit: 25f723de857000d2be110e4be49cde05c2d61eb6
URL: http://cgit.haiku-os.org/haiku/commit/?id=25f723de8570
Author: Michael Lotz <mmlr@xxxxxxxx>
Date: Wed Apr 22 21:22:01 2015 UTC

usb_hid: Let protocol handlers know of their closing.

On close a flag is set in the cookie of this user of a protocol handler
and the device cancels its pending transfer. This wakes up any possible
listeners. When the closed flag is set, an error code is returned from
_ReadReport() which causes the retry loop to be left. Handlers listening
on the same device which were not closed just retry the transfer.

This ensures that closing a device will cause pending control requests
to complete with a sensible error code.

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp
b/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp
index 7ed6017..9ec2b61 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp
+++ b/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp
@@ -247,6 +247,9 @@ status_t
HIDDevice::Close(ProtocolHandler *handler)
{
atomic_add(&fOpenCount, -1);
+ gUSBModule->cancel_queued_transfers(fInterruptPipe);
+ // This will wake up any listeners. Whether they should close
or retry
+ // is handeled internally by the handlers.
return B_OK;
}

diff --git
a/src/add-ons/kernel/drivers/input/usb_hid/JoystickProtocolHandler.cpp
b/src/add-ons/kernel/drivers/input/usb_hid/JoystickProtocolHandler.cpp
index 20ab159..6900951 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/JoystickProtocolHandler.cpp
+++ b/src/add-ons/kernel/drivers/input/usb_hid/JoystickProtocolHandler.cpp
@@ -337,6 +337,9 @@ JoystickProtocolHandler::_Update()
return B_DEV_NOT_READY;
}

+ if (result == B_CANCELED)
+ return B_CANCELED;
+
if (result != B_INTERRUPTED) {
// interrupts happen when other reports come in on the
same
// input as ours
diff --git
a/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp
b/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp
index a04f896..15211d0 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp
+++ b/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp
@@ -340,7 +340,7 @@ KeyboardProtocolHandler::Control(uint32 *cookie, uint32 op,
void *buffer,

bigtime_t enterTime = system_time();
while (RingBufferReadable() == 0) {
- status_t result =
_ReadReport(fCurrentRepeatDelay);
+ status_t result =
_ReadReport(fCurrentRepeatDelay, cookie);
if (result != B_OK && result !=
B_TIMED_OUT)
return result;

@@ -459,7 +459,7 @@ KeyboardProtocolHandler::_SetLEDs(uint8 *data)


status_t
-KeyboardProtocolHandler::_ReadReport(bigtime_t timeout)
+KeyboardProtocolHandler::_ReadReport(bigtime_t timeout, uint32 *cookie)
{
status_t result = fInputReport.WaitForReport(timeout);
if (result != B_OK) {
@@ -468,6 +468,9 @@ KeyboardProtocolHandler::_ReadReport(bigtime_t timeout)
return B_ERROR;
}

+ if ((*cookie & PROTOCOL_HANDLER_COOKIE_FLAG_CLOSED) != 0)
+ return B_CANCELED;
+
if (result != B_TIMED_OUT && result != B_INTERRUPTED) {
// we expect timeouts as we do repeat key handling this
way,
// interrupts happen when other reports come in on the
same
diff --git a/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.h
b/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.h
index 16a290c..9c91161 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.h
+++ b/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.h
@@ -39,7 +39,7 @@ public:
private:
void _WriteKey(uint32 key,
bool down);
status_t _SetLEDs(uint8 *data);
- status_t _ReadReport(bigtime_t
timeout);
+ status_t _ReadReport(bigtime_t
timeout, uint32 *cookie);

private:
mutex fLock;
diff --git a/src/add-ons/kernel/drivers/input/usb_hid/MouseProtocolHandler.cpp
b/src/add-ons/kernel/drivers/input/usb_hid/MouseProtocolHandler.cpp
index 4533ec4..daf5c3e 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/MouseProtocolHandler.cpp
+++ b/src/add-ons/kernel/drivers/input/usb_hid/MouseProtocolHandler.cpp
@@ -132,7 +132,7 @@ MouseProtocolHandler::Control(uint32 *cookie, uint32 op,
void *buffer,
return B_BUFFER_OVERFLOW;

while (true) {
- status_t result = _ReadReport(buffer);
+ status_t result = _ReadReport(buffer, cookie);
if (result != B_INTERRUPTED)
return result;
}
@@ -161,7 +161,7 @@ MouseProtocolHandler::Control(uint32 *cookie, uint32 op,
void *buffer,


status_t
-MouseProtocolHandler::_ReadReport(void *buffer)
+MouseProtocolHandler::_ReadReport(void *buffer, uint32 *cookie)
{
status_t result = fReport.WaitForReport(B_INFINITE_TIMEOUT);
if (result != B_OK) {
@@ -170,6 +170,9 @@ MouseProtocolHandler::_ReadReport(void *buffer)
return B_DEV_NOT_READY;
}

+ if ((*cookie & PROTOCOL_HANDLER_COOKIE_FLAG_CLOSED) != 0)
+ return B_CANCELED;
+
if (result != B_INTERRUPTED) {
// interrupts happen when other reports come in on the
same
// input as ours
diff --git a/src/add-ons/kernel/drivers/input/usb_hid/MouseProtocolHandler.h
b/src/add-ons/kernel/drivers/input/usb_hid/MouseProtocolHandler.h
index eb9ffdd..81ab7a7 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/MouseProtocolHandler.h
+++ b/src/add-ons/kernel/drivers/input/usb_hid/MouseProtocolHandler.h
@@ -34,7 +34,7 @@ public:
size_t
length);

private:
- status_t _ReadReport(void
*buffer);
+ status_t _ReadReport(void
*buffer, uint32 *cookie);

HIDReport & fReport;

diff --git a/src/add-ons/kernel/drivers/input/usb_hid/ProtocolHandler.cpp
b/src/add-ons/kernel/drivers/input/usb_hid/ProtocolHandler.cpp
index 1d8cffb..0094fde 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/ProtocolHandler.cpp
+++ b/src/add-ons/kernel/drivers/input/usb_hid/ProtocolHandler.cpp
@@ -124,6 +124,9 @@ ProtocolHandler::Open(uint32 flags, uint32 *cookie)
status_t
ProtocolHandler::Close(uint32 *cookie)
{
+ *cookie |= PROTOCOL_HANDLER_COOKIE_FLAG_CLOSED;
+ // This lets the handlers know that this user is gone.
+
return fDevice->Close(this);
}

diff --git a/src/add-ons/kernel/drivers/input/usb_hid/ProtocolHandler.h
b/src/add-ons/kernel/drivers/input/usb_hid/ProtocolHandler.h
index 8c6968b..92a41d4 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/ProtocolHandler.h
+++ b/src/add-ons/kernel/drivers/input/usb_hid/ProtocolHandler.h
@@ -9,6 +9,9 @@
#include <SupportDefs.h>


+#define PROTOCOL_HANDLER_COOKIE_FLAG_CLOSED 0x80000000
+
+
class HIDDevice;
class HIDReport;

diff --git a/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp
b/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp
index c5507c5..18496fe 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp
+++ b/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp
@@ -189,7 +189,7 @@ TabletProtocolHandler::Control(uint32 *cookie, uint32 op,
void *buffer,
return B_BUFFER_OVERFLOW;

while (true) {
- status_t result = _ReadReport(buffer);
+ status_t result = _ReadReport(buffer, cookie);
if (result != B_INTERRUPTED)
return result;
}
@@ -218,7 +218,7 @@ TabletProtocolHandler::Control(uint32 *cookie, uint32 op,
void *buffer,


status_t
-TabletProtocolHandler::_ReadReport(void *buffer)
+TabletProtocolHandler::_ReadReport(void *buffer, uint32 *cookie)
{
status_t result = fReport.WaitForReport(B_INFINITE_TIMEOUT);
if (result != B_OK) {
@@ -227,6 +227,9 @@ TabletProtocolHandler::_ReadReport(void *buffer)
return B_DEV_NOT_READY;
}

+ if ((*cookie & PROTOCOL_HANDLER_COOKIE_FLAG_CLOSED) != 0)
+ return B_CANCELED;
+
if (result != B_INTERRUPTED) {
// interrupts happen when other reports come in on the
same
// input as ours
diff --git a/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.h
b/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.h
index 342a466..55a81bc 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.h
+++ b/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.h
@@ -36,7 +36,7 @@ public:
size_t
length);

private:
- status_t _ReadReport(void
*buffer);
+ status_t _ReadReport(void
*buffer, uint32 *cookie);

HIDReport & fReport;


############################################################################

Commit: 127092c5944164b0338889433f70d152e19a22dc
URL: http://cgit.haiku-os.org/haiku/commit/?id=127092c59441
Author: Michael Lotz <mmlr@xxxxxxxx>
Date: Thu Apr 23 20:09:26 2015 UTC

usb_hid: Rename cookie flag define to be more descriptive.

----------------------------------------------------------------------------

diff --git
a/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp
b/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp
index 15211d0..177d4d7 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp
+++ b/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp
@@ -28,8 +28,8 @@
#define RIGHT_ALT_KEY 0x40
#define ALT_KEYS (LEFT_ALT_KEY | RIGHT_ALT_KEY)

-#define KEYBOARD_FLAG_READER 0x01
-#define KEYBOARD_FLAG_DEBUGGER 0x02
+#define KEYBOARD_HANDLER_COOKIE_FLAG_READER 0x01
+#define KEYBOARD_HANDLER_COOKIE_FLAG_DEBUGGER 0x02


static bool sDebugKeyboardFound = false;
@@ -311,9 +311,9 @@ KeyboardProtocolHandler::Open(uint32 flags, uint32 *cookie)
status_t
KeyboardProtocolHandler::Close(uint32 *cookie)
{
- if ((*cookie & KEYBOARD_FLAG_DEBUGGER) != 0)
+ if ((*cookie & KEYBOARD_HANDLER_COOKIE_FLAG_DEBUGGER) != 0)
fHasDebugReader = false;
- if ((*cookie & KEYBOARD_FLAG_READER) != 0)
+ if ((*cookie & KEYBOARD_HANDLER_COOKIE_FLAG_READER) != 0)
atomic_and(&fHasReader, 0);

return ProtocolHandler::Close(cookie);
@@ -332,7 +332,7 @@ KeyboardProtocolHandler::Control(uint32 *cookie, uint32 op,
void *buffer,
return B_BUSY;

// We're the first, so we become the only reader
- *cookie = KEYBOARD_FLAG_READER;
+ *cookie = KEYBOARD_HANDLER_COOKIE_FLAG_READER;
}

while (true) {
@@ -360,7 +360,8 @@ KeyboardProtocolHandler::Control(uint32 *cookie, uint32 op,
void *buffer,
}
}

- if (fHasDebugReader && (*cookie &
KEYBOARD_FLAG_DEBUGGER)
+ if (fHasDebugReader
+ && (*cookie &
KEYBOARD_HANDLER_COOKIE_FLAG_DEBUGGER)
== 0) {
// Handover buffer to the debugger
instead
locker.Unlock();
@@ -420,7 +421,7 @@ KeyboardProtocolHandler::Control(uint32 *cookie, uint32 op,
void *buffer,
if (fHasDebugReader)
return B_BUSY;

- *cookie |= KEYBOARD_FLAG_DEBUGGER;
+ *cookie |= KEYBOARD_HANDLER_COOKIE_FLAG_DEBUGGER;
fHasDebugReader = true;
return B_OK;
}

############################################################################

Commit: 0034a3c5153f98452448894ba68a181b62b24afd
URL: http://cgit.haiku-os.org/haiku/commit/?id=0034a3c5153f
Author: Michael Lotz <mmlr@xxxxxxxx>
Date: Thu Apr 23 20:13:08 2015 UTC

usb_hid: 80 character limit cleanup.

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp
b/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp
index 9ec2b61..c444ef6 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp
+++ b/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp
@@ -277,8 +277,8 @@ HIDDevice::MaybeScheduleTransfer()
status_t result = gUSBModule->queue_interrupt(fInterruptPipe,
fTransferBuffer, fTransferBufferSize, _TransferCallback, this);
if (result != B_OK) {
- TRACE_ALWAYS("failed to schedule interrupt transfer 0x%08"
B_PRIx32 "\n",
- result);
+ TRACE_ALWAYS("failed to schedule interrupt transfer 0x%08"
B_PRIx32
+ "\n", result);
return result;
}

@@ -335,10 +335,12 @@ HIDDevice::_TransferCallback(void *cookie, status_t
status, void *data,
if (status == B_DEV_STALLED && !device->fRemoved) {
// try clearing stalls right away, the report listeners will
resubmit
gUSBModule->queue_request(device->fDevice,
- USB_REQTYPE_STANDARD | USB_REQTYPE_ENDPOINT_OUT,
USB_REQUEST_CLEAR_FEATURE,
- USB_FEATURE_ENDPOINT_HALT, device->fEndpointAddress, 0,
NULL, _UnstallCallback, device);
+ USB_REQTYPE_STANDARD | USB_REQTYPE_ENDPOINT_OUT,
+ USB_REQUEST_CLEAR_FEATURE, USB_FEATURE_ENDPOINT_HALT,
+ device->fEndpointAddress, 0, NULL, _UnstallCallback,
device);
return;
}
+
atomic_set(&device->fTransferScheduled, 0);
device->fParser.SetReport(status, device->fTransferBuffer,
actualLength);
}
diff --git a/src/add-ons/kernel/drivers/input/usb_hid/HIDReport.cpp
b/src/add-ons/kernel/drivers/input/usb_hid/HIDReport.cpp
index fe735b7..6ba25b0 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/HIDReport.cpp
+++ b/src/add-ons/kernel/drivers/input/usb_hid/HIDReport.cpp
@@ -157,8 +157,8 @@ HIDReport::SetReport(status_t status, uint8 *report, size_t
length)
fReportStatus = status;
fCurrentReport = report;
if (status == B_OK && length * 8 < fReportSize) {
- TRACE_ALWAYS("report of %lu bits too small, expected %"
B_PRIu32 " bits\n",
- length * 8, fReportSize);
+ TRACE_ALWAYS("report of %lu bits too small, expected %" B_PRIu32
+ " bits\n", length * 8, fReportSize);
fReportStatus = B_ERROR;
}

diff --git
a/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp
b/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp
index 177d4d7..a30af96 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp
+++ b/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp
@@ -350,8 +350,8 @@ KeyboardProtocolHandler::Control(uint32 *cookie, uint32 op,
void *buffer,
if (RingBufferReadable() == 0 &&
fCurrentRepeatKey != 0
&& system_time() - enterTime >
fCurrentRepeatDelay) {
// this case is for handling
key repeats, it means no
- // interrupt transfer has
happened or it didn't produce any
- // new key events, but a
repeated key down is due
+ // interrupt transfer has
happened or it didn't produce
+ // any new key events, but a
repeated key down is due
_WriteKey(fCurrentRepeatKey,
true);

// the next timeout is reduced
to the repeat_rate

############################################################################

Commit: 87c27f4f274b7bf86da2ffdc01f567bdf17a73c1
URL: http://cgit.haiku-os.org/haiku/commit/?id=87c27f4f274b
Author: Michael Lotz <mmlr@xxxxxxxx>
Date: Thu Apr 23 20:19:17 2015 UTC

usb_hid: Fix copy length of key state array.

Twice the size was copied due to a missed adjustment in hrev31839,
reading past the key state array. This didn't cause any corruption
because the overwritten state wasn't used anymore later on and the
write didn't overrun. It could cause a crash however if the read went
past the allocated area.

----------------------------------------------------------------------------

diff --git
a/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp
b/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp
index a30af96..9824a6f 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp
+++ b/src/add-ons/kernel/drivers/input/usb_hid/KeyboardProtocolHandler.cpp
@@ -771,6 +771,6 @@ KeyboardProtocolHandler::_ReadReport(bigtime_t timeout,
uint32 *cookie)
keyDown = true;
}

- memcpy(fLastKeys, fCurrentKeys, fKeyCount * sizeof(uint32));
+ memcpy(fLastKeys, fCurrentKeys, fKeyCount * sizeof(uint16));
return B_OK;
}

############################################################################

Commit: 26bebb13a12d2ff89380e41ecae676a106675f67
URL: http://cgit.haiku-os.org/haiku/commit/?id=26bebb13a12d
Author: Michael Lotz <mmlr@xxxxxxxx>
Date: Thu Apr 23 20:34:07 2015 UTC

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.

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/drivers/input/usb_hid/HIDReportItem.cpp
b/src/add-ons/kernel/drivers/input/usb_hid/HIDReportItem.cpp
index 76faca7..8bb5c51 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/HIDReportItem.cpp
+++ b/src/add-ons/kernel/drivers/input/usb_hid/HIDReportItem.cpp
@@ -22,6 +22,7 @@ HIDReportItem::HIDReportItem(HIDReport *report, uint32
bitOffset,
fShift(bitOffset % 8),
fMask(~(0xffffffff << bitLength)),
fBitCount(bitLength),
+ fByteCount((fShift + fBitCount + 7) / 8),
fHasData(hasData),
fArray(isArray),
fRelative(isRelative),
@@ -63,7 +64,7 @@ HIDReportItem::Extract()
if (report == NULL)
return B_NO_INIT;

- memcpy(&fData, report + fByteOffset, sizeof(uint32));
+ memcpy(&fData, report + fByteOffset, fByteCount);
fData >>= fShift;
fData &= fMask;

@@ -89,13 +90,13 @@ HIDReportItem::Insert()
return B_NO_INIT;

uint32 value;
- memcpy(&value, report + fByteOffset, sizeof(uint32));
+ memcpy(&value, report + fByteOffset, fByteCount);
value &= ~(fMask << fShift);

if (fValid)
value |= (fData & fMask) << fShift;

- memcpy(report + fByteOffset, &value, sizeof(uint32));
+ memcpy(report + fByteOffset, &value, fByteCount);
return B_OK;
}

diff --git a/src/add-ons/kernel/drivers/input/usb_hid/HIDReportItem.h
b/src/add-ons/kernel/drivers/input/usb_hid/HIDReportItem.h
index b9f4e1f..2ee2734 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/HIDReportItem.h
+++ b/src/add-ons/kernel/drivers/input/usb_hid/HIDReportItem.h
@@ -49,6 +49,7 @@ private:
uint8 fShift;
uint32 fMask;
uint8 fBitCount;
+ uint8 fByteCount;
bool fHasData;
bool fArray;
bool fRelative;

############################################################################

Revision: hrev49097
Commit: c14658c763507689b8b62a9294b50cb15c6630f8
URL: http://cgit.haiku-os.org/haiku/commit/?id=c14658c76350
Author: Michael Lotz <mmlr@xxxxxxxx>
Date: Thu Apr 23 20:43:06 2015 UTC

keyboard input device: Fix 64 bit debug build.

----------------------------------------------------------------------------

diff --git a/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp
b/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp
index a973c3e..c9fa64f 100644
--- a/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp
+++ b/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp
@@ -313,8 +313,8 @@ KeyboardDevice::_ControlThread()
uint32 keycode = keyInfo.keycode;
bool isKeyDown = keyInfo.is_keydown;

- LOG_EVENT("KB_READ: %Ld, %02x, %02lx\n", keyInfo.timestamp,
isKeyDown,
- keycode);
+ LOG_EVENT("KB_READ: %" B_PRIdBIGTIME ", %02x, %02" B_PRIx32
"\n",
+ keyInfo.timestamp, isKeyDown, keycode);

if (keycode == 0)
continue;
@@ -681,7 +681,8 @@ KeyboardInputDevice::Control(const char* name, void* cookie,
uint32 command, BMessage* message)
{
KID_CALLED();
- TRACE("KeyboardInputDevice::Control(%s, code: %lu)\n", name, command);
+ TRACE("KeyboardInputDevice::Control(%s, code: %" B_PRIu32 ")\n", name,
+ command);

if (command == B_NODE_MONITOR)
_HandleMonitor(message);


Other related posts:

  • » [haiku-commits] haiku: hrev49097 - in src/add-ons: kernel/drivers/input/usb_hid input_server/devices/keyboard - mmlr