From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.7646.1671583776092980066 for ; Tue, 20 Dec 2022 16:49:36 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=DRWxyLST; spf=pass (domain: intel.com, ip: 192.55.52.93, 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=1671583776; x=1703119776; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=6K3wKuqlo7sg3VJZvVMVBqMOz13UYCBW8jXnMlraHME=; b=DRWxyLSTzG4xJHet0Jvd6e+FYgxTEK4vCZL+PbRIeyT0P+OyDPg1OjOp k3GH3cq6x+7x7DSwuUrNDemWvt3kdtjSsQyRd4Y1tgXJTvMpFBzyreq8Q 9QvLTHcUg9HyGHPIW60p5aVDT5oXTq8Q8P0m6UsOwaTl2YSlqScPV7fQj wlHnygyhcKojzViPNApZMFTww033vnR8uXCe68pYS0plM4bDyoHFyQZlS KuEgj8qIrxbiHWwXeVvVMDmJTd/qDp0tH18FlEAWH+qPud9CH/zyngh74 JILG2dkjYuFlG+9r4crBzxaaYkea1YN1hPBhdccTN+ox991jS4RViypjs Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10567"; a="317389992" X-IronPort-AV: E=Sophos;i="5.96,261,1665471600"; d="scan'208";a="317389992" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2022 16:49:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10567"; a="644658928" X-IronPort-AV: E=Sophos;i="5.96,261,1665471600"; d="scan'208";a="644658928" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga007.jf.intel.com with ESMTP; 20 Dec 2022 16:49:35 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 20 Dec 2022 16:49:34 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 20 Dec 2022 16:49:33 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Tue, 20 Dec 2022 16:49:33 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.175) 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; Tue, 20 Dec 2022 16:49:33 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dpAPyhu7lwEPEKo6GwNTdEZ9/UTRrFHBNn38Mki8DCfF/RWa5UcakhBogQJ7WPGJ0JO/WTQY3wwBRuiD9ZH9kMdj65NAIfdeyYiafGYj3T6r2ITQ7SC8tOm+IMfHIKadhBhvaDVuy4+krOd+8hUMNj6oLHDm16jtoaNqYIvn+kEtqaMLhCUr8SIvHOFXeoLVwg4JS/yuNN5DrLjWZ3s0TGBSzabfePeLaHREEI9FZLE4GtrA2lUodcNt9gH4WbGywn5KhXn3iW2FDgUhkUpxDZPO0Dxn3Y7Gw2wg2zDXXTSbfmOx9VNmEc+vH196nPcRwrLoxOqlKvy9oElc1laZ8A== 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=o8C41vBaLD/gTzhCzqwj4xBKgJIyHwPX7rHAp22UZ64=; b=YbNEc0BgRscX2CztKckWfhmN3zL5tMdXH+JX+4xJB7q82U84oXHffKwzgmWArcqQdKeLvcpyL1eDCRuF4mGaHIzs6y1yuhuQdVtpX521+wwAy434VpcZxU2R7RmzFBJxj/SIu0ggoL9en1JaPGUlEK7ez7jdDWon81W+UhbVfGN9meM7UuRVil4q+tqVqwMQnoq0UbxVyPj4kLnNLgp+YtYZc+im6F6GTBX/Tt18/koiEYfmJDV2QgozyN0GdG9qzHHivtzBSIfyi5UHh8Dv7QNYw5BiLz0baea9yAS1FvY1rjNYrnEgO9htcS9XlUzEcxrzNm9hztfogaHgxiS0qA== 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 BL1PR11MB5351.namprd11.prod.outlook.com (2603:10b6:208:318::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.12; Wed, 21 Dec 2022 00:49: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; Wed, 21 Dec 2022 00:49:25 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Wu, Hao A" , "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: AQHZESyWEYAkbOf6r0iRY9FceTi0eq50wIAggALJNyA= Date: Wed, 21 Dec 2022 00:49:25 +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_|BL1PR11MB5351:EE_ x-ms-office365-filtering-correlation-id: 5496a503-df38-4190-b3bf-08dae2ed3560 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: SI53Fw6wsxDgeiVSH4+/A6OmmH3UadcgWKXbsPYG/p/rRqpWw05mjzZ1IR/4vHtB9QguqSrOgwXAiK/Y9rIyCatFew4Ejoug72I5u2n0MwlEmuiUDk0dzv1NyqAHku/Er2rBQqgGzHEcFTSFkKllbJWPh9wioT5FJ56fCXBMKSIlowOBwByNt17yCEBNXh/9hfsgZt+23r94usToOYU36cdHUlry9SxLDFvuhoDWlYmohzTCbJ5YYZI36NGW4oeAV5FTB7LWEnwiKivRLyEQbwpMOyUJQ15FeIx6dWivQkhZCAxKXSOAapifjdt/a/Cav/omAwniuy/9xMdW8jXniJzLxqwnUdiIBTQmF1FkbOoabk9Z0zAULTkA7Lo4VkjTvO8PfQ0lDpQWpIZGgp2LkFw+bhYM8zSPWcmOkP/pWtbBJEX0gkF9EHIeUcJZg9FTMoY/VtHRrs+bNl7vhBjYU54k99whOKTA8CbhSntk0s9Sy1sIWhTwLv0zJaGH3yn8LwM9szkhTzjSKFurQIfjoT0qqR3qL3jfVstmeZk2HmCjhzw7SDdKcwOznnKVE4x9gYTwD8TgwijWleT1Bz0Zu1sukxKBhDqkLweOJzwBQSywMxNY9UmV+8iMckwzLYYXTH8u2IyDiXOaqW6bxwuDSVhW/Diqjk/AQ+7HxsG2ilAm2ecO+g9quvWQ77B0wA5QRGM0KkFMJ3YZcF1spmjDfBE3O5gljFFklGpY2X9njcLXRSsUO1bv/B2HFpHR6rhg+HUrWnhhVl7BFS31g3D1IQ== 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)(136003)(396003)(39860400002)(346002)(376002)(451199015)(66899015)(66476007)(38100700002)(76116006)(82960400001)(8676002)(5660300002)(64756008)(66946007)(66446008)(66556008)(33656002)(83380400001)(86362001)(8936002)(122000001)(966005)(478600001)(316002)(52536014)(71200400001)(2906002)(110136005)(41300700001)(7696005)(38070700005)(9686003)(6506007)(53546011)(186003)(26005)(55016003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?EsmsSPfB4QlP2HcUxCB/UbTVTsYhnH81QdaLCHhYlYpVnj0wTyyK4kr9bckT?= =?us-ascii?Q?KIpfucx4/vMP/rMkQaI2cjZhte7ofoE7F1n2S/NjjIvHfSvAYdlWhPnOmLEl?= =?us-ascii?Q?5GWdUOK61bDuIe1mrhK/CgEj+kZKp4FK6Wpa5MOeVQ5sMGnMX6Hjv++T+pMz?= =?us-ascii?Q?z0k69kVFPISQfDVj0KYqr4gEg7VdDdMUwMsmn0jI9djyUOThAoUqTo7gsIjo?= =?us-ascii?Q?LVXNk6sHmAV16XEblxjpdvwUj8fWB/QAepX5u2gsNfKM79b1xObQr6JmSg9u?= =?us-ascii?Q?haAt5qyte4rtNtejhCn91gSaTE9pNkDBELdaN1j40r/2z1QL6m+QOIukXywa?= =?us-ascii?Q?Is5fEDdmSAw7vD6xPCv+guuI0jhbijx7Aby7B4mHIbRFr2OOfZdlJ0eBKnOo?= =?us-ascii?Q?BB55myodjc9JYdGGAojj2mWXhHjxnjUy8TFYLcumngUubANFOiDoh9DmUV3X?= =?us-ascii?Q?oeQezVCSqbZdUwoG15ZQEuPP6IdThW2sCNTzKucJ+hkYILvFitFoU50JJoqB?= =?us-ascii?Q?1skPfQkaxNh7eKRBHzqDHvj1r9gpk87DN6eaxIgiqnxEXkKWrAJOhOqShVaX?= =?us-ascii?Q?7FXy2RUGsSbpTp+FDdq3l4DjSwfWEi4hnINXTphrqANm5F0kVRPJ8hCGw2Gw?= =?us-ascii?Q?mdpHMHgTw6sD/4jB2p4t7p3aUKgwyFkGHAsH+F4+3Og1NTfFR4/6mhsq/jO1?= =?us-ascii?Q?LHKrZvxIZT0O5rs0taPaHKxqboOoQTZSIfzqwU/maK2pMILc6Cl7bALpv8Tj?= =?us-ascii?Q?rTV+SDwkQsEJlpxmjLeEoF5xzHw8g6X3Mub1etxCNSRPok6PvpkW3wB00bjC?= =?us-ascii?Q?EpfeyHJeuNjoNYd3P7X+8RrHQZSJGdLzyOgSA3K+EgmDogKO8KoUEcBchESq?= =?us-ascii?Q?pkRrkIMz5Y5aO5Wzg2HUoHPRkdQIIEW7UQGf+aXFgvFcEQSVKli2ZGf8Psaz?= =?us-ascii?Q?jIAnWT40fzMvV8ew56y46vaddTxbgKNfBWH87tC6Q50uMZcJ964A3tMZF6am?= =?us-ascii?Q?fnalSfv++oN5Q93eVAv70sfsCreTCQLcmfdF69mAx0lfhKsVJcxBLb/P6sW3?= =?us-ascii?Q?lSnUlf4aS48cZrsivvLeZHgMhh3eAvxcbXVKmK6wwx506Ldll2Sy2sIrtfFM?= =?us-ascii?Q?L5RqVobZx1SR0alnRhVjUWTllsMIo/MJiDXDVNqHEGMBQWSJE9QcLQFIOBfQ?= =?us-ascii?Q?2L1LMOGz3DhjxLaY+0ZqohJJj5WOOJUb4vtHabR6ZpLIud8JX4UY7ODmWz2G?= =?us-ascii?Q?JzneJBkyzRBiIVYH5kLLVfX6uZ9g9poPDyC6zyth/5hg0FT3QHw/zVy5zG9W?= =?us-ascii?Q?MD28Kjsy/zIUaD85CNgkau7F2XLb/XKBy6vN/6yXTinxleQecYhb7f0JDtG6?= =?us-ascii?Q?sDjQwVvJlSwFe61/ospZM5Ua4wfdvnjZkKcGQk0F96gq5NyvUl9HNUN7NssN?= =?us-ascii?Q?o8lbIlgapXoxhNfBVeGr3eFVYhvnoeUjqaMuznb+KeSllAB1UVFgd/roSImd?= =?us-ascii?Q?OnFKnyNjDwrKsmRYqwM+nGzhDXlp2K6VcuOAYbkEqK3VUVcxmqurN/POPrde?= =?us-ascii?Q?5+5BmXG6tIGB5JUwXC7SA3PN+i4IUjVgPwCxoKc6?= 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: 5496a503-df38-4190-b3bf-08dae2ed3560 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Dec 2022 00:49:25.6690 (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: GKpvuYQJQuxsRcYzVQlANua3bUwf3tYok9LWSvBTcstEBFhwfGgqE76j46Z2Dk1zaHZnDaw+sfvx2xlB7AuS6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5351 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 Merged via: PR - https://github.com/tianocore/edk2/pull/3806 Commit - https://github.com/tianocore/edk2/commit/ec25e904c7da70302f2725e20= 05e3762f1ae891e Best Regards, Hao Wu > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Wu, Hao > A > Sent: Monday, December 19, 2022 3:46 PM > 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 >=20 > Reviewed-by: Hao A Wu >=20 > I will make minor modification to: > * Function description comment > * Input parameter name > of XhcCheckUsbPortSpeedUsedPsic() to make the declaration (in .H) and the > definition (in .C) match. >=20 > Best Regards, > Hao Wu >=20 > > -----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 > > > > 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). > > > > An example can be found below: > > > > 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 > > > > The result is edk2 detecting USB2 devices as USB3 devices, which > > consequently causes enumeration to fail. > > > > To avoid incorrect detection, check the Compatible Port Offset to find > > the starting Port of Root Hubs that support the protocol. > > > > 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(-) > > > > 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 > > > > // > > > > if (PortSpeed > 0) { > > > > - PortStatus->PortStatus =3D XhcCheckUsbPortSpeedUsedPsic (Xhc, > > PortSpeed); > > > > + PortStatus->PortStatus =3D XhcCheckUsbPortSpeedUsedPsic (Xhc, > > PortSpeed, PortNumber); > > > > // If no match found in ext cap reg, fall back to PORTSC > > > > if (PortStatus->PortStatus =3D=3D 0) { > > > > // > > > > 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. > > > > @param ExtCapOffset The USB Major Version in xHCI Support Protoco= l > > Capability Field > > > > @param PortSpeed The Port Speed Field in USB PortSc register > > > > + @param PortNumber The Port Number (0-indexed) > > > > > > > > @return The Protocol Speed ID (PSI) from xHCI Supported Protocol > > capability register. > > > > > > > > @@ -644,12 +645,15 @@ UINT32 > > XhciPsivGetPsid ( > > > > IN USB_XHCI_INSTANCE *Xhc, > > > > IN UINT32 ExtCapOffset, > > > > - IN UINT8 PortSpeed > > > > + IN UINT8 PortSpeed, > > > > + IN UINT8 PortNumber > > > > ) > > > > { > > > > XHC_SUPPORTED_PROTOCOL_DW2 PortId; > > > > XHC_SUPPORTED_PROTOCOL_PROTOCOL_SPEED_ID Reg; > > > > UINT32 Count; > > > > + UINT32 MinPortIndex; > > > > + UINT32 MaxPortIndex; > > > > > > > > if ((Xhc =3D=3D NULL) || (ExtCapOffset =3D=3D 0xFFFFFFFF)) { > > > > return 0; > > > > @@ -663,6 +667,23 @@ XhciPsivGetPsid ( > > // > > > > PortId.Dword =3D XhcReadExtCapReg (Xhc, ExtCapOffset + > > XHC_SUPPORTED_PROTOCOL_DW2_OFFSET); > > > > > > > > + // > > > > + // According to XHCI 1.1 spec November 2017, valid values > > > > + // for CompPortOffset are 1 to CompPortCount - 1. > > > > + // > > > > + // PortNumber is zero-indexed, so subtract 1. > > > > + // > > > > + if ((PortId.Data.CompPortOffset =3D=3D 0) || (PortId.Data.CompPortCo= unt > > + =3D=3D > > 0)) { > > > > + return 0; > > > > + } > > > > + > > > > + MinPortIndex =3D PortId.Data.CompPortOffset - 1; > > > > + MaxPortIndex =3D MinPortIndex + PortId.Data.CompPortCount - 1; > > > > + > > > > + if ((PortNumber < MinPortIndex) || (PortNumber > MaxPortIndex)) { > > > > + return 0; > > > > + } > > > > + > > > > for (Count =3D 0; Count < PortId.Data.Psic; Count++) { > > > > Reg.Dword =3D XhcReadExtCapReg (Xhc, ExtCapOffset + > > XHC_SUPPORTED_PROTOCOL_PSI_OFFSET + (Count << 2)); > > > > if (Reg.Data.Psiv =3D=3D PortSpeed) { > > > > @@ -676,8 +697,9 @@ XhciPsivGetPsid ( > > /** > > > > Find PortSpeed value match case in XHCI Supported Protocol > > Capability > > > > > > > > - @param Xhc The XHCI Instance. > > > > - @param PortSpeed The Port Speed Field in USB PortSc register > > > > + @param Xhc The XHCI Instance. > > > > + @param PortSpeed The Port Speed Field in USB PortSc register > > > > + @param PortNumber The Port Number (0-indexed) > > > > > > > > @return The USB Port Speed. > > > > > > > > @@ -685,7 +707,8 @@ XhciPsivGetPsid ( > > UINT16 > > > > XhcCheckUsbPortSpeedUsedPsic ( > > > > IN USB_XHCI_INSTANCE *Xhc, > > > > - IN UINT8 PortSpeed > > > > + IN UINT8 PortSpeed, > > > > + IN UINT8 PortNumber > > > > ) > > > > { > > > > XHC_SUPPORTED_PROTOCOL_PROTOCOL_SPEED_ID SpField; > > > > @@ -703,7 +726,7 @@ XhcCheckUsbPortSpeedUsedPsic ( > > // PortSpeed definition when the Major Revision is 03h. > > > > // > > > > if (Xhc->Usb3SupOffset !=3D 0xFFFFFFFF) { > > > > - SpField.Dword =3D XhciPsivGetPsid (Xhc, Xhc->Usb3SupOffset, PortSp= eed); > > > > + SpField.Dword =3D XhciPsivGetPsid (Xhc, Xhc->Usb3SupOffset, > > + PortSpeed, > > PortNumber); > > > > if (SpField.Dword !=3D 0) { > > > > // > > > > // Found the corresponding PORTSC value in PSIV field of USB3 of= fset. > > > > @@ -717,7 +740,7 @@ XhcCheckUsbPortSpeedUsedPsic ( > > // PortSpeed definition when the Major Revision is 02h. > > > > // > > > > if ((UsbSpeedIdMap =3D=3D 0) && (Xhc->Usb2SupOffset !=3D 0xFFFFFFFF)= ) { > > > > - SpField.Dword =3D XhciPsivGetPsid (Xhc, Xhc->Usb2SupOffset, PortSp= eed); > > > > + SpField.Dword =3D XhciPsivGetPsid (Xhc, Xhc->Usb2SupOffset, > > + PortSpeed, > > PortNumber); > > > > if (SpField.Dword !=3D 0) { > > > > // > > > > // Found the corresponding PORTSC value in PSIV field of USB2 of= fset. > > > > 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 ( > > /** > > > > Find SpeedField value match with Port Speed ID value. > > > > > > > > - @param Xhc The XHCI Instance. > > > > - @param Speed The Port Speed filed in USB PortSc register > > > > + @param Xhc The XHCI Instance. > > > > + @param Speed The Port Speed filed in USB PortSc register > > > > + @param PortNumber The Port Number (0-indexed) > > > > > > > > @return The USB Port Speed. > > > > > > > > @@ -632,7 +633,8 @@ XhcGetSupportedProtocolCapabilityAddr ( > > UINT16 > > > > XhcCheckUsbPortSpeedUsedPsic ( > > > > IN USB_XHCI_INSTANCE *Xhc, > > > > - IN UINT8 Speed > > > > + IN UINT8 Speed, > > > > + IN UINT8 PortNumber > > > > ); > > > > > > > > #endif > > > > -- > > 2.37.2 > > > > > > > > -=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 >=20 >=20 >=20 >=20