From: Mark Cave-Ayland Date: Tue, 12 Jun 2018 16:44:00 +0000 (+0100) Subject: adb: fix read reg 3 byte ordering X-Git-Tag: v3.0.0-rc0~80^2~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb6649f172d6ea1a8d8980b7f93d31808eb06ff8;p=thirdparty%2Fqemu.git adb: fix read reg 3 byte ordering According to the Apple ADB documentation, register 3 is a 2-byte register with the device address in the first byte, and the handler ID in the second byte. This is currently the opposite away to which QEMU returns them so switch the order around. Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- diff --git a/hw/input/adb-kbd.c b/hw/input/adb-kbd.c index 50b62712c85..0ad384dc893 100644 --- a/hw/input/adb-kbd.c +++ b/hw/input/adb-kbd.c @@ -290,8 +290,8 @@ static int adb_kbd_request(ADBDevice *d, uint8_t *obuf, olen = 2; break; case 3: - obuf[0] = d->handler; - obuf[1] = d->devaddr; + obuf[0] = d->devaddr; + obuf[1] = d->handler; olen = 2; break; } diff --git a/hw/input/adb-mouse.c b/hw/input/adb-mouse.c index 3ba6027d336..473045fbacc 100644 --- a/hw/input/adb-mouse.c +++ b/hw/input/adb-mouse.c @@ -172,8 +172,8 @@ static int adb_mouse_request(ADBDevice *d, uint8_t *obuf, case 1: break; case 3: - obuf[0] = d->handler; - obuf[1] = d->devaddr; + obuf[0] = d->devaddr; + obuf[1] = d->handler; olen = 2; break; }