From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.88]) by mx.groups.io with SMTP id smtpd.web10.35853.1670820762188014933 for ; Sun, 11 Dec 2022 20:52:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=PHXGrq7w; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.94.88, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cLYtAGzRErOYc5U7HntNYreVJJTakj2i63KVuBe7jT37y9qwmX9dJ6n611BpzdhHb/+ZCFDZ4KIEDrK6Wv03/WUwbngyPR8ug9xISk9F212uvybQp8jzEg9Gbx2LOYx2yNVEc4eG+0DfwIHJb5MIQdEl1/y5eY04qNA4fIxZYBL/5pPo9RGomdLkY+340Tn6QPBbSI7XwP4TzdQyuzSk4FZo7UYH4AAURhKIKlIYCBqaaYvbBdfpKmdjc/z/W4P5f17qNKvp2Z1y6vOYqSBJNrXddWaMtP/4voOfTWvM9BR3/4KPaAm2GmFbi9oqZxWXbov7qKfjYQU0+pjwwzx0kw== 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=Kx3r7QSvg37BAL4UxmIAJ5beZnSjNoMeY6AOI7Yo9nc=; b=lKJQEAL8AlJBZX+wwRvhAekiNAEmXFMKMysUvfuyJDIzCwCullZfmB1jRw5tz/+d+7zQclpxvHAnoc0ftWqgpRQJHG/SoJhkAuEYl26Gzmogb9SAkq64zbg+JhAS/DsRyKQdHg48Rk6UxomA3n1yifFGtvadnzlx5pZdMpsb41AtPKc/X+Wpuwe0WjXB14L3F3z8DGRcHBhd3LQo/zPpMPhz3Og/WTQnSwzPpPQxRNFYXTE9RNtW+lVObedIovToZeJmL/bh1JmYroy0zPpoGyy+9uGejCh2o56gFleaxmPDRIQOMMJKbWw4g+qW3D9qZvefp8qM06W3NQHD6m+X2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Kx3r7QSvg37BAL4UxmIAJ5beZnSjNoMeY6AOI7Yo9nc=; b=PHXGrq7wY8uim6HEjzELJqKOiYabDWtb23wklZ2TieaEWQZ9WJk8KCDXfJl8rEKA9ocjwNC0nhW0HMZgW72vJL4JkzbLjrTdXycSCkhHhhJhtBgnK3Z8D3tY5j64krW41tJxD9JhU0fTwx4/dO3g5mn5QSTij3CbJqGsvn0JJkc= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by MN2PR12MB4502.namprd12.prod.outlook.com (2603:10b6:208:263::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 04:52:39 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::ce0a:283e:839:34bd]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::ce0a:283e:839:34bd%3]) with mapi id 15.20.5880.019; Mon, 12 Dec 2022 04:52:39 +0000 From: "Chang, Abner" To: "Simon Wang (SW-GPU)" , "devel@edk2.groups.io" CC: Nickle Wang , Nick Ramirez , Igor Miroshnichenko Subject: Re: [edk2-staging][PATCH] edk2-staging/RedfishClientPkg: Add Redfish.Settings support Thread-Topic: [edk2-staging][PATCH] edk2-staging/RedfishClientPkg: Add Redfish.Settings support Thread-Index: AQHZC5hDy2iR9gZTWU2Xlf3X5ss1J65lGa/AgASCPSA= Date: Mon, 12 Dec 2022 04:52:39 +0000 Message-ID: References: <20221209063413.31912-1-simowang@nvidia.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2022-12-12T04:52:36Z; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=75da4721-642e-4404-90a0-10ba1263c989; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|MN2PR12MB4502:EE_ x-ms-office365-filtering-correlation-id: 6d69cef1-618c-4847-c59a-08dadbfcb218 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 01UwHZ/s2nXHC5QnIKkSB3Rv8H37u2BwlkRkth/k8OaLCU+7h0wbDuj98o3/nh+f6RyBXkCxTHDrB8+OOYKqeW2Fepvmm3Zi/RfpeYz/E349ZkJhYRnKhfJUe3sBXnxFm+UKFapPPihSsSURf0BcXnVcZYhMqJ3vzm98XR27rVeK7GM2hqg6iIwGWq86Cw2ofyGiZwv4ewWWTiar64usgcuflR27TV5impaa6oyobNXNnFF5XSXe6OCBwmZlXHj9ZJA7XFCRlwVe1/mKVX4jonlIfj0e0juDtfEQJMjrX6KmQW56Jzsesmx7nVJnl/AXqTL2kxGKM9lEUA/CTES2lDXfoLMWtTz5Ahy2gGY4giiWLnhUs4j8dTor3lQ+mQEeriVJejn84bV3QQ4UySlSfde89XEinvVQXCfhWN1Sk4/DztdUI7xDMzg6Oto8uNw5sLTA2LePcKGazlRaoXxPnCEiWBpxZmwtzjqo4lxtkNTuZIL6MtTrjE/49hIjZw4TiSiNzK+aQo6IJycL3A69pDcasLdfVgGm+DUM0liqk0RfvfIyRSsz1j3nGN8uws4aoke5GFKt4gmljA55UTPHGby1wmy7abqaJtDd7UOBDzhCPi5nIX9jsrZ1Y89Z7ibMjL4CZKoiRuwl+mVYeQrn4z1ypci+F9WshvYvac+KnG3ESSy5dQPC+lgBAiSDYm/BfOoMtEKBv9gJCFR8hhwCfg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB3966.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(396003)(136003)(366004)(376002)(39860400002)(451199015)(30864003)(2906002)(110136005)(19627235002)(8936002)(54906003)(316002)(5660300002)(52536014)(66946007)(8676002)(64756008)(66476007)(4326008)(66446008)(66556008)(76116006)(41300700001)(33656002)(186003)(478600001)(6506007)(71200400001)(9686003)(86362001)(53546011)(7696005)(38100700002)(26005)(83380400001)(55016003)(122000001)(38070700005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?C2Aqp7wdF3tfW9ULYlD2SnZy6kEpteV4nU21sWgOur3W+leCO0FBQ6QK2Xhw?= =?us-ascii?Q?uRlcZS76lGjjxH1HG6XEtnxKxUXuzxsyoCqpk9B9yiy8J0SUtQbv37rA5d88?= =?us-ascii?Q?PsNUxvL43TPNdy5aARLQsj4fBDR+LSVy/ul3ItqQB6sRCbrUyqYs+sM4+zEo?= =?us-ascii?Q?M4/d8tOgbI9eIN9XFi1pmXkKxZVOx5YOfXnHenAYmDg/rL3kJm54gtf/Uy3l?= =?us-ascii?Q?YpsKfQ8qfEuOCaD6+nhLDkgHIcW2+/8vzQumYENIhDKpc2v2mQpyZWDWyOtx?= =?us-ascii?Q?feEQBCkM378i4WJLRlHTFStDnMOMQ3BSY9ul9D6xgDnsRTD5ch78vGeyyQhG?= =?us-ascii?Q?ugcDTzb0VvnnXWxLmCHLYOppPgMK+AAsJmkHkpbkQY0dJMxqQns2DavHvF9Y?= =?us-ascii?Q?lbdMiOTTzOaYoFeWiHIy+wQt/RMLH2fh+G1MlX1MzksdiSFdy6gWA5j87QC/?= =?us-ascii?Q?4Au0sXgGbdcXw866FLDtwliM+ISm7F9T9K+/CvOKEXkdKeJMo6FIaL9T7VSB?= =?us-ascii?Q?c/Tv0IOqXVp8v+CTbKZFBEXutAjjwMxxhw4azWT7UZ34iHDnijYho3svfHuL?= =?us-ascii?Q?9AKiDojeeslPF5MaV5ItH2ILCOeqD9wF095elTAlctKsnnPe/9Pt7dr9K23J?= =?us-ascii?Q?wlZPu7zzVaFQvydcZR/giJMdqNS4OklCMFyg7elUNOglJKGURi5ETEzWS0aU?= =?us-ascii?Q?X/Ywc+AR3BN6QZLgk84S5v+gPY3JAoy9BG6cd+5Ms8yQuIG28GfoTEN/jjvV?= =?us-ascii?Q?C+vfg7+EQDEL/eUYjuTmk1KpfBHbIee6Srk4sYA9g15OmFEM9HKNestS7jl6?= =?us-ascii?Q?LF6c62OpzKZaWEwhA0KL70/5hJYyaz5YvOD6FRTDQqogQSNIurcpNVbUDP6n?= =?us-ascii?Q?7PbhDTlLrt2TYGOrB1ZgY1Yq9GjOebMfjYV8PInR9YxIV+YaMbm7dwTucJ5C?= =?us-ascii?Q?K433Pm2pmZ4VEPGsNKJKUNKPklbpWUBQnnSODDk9SVRAmSEzaxsal2E15TPL?= =?us-ascii?Q?DcXEgYFuzq7IKMHWEIaJWhefKMVuegcQfdUZqLrzeX4arPaUbtMAyz5DYpAQ?= =?us-ascii?Q?cXAWuMbAInM4nmwcwU+UqnPxBrsEJly+g0/aU+Zui7GWlXNiX/RSsdksMpyR?= =?us-ascii?Q?9+ihzo/efAKDcx2W90ZdoSrRl1ZaRDiny82/bCB3AZOqKgsYNgHOdM0pMnRe?= =?us-ascii?Q?7AaFcThPQxitcgi4FpmqTMu4duoWcsQYizcIDxhWjQzWGH901AJkz3bhw6dH?= =?us-ascii?Q?yZEUV4zrVDQQDxvoc2VYXZ0Yx9kg1z1vGW4pfpfs+FQ78f+E2gZCQ4ZZtvOk?= =?us-ascii?Q?OzIpH0xVbrpCZ4ACXNtmuYxDMZGYacE3QJ8p3wP8Tqd+zGCNmpCLlwb86x4I?= =?us-ascii?Q?oEsJ9ZncyGG0poAmVuWkdazQufH4ZuAoLg9663o0yfA3Mf02JRB8+WMkPNCw?= =?us-ascii?Q?/cLi6/gptoIFiYcqtrlEaaWYsvbPZpbJNVqbSIoNdmo/1y4xfYNE1AD/bi7K?= =?us-ascii?Q?dFc47H8v3oH8jS/fFhKLI38kzcLv2tVs0ZYyJ7AUeNO1uld8Ra4FZFNhgceQ?= =?us-ascii?Q?Eoazo/jLYGOZUOZcbwkhu1/bUN1PsspNBhtPuoCQ?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d69cef1-618c-4847-c59a-08dadbfcb218 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Dec 2022 04:52:39.2243 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: DPGDCRSUlqMUcUjLXF1hhohUbKeEKvV0wWfqjaXAiz9ZSjTJMpSucH0b/SyZsim8+dwxbzf/yzG7cBDJHIgCsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4502 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] Hi Simon, comments in line. > -----Original Message----- > From: Simon Wang (SW-GPU) > Sent: Friday, December 9, 2022 2:40 PM > To: devel@edk2.groups.io > Cc: Nickle Wang ; Nick Ramirez > ; Chang, Abner ; Igor > Miroshnichenko > Subject: [edk2-staging][PATCH] edk2-staging/RedfishClientPkg: Add > Redfish.Settings support >=20 > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. >=20 >=20 > BIOS feature driver cannot recognize "@Redfish.Settings", decode it and g= et > pending setting URI. So BIOS feature driver can consume pending setting > from correct place. >=20 > Signed-off-by: Simon Wang > Cc: Nickle Wang > Cc: Abner Chang > Cc: Igor Kulchytskyy > Cc: Nick Ramirez > --- > .../Features/Bios/v1_0_9/Dxe/BiosDxe.c | 214 +++++++++++------- > 1 file changed, 130 insertions(+), 84 deletions(-) >=20 > diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > index a478061cde..5e3820fa96 100644 > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > @@ -2,6 +2,7 @@ > Redfish feature driver implementation - Bios >=20 > (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> + Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. >=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -9,15 +10,15 @@ >=20 > #include "../Common/BiosCommon.h" >=20 > -extern REDFISH_RESOURCE_COMMON_PRIVATE > *mRedfishResourcePrivate; > +extern REDFISH_RESOURCE_COMMON_PRIVATE > *mRedfishResourcePrivate; Just a note here, move extern declaration to header file when autogen the f= eature driver. This is compliant with edk2 C coding standard section 5.4.2.= 1. >=20 > EFI_STATUS > HandleResource ( > - IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > - IN EFI_STRING Uri > + IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > + IN EFI_STRING Uri > ); >=20 > -EFI_HANDLE medfishResourceConfigProtocolHandle; > +EFI_HANDLE medfishResourceConfigProtocolHandle; >=20 > /** > Provising redfish resource by given URI. > @@ -33,16 +34,16 @@ EFI_HANDLE medfishResourceConfigProtocolHandle; > **/ > EFI_STATUS > RedfishResourceProvisioningResource ( > - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > - IN EFI_STRING Uri, > - IN BOOLEAN PostMode > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN EFI_STRING Uri, > + IN BOOLEAN PostMode > ) > { > - REDFISH_RESOURCE_COMMON_PRIVATE *Private; > - EFI_STATUS Status; > - REDFISH_RESPONSE Response; > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + EFI_STATUS Status; > + REDFISH_RESPONSE Response; >=20 > - if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) { > + if ((This =3D=3D NULL) || IS_EMPTY_STRING (Uri)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -60,7 +61,7 @@ RedfishResourceProvisioningResource ( > return Status; > } >=20 > - Private->Uri =3D Uri; > + Private->Uri =3D Uri; > Private->Payload =3D Response.Payload; > ASSERT (Private->Payload !=3D NULL); >=20 > @@ -94,16 +95,22 @@ RedfishResourceProvisioningResource ( **/ > EFI_STATUS RedfishResourceConsumeResource ( > - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > - IN EFI_STRING Uri > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN EFI_STRING Uri > ) > { > - REDFISH_RESOURCE_COMMON_PRIVATE *Private; > - EFI_STATUS Status; > - REDFISH_RESPONSE Response; > - CHAR8 *Etag; > - > - if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) { > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + EFI_STATUS Status; > + REDFISH_RESPONSE Response; > + REDFISH_RESPONSE *ExpectedResponse; > + REDFISH_RESPONSE RedfishSettingsResponse; > + CHAR8 *Etag; > + UINTN Index; > + EDKII_JSON_VALUE JsonValue; > + EFI_STRING RedfishSettingsUri; > + CONST CHAR8 *RedfishSettingsUriKeys[] =3D > { "@Redfish.Settings", "SettingsObject", "@odata.id" }; > + > + if ((This =3D=3D NULL) || IS_EMPTY_STRING (Uri)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -119,7 +126,37 @@ RedfishResourceConsumeResource ( > return Status; > } >=20 > - Private->Uri =3D Uri; > + ExpectedResponse =3D &Response; > + RedfishSettingsUri =3D NULL; > + JsonValue =3D RedfishJsonInPayload (Response.Payload); > + > + // > + // Seeking RedfishSettings URI link. > + // > + for (Index =3D 0; Index < ARRAY_SIZE (RedfishSettingsUriKeys); Index++= ) { > + if (JsonValue =3D=3D NULL) { > + break; > + } > + > + JsonValue =3D JsonObjectGetValue (JsonValueGetObject (JsonValue), > + RedfishSettingsUriKeys[Index]); } > + > + if (JsonValue !=3D NULL) { > + // > + // Verify RedfishSettings URI link is valid to retrieve resource or = not. > + // > + RedfishSettingsUri =3D JsonValueGetUnicodeString (JsonValue); > + > + Status =3D GetResourceByUri (Private->RedfishService, RedfishSetting= sUri, > &RedfishSettingsResponse); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", > __FUNCTION__, RedfishSettingsUri)); Can we have a more clear debug message, something like "@Redfish.Settings exists, however to get resource from %s failed.\n" Thanks Abner > + } else { > + Uri =3D RedfishSettingsUri; > + ExpectedResponse =3D &RedfishSettingsResponse; > + } > + } > + > + Private->Uri =3D Uri; > Private->Payload =3D Response.Payload; > ASSERT (Private->Payload !=3D NULL); >=20 > @@ -129,7 +166,7 @@ RedfishResourceConsumeResource ( > // > // Find etag in HTTP response header > // > - Etag =3D NULL; > + Etag =3D NULL; > Status =3D GetEtagAndLocation (&Response, &Etag, NULL); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, failed to get ETag from HTTP header\n", > __FUNCTION__)); @@ -153,13 +190,23 @@ > RedfishResourceConsumeResource ( > // Release resource > // > if (Private->Payload !=3D NULL) { > - RedfishFreeResponse ( > - Response.StatusCode, > - Response.HeaderCount, > - Response.Headers, > - Response.Payload > - ); > - Private->Payload =3D NULL; > + if (Response.Payload !=3D NULL) { > + RedfishFreeResponse ( > + Response.StatusCode, > + Response.HeaderCount, > + Response.Headers, > + Response.Payload > + ); > + } > + > + if (RedfishSettingsResponse.Payload !=3D NULL) { > + RedfishFreeResponse ( > + RedfishSettingsResponse.StatusCode, > + RedfishSettingsResponse.HeaderCount, > + RedfishSettingsResponse.Headers, > + RedfishSettingsResponse.Payload > + ); > + } > } >=20 > if (Private->Json !=3D NULL) { > @@ -185,13 +232,13 @@ RedfishResourceConsumeResource ( **/ > EFI_STATUS RedfishResourceGetInfo ( > - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > OUT REDFISH_SCHEMA_INFO *Info > ) > { > - REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; >=20 > - if (This =3D=3D NULL || Info =3D=3D NULL) { > + if ((This =3D=3D NULL) || (Info =3D=3D NULL)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -217,15 +264,15 @@ RedfishResourceGetInfo ( **/ EFI_STATUS > RedfishResourceUpdate ( > - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > - IN EFI_STRING Uri > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN EFI_STRING Uri > ) > { > - REDFISH_RESOURCE_COMMON_PRIVATE *Private; > - EFI_STATUS Status; > - REDFISH_RESPONSE Response; > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + EFI_STATUS Status; > + REDFISH_RESPONSE Response; >=20 > - if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) { > + if ((This =3D=3D NULL) || IS_EMPTY_STRING (Uri)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -241,7 +288,7 @@ RedfishResourceUpdate ( > return Status; > } >=20 > - Private->Uri =3D Uri; > + Private->Uri =3D Uri; > Private->Payload =3D Response.Payload; > ASSERT (Private->Payload !=3D NULL); >=20 > @@ -286,15 +333,15 @@ RedfishResourceUpdate ( **/ EFI_STATUS > RedfishResourceCheck ( > - IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > - IN EFI_STRING Uri > + IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > + IN EFI_STRING Uri > ) > { > - REDFISH_RESOURCE_COMMON_PRIVATE *Private; > - EFI_STATUS Status; > - REDFISH_RESPONSE Response; > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + EFI_STATUS Status; > + REDFISH_RESPONSE Response; >=20 > - if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) { > + if ((This =3D=3D NULL) || IS_EMPTY_STRING (Uri)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -310,7 +357,7 @@ RedfishResourceCheck ( > return Status; > } >=20 > - Private->Uri =3D Uri; > + Private->Uri =3D Uri; > Private->Payload =3D Response.Payload; > ASSERT (Private->Payload !=3D NULL); >=20 > @@ -354,18 +401,17 @@ RedfishResourceCheck ( > @retval Others Some error happened. >=20 > **/ > - > EFI_STATUS > RedfishResourceIdentify ( > IN EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *This, > IN EFI_STRING Uri > ) > { > - REDFISH_RESOURCE_COMMON_PRIVATE *Private; > - EFI_STATUS Status; > - REDFISH_RESPONSE Response; > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + EFI_STATUS Status; > + REDFISH_RESPONSE Response; >=20 > - if (This =3D=3D NULL || IS_EMPTY_STRING (Uri)) { > + if ((This =3D=3D NULL) || IS_EMPTY_STRING (Uri)) { > return EFI_INVALID_PARAMETER; > } >=20 > @@ -381,7 +427,7 @@ RedfishResourceIdentify ( > return Status; > } >=20 > - Private->Uri =3D Uri; > + Private->Uri =3D Uri; > Private->Payload =3D Response.Payload; > ASSERT (Private->Payload !=3D NULL); >=20 > @@ -392,6 +438,7 @@ RedfishResourceIdentify ( > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, identify %s failed: %r\n", __FUNCTION__, > Uri, Status)); > } > + > // > // Release resource > // > @@ -413,7 +460,7 @@ RedfishResourceIdentify ( > return Status; > } >=20 > -EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL mRedfishResourceConfig =3D > { > +EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL mRedfishResourceConfig > =3D { > RedfishResourceProvisioningResource, > RedfishResourceConsumeResource, > RedfishResourceUpdate, > @@ -441,10 +488,10 @@ EFI_STATUS > EFIAPI > RedfishResourceInit ( > IN EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL *This, > - IN REDFISH_CONFIG_SERVICE_INFORMATION *RedfishConfigServiceInfo > + IN REDFISH_CONFIG_SERVICE_INFORMATION > *RedfishConfigServiceInfo > ) > { > - REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; >=20 > Private =3D > REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_CONFIG_PROTOCO > L (This); >=20 > @@ -468,10 +515,10 @@ RedfishResourceInit ( EFI_STATUS EFIAPI > RedfishResourceStop ( > - IN EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL *This > + IN EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL *This > ) > { > - REDFISH_RESOURCE_COMMON_PRIVATE *Private; > + REDFISH_RESOURCE_COMMON_PRIVATE *Private; >=20 > Private =3D > REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_CONFIG_PROTOCO > L (This); >=20 > @@ -493,7 +540,7 @@ RedfishResourceStop ( > return EFI_SUCCESS; > } >=20 > -EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL mRedfishConfigHandler =3D { > +EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL mRedfishConfigHandler =3D { > RedfishResourceInit, > RedfishResourceStop > }; > @@ -506,10 +553,9 @@ EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL > mRedfishConfigHandler =3D { **/ VOID EFIAPI - > EfiRestJasonStructureProtocolIsReady > - ( > - IN EFI_EVENT Event, > - IN VOID *Context > +EfiRestJasonStructureProtocolIsReady ( > + IN EFI_EVENT Event, > + IN VOID *Context > ) > { > EFI_STATUS Status; > @@ -523,10 +569,10 @@ EfiRestJasonStructureProtocolIsReady > } >=20 > Status =3D gBS->LocateProtocol ( > - &gEfiRestJsonStructureProtocolGuid, > - NULL, > - (VOID **)&mRedfishResourcePrivate->JsonStructProtocol > - ); > + &gEfiRestJsonStructureProtocolGuid, > + NULL, > + (VOID **)&mRedfishResourcePrivate->JsonStructProtocol > + ); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, failed to locate > gEfiRestJsonStructureProtocolGuid: %r\n", __FUNCTION__, Status)); > } > @@ -550,7 +596,7 @@ RedfishResourceUnload ( > ) > { > EFI_STATUS Status; > - EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL *ConfigHandler; > + EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL *ConfigHandler; >=20 > if (mRedfishResourcePrivate =3D=3D NULL) { > return EFI_NOT_READY; > @@ -564,12 +610,12 @@ RedfishResourceUnload ( > Status =3D gBS->OpenProtocol ( > ImageHandle, > &gEdkIIRedfishConfigHandlerProtocolGuid, > - (VOID **) &ConfigHandler, > + (VOID **)&ConfigHandler, > NULL, > NULL, > EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL > ); > - if (EFI_ERROR (Status) || ConfigHandler =3D=3D NULL) { > + if (EFI_ERROR (Status) || (ConfigHandler =3D=3D NULL)) { > return Status; > } >=20 > @@ -612,10 +658,10 @@ RedfishResourceUnload ( EFI_STATUS EFIAPI > RedfishExternalResourceResourceFeatureCallback ( > - IN EDKII_REDFISH_FEATURE_PROTOCOL *This, > - IN FEATURE_CALLBACK_ACTION FeatureAction, > - IN VOID *Context, > - IN OUT RESOURCE_INFORMATION_EXCHANGE *InformationExchange > + IN EDKII_REDFISH_FEATURE_PROTOCOL *This, > + IN FEATURE_CALLBACK_ACTION FeatureAction, > + IN VOID *Context, > + IN OUT RESOURCE_INFORMATION_EXCHANGE *InformationExchange > ) > { > EFI_STATUS Status; > @@ -647,11 +693,12 @@ RedfishExternalResourceResourceFeatureCallback ( > // > // Create the full URI from Redfish service root. > // > - ResourceUri =3D (EFI_STRING)AllocateZeroPool (MAX_URI_LENGTH * > sizeof(CHAR16)); > + ResourceUri =3D (EFI_STRING)AllocateZeroPool (MAX_URI_LENGTH * sizeof > + (CHAR16)); > if (ResourceUri =3D=3D NULL) { > DEBUG ((DEBUG_ERROR, "%a, Fail to allocate memory for full URI.\n", > __FUNCTION__)); > return EFI_OUT_OF_RESOURCES; > } > + > StrCatS (ResourceUri, MAX_URI_LENGTH, Private->RedfishVersion); > StrCatS (ResourceUri, MAX_URI_LENGTH, InformationExchange- > >SendInformation.FullUri); >=20 > @@ -681,10 +728,9 @@ RedfishExternalResourceResourceFeatureCallback > ( **/ VOID EFIAPI -EdkIIRedfishFeatureProtocolIsReady > - ( > - IN EFI_EVENT Event, > - IN VOID *Context > +EdkIIRedfishFeatureProtocolIsReady ( > + IN EFI_EVENT Event, > + IN VOID *Context > ) > { > EFI_STATUS Status; > @@ -699,10 +745,10 @@ EdkIIRedfishFeatureProtocolIsReady > } >=20 > Status =3D gBS->LocateProtocol ( > - &gEdkIIRedfishFeatureProtocolGuid, > - NULL, > - (VOID **)&FeatureProtocol > - ); > + &gEdkIIRedfishFeatureProtocolGuid, > + NULL, > + (VOID **)&FeatureProtocol > + ); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, failed to locate > gEdkIIRedfishFeatureProtocolGuid: %r\n", __FUNCTION__, Status)); > gBS->CloseEvent (Event); > @@ -744,8 +790,8 @@ RedfishResourceEntryPoint ( > IN EFI_SYSTEM_TABLE *SystemTable > ) > { > - EFI_STATUS Status; > - VOID *Registration; > + EFI_STATUS Status; > + VOID *Registration; >=20 > if (mRedfishResourcePrivate !=3D NULL) { > return EFI_ALREADY_STARTED; > -- > 2.17.1