Add support for specifying UDC that HID gadget will connect to
Currently, HID gadget always connects to the USB virtual hub port
under /sys/bus/platform/devices/1e6a0000.usb-vhub, which only works
on ASPEED platform.
This commit adds support for specifying UDC that HID gadget will
connect to, it could be useful for non-ASPEED platform. Although there
are still some other ASPEED-specific behaviors need to be addressed,
but this commit is the first step for non-ASPEED platform.
Tested:
Specify UDC by '-u' parameter and HID gadget will connect to it. Otherwise,
HID gadget will connect to the USB virtual hub port.
Signed-off-by: Marvin Lin <milkfafa@gmail.com>
Change-Id: Ie24ed9d32cb4f7483e8d4c8b51cc5e1bb5fa94de
diff --git a/ikvm_input.hpp b/ikvm_input.hpp
index 295fb12..83e4071 100644
--- a/ikvm_input.hpp
+++ b/ikvm_input.hpp
@@ -24,8 +24,10 @@
*
* @param[in] kbdPath - Path to the USB keyboard device
* @param[in] ptrPath - Path to the USB mouse device
+ * @param[in] udc - Name of UDC
*/
- Input(const std::string& kbdPath, const std::string& ptrPath);
+ Input(const std::string& kbdPath, const std::string& ptrPath,
+ const std::string& udc);
~Input();
Input(const Input&) = default;
Input& operator=(const Input&) = default;
@@ -113,6 +115,8 @@
std::string keyboardPath;
/* @brief Path to the USB mouse device */
std::string pointerPath;
+ /* @brief Name of UDC */
+ std::string udcName;
/*
* @brief Mapping of RFB key code to report data index to keep track
* of which keys are down