From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.16087.1671435989556285371 for ; Sun, 18 Dec 2022 23:46:29 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=bmOdN+5h; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: hao.a.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671435989; x=1702971989; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=oEL9A8UV9j8o7D+fCe06nt9D1WWhdI42QTCmUKuMapk=; b=bmOdN+5h3qnOumIqYXjvtb9tv+f7NpBWrXqCvj/W2xhWzPSVy5eeFZJB /WjDw/9IFSToo6gFEyXqs3mlhKAwmfb14RCxlop2mu64svVzHDWzW6Uh/ InIal1zvDnOZVeI6D6kKxjP10HPH44gUNfOEU68T7ZEOgeX04IPVVebxC AUsKPHhu6rtaJGleYSTg1pGdzQv0EFMCCaD0WFlfIp40DD1HKZBxtaTER rqRvwXYl2MhQF3IAwmjSE+JsCO3BiLh5LBYHApMtwjhaK4D71wQzPjImZ +Vt8Na+IN00xt/KlppUaVKeA+rQioTpMc6pKAhyopYKemljjxOILhuWc0 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="306968093" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="306968093" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Dec 2022 23:46:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="652601594" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="652601594" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga007.fm.intel.com with ESMTP; 18 Dec 2022 23:46:28 -0800 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Sun, 18 Dec 2022 23:46:28 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Sun, 18 Dec 2022 23:46:28 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.101) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Sun, 18 Dec 2022 23:46:28 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WLQaCxq3otpKd1Tt26RAzaxmXBmojgk1U9XghCLFXzcileOUXAblRIKFJJGFesnhlwlfR+vAFyNCRg96u1BLZcySLQxwNs1zcbpujzLINCuhGbiMa/1eWxEYYuV9p7XvrchlaT9/c7vkEbzsfnRXYEcDjpMFrykWxyS8GuDNY7ntf08xA+wQ+GCcllInGFvTJ1ncEZZl+Hh9M7TR/nyDSN42kI5mV6aZpDwgj7gQm38W6MYZbDb1HQSGUgQvGbDDFYTEi6mOLZ480fZpplQc3LIKmqVblD3yRkk5K0wZHWNMl71po1rTAH2qwO/BxCqCu1Uxj82EdQXmxldsFSSdJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Z/CeAfrzHPN8h/8husHhi/66tp8wWWKwM4mj4JPk7n8=; b=BLrcuv1v5CpZwUT9NAjaN3FbKGE1dnLBfODBrpvgLaJxKe2ynnQX+lDQkasEPUkh3EyrJPnLDLQOFCfBUkSYiumTI8nP0hjTWWFSIhPMMD07sU3G8XfT7bDy3kV7nM2xN8RQngvAMrA0edopcCSkMADUg0xH+8kOCDHHVvYNkysGOii4qLc0GMDbKEv3AZMRO/FKhRzf7fc9hcfTta+K3z+jkF7eZaTA7UbgVSofHMZs5v41r26nEhrJgndmOiagTSN/9hf3RXFZWO6jNkNfoqosGKK9A0xbmWmq8FGuxMjOPy6mTvwaW6jZmHWaCDPuFpO8ShAcA8ABOBRf4RcFgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM6PR11MB4025.namprd11.prod.outlook.com (2603:10b6:5:197::31) by BY1PR11MB8080.namprd11.prod.outlook.com (2603:10b6:a03:528::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Mon, 19 Dec 2022 07:46:25 +0000 Received: from DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::6129:7158:18dd:761c]) by DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::6129:7158:18dd:761c%3]) with mapi id 15.20.5924.016; Mon, 19 Dec 2022 07:46:24 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Rhodes, Sean" Subject: Re: [edk2-devel] [PATCH 3/3] MdeModulePkg/Bus/Pci/XhciDxe: Check port is compatible before getting PSIV Thread-Topic: [edk2-devel] [PATCH 3/3] MdeModulePkg/Bus/Pci/XhciDxe: Check port is compatible before getting PSIV Thread-Index: AQHZESyWEYAkbOf6r0iRY9FceTi0eq50wIAg Date: Mon, 19 Dec 2022 07:46:24 +0000 Message-ID: References: <7bad2974b731b7cd8323582aa89ae4ed9f10702c.1671181085.git.sean@starlabs.systems> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR11MB4025:EE_|BY1PR11MB8080:EE_ x-ms-office365-filtering-correlation-id: 3f8500e0-3a14-45d2-9b24-08dae19520f8 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9LWN5jTR37VQevk6OdfshIXtyosCfazMjxViBqqyPKKaNH8F10+hCcom3YZuaUOokPuHEYBONJpLmxJAeJt7nv2H9sFP3R26ePQMTgnYh7Ty7PM0ggPYg4pPvLUUyTElM4QIf0DJvqXBV8GhI++O0Yk0CvSvp8mv0YfAI7EEz+kr30P3sMWZFg5CPBaxOCLr23Ewr+ej1xTuI/9Ng7lFueUahErik8n5fjaakqZeZ4sPjVAAx4dXUvUKgO5YwFbekF2wpP8DD2u6tth9cNcZDMv65tes2Es1ewHJiSr508kZap0lKHStrcJI02JrI5WOFV8fEcGo0fQkgM1LnbaCnXJa9OCJxZhd+/8MD1roQ6ZktnUauKYfAhCI7NBWKIIfjCJrUG0QThKfsz9HYwIv6YOn0U/hJ4pIcmIGiLQhYkw6yTNWTR0+Ip5C/kSsG67Gx3pqgMC6TOb/kTF2KMSKqlfquCTlG8b1nnt4E88+VDVglFAycHcCR0eaN6luQ6pUY8Z4Z9/Dbfw2ZIpd+lmOjw1eBcqw+1XOV1G2yTek3VoRLEINwLMImDxbA9FqtsPVAw7Fb8JC7C99M7A/HMsS0en3xegKx3iPaZA0m3Re6KbNa4u0bL0QO8yRgdmOP6ya7kUXUzvWwkTIoK5nNDnYvxgWRqfL1dLNgfZ7s1d7LaRyOBdtksycNr0lTgs+d79oPifjRft6RxMRBjQKJt7vDXR64fT8b3SqcSOw3a7pCrifd+fskYu8ksYQucMSspPyum+L/8Fsc83k68NKj85oMA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4025.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(346002)(376002)(396003)(136003)(39860400002)(451199015)(110136005)(966005)(6506007)(53546011)(38070700005)(8676002)(7696005)(66946007)(122000001)(86362001)(38100700002)(64756008)(66446008)(66556008)(66476007)(71200400001)(76116006)(478600001)(316002)(82960400001)(66899015)(83380400001)(52536014)(8936002)(5660300002)(33656002)(2906002)(41300700001)(9686003)(186003)(55016003)(26005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?k6arQEVY+XlDYI3DX7Ut+k9aa4tAuDldq/aIrJv8Q4ITYq6dLYj2GNPzHH9p?= =?us-ascii?Q?j5v72z/v1nFYK19jRSUq4u4dhbAccbxeIY8CjVboGQSiQ/+G9rrZ/Dt5LVPD?= =?us-ascii?Q?Rv3LB4/oWL0AAC3YSaOSrEyAWxFkCjGFZ8pv3IIUTz2HKuHntkcWv9KvIY/m?= =?us-ascii?Q?6LpI376unA85KH2VQ7Hl50j0Nk46Mj90xZSDGfVRsayknJv8Z84cSwoB8ZOX?= =?us-ascii?Q?ATSAkTFiwm7DppEv/oE2lb/MQu3qP0dnv8GiPl/bGiCOhHtjKegYLvb1m5k9?= =?us-ascii?Q?kPrriFB3olnKVBdMUyeQPqW15iqM3Ub/SmT34moThqsOihkJXH3eyHIMOYIE?= =?us-ascii?Q?6V7FLba6mPNwYkTCykHhLr1BIsAJOqG0a+EwoXMFndqKmt7IWqN8cN2oURTD?= =?us-ascii?Q?KUvSXnqPe3IeWr4SD5TWwnyB8oMw1v3CZjcjzbexa0ZyMofFS6V8jf7LJ2ea?= =?us-ascii?Q?zydb1C+el6euSNO8Eey+wDekpOwECwvpPBrCY10WD0RdWfadyw8KtXv2XYHa?= =?us-ascii?Q?dsunid9/koA7ESdKUgi0c7Gd1nAVHRvkXVjgx5uuHRH+tqxRz8BMKiN81CGi?= =?us-ascii?Q?kK/MSWCEZqLsan8Ip/NTUKapRn8+o6f+x9+IMfqnLGXFzCKBvto/XabkpXvy?= =?us-ascii?Q?LxsnmaFNUCt2fr8EHs5XDyBghNeqpK/oi8Fr/fofBjJS78xv8AfbGjcMm5yD?= =?us-ascii?Q?4bG7/esn5ZNvq/KdormMOGb6fxIJtb8eyvW4qM+tsAH2T5I8SAntVD1AL9/F?= =?us-ascii?Q?+VRXqpPutJWk9TfYa8xqsUiRx7EVy/EdD4JgASVdPVph9qaeswz/qmm1kG+h?= =?us-ascii?Q?7cGhDjSpMSovFlFBL6OMD0RXosMZZnKIz15g48hV/eEgsz7zObeef1KhV/3E?= =?us-ascii?Q?meVXGkSiKVvoX3UEiqqW3VdiOUqam8UHQ9rlMtVozjJQKIek8XR3NeXr+LVR?= =?us-ascii?Q?n6h9ISVcxE3mOL6/HahjcMwJV22YSk1f8hvg30hWFC+ueFjtQgGcwffIc7+R?= =?us-ascii?Q?z8H3E4hU2b9JJBsaXYBdpIieR0Abo/4NxHPkgV7gqaB7cbqbgljLVb+7Md86?= =?us-ascii?Q?d+o64dFae9WArZlxQWhurK+nh6ziRaMxjbW15Ipe0y21Bayj74p9OxFYiLFu?= =?us-ascii?Q?Z1njy5///GHBwskpQYUI3Kj23nwhWXoNAIlvb+B06IJKN3wvr3vGULiG/O6D?= =?us-ascii?Q?8yV7QDawTm0DOD/clJSIGfJ+kKWF2yf2BwHS69AZRocu7pGwE5D43Y1id7Ul?= =?us-ascii?Q?jhMK4DsDLtQAoiWSAY3tFs5zHB/1oxqA6iUy3hywi03B3o7vEelI+mdxZ6Cy?= =?us-ascii?Q?jHy2mMzwmi/kbzMJxuM12Tb1hAEg6wiCibrvh306lczdki+yjfj9uIlw53PG?= =?us-ascii?Q?kT3A0Rvslfls6VnMvzBKKfqc/IGGJYwxh2wmSriOcV0TWFcW7kPa496sGS10?= =?us-ascii?Q?j0OiQXHzBQtt2/mHRsqiHftm2YgU9lltZOF+bYfg5RS8vScLGakLcx+qytvX?= =?us-ascii?Q?roTgS/3VaecJox/Tdi1HjLCsUw3FQPjm2BNu0gS8YFXBa2QRHtDAmD17/Ixj?= =?us-ascii?Q?F0VaXCD01AmbpLt3x/VKoqMRhhzPqYX0ne2QtWxD?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4025.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3f8500e0-3a14-45d2-9b24-08dae19520f8 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Dec 2022 07:46:24.5418 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 2JMeDgK+tkvHIsgoQmthqzKG/e1I8aoswAsF12OoUhZs+OXwWZiTvLwrTfpD48Pp9ncg0qwkzsEUW/mmsPJo7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR11MB8080 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Hao A Wu I will make minor modification to: * Function description comment * Input parameter name of XhcCheckUsbPortSpeedUsedPsic() to make the declaration (in .H) and the d= efinition (in .C) match. Best Regards, Hao Wu > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Sean > Rhodes > Sent: Friday, December 16, 2022 4:58 PM > To: devel@edk2.groups.io > Cc: Rhodes, Sean > Subject: [edk2-devel] [PATCH 3/3] MdeModulePkg/Bus/Pci/XhciDxe: Check > port is compatible before getting PSIV >=20 > On some platforms, including Sky Lake and Kaby Lake, the PSIV (Protocol > Speed ID Value) indices are shared between Protocol Speed ID DWORD' in > the extended capabilities registers for both USB2 (Full Speed) and USB3 > (Super Speed). >=20 > An example can be found below: >=20 > XhcCheckUsbPortSpeedUsedPsic: checking for USB2 ext caps > XhciPsivGetPsid: found 3 PSID entries > XhciPsivGetPsid: looking for port speed 1 > XhciPsivGetPsid: PSIV 1 PSIE 2 PLT 0 PSIM 12 > XhciPsivGetPsid: PSIV 2 PSIE 1 PLT 0 PSIM 1500 > XhciPsivGetPsid: PSIV 3 PSIE 2 PLT 0 PSIM 480 > XhcCheckUsbPortSpeedUsedPsic: checking for USB3 ext caps > XhciPsivGetPsid: found 3 PSID entries > XhciPsivGetPsid: looking for port speed 1 > XhciPsivGetPsid: PSIV 1 PSIE 3 PLT 0 PSIM 5 > XhciPsivGetPsid: PSIV 2 PSIE 3 PLT 0 PSIM 10 > XhciPsivGetPsid: PSIV 34 PSIE 2 PLT 0 PSIM 1248 >=20 > The result is edk2 detecting USB2 devices as USB3 devices, which > consequently causes enumeration to fail. >=20 > To avoid incorrect detection, check the Compatible Port Offset to find > the starting Port of Root Hubs that support the protocol. >=20 > Signed-off-by: Sean Rhodes > --- > MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 2 +- > MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c | 35 +++++++++++++++++++++-- > --- > MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h | 8 +++--- > 3 files changed, 35 insertions(+), 10 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > index 8dd7a8fbb7..461b2cd9b5 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > @@ -405,7 +405,7 @@ XhcGetRootHubPortStatus ( > // Section 7.2 xHCI Support Protocol Capability >=20 > // >=20 > if (PortSpeed > 0) { >=20 > - PortStatus->PortStatus =3D XhcCheckUsbPortSpeedUsedPsic (Xhc, > PortSpeed); >=20 > + PortStatus->PortStatus =3D XhcCheckUsbPortSpeedUsedPsic (Xhc, > PortSpeed, PortNumber); >=20 > // If no match found in ext cap reg, fall back to PORTSC >=20 > if (PortStatus->PortStatus =3D=3D 0) { >=20 > // >=20 > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c > index 2b4a4b2444..5700fc5fb8 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c > @@ -636,6 +636,7 @@ XhcGetSupportedProtocolCapabilityAddr ( > @param Xhc The XHCI Instance. >=20 > @param ExtCapOffset The USB Major Version in xHCI Support Protocol > Capability Field >=20 > @param PortSpeed The Port Speed Field in USB PortSc register >=20 > + @param PortNumber The Port Number (0-indexed) >=20 >=20 >=20 > @return The Protocol Speed ID (PSI) from xHCI Supported Protocol > capability register. >=20 >=20 >=20 > @@ -644,12 +645,15 @@ UINT32 > XhciPsivGetPsid ( >=20 > IN USB_XHCI_INSTANCE *Xhc, >=20 > IN UINT32 ExtCapOffset, >=20 > - IN UINT8 PortSpeed >=20 > + IN UINT8 PortSpeed, >=20 > + IN UINT8 PortNumber >=20 > ) >=20 > { >=20 > XHC_SUPPORTED_PROTOCOL_DW2 PortId; >=20 > XHC_SUPPORTED_PROTOCOL_PROTOCOL_SPEED_ID Reg; >=20 > UINT32 Count; >=20 > + UINT32 MinPortIndex; >=20 > + UINT32 MaxPortIndex; >=20 >=20 >=20 > if ((Xhc =3D=3D NULL) || (ExtCapOffset =3D=3D 0xFFFFFFFF)) { >=20 > return 0; >=20 > @@ -663,6 +667,23 @@ XhciPsivGetPsid ( > // >=20 > PortId.Dword =3D XhcReadExtCapReg (Xhc, ExtCapOffset + > XHC_SUPPORTED_PROTOCOL_DW2_OFFSET); >=20 >=20 >=20 > + // >=20 > + // According to XHCI 1.1 spec November 2017, valid values >=20 > + // for CompPortOffset are 1 to CompPortCount - 1. >=20 > + // >=20 > + // PortNumber is zero-indexed, so subtract 1. >=20 > + // >=20 > + if ((PortId.Data.CompPortOffset =3D=3D 0) || (PortId.Data.CompPortCoun= t =3D=3D > 0)) { >=20 > + return 0; >=20 > + } >=20 > + >=20 > + MinPortIndex =3D PortId.Data.CompPortOffset - 1; >=20 > + MaxPortIndex =3D MinPortIndex + PortId.Data.CompPortCount - 1; >=20 > + >=20 > + if ((PortNumber < MinPortIndex) || (PortNumber > MaxPortIndex)) { >=20 > + return 0; >=20 > + } >=20 > + >=20 > for (Count =3D 0; Count < PortId.Data.Psic; Count++) { >=20 > Reg.Dword =3D XhcReadExtCapReg (Xhc, ExtCapOffset + > XHC_SUPPORTED_PROTOCOL_PSI_OFFSET + (Count << 2)); >=20 > if (Reg.Data.Psiv =3D=3D PortSpeed) { >=20 > @@ -676,8 +697,9 @@ XhciPsivGetPsid ( > /** >=20 > Find PortSpeed value match case in XHCI Supported Protocol Capability >=20 >=20 >=20 > - @param Xhc The XHCI Instance. >=20 > - @param PortSpeed The Port Speed Field in USB PortSc register >=20 > + @param Xhc The XHCI Instance. >=20 > + @param PortSpeed The Port Speed Field in USB PortSc register >=20 > + @param PortNumber The Port Number (0-indexed) >=20 >=20 >=20 > @return The USB Port Speed. >=20 >=20 >=20 > @@ -685,7 +707,8 @@ XhciPsivGetPsid ( > UINT16 >=20 > XhcCheckUsbPortSpeedUsedPsic ( >=20 > IN USB_XHCI_INSTANCE *Xhc, >=20 > - IN UINT8 PortSpeed >=20 > + IN UINT8 PortSpeed, >=20 > + IN UINT8 PortNumber >=20 > ) >=20 > { >=20 > XHC_SUPPORTED_PROTOCOL_PROTOCOL_SPEED_ID SpField; >=20 > @@ -703,7 +726,7 @@ XhcCheckUsbPortSpeedUsedPsic ( > // PortSpeed definition when the Major Revision is 03h. >=20 > // >=20 > if (Xhc->Usb3SupOffset !=3D 0xFFFFFFFF) { >=20 > - SpField.Dword =3D XhciPsivGetPsid (Xhc, Xhc->Usb3SupOffset, PortSpee= d); >=20 > + SpField.Dword =3D XhciPsivGetPsid (Xhc, Xhc->Usb3SupOffset, PortSpee= d, > PortNumber); >=20 > if (SpField.Dword !=3D 0) { >=20 > // >=20 > // Found the corresponding PORTSC value in PSIV field of USB3 offs= et. >=20 > @@ -717,7 +740,7 @@ XhcCheckUsbPortSpeedUsedPsic ( > // PortSpeed definition when the Major Revision is 02h. >=20 > // >=20 > if ((UsbSpeedIdMap =3D=3D 0) && (Xhc->Usb2SupOffset !=3D 0xFFFFFFFF)) = { >=20 > - SpField.Dword =3D XhciPsivGetPsid (Xhc, Xhc->Usb2SupOffset, PortSpee= d); >=20 > + SpField.Dword =3D XhciPsivGetPsid (Xhc, Xhc->Usb2SupOffset, PortSpee= d, > PortNumber); >=20 > if (SpField.Dword !=3D 0) { >=20 > // >=20 > // Found the corresponding PORTSC value in PSIV field of USB2 offs= et. >=20 > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h > index 5fe2ba4f0e..2e4f95f8ac 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h > @@ -623,8 +623,9 @@ XhcGetSupportedProtocolCapabilityAddr ( > /** >=20 > Find SpeedField value match with Port Speed ID value. >=20 >=20 >=20 > - @param Xhc The XHCI Instance. >=20 > - @param Speed The Port Speed filed in USB PortSc register >=20 > + @param Xhc The XHCI Instance. >=20 > + @param Speed The Port Speed filed in USB PortSc register >=20 > + @param PortNumber The Port Number (0-indexed) >=20 >=20 >=20 > @return The USB Port Speed. >=20 >=20 >=20 > @@ -632,7 +633,8 @@ XhcGetSupportedProtocolCapabilityAddr ( > UINT16 >=20 > XhcCheckUsbPortSpeedUsedPsic ( >=20 > IN USB_XHCI_INSTANCE *Xhc, >=20 > - IN UINT8 Speed >=20 > + IN UINT8 Speed, >=20 > + IN UINT8 PortNumber >=20 > ); >=20 >=20 >=20 > #endif >=20 > -- > 2.37.2 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#97497): https://edk2.groups.io/g/devel/message/97497 > Mute This Topic: https://groups.io/mt/95706436/1768737 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [hao.a.wu@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D >=20