Incorrect port id for gadget driver
The portId should be 1e6a0000.usb-vhub.X instead of gadget.Y.
Tested with
1. Connect evb-ast2500 evb to a mother board.
2. Dump the input devices event by evtest.
3. Establish KVM session on WebUI.
4. Move around the mouse on WebUI.
5. Press keyboard on WebUI.
Mouse:
```
$ sudo evtest /dev/input/event16
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x1d6b product 0x104 version 0x101
Input device name: "OpenBMC virtual_input"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 272 (BTN_LEFT)
Event code 273 (BTN_RIGHT)
Event code 274 (BTN_MIDDLE)
Event type 2 (EV_REL)
Event code 8 (REL_WHEEL)
Event code 11 (REL_WHEEL_HI_RES)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 16383
Min 0
Max 32767
Event code 1 (ABS_Y)
Value 16383
Min 0
Max 32767
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Event: time 1678869292.665398, type 3 (EV_ABS), code 0 (ABS_X), value
30720
Event: time 1678869292.665398, type 3 (EV_ABS), code 1 (ABS_Y), value 0
Event: time 1678869292.665398, -------------- SYN_REPORT ------------
Event: time 1678869292.683394, type 3 (EV_ABS), code 0 (ABS_X), value
30566
Event: time 1678869292.683394, type 3 (EV_ABS), code 1 (ABS_Y), value
546
Event: time 1678869292.683394, -------------- SYN_REPORT ------------
Event: time 1678869292.699394, type 3 (EV_ABS), code 0 (ABS_X), value
30412
Event: time 1678869292.699394, type 3 (EV_ABS), code 1 (ABS_Y), value
819
Event: time 1678869292.699394, -------------- SYN_REPORT ------------
Event: time 1678869292.716394, type 3 (EV_ABS), code 0 (ABS_X), value
30259
Event: time 1678869292.716394, type 3 (EV_ABS), code 1 (ABS_Y), value
1228
Event: time 1678869292.716394, -------------- SYN_REPORT ------------
Event: time 1678869292.734401, type 3 (EV_ABS), code 0 (ABS_X), value
16383
Event: time 1678869292.734401, type 3 (EV_ABS), code 1 (ABS_Y), value
16383
```
Keyboard:
```
$ sudo evtest /dev/input/event15
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x1d6b product 0x104 version 0x101
Input device name: "OpenBMC virtual_input"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 1 (KEY_ESC)
Event code 2 (KEY_1)
Event code 3 (KEY_2)
Event code 4 (KEY_3)
Event code 5 (KEY_4)
Event code 6 (KEY_5)
Event code 7 (KEY_6)
Event code 8 (KEY_7)
Event code 9 (KEY_8)
Event code 10 (KEY_9)
... skip
Event: time 1678869404.403709, -------------- SYN_REPORT ------------
Event: time 1678869404.566714, type 4 (EV_MSC), code 4 (MSC_SCAN), value
70007
Event: time 1678869404.566714, type 1 (EV_KEY), code 32 (KEY_D), value 1
Event: time 1678869404.566714, -------------- SYN_REPORT ------------
Event: time 1678869404.612705, type 4 (EV_MSC), code 4 (MSC_SCAN), value
70007
Event: time 1678869404.612705, type 1 (EV_KEY), code 32 (KEY_D), value 0
Event: time 1678869404.612705, -------------- SYN_REPORT ------------
Event: time 1678869405.525694, type 4 (EV_MSC), code 4 (MSC_SCAN), value
700e1
Event: time 1678869405.525694, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT),
value 1
Event: time 1678869405.525694, -------------- SYN_REPORT ------------
Event: time 1678869405.535692, type 4 (EV_MSC), code 4 (MSC_SCAN), value
700e1
Event: time 1678869405.535692, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT),
value 0
```
Fixes: 20de859 ("Potentially connect udc device incorrectly")
Change-Id: Ia01d767c2f07145ab0abe660ff63f42d5e8974a2
Signed-off-by: Troy Lee <troy_lee@aspeedtech.com>
diff --git a/ikvm_input.cpp b/ikvm_input.cpp
index f3981a4..b900740 100644
--- a/ikvm_input.cpp
+++ b/ikvm_input.cpp
@@ -72,7 +72,7 @@
std::string::npos &&
!fs::exists(gadget.path() / "suspended"))
{
- const std::string portId = gadget.path().filename();
+ const std::string portId = port.path().filename();
hidUdcStream << portId << std::endl;
found = true;
break;