From nobody Mon Dec 15 16:20:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1548710451367617.4324778273856; Mon, 28 Jan 2019 13:20:51 -0800 (PST) Received: from localhost ([127.0.0.1]:38779 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goEKi-0007lu-9B for importer@patchew.org; Mon, 28 Jan 2019 16:20:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goD9q-0003Xi-3q for qemu-devel@nongnu.org; Mon, 28 Jan 2019 15:05:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1goD9c-0005DN-17 for qemu-devel@nongnu.org; Mon, 28 Jan 2019 15:05:16 -0500 Received: from mail-eopbgr800129.outbound.protection.outlook.com ([40.107.80.129]:58944 helo=NAM03-DM3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1goD9b-0005CQ-Ex for qemu-devel@nongnu.org; Mon, 28 Jan 2019 15:05:11 -0500 Received: from DM5PR07MB2921.namprd07.prod.outlook.com (10.168.103.7) by DM5PR07MB3065.namprd07.prod.outlook.com (10.172.88.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.16; Mon, 28 Jan 2019 20:05:08 +0000 Received: from DM5PR07MB2921.namprd07.prod.outlook.com ([fe80::d0bb:c162:9ce9:dca7]) by DM5PR07MB2921.namprd07.prod.outlook.com ([fe80::d0bb:c162:9ce9:dca7%10]) with mapi id 15.20.1558.023; Mon, 28 Jan 2019 20:05:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janustech.onmicrosoft.com; s=selector1-janustech-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dKC4IkXgzlBy4NMYErjSM45ZpYzTPodgZv0yB/nDCH8=; b=EfaGOfPyVnoZgEihERlpFwLsPZDSwtgTdtSvZkKWJNc8KpyPEgkhBuWrjhcXx0ZRfDwg03WfQmTdJTzq1u86SEEKfjajQRkFcPW/GWt9Zl2fWCfr6odCVae5qDcZuZWFyXQs0VuR75dWmHQ7rX6+ir7FCZW0gNvotTZlSCOusUo= From: Yuri Benditovich To: Gerd Hoffmann , "qemu-devel@nongnu.org" Thread-Topic: [PATCH 1/2] usb: XHCI shall not halt isochronous endpoints Thread-Index: AQHUt0TESNc5kwBgxEm8rAiivh6EwQ== Date: Mon, 28 Jan 2019 20:05:07 +0000 Message-ID: <20190128200444.5128-2-yuri.benditovich@janustech.com> References: <20190128200444.5128-1-yuri.benditovich@janustech.com> In-Reply-To: <20190128200444.5128-1-yuri.benditovich@janustech.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0221.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:b::17) To DM5PR07MB2921.namprd07.prod.outlook.com (2603:10b6:3:a::7) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yuri.benditovich@janustech.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.15.1.windows.2 x-originating-ip: [141.226.29.227] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR07MB3065; 6:Q0j4rZKL64SLORQJXILbI1gYCe+Msk+29ktqHu3uSWo++CmzhcPcZx0Ge07RvmUJoL0wnfEgIJ5P86a9TUGTszDzyt3yVUHEAvLvrhv3P1ib6mLUsgzZnoi+2gsvyI/GWUTppQJ6OwwZ78ee6dXxvYz6wbwoov65HVJSZpQVKevw4gYYOpXVhm3GdXtT9GT5q9HNrIaDcXZXC90fKXcVL0Xw4h5eEJ3lg0/NDbZ8Afir5BhBVD2Q5h2qCwi4ftNOQwXOzhKenajV2CwpuNQzU25iD2zar3+RvaomZruia4ZtaAjCt1OD0kv6wXcbfvmOLqtvi4XO7f0wSquBxQ1eRwS/dugqcAH6z5awVPhDupZ3h0IJZYmVGNezxuNLdlzZDqkeavRqNCfvN11AXuw0QNsit6WCdGY5SneO2BjoKIQ4wGnNZYuVLCW/X/cVZfIWXs/4z+uhTf+sYrCxkMaezg==; 5:nMW+/sN5+mB462QC7QwcCJgFBpv5cjmC7kiIuz3mIuTVNU095hA76ABN7fbQyqMry2fm4hMDFAKPaZSR8ga6Mv/F4KWcpPna1r7knbfD/NUDsTCVzPZV8MsCYkz41kFgDq6nSyFQAuKXHumiOii/gJ4wipmA6h7n2MZnp/097r13jIVpZgPMD5E3B0hH1jIUSvx0sMsUgM0SPSGtWBqYXw==; 7:8oyhV65wvOQaicDeGOs7Aq9eR+ok4pPtSUltXeMfqurQQQvy7orJZYMgj9j1gpfV7rxQRCGjXPzevF9/UrOiQHs0z/zoCXCFVpq3s+MzetlzFiUUsDxcXDa6enEt1yM2OXINbofb9IjYr58fe+JJww== x-ms-office365-filtering-correlation-id: e610a977-511e-4260-dc03-08d6855be64e x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(7021145)(8989299)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020); SRVR:DM5PR07MB3065; x-ms-traffictypediagnostic: DM5PR07MB3065: x-microsoft-antispam-prvs: x-forefront-prvs: 0931CB1479 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(396003)(366004)(39830400003)(376002)(346002)(199004)(189003)(99286004)(81156014)(476003)(305945005)(7736002)(76176011)(6506007)(386003)(52116002)(8936002)(14454004)(446003)(50226002)(6116002)(3846002)(36756003)(81166006)(8676002)(11346002)(508600001)(68736007)(44832011)(86362001)(2616005)(256004)(2906002)(486006)(25786009)(6512007)(4326008)(26005)(186003)(71200400001)(97736004)(6436002)(102836004)(107886003)(66066001)(110136005)(6486002)(53936002)(4744005)(71190400001)(316002)(105586002)(106356001)(2501003)(1076003); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR07MB3065; H:DM5PR07MB2921.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; received-spf: None (protection.outlook.com: janustech.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: iHSOKhAwNNj3nT+UxZfarh7y8k4Fst/SwhXPxjS7bPcDdUsBraaBTHk3P7stXz90KyPP0bOG9aemyMO43+K8P1xY3yWQSyY+4uljEkjP3tE8dxFEbVZSHzSNRhRMxfb25Kj7R4s/miGPCm5+AnDLTdpJNZs/28jeZV6CWnOVoiEkc8NkG7kPzecie6sEDS6S09PhrgNFD077umdNCjVRjuCzYpoW9Sy+Jt/5zOcT2wrAMV/3XCtI1ocyitCaMlhPFRAt5zihqIG1+3YkdFKtC9HGk290PAxoNcw9pZgrOglYuQiR5bVdCMtp1D7G2jbe7qJ1p4NjIcZ04tsqRIaZg7ROc0Lr/AxmAyqR72znLRcIeOQQCl4rH1/AP1ZyLdl+5+l0uWHtzq0a/kSrluYyb1d+Q5Knv0MGApx28ZsrIeQ= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-Network-Message-Id: e610a977-511e-4260-dc03-08d6855be64e X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jan 2019 20:05:06.2412 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3065 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.80.129 X-Mailman-Approved-At: Mon, 28 Jan 2019 16:15:17 -0500 Subject: [Qemu-devel] [PATCH 1/2] usb: XHCI shall not halt isochronous endpoints 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: Dmitry Fleytman Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" According to the XHCI spec (4.10.2) the controller never halts isochronous endpoints. This commit prevent stop of isochronous streaming when sporadic errors status received from backends. Signed-off-by: Yuri Benditovich Reviewed-by: Dmitry Fleytman --- hw/usb/hcd-xhci.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 8f1a01a..1a8fd96 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -1571,6 +1571,11 @@ static void xhci_stall_ep(XHCITransfer *xfer) uint32_t err; XHCIStreamContext *sctx; =20 + if (epctx->type =3D=3D ET_ISO_IN || epctx->type =3D=3D ET_ISO_OUT) { + /* never halt isoch endpoints, 4.10.2 */ + return; + } + if (epctx->nr_pstreams) { sctx =3D xhci_find_stream(epctx, xfer->streamid, &err); if (sctx =3D=3D NULL) { --=20 2.9.5 From nobody Mon Dec 15 16:20:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1548710246672213.97684865853535; Mon, 28 Jan 2019 13:17:26 -0800 (PST) Received: from localhost ([127.0.0.1]:38732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goEHQ-0005bs-T1 for importer@patchew.org; Mon, 28 Jan 2019 16:17:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goDA5-0003q0-N9 for qemu-devel@nongnu.org; Mon, 28 Jan 2019 15:05:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1goD9q-0005OQ-3b for qemu-devel@nongnu.org; Mon, 28 Jan 2019 15:05:32 -0500 Received: from mail-eopbgr800129.outbound.protection.outlook.com ([40.107.80.129]:58944 helo=NAM03-DM3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1goD9c-0005CQ-Ht for qemu-devel@nongnu.org; Mon, 28 Jan 2019 15:05:16 -0500 Received: from DM5PR07MB2921.namprd07.prod.outlook.com (10.168.103.7) by DM5PR07MB3065.namprd07.prod.outlook.com (10.172.88.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.16; Mon, 28 Jan 2019 20:05:09 +0000 Received: from DM5PR07MB2921.namprd07.prod.outlook.com ([fe80::d0bb:c162:9ce9:dca7]) by DM5PR07MB2921.namprd07.prod.outlook.com ([fe80::d0bb:c162:9ce9:dca7%10]) with mapi id 15.20.1558.023; Mon, 28 Jan 2019 20:05:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janustech.onmicrosoft.com; s=selector1-janustech-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XLRrXpnH2UEdiufeSw3UdngPQo7LcJgU5zAfKU7GqmY=; b=RyaE7wzJbXDRsXtYtyF6xOB04tQ+6oM1mgixvG+hGoDrFlO0kDCz1xS6lanCpewvslCFSxiopERy9ED1PHkl8CKXBM0ljMoSoBfg+M/ujZo9LWHwiybHu0AWqHRhti8TIksICb4hLgGwBq/frbRtp7U80M8hbwD1h4EE5JccXGE= From: Yuri Benditovich To: Gerd Hoffmann , "qemu-devel@nongnu.org" Thread-Topic: [PATCH 2/2] usb: implement XHCI underrun/overrun events Thread-Index: AQHUt0TFxR+Sidj3D0e4KzSqSVI7Qw== Date: Mon, 28 Jan 2019 20:05:09 +0000 Message-ID: <20190128200444.5128-3-yuri.benditovich@janustech.com> References: <20190128200444.5128-1-yuri.benditovich@janustech.com> In-Reply-To: <20190128200444.5128-1-yuri.benditovich@janustech.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0221.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:b::17) To DM5PR07MB2921.namprd07.prod.outlook.com (2603:10b6:3:a::7) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yuri.benditovich@janustech.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.15.1.windows.2 x-originating-ip: [141.226.29.227] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR07MB3065; 6:AWtGxfkNqWZJsgSUbDfdIec683LkiZSeEFf13jruJBNVKLuwweUmVJQgXCIrqFaj6VeDeh7n5jVP6GSek0wuODMO17UHPV338HbOJQ23Nx2MgvX6W8vjZ+Mk00GFHb3fQ73qlRTPI4R88tmXzOTBPLh4/s1U8+5rDFUWnAGEYvias8boBqJ6/gVySpASxNS29Y2vYNCVZ8arl6YGdDB0jzSPL65YtP7DtdpPOhISCP7wT+/XNOsO3jHB/11g8Yf7twRnC+bVh/mnn3FUBNxC+4dXG8CBEyIzxxflob+3YvY3hhYY0X6T489XUys5DUDD1DfN9Jh4IjmWlYQUSNnEYBXrDpOepPOgmfZ4MiMouRL+cLmT0MFPpMakM4ZJKSSgeFKNndAhSzyrU+zFWPX0mTcQK+s7VeyGETDJBaey63MKJcf2ArNlfVQpbQpoNnGanqowJYQPBi+K0eEix/D+DQ==; 5:ZYpQ5dhP1O7wqRQA8lKOJ7Na0oor2TotFb7vHBAKXxLNUUzbs+NjR/k0VafnvHuyAat2w7nDa+WjSSfloZk/JjhshEW1mUz+qx3i7sAYD1ZMvjprqla1DVbuc8RbBZ4AFGyhtMh57rSx1sJa35ZWh+wQeGQa6Nv+j08T47R7QdabZmHmRGHShn0LIbn58p8SRxG/rOxKlUtZ6euOwljdTg==; 7:zTaeSVxvdmxx7AKVIXiDEz/PzKsJS80NfFx4v/qKndWD2WYYnjjHQ2LfW0P9Rhr8p1KKOGfkr+d9g/H2q85LCcPmbiXSuZY8iji11uUMH7x3/DF8dSLif2HjYmnxraCL4ZOxVhZ14weSjVJyKAZYPQ== x-ms-office365-filtering-correlation-id: 9e254da5-9687-4850-8d35-08d6855be770 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(7021145)(8989299)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020); SRVR:DM5PR07MB3065; x-ms-traffictypediagnostic: DM5PR07MB3065: x-microsoft-antispam-prvs: x-forefront-prvs: 0931CB1479 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(396003)(366004)(39830400003)(376002)(346002)(199004)(189003)(99286004)(81156014)(476003)(305945005)(7736002)(76176011)(6506007)(386003)(52116002)(8936002)(14454004)(446003)(50226002)(6116002)(3846002)(36756003)(81166006)(8676002)(11346002)(508600001)(68736007)(44832011)(86362001)(2616005)(14444005)(256004)(2906002)(486006)(25786009)(6512007)(4326008)(26005)(186003)(71200400001)(97736004)(6436002)(102836004)(107886003)(66066001)(110136005)(6486002)(53936002)(71190400001)(316002)(105586002)(106356001)(2501003)(1076003); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR07MB3065; H:DM5PR07MB2921.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; received-spf: None (protection.outlook.com: janustech.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: E2jN17+dAJn/eWhKv4FpWrzdvlSsNeIgc3Zc2M5ZU2Hmxyx8hvopfRcSj+TpJQKRSjV6LTIVGNXTzOC3VuFXRwrSi9X7qP9Z1+Wzol5+dN5iF8V8f3SzqDjfNtU0d/F5gtpG6KiYHZ3Wc0FPk7kDP3WFsgWIvBCkRBSdXQeLcvXX51S1YJYB+aFrCpwkVJTGpTM8Avjt85MXqHakNF2sOy4AolRuKIMF3LLOdXUA4j6iDbkrK+aWcqQTs0QHR45752iIS7zW3hThwjjyg3WilqyBY61Df+4WxpaagAGNxXknPNtEPxKv6WGnVYYSImeeonl6XNQmz/sjEfAt0vk0wIni0JmDJaH1LScsW21Gn4ZFFGwJzA2l10MKSTZ18aYWtWQWn9B/4myhmytiX+KF1NaQ7s1hiMgOALB39QQU080= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e254da5-9687-4850-8d35-08d6855be770 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jan 2019 20:05:08.1467 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3065 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.80.129 X-Mailman-Approved-At: Mon, 28 Jan 2019 16:15:17 -0500 Subject: [Qemu-devel] [PATCH 2/2] usb: implement XHCI underrun/overrun events 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: Dmitry Fleytman Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Implement underrun/overrun events of isochronous endpoints according to XHCI spec (4.10.3.1) Guest software restarts data streaming when receives these events. The XHCI reports these events using interrupter assigned to the slot (as these events do not have TRB), so current commit adds the field of assigned interrupter to the XHCISlot structure. Guest software assigns interrupter to the slot on 'Address Device' and 'Evaluate Context' commands. Signed-off-by: Yuri Benditovich Reviewed-by: Dmitry Fleytman --- hw/usb/hcd-xhci.c | 17 +++++++++++++++-- hw/usb/hcd-xhci.h | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 1a8fd96..19c64f7 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -1949,6 +1949,16 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, un= signed int streamid) while (1) { length =3D xhci_ring_chain_length(xhci, ring); if (length <=3D 0) { + if (epctx->type =3D=3D ET_ISO_OUT || epctx->type =3D=3D ET_ISO= _IN) { + /* 4.10.3.1 */ + XHCIEvent ev =3D { ER_TRANSFER }; + ev.ccode =3D epctx->type =3D=3D ET_ISO_IN ? + CC_RING_OVERRUN : CC_RING_UNDERRUN; + ev.slotid =3D epctx->slotid; + ev.epid =3D epctx->epid; + ev.ptr =3D epctx->ring.dequeue; + xhci_event(xhci, &ev, xhci->slots[epctx->slotid-1].intr); + } break; } xfer =3D xhci_ep_alloc_xfer(epctx, length); @@ -2028,6 +2038,7 @@ static TRBCCode xhci_disable_slot(XHCIState *xhci, un= signed int slotid) xhci->slots[slotid-1].enabled =3D 0; xhci->slots[slotid-1].addressed =3D 0; xhci->slots[slotid-1].uport =3D NULL; + xhci->slots[slotid-1].intr =3D 0; return CC_SUCCESS; } =20 @@ -2127,6 +2138,7 @@ static TRBCCode xhci_address_slot(XHCIState *xhci, un= signed int slotid, slot =3D &xhci->slots[slotid-1]; slot->uport =3D uport; slot->ctx =3D octx; + slot->intr =3D get_field(slot_ctx[2], TRB_INTR); =20 /* Make sure device is in USB_STATE_DEFAULT state */ usb_device_reset(dev); @@ -2300,8 +2312,9 @@ static TRBCCode xhci_evaluate_slot(XHCIState *xhci, u= nsigned int slotid, =20 slot_ctx[1] &=3D ~0xFFFF; /* max exit latency */ slot_ctx[1] |=3D islot_ctx[1] & 0xFFFF; - slot_ctx[2] &=3D ~0xFF00000; /* interrupter target */ - slot_ctx[2] |=3D islot_ctx[2] & 0xFF000000; + /* update interrupter target field */ + xhci->slots[slotid-1].intr =3D get_field(islot_ctx[2], TRB_INTR); + set_field(&slot_ctx[2], xhci->slots[slotid-1].intr, TRB_INTR); =20 DPRINTF("xhci: output slot context: %08x %08x %08x %08x\n", slot_ctx[0], slot_ctx[1], slot_ctx[2], slot_ctx[3]); diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h index fc36a4c..240caa4 100644 --- a/hw/usb/hcd-xhci.h +++ b/hw/usb/hcd-xhci.h @@ -140,6 +140,7 @@ typedef struct XHCIPort { typedef struct XHCISlot { bool enabled; bool addressed; + uint16_t intr; dma_addr_t ctx; USBPort *uport; XHCIEPContext *eps[31]; --=20 2.9.5