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_args.hpp b/ikvm_args.hpp
index 565d9c0..cb3d3ad 100644
--- a/ikvm_args.hpp
+++ b/ikvm_args.hpp
@@ -101,6 +101,16 @@
}
/*
+ * @brief Get the name of UDC
+ *
+ * @return Reference to the string storing the name of UDC
+ */
+ inline const std::string& getUdcName() const
+ {
+ return udcName;
+ }
+
+ /*
* @brief Get the path to the V4L2 video device
*
* @return Reference to the string storing the path to the video device
@@ -135,6 +145,8 @@
std::string keyboardPath;
/* @brief Path to the USB mouse device */
std::string pointerPath;
+ /* @brief Name of UDC */
+ std::string udcName;
/* @brief Path to the V4L2 video device */
std::string videoPath;
/* @brief Identical frames detection */