From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.73]) by mx.groups.io with SMTP id smtpd.web11.2107.1592418142259904835 for ; Wed, 17 Jun 2020 11:22:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=NV7jcTpg; spf=pass (domain: arm.com, ip: 40.107.21.73, mailfrom: samer.el-haj-mahmoud@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s4VbHGghqM/OcVIqedEUGPn1wQ9Dy7Hrse42s7sg658=; b=NV7jcTpg519xHKiFzlSgA5FuPNMssEQuJ1JvJ+asNZtDOOapOq2dkHm3gsbu+FGAMATGp29t8P6pD93im5YCCn0oTRC2Me3wuQUbD0kGWDulBJpiwkUSS4wtsYzgQqGDZdjnuQx0AxG0qAoLoWD5PDEst4J+slnREgg7fxNHG+8= Received: from DB6PR0301CA0046.eurprd03.prod.outlook.com (2603:10a6:4:54::14) by VI1PR08MB5501.eurprd08.prod.outlook.com (2603:10a6:803:138::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Wed, 17 Jun 2020 18:22:19 +0000 Received: from DB5EUR03FT060.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:54:cafe::27) by DB6PR0301CA0046.outlook.office365.com (2603:10a6:4:54::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.21 via Frontend Transport; Wed, 17 Jun 2020 18:22:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT060.mail.protection.outlook.com (10.152.21.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Wed, 17 Jun 2020 18:22:19 +0000 Received: ("Tessian outbound cdc313860a50:v59"); Wed, 17 Jun 2020 18:22:19 +0000 X-CR-MTA-TID: 64aa7808 Received: from ab9cdd636b90.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D8249091-85DD-4211-B04C-7B260B05DAF4.1; Wed, 17 Jun 2020 18:22:14 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ab9cdd636b90.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 17 Jun 2020 18:22:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QsAEjG0MbGdoTTWrEBdf6BMz5qvIBNVICZSawte1T7ssdL7Aob0CxNNvRwqKrggfICW3RGEG/XPrJJ03AuPjgAaZFEy4y+akgxh8PNOu0NQhNmXtumYrk64K7H9iGaGlKu7pE8VeKlhsK18lLNzC8eIHK3Vl0B90oeGKzfMmz/sRDBLMQqn6Xfbv7gEvS3EWH4aWYvj3kXkR3mGVhnxP23XSADz2Cz7W2RB8iGiX2fS75RDOvhye3xdqGbgRvmDWxU3DWd9C8xJMsQPoX4vqdWa20TC+QNIb3JTPjW7A1RZuh7ZbHT0KzYslsjpG76laQwLYqoXUPUWkJBwUxhIKLw== 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-SenderADCheck; bh=s4VbHGghqM/OcVIqedEUGPn1wQ9Dy7Hrse42s7sg658=; b=hQzdzm0ARI3BMoeUo2SZSXLQ8ZvOxTydwQ6kdTcZV6zF2t5UJ6WtBrxV101DwhlaHEbXk5ValAUNuYzb0TbypiiGWkqkrS8GF6LbXXhTACJm0vpownMUXUIKNDKoSrG7fgsohvrwV4yT7Nfl6dhwTv+Iu+AiSOdPdYhiTbOj2696B4EN+/7pAD4ORl2/2R5yiV9jDiwvDynhcH+c9AQFL6PVe50DRxHd5VolpJyH1+9Sk9NBDP/ZZTw/qBy/Dj6P0sTKspItUeKqozV++eSEZ3lUkhdAvPFB/rlJIjrqYFWPMsawBJf4aBfHhcczJ2Jnfw6NcRZFNsKBpGZs0ivnuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s4VbHGghqM/OcVIqedEUGPn1wQ9Dy7Hrse42s7sg658=; b=NV7jcTpg519xHKiFzlSgA5FuPNMssEQuJ1JvJ+asNZtDOOapOq2dkHm3gsbu+FGAMATGp29t8P6pD93im5YCCn0oTRC2Me3wuQUbD0kGWDulBJpiwkUSS4wtsYzgQqGDZdjnuQx0AxG0qAoLoWD5PDEst4J+slnREgg7fxNHG+8= Received: from DB7PR08MB3260.eurprd08.prod.outlook.com (2603:10a6:5:21::23) by DB7PR08MB2955.eurprd08.prod.outlook.com (2603:10a6:5:17::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.24; Wed, 17 Jun 2020 18:22:12 +0000 Received: from DB7PR08MB3260.eurprd08.prod.outlook.com ([fe80::88ec:d703:3e32:4c6b]) by DB7PR08MB3260.eurprd08.prod.outlook.com ([fe80::88ec:d703:3e32:4c6b%5]) with mapi id 15.20.3109.021; Wed, 17 Jun 2020 18:22:12 +0000 From: "Samer El-Haj-Mahmoud" To: Ard Biesheuvel , "devel@edk2.groups.io" CC: Ard Biesheuvel , Pete Batard , "Andrei Warkentin (awarkentin@vmware.com)" , Samer El-Haj-Mahmoud Subject: Re: [PATCH edk2-platforms v2] Silicon/Broadcom/BcmGenetDxe: implement media state adapter info protocol Thread-Topic: [PATCH edk2-platforms v2] Silicon/Broadcom/BcmGenetDxe: implement media state adapter info protocol Thread-Index: AQHWRNNB86ek0132okOermxel1bttqjdHoAw Date: Wed, 17 Jun 2020 18:22:11 +0000 Message-ID: References: <20200617181501.1184090-1-ard.biesheuvel@arm.com> In-Reply-To: <20200617181501.1184090-1-ard.biesheuvel@arm.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: c5b9822d-fdac-469d-88b3-2ebea9662765.1 x-checkrecipientchecked: true Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [99.132.126.10] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a00017b6-d48f-45d1-6a7a-08d812eb5f01 x-ms-traffictypediagnostic: DB7PR08MB2955:|VI1PR08MB5501: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:7691;OLM:10000; x-forefront-prvs: 04371797A5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 6sRzSf1h/Z3F7hqzO43X38irunxFY9jFAZBD1xlNUjVkx5mj65ExQpELevqSP5ZyothZWIFZDa2nRIgp+c6lHrjkWjqjgNSNsStJFHN2P/Qy8xEz3iX84+uAFjvVyM0nCgDU/wZ8V/9GyF59DEbt3SWpIMvdG8XiXxZ1J/zH7u3hsCXyeBZCVJjYRZ8MgWqGOfhLQal5FAPNJ0F4zROq1BVaPtcRuoBA/T+YX+TNuOBEfHcw1tgtfugST3O23CmxmEBmqCjqDWvMYXCIvONlQkWJoNzu1AjIuzWYTDw++jezXU+XKH+APauDVHHWXUyD5VcjYxI+LLZ1T5Obk3D1r7zIF70ngfosUoHzm1FY4JWRTNjFO6iy2UN71YCyV2x3 X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR08MB3260.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(39860400002)(366004)(136003)(396003)(346002)(376002)(86362001)(2906002)(54906003)(186003)(26005)(33656002)(4326008)(71200400001)(52536014)(5660300002)(55016002)(478600001)(8936002)(9686003)(53546011)(6506007)(8676002)(66446008)(66556008)(66476007)(64756008)(76116006)(66946007)(83380400001)(110136005)(316002)(7696005)(44824005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: IOBtJ08yoR/1Eg4M8g65hATjzzSo71wZONcLh4Y9RHmfp1MFizGlSb/HZHZ3qJwBXHBOfGaGnaiHkeGf2LQIP2zv/dQUcyMbLdXvNrETDt23xxyeJb9SoR6OmUE43o4ZIi/PL7eGhN3vsGE0L6axa5x68en/CFCozMjedYlCB5qxum+purZ7KGeCZcUIFYdcWa3UOroPXPccaBH1/qqa4EJ6hdiv0yVN/oAE59x+8wwEkJIr4TbqqwPrh4Fq/myqkKnFXsu7FBaQbfCct1vQ2HifRelOu1fTJTIIBr3wOmRZ8BN0w+GfuFMdEn1MtfsZJhY20AJ67pgJR8zF23uvI2TH6LW4B2ouKYkLWVCsoYSsncqPqhnSkOzjdrJFaINKghYVONVi8QkYXdbMMwdOpZTvaeDbJsFN9mKsaCHghnxLD79oh/Etp4m9t7Ebn7CCwbjWwnhJtN+ti6vIP1e72FblBzWqNNhy2DPPCMRDc5rt1IKjgW+Yfxhw5Jrqz9xJ MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB2955 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Return-Path: Samer.El-Haj-Mahmoud@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT060.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFTY:;SFS:(4636009)(396003)(346002)(136003)(376002)(39860400002)(46966005)(53546011)(6506007)(5660300002)(52536014)(26005)(336012)(83380400001)(2906002)(478600001)(316002)(86362001)(33656002)(8936002)(47076004)(81166007)(8676002)(82740400003)(7696005)(186003)(82310400002)(4326008)(70586007)(70206006)(356005)(110136005)(54906003)(55016002)(9686003)(44824005);DIR:OUT;SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 05c2eaa5-2c86-474e-585a-08d812eb5ab5 X-Forefront-PRVS: 04371797A5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 65iItvMPmPgf7hW0CBlYRD8ngfoacX1MJVyHByCGmxW2p17YNe6OMGPBpd/8wTYB8J/TR8aT3+X80T06SB7zjV04RMWivBEDG5izxen3pfTEAZagO0lUQeEYLN/292NZyNAcP8hf7KX0ZQ/Yoajmtxex8VGgT7SyRLYAJof/HO0RzJMpHMjBeV7HKtil2LC3grtg1yqPJheXGpXxFZUYUSidl9ctQvgPXN6w/jI1iPAFwgqgHBh2oAkxT/zqvZd0T4YkBNIYiu6TiLLa2ZOTDdCBzNY1hDgrUVKKwYfhF64MB3+PhIf+vUUc0E8YOugnh1tqbuNGV4QmlFTvQLjLXfbZ5xEzM5o8XM52BUnYCTR2bvmd6C+SmsqDHgNGxffjRI1uPuawxkpYOqPBWw/04AXXHOaGBXqVL7SGZNKJKJ0= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2020 18:22:19.3388 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a00017b6-d48f-45d1-6a7a-08d812eb5f01 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5501 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Tested on RPi4 w/ 4GB Reviewed-by: Samer El-Haj-Mahmoud > -----Original Message----- > From: Ard Biesheuvel > Sent: Wednesday, June 17, 2020 2:15 PM > To: devel@edk2.groups.io > Cc: Ard Biesheuvel ; Pete Batard > ; Andrei Warkentin (awarkentin@vmware.com) > ; Samer El-Haj-Mahmoud Mahmoud@arm.com> > Subject: [PATCH edk2-platforms v2] Silicon/Broadcom/BcmGenetDxe: > implement media state adapter info protocol > > NetLibDetectMedia () in DxeNetLib is used as a fallback on implementation= s > of the SNP protocol that do not also carry an implementation of the adapt= er > info protocol to provide media state information, and it does all kinds o= f > terrible things to the network interface (stopping and restarting multipl= e > times, reprogramming the multicast filters etc etc) to workaround some > alleged UNDI shortcoming. > > Although our GENET code should be bullet proof and therefore able to take > this kind of abuse, it is better to avoid it, and provide an implementati= on > of the adapter info protocol that returns the media state directly, witho= ut > the need to mistreat the SNP layer. > > > Cc: Pete Batard > > Cc: Andrei Warkentin (awarkentin@vmware.com) > > > Cc: Samer El-Haj-Mahmoud > > Signed-off-by: Ard Biesheuvel > --- > > v2: > > - use the correct accessor to retrieve the GENET_PRIVATE_DATA pointer > > - call into the PHY routines to get the state, to ensure it is not stale > > > Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.inf | 3 + > Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h | 5 + > Silicon/Broadcom/Drivers/Net/BcmGenetDxe/AdapterInfo.c | 106 > ++++++++++++++++++++ > Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c | 12 ++- > 4 files changed, 121 insertions(+), 5 deletions(-) > > diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.inf > b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.inf > index 28f3e66ebaf0..89dee9f10c83 100644 > --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.inf > +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.inf > @@ -19,6 +19,7 @@ [Defines] > UNLOAD_IMAGE =3D GenetUnload > > > > [Sources] > > + AdapterInfo.c > > BcmGenetDxe.h > > ComponentName.c > > DriverBinding.c > > @@ -49,10 +50,12 @@ [LibraryClasses] > > > [Protocols] > > gBcmGenetPlatformDeviceProtocolGuid ## TO_START > > + gEfiAdapterInformationProtocolGuid ## BY_START > > gEfiDevicePathProtocolGuid ## BY_START > > gEfiSimpleNetworkProtocolGuid ## BY_START > > > > [Guids] > > + gEfiAdapterInfoMediaStateGuid > > gEfiEventExitBootServicesGuid > > > > [FixedPcd] > > diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h > b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h > index 0af9d5209cf2..1a117b25f87f 100644 > --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h > +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h > @@ -14,6 +14,7 @@ > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -209,6 +210,8 @@ typedef struct { > EFI_SIMPLE_NETWORK_PROTOCOL Snp; > > EFI_SIMPLE_NETWORK_MODE SnpMode; > > > > + EFI_ADAPTER_INFORMATION_PROTOCOL Aip; > > + > > BCM_GENET_PLATFORM_DEVICE_PROTOCOL *Dev; > > > > GENERIC_PHY_PRIVATE_DATA Phy; > > @@ -234,9 +237,11 @@ extern EFI_COMPONENT_NAME_PROTOCOL > gGenetComponentName; > extern EFI_COMPONENT_NAME2_PROTOCOL > gGenetComponentName2; > > > > extern CONST EFI_SIMPLE_NETWORK_PROTOCOL > gGenetSimpleNetworkTemplate; > > +extern CONST EFI_ADAPTER_INFORMATION_PROTOCOL > gGenetAdapterInfoTemplate; > > > > #define GENET_DRIVER_SIGNATURE SIGNATURE_32('G', 'N', 'E'= , 'T') > > #define GENET_PRIVATE_DATA_FROM_SNP_THIS(a) CR(a, > GENET_PRIVATE_DATA, Snp, GENET_DRIVER_SIGNATURE) > > +#define GENET_PRIVATE_DATA_FROM_AIP_THIS(a) CR(a, > GENET_PRIVATE_DATA, Aip, GENET_DRIVER_SIGNATURE) > > > > #define GENET_RX_BUFFER(g, idx) ((UINT8 *)(UINTN)(g)->RxBu= ffer + > GENET_MAX_PACKET_SIZE * (idx)) > > > > diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/AdapterInfo.c > b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/AdapterInfo.c > new file mode 100644 > index 000000000000..4b42b2bba67a > --- /dev/null > +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/AdapterInfo.c > @@ -0,0 +1,106 @@ > +/** @file > > + > > + Copyright (c) 2020 Arm, Limited. All rights reserved. > > + > > + SPDX-License-Identifier: BSD-2-Clause-Patent > > + > > +**/ > > + > > +#include > > +#include > > +#include > > +#include > > + > > +#include "BcmGenetDxe.h" > > + > > +STATIC > > +EFI_STATUS > > +EFIAPI > > +GenetAipGetInformation ( > > + IN EFI_ADAPTER_INFORMATION_PROTOCOL *This, > > + IN EFI_GUID *InformationType, > > + OUT VOID **InformationBlock, > > + OUT UINTN *InformationBlockSize > > + ) > > +{ > > + EFI_ADAPTER_INFO_MEDIA_STATE *AdapterInfo; > > + GENET_PRIVATE_DATA *Genet; > > + > > + if (This =3D=3D NULL || InformationBlock =3D=3D NULL || > > + InformationBlockSize =3D=3D NULL) { > > + return EFI_INVALID_PARAMETER; > > + } > > + > > + if (!CompareGuid (InformationType, &gEfiAdapterInfoMediaStateGuid)) { > > + return EFI_UNSUPPORTED; > > + } > > + > > + AdapterInfo =3D AllocateZeroPool (sizeof > (EFI_ADAPTER_INFO_MEDIA_STATE)); > > + if (AdapterInfo =3D=3D NULL) { > > + return EFI_OUT_OF_RESOURCES; > > + } > > + > > + *InformationBlock =3D AdapterInfo; > > + *InformationBlockSize =3D sizeof (EFI_ADAPTER_INFO_MEDIA_STATE); > > + > > + Genet =3D GENET_PRIVATE_DATA_FROM_AIP_THIS (This); > > + AdapterInfo->MediaState =3D GenericPhyUpdateConfig (&Genet->Phy); > > + > > + return EFI_SUCCESS; > > +} > > + > > +STATIC > > +EFI_STATUS > > +EFIAPI > > +GenetAipSetInformation ( > > + IN EFI_ADAPTER_INFORMATION_PROTOCOL *This, > > + IN EFI_GUID *InformationType, > > + IN VOID *InformationBlock, > > + IN UINTN InformationBlockSize > > + ) > > +{ > > + if (This =3D=3D NULL || InformationBlock =3D=3D NULL) { > > + return EFI_INVALID_PARAMETER; > > + } > > + > > + if (CompareGuid (InformationType, &gEfiAdapterInfoMediaStateGuid)) { > > + return EFI_WRITE_PROTECTED; > > + } > > + > > + return EFI_UNSUPPORTED; > > +} > > + > > +STATIC > > +EFI_STATUS > > +EFIAPI > > +GenetAipGetSupportedTypes ( > > + IN EFI_ADAPTER_INFORMATION_PROTOCOL *This, > > + OUT EFI_GUID **InfoTypesBuffer, > > + OUT UINTN *InfoTypesBufferCount > > + ) > > +{ > > + EFI_GUID *Guid; > > + > > + if (This =3D=3D NULL || InfoTypesBuffer =3D=3D NULL || > > + InfoTypesBufferCount =3D=3D NULL) { > > + return EFI_INVALID_PARAMETER; > > + } > > + > > + Guid =3D AllocatePool (sizeof *Guid); > > + if (Guid =3D=3D NULL) { > > + return EFI_OUT_OF_RESOURCES; > > + } > > + > > + CopyGuid (Guid, &gEfiAdapterInfoMediaStateGuid); > > + > > + *InfoTypesBuffer =3D Guid; > > + *InfoTypesBufferCount =3D 1; > > + > > + return EFI_SUCCESS; > > +} > > + > > +CONST EFI_ADAPTER_INFORMATION_PROTOCOL > gGenetAdapterInfoTemplate =3D { > > + GenetAipGetInformation, > > + GenetAipSetInformation, > > + GenetAipGetSupportedTypes, > > +}; > > diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c > b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c > index 7f93c68cd608..f9aa006dc799 100644 > --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c > +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c > @@ -163,6 +163,7 @@ GenetDriverBindingStart ( > > > EfiInitializeLock (&Genet->Lock, TPL_CALLBACK); > > CopyMem (&Genet->Snp, &gGenetSimpleNetworkTemplate, sizeof Genet- > >Snp); > > + CopyMem (&Genet->Aip, &gGenetAdapterInfoTemplate, sizeof Genet- > >Aip); > > > > Genet->Snp.Mode =3D &Genet->SnpMode; > > Genet->SnpMode.State =3D EfiSimpleNetworkStopped; > > @@ -203,7 +204,8 @@ GenetDriverBindingStart ( > } > > > > Status =3D gBS->InstallMultipleProtocolInterfaces (&ControllerHandle, > > - &gEfiSimpleNetworkProtocolGuid, &Genet->Snp, > > + &gEfiSimpleNetworkProtocolGuid, &Genet->Snp, > > + &gEfiAdapterInformationProtocolGuid, &Genet->Aip, > > NULL); > > > > if (EFI_ERROR (Status)) { > > @@ -273,10 +275,10 @@ GenetDriverBindingStop ( > > > ASSERT (Genet->ControllerHandle =3D=3D ControllerHandle); > > > > - Status =3D gBS->UninstallProtocolInterface (ControllerHandle, > > - &gEfiSimpleNetworkProtocolGu= id, > > - &Genet->Snp > > - ); > > + Status =3D gBS->UninstallMultipleProtocolInterfaces (ControllerHandle, > > + &gEfiSimpleNetworkProtocolGuid, &Genet->Snp, > > + &gEfiAdapterInformationProtocolGuid, &Genet->Aip, > > + NULL); > > if (EFI_ERROR (Status)) { > > return Status; > > } > > -- > 2.27.0 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.