diff --git a/src/add-ons/kernel/drivers/input/usb_hid/HIDCollection.cpp b/src/add-ons/kernel/drivers/input/usb_hid/HIDCollection.cpp index 4bdde2297b..155f4f1965 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/HIDCollection.cpp +++ b/src/add-ons/kernel/drivers/input/usb_hid/HIDCollection.cpp @@ -3,7 +3,12 @@ * Distributed under the terms of the MIT License. */ +#ifndef USERLAND_HID #include "Driver.h" +#else +#include "UserlandHID.h" +#endif + #include "HIDCollection.h" #include "HIDReportItem.h" diff --git a/src/add-ons/kernel/drivers/input/usb_hid/HIDParser.cpp b/src/add-ons/kernel/drivers/input/usb_hid/HIDParser.cpp index 0d62d35f36..49f8cb4d80 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/HIDParser.cpp +++ b/src/add-ons/kernel/drivers/input/usb_hid/HIDParser.cpp @@ -3,7 +3,12 @@ * Distributed under the terms of the MIT License. */ +#ifndef USERLAND_HID #include "Driver.h" +#else +#include "UserlandHID.h" +#endif + #include "HIDCollection.h" #include "HIDParser.h" #include "HIDReport.h" 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 cf8791f4f0..dd65b7bf7e 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/HIDReport.cpp +++ b/src/add-ons/kernel/drivers/input/usb_hid/HIDReport.cpp @@ -3,7 +3,12 @@ * Distributed under the terms of the MIT License. */ +#ifndef USERLAND_HID #include "Driver.h" +#else +#include "UserlandHID.h" +#endif + #include "HIDCollection.h" #include "HIDDevice.h" #include "HIDReport.h" @@ -26,7 +31,9 @@ HIDReport::HIDReport(HIDParser *parser, uint8 type, uint8 id) fCurrentReport(NULL), fBusyCount(0) { +#ifndef USERLAND_HID fConditionVariable.Init(this, "hid report"); +#endif } @@ -155,10 +162,13 @@ HIDReport::SetReport(status_t status, uint8 *report, size_t length) fReportStatus = B_ERROR; } +#ifndef USERLAND_HID fConditionVariable.NotifyAll(); +#endif } +#ifndef USERLAND_HID status_t HIDReport::SendReport() { @@ -184,6 +194,7 @@ HIDReport::SendReport() free(report); return result; } +#endif // !USERLAND_HID HIDReportItem * @@ -208,6 +219,7 @@ HIDReport::FindItem(uint16 usagePage, uint16 usageID) } +#ifndef USERLAND_HID status_t HIDReport::WaitForReport(bigtime_t timeout) { @@ -241,6 +253,7 @@ HIDReport::DoneProcessing() { atomic_add(&fBusyCount, -1); } +#endif // !USERLAND_HID void diff --git a/src/add-ons/kernel/drivers/input/usb_hid/HIDReport.h b/src/add-ons/kernel/drivers/input/usb_hid/HIDReport.h index 48f9bd3026..37179e7997 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/HIDReport.h +++ b/src/add-ons/kernel/drivers/input/usb_hid/HIDReport.h @@ -7,7 +7,9 @@ #include "HIDParser.h" +#ifndef USERLAND_HID #include +#endif #define HID_REPORT_TYPE_INPUT 0x01 #define HID_REPORT_TYPE_OUTPUT 0x02 @@ -39,14 +41,18 @@ public: size_t length); uint8 * CurrentReport() { return fCurrentReport; }; +#ifndef USERLAND_HID status_t SendReport(); +#endif uint32 CountItems() { return fItemsUsed; }; HIDReportItem * ItemAt(uint32 index); HIDReportItem * FindItem(uint16 usagePage, uint16 usageID); +#ifndef USERLAND_HID status_t WaitForReport(bigtime_t timeout); void DoneProcessing(); +#endif void PrintToStream(); @@ -66,7 +72,10 @@ private: status_t fReportStatus; uint8 * fCurrentReport; int32 fBusyCount; + +#ifndef USERLAND_HID ConditionVariable fConditionVariable; +#endif }; #endif // HID_REPORT_H 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 6ce9a2d2c5..3ffeec6d6e 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/HIDReportItem.cpp +++ b/src/add-ons/kernel/drivers/input/usb_hid/HIDReportItem.cpp @@ -3,7 +3,11 @@ * Distributed under the terms of the MIT License. */ +#ifndef USERLAND_HID #include "Driver.h" +#else +#include "UserlandHID.h" +#endif #include "HIDReportItem.h" #include "HIDReport.h"