diff --git a/src/add-ons/kernel/drivers/input/hid_shared/HIDParser.cpp b/src/add-ons/kernel/drivers/input/hid_shared/HIDParser.cpp index aaef7dce68..05d8729d2e 100644 --- a/src/add-ons/kernel/drivers/input/hid_shared/HIDParser.cpp +++ b/src/add-ons/kernel/drivers/input/hid_shared/HIDParser.cpp @@ -430,6 +430,13 @@ HIDParser::ReportAt(uint8 type, uint8 index) size_t HIDParser::MaxReportSize() +{ + return MaxReportSize(HID_REPORT_TYPE_ANY); +} + + +size_t +HIDParser::MaxReportSize(uint8 type) { size_t maxSize = 0; for (int32 i = 0; i < fReports.Count(); i++) { @@ -437,6 +444,9 @@ HIDParser::MaxReportSize() if (report == NULL) continue; + if (type != HID_REPORT_TYPE_ANY && report->Type() != type) + continue; + if (report->ReportSize() > maxSize) maxSize = report->ReportSize(); } diff --git a/src/add-ons/kernel/drivers/input/hid_shared/HIDParser.h b/src/add-ons/kernel/drivers/input/hid_shared/HIDParser.h index 75f1101158..b8523eb431 100644 --- a/src/add-ons/kernel/drivers/input/hid_shared/HIDParser.h +++ b/src/add-ons/kernel/drivers/input/hid_shared/HIDParser.h @@ -30,6 +30,7 @@ public: uint8 CountReports(uint8 type); HIDReport * ReportAt(uint8 type, uint8 index); size_t MaxReportSize(); + size_t MaxReportSize(uint8 type); HIDCollection * RootCollection() { return fRootCollection; }; diff --git a/src/add-ons/kernel/drivers/input/hid_shared/KeyboardProtocolHandler.cpp b/src/add-ons/kernel/drivers/input/hid_shared/KeyboardProtocolHandler.cpp index ad3128b482..da6619f109 100644 --- a/src/add-ons/kernel/drivers/input/hid_shared/KeyboardProtocolHandler.cpp +++ b/src/add-ons/kernel/drivers/input/hid_shared/KeyboardProtocolHandler.cpp @@ -110,7 +110,8 @@ KeyboardProtocolHandler::KeyboardProtocolHandler(HIDReport &inputReport, #ifdef USB_KDL sDebugKeyboardPipe = fInputReport.Device()->InterruptPipe(); #endif - sDebugKeyboardReportSize = fInputReport.Parser()->MaxReportSize(); + sDebugKeyboardReportSize = + fInputReport.Parser()->MaxReportSize(HID_REPORT_TYPE_INPUT); if (outputReport != NULL) sDebugKeyboardFound = true; } @@ -794,7 +795,7 @@ KeyboardProtocolHandler::_ReadReport(bigtime_t timeout, uint32 *cookie) = fInputReport.Device()->InterruptPipe(); #endif sDebugKeyboardReportSize - = fInputReport.Parser()->MaxReportSize(); + = fInputReport.Parser()->MaxReportSize(HID_REPORT_TYPE_INPUT); #endif char letter = current[i] - 4 + 'a'; 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 cbce1e65ee..7902bbf5ff 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp +++ b/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp @@ -181,7 +181,7 @@ HIDDevice::HIDDevice(usb_device device, const usb_configuration_info *config, return; } - fTransferBufferSize = fParser.MaxReportSize(); + fTransferBufferSize = fParser.MaxReportSize(HID_REPORT_TYPE_INPUT); if (fTransferBufferSize == 0) { TRACE_ALWAYS("report claims a report size of 0\n"); return;