From nobody Sat Oct 25 09:08:51 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520309791846905.0055739356437; Mon, 5 Mar 2018 20:16:31 -0800 (PST) Received: from localhost ([::1]:52842 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1et41f-0005z7-1X for importer@patchew.org; Mon, 05 Mar 2018 23:16:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1et3o1-0001cR-Vx for qemu-devel@nongnu.org; Mon, 05 Mar 2018 23:02:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1et3nz-0004YQ-Vr for qemu-devel@nongnu.org; Mon, 05 Mar 2018 23:02:26 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:38657) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1et3nz-0004WQ-JE; Mon, 05 Mar 2018 23:02:23 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 3zwNQB0wKnz9shc; Tue, 6 Mar 2018 15:02:07 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1520308930; bh=yHvPQtmHqjMAS4BeexNvnr6COhi2MYcqFLv21F/3sTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tw5ZU8AommXMNpTArh6SGasJlPlcQP7oE0TBpxBUxQEdlPsg/oNevnqcrY6LeNhIE uXmAGhozngDbgmorODg/wpRvPcIqjMcrmVNJom2k8Lkb66yR0EeKk5cKTVP8G7jBbM c/p582/qw7soFQGnyzz32axxewpYGWrp+IVEnJaE= From: David Gibson To: peter.maydell@linaro.org, groug@kaod.org Date: Tue, 6 Mar 2018 15:01:53 +1100 Message-Id: <20180306040154.3669-30-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180306040154.3669-1-david@gibson.dropbear.id.au> References: <20180306040154.3669-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 29/30] adb: add trace-events for monitoring keyboard/mouse during bus enumeration X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: surajjs@au1.ibm.com, Mark Cave-Ayland , qemu-devel@nongnu.org, agraf@suse.de, qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland This is useful to help diagnose problems related to address clashes during MacOS 9 boot. Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/input/adb-kbd.c | 4 ++++ hw/input/adb-mouse.c | 5 +++++ hw/input/trace-events | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/hw/input/adb-kbd.c b/hw/input/adb-kbd.c index 266aed1b7b..50b62712c8 100644 --- a/hw/input/adb-kbd.c +++ b/hw/input/adb-kbd.c @@ -258,6 +258,7 @@ static int adb_kbd_request(ADBDevice *d, uint8_t *obuf, case ADB_CMD_CHANGE_ID_AND_ACT: case ADB_CMD_CHANGE_ID_AND_ENABLE: d->devaddr =3D buf[1] & 0xf; + trace_adb_kbd_request_change_addr(d->devaddr); break; default: d->devaddr =3D buf[1] & 0xf; @@ -269,6 +270,9 @@ static int adb_kbd_request(ADBDevice *d, uint8_t *obuf, if (buf[2] =3D=3D 1 || buf[2] =3D=3D 2 || buf[2] =3D=3D 3)= { d->handler =3D buf[2]; } + + trace_adb_kbd_request_change_addr_and_handler(d->devaddr, + d->handler); break; } } diff --git a/hw/input/adb-mouse.c b/hw/input/adb-mouse.c index 47e88faf25..3ba6027d33 100644 --- a/hw/input/adb-mouse.c +++ b/hw/input/adb-mouse.c @@ -118,6 +118,7 @@ static int adb_mouse_request(ADBDevice *d, uint8_t *obu= f, s->dx =3D 0; s->dy =3D 0; s->dz =3D 0; + trace_adb_mouse_flush(); return 0; } =20 @@ -138,6 +139,7 @@ static int adb_mouse_request(ADBDevice *d, uint8_t *obu= f, case ADB_CMD_CHANGE_ID_AND_ACT: case ADB_CMD_CHANGE_ID_AND_ENABLE: d->devaddr =3D buf[1] & 0xf; + trace_adb_mouse_request_change_addr(d->devaddr); break; default: d->devaddr =3D buf[1] & 0xf; @@ -155,6 +157,9 @@ static int adb_mouse_request(ADBDevice *d, uint8_t *obu= f, if (buf[2] =3D=3D 1 || buf[2] =3D=3D 2) { d->handler =3D buf[2]; } + + trace_adb_mouse_request_change_addr_and_handler(d->devaddr, + d->handler= ); break; } } diff --git a/hw/input/trace-events b/hw/input/trace-events index 5affabc81d..db72484a25 100644 --- a/hw/input/trace-events +++ b/hw/input/trace-events @@ -4,10 +4,15 @@ adb_kbd_no_key(void) "Ignoring NO_KEY" adb_kbd_writereg(int reg, uint8_t val) "reg %d val 0x%2.2x" adb_kbd_readreg(int reg, uint8_t val0, uint8_t val1) "reg %d obuf[0] 0x%2.= 2x obuf[1] 0x%2.2x" +adb_kbd_request_change_addr(int devaddr) "change addr to 0x%x" +adb_kbd_request_change_addr_and_handler(int devaddr, int handler) "change = addr and handler to 0x%x, 0x%x" =20 # hw/input/adb-mouse.c +adb_mouse_flush(void) "flush" adb_mouse_writereg(int reg, uint8_t val) "reg %d val 0x%2.2x" adb_mouse_readreg(int reg, uint8_t val0, uint8_t val1) "reg %d obuf[0] 0x%= 2.2x obuf[1] 0x%2.2x" +adb_mouse_request_change_addr(int devaddr) "change addr to 0x%x" +adb_mouse_request_change_addr_and_handler(int devaddr, int handler) "chang= e addr and handler to 0x%x, 0x%x" =20 # hw/input/ps2.c ps2_put_keycode(void *opaque, int keycode) "%p keycode 0x%02x" --=20 2.14.3