From nobody Mon May 20 07:56:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+64302+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+64302+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1597523200; cv=none; d=zohomail.com; s=zohoarc; b=OVUrV2qRcC5uD3QtiTjsw0HbCDYb94ylKd+GxXpR0ohCeY7yJV6I43W27VSBD9ly1MGjnYJhzIugAS7QomqfGAdsgCLIA6zTTRypMKeytQDZ+q0g/CVGTO+gDANyLPpDTJh1tRDwRzNGhQJ0hevrVj8JpUEwtpO2B7G/ZFpT3IY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597523200; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=Pjr6uxMsVVMmN7uZ/6p4hzMFNgRz+RlwmeqNyjt0vRk=; b=diOmWira+r9O0GK86lKegdM5/UwefXiI74w9z2m1ki91XLluzQe9oOw0R9fy0xW9A7rU3cfdrwfOEn+XSrbSJPI+8M6pp5ee9y7N3QW4HN1dgeiES17lMiEYt93gU1KIhecld9t66aCVg7v6vVzO31aZWeI/QlVTR9cq1mFbuWk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+64302+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1597523199965992.6166482338496; Sat, 15 Aug 2020 13:26:39 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 6zUCYY1788612xET1t5o9lrT; Sat, 15 Aug 2020 13:26:38 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.12474.1597523193105544696 for ; Sat, 15 Aug 2020 13:26:33 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 675E8D6E; Sat, 15 Aug 2020 13:26:32 -0700 (PDT) X-Received: from U203705.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 26EC43F66B; Sat, 15 Aug 2020 13:26:32 -0700 (PDT) From: "Samer El-Haj-Mahmoud" To: devel@edk2.groups.io Cc: Leif Lindholm , Pete Batard , Andrei Warkentin , Ard Biesheuvel Subject: [edk2-devel] [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix DisplayDxe ComponentName2 error checking Date: Sat, 15 Aug 2020 16:26:29 -0400 Message-Id: <20200815202631.29690-2-Samer.El-Haj-Mahmoud@arm.com> In-Reply-To: <20200815202631.29690-1-Samer.El-Haj-Mahmoud@arm.com> References: <20200815202631.29690-1-Samer.El-Haj-Mahmoud@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,samer.el-haj-mahmoud@arm.com X-Gm-Message-State: mCv388A58zVfyCAmnOSTjHGGx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1597523198; bh=ze+A9JBfdxiNcr2M6zSsYt6IgPyEfADP5EZ8BRLwfZA=; h=Cc:Date:From:Reply-To:Subject:To; b=HvqYVlbYiJWHoiBR/SSB4gDZuLwlfCO6VA7KEu9c/uCHUvTvBq9b3+BJlLUGsrCcUUt 2xRNrTNSC1ORi/r/AVck+Njopyx0Gp8ZUW31361ZzWY/RUUfPJ+mmohtDnyq7qNwywE7W 0vL88uf/qwP9q22Msnf2Xzt1dSPWQwqIMpI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Fix input param error checking for the DisplayDxe ComponentName2 protocol. This fixes https://github.com/pftf/RPi4/issues/84 Cc: Leif Lindholm Cc: Pete Batard Cc: Andrei Warkentin Cc: Ard Biesheuvel Signed-off-by: Samer El-Haj-Mahmoud Reviewed-by: Pete Batard --- Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h | 2 ++ Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c | 22 +++++++++++++= +++++++ 2 files changed, 24 insertions(+) diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h b/Platfor= m/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h index bfbe9e868843..073f65111645 100644 --- a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h +++ b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h @@ -1,5 +1,6 @@ /** @file * + * Copyright (c) 2020, ARM Limited. All rights reserved. * Copyright (c) 2017-2018, Andrei Warkentin * Copyright (c) Microsoft Corporation. All rights reserved. * @@ -27,6 +28,7 @@ extern EFI_GRAPHICS_OUTPUT_PROTOCOL gDisplayProto; extern EFI_COMPONENT_NAME_PROTOCOL gComponentName; extern EFI_COMPONENT_NAME2_PROTOCOL gComponentName2; +extern EFI_DRIVER_BINDING_PROTOCOL mDriverBinding; =20 VOID RegisterScreenshotHandlers ( diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c b/Plat= form/RaspberryPi/Drivers/DisplayDxe/ComponentName.c index 092230cd7c9b..4c065b5d51bf 100644 --- a/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c +++ b/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c @@ -1,5 +1,6 @@ /** @file * + * Copyright (c) 2020, ARM Limited. All rights reserved. * Copyright (c) 2018, Andrei Warkentin * Copyright (c) 2006-2016, Intel Corporation. All rights reserved. * @@ -206,6 +207,27 @@ ComponentNameGetControllerName ( OUT CHAR16 **ControllerName ) { + EFI_STATUS Status; + + // + // This is a device driver, so ChildHandle must be NULL. + // + if (ChildHandle !=3D NULL) { + return EFI_UNSUPPORTED; + } + + // + // Make sure this driver is currently managing ControllHandle + // + Status =3D EfiTestManagedDevice ( + ControllerHandle, + mDriverBinding.DriverBindingHandle, + &gEfiGraphicsOutputProtocolGuid + ); + if (EFI_ERROR (Status)) { + return Status; + } + return LookupUnicodeString2 ( Language, This->SupportedLanguages, --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#64302): https://edk2.groups.io/g/devel/message/64302 Mute This Topic: https://groups.io/mt/76213602/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Mon May 20 07:56:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+64300+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+64300+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1597523200; cv=none; d=zohomail.com; s=zohoarc; b=RhbSRT/385rbWtzx7StMH8OCPmJ/X990KsKAAvHthxXLfHiQ9SWEWzpUIU885YPNLk/tuyHMFJYf+iF2+bXnXTFTcLsLdbbzj+YA3EilUguTkVcGD20e3iRFtJPChn3zDPBW2q95dt7Y5tJeUwzfRqduzOqKWPptjGNywHX6/Bo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597523200; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=PiCxIiRBRYZswcAQa+o2xrSH7hw3BAPpd2YHZh6ylUk=; b=RSh03ecA390zSHm7ynsK2CnI0EGUNcyuvFHGxHqdeQMyez9yeKxawt/mREqSvkqX9YiH7Qo59xjRUo0PJuzIM9UnTsi57TeYGseW4+M3GfFjmnZeriM4YZPSbr5erqOBgWnvZIdKWS57BYTzd14CRpk7RzUiuAnVAfRghFbyqLE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+64300+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1597523200966638.845571037313; Sat, 15 Aug 2020 13:26:40 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id sAMZYY1788612xMNy1igjORX; Sat, 15 Aug 2020 13:26:40 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.12719.1597523193291451517 for ; Sat, 15 Aug 2020 13:26:33 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B43D7101E; Sat, 15 Aug 2020 13:26:32 -0700 (PDT) X-Received: from U203705.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 77B743F66B; Sat, 15 Aug 2020 13:26:32 -0700 (PDT) From: "Samer El-Haj-Mahmoud" To: devel@edk2.groups.io Cc: Leif Lindholm , Pete Batard , Andrei Warkentin , Ard Biesheuvel Subject: [edk2-devel] [edk2-platform][PATCH v1 2/3] Platforms/RaspberryPi: Fix DwUsbHostDxe ComponentName2 error checking Date: Sat, 15 Aug 2020 16:26:30 -0400 Message-Id: <20200815202631.29690-3-Samer.El-Haj-Mahmoud@arm.com> In-Reply-To: <20200815202631.29690-1-Samer.El-Haj-Mahmoud@arm.com> References: <20200815202631.29690-1-Samer.El-Haj-Mahmoud@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,samer.el-haj-mahmoud@arm.com X-Gm-Message-State: a4fF2ZWrPV1cg0VbRfwwctsCx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1597523200; bh=FVU3oAx3uecTDB/aic9ftSlemx1u/cNg2l+9qo69GiE=; h=Cc:Date:From:Reply-To:Subject:To; b=BxNTVRvD9TUqFyMquiKMeE8yBmmbtSeAMzPwo52++iwv0IDBnG0D9rRgVuTNQPZfZ/z Q7HVoxbLMnVogha20kPLEYEqEKXoyVAWHGlkQMZzFcgWvX3BU8dLlONDpzDr1/ib+fgME yrnYEzB++nc8KxNP1lVGrBNSmtumHuz959Q= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Fix input param error checking for the DwUsbHostDxe ComponentName2 protocol. This fixes https://github.com/pftf/RPi4/issues/86 Cc: Leif Lindholm Cc: Pete Batard Cc: Andrei Warkentin Cc: Ard Biesheuvel Signed-off-by: Samer El-Haj-Mahmoud Reviewed-by: Pete Batard --- Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.h | 4 +++- Platform/RaspberryPi/Drivers/DwUsbHostDxe/ComponentName.c | 18 +++++++++++= +++++++ Platform/RaspberryPi/Drivers/DwUsbHostDxe/DriverBinding.c | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.h b/Pla= tform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.h index 106e5425355e..cf6c81b64ab5 100644 --- a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.h +++ b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.h @@ -1,5 +1,6 @@ /** @file * + * Copyright (c) 2020, ARM Limited. All rights reserved. * Copyright (c) 2017-2018, Andrey Warkentin * Copyright (c) 2015-2016, Linaro Limited. All rights reserved. * @@ -121,8 +122,9 @@ typedef struct _DWUSB_OTGHC_DEV { UINT16 LastMicroFrame; } DWUSB_OTGHC_DEV; =20 -extern EFI_COMPONENT_NAME_PROTOCOL gComponentName; +extern EFI_COMPONENT_NAME_PROTOCOL gComponentName; extern EFI_COMPONENT_NAME2_PROTOCOL gComponentName2; +extern EFI_DRIVER_BINDING_PROTOCOL mDriverBinding; =20 EFI_STATUS CreateDwUsbHc ( diff --git a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/ComponentName.c b/Pl= atform/RaspberryPi/Drivers/DwUsbHostDxe/ComponentName.c index 2f3c53323bf1..8639ab7d39c5 100644 --- a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/ComponentName.c +++ b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/ComponentName.c @@ -1,5 +1,6 @@ /** @file * + * Copyright (c) 2020, ARM Limited. All rights reserved. * Copyright (c) 2018, Andrey Warkentin * * SPDX-License-Identifier: BSD-2-Clause-Patent @@ -205,10 +206,27 @@ ComponentNameGetControllerName ( OUT CHAR16 **ControllerName ) { + EFI_STATUS Status; + + // + // This is a device driver, so ChildHandle must be NULL. + // if (ChildHandle !=3D NULL) { return EFI_UNSUPPORTED; } =20 + // + // Make sure this driver is currently managing ControllHandle + // + Status =3D EfiTestManagedDevice ( + ControllerHandle, + mDriverBinding.DriverBindingHandle, + &gEfiUsb2HcProtocolGuid + ); + if (EFI_ERROR (Status)) { + return Status; + } + return LookupUnicodeString2 ( Language, This->SupportedLanguages, diff --git a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DriverBinding.c b/Pl= atform/RaspberryPi/Drivers/DwUsbHostDxe/DriverBinding.c index 7f78179d4c06..bada13a6cd7c 100644 --- a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DriverBinding.c +++ b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DriverBinding.c @@ -36,7 +36,7 @@ DriverStop ( IN EFI_HANDLE *ChildHandleBuffer ); =20 -STATIC EFI_DRIVER_BINDING_PROTOCOL mDriverBinding =3D { +EFI_DRIVER_BINDING_PROTOCOL mDriverBinding =3D { DriverSupported, DriverStart, DriverStop, --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#64300): https://edk2.groups.io/g/devel/message/64300 Mute This Topic: https://groups.io/mt/76213600/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Mon May 20 07:56:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+64303+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+64303+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1597523197; cv=none; d=zohomail.com; s=zohoarc; b=ZsKlC0h6IaolWzUvZLayNgX+to/zbZn3ohRYNaF/98SRz4iHlRKtWrqf3Rc5mx7jxJp/bMnmaY3k+Cz1mfXpaZY0reP3igCv+dYoydy0eWVLAdAHJPbuQF1lKQAodlM1ffd+e+ahruzoEykUBHtC63oZJnq9th14hc+4OuFMf6o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597523197; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=72knffSP/ReXzP0dbBbzBT7wkYgCjObZovCnFbFVDuk=; b=ahk+SYL/ApyTXPkRYqyfMVgyNF/I5YCs6aHuBpMV8Kl2gt5RgjvhMJr/HwKtE53gxqsGkDzmFwe47yg7I3PCZMNnziPSA0mjpQpIiQ8t2xPvDK3maWIQ4XjdMzIrQIHWb3ySRVcqaZXXnhk/vgxaTnDdnFetnD7ZPgOmTucsKUM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+64303+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1597523197905263.0968425241591; Sat, 15 Aug 2020 13:26:37 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id j1ggYY1788612xPKn8rJ2sPL; Sat, 15 Aug 2020 13:26:37 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.12476.1597523193518170250 for ; Sat, 15 Aug 2020 13:26:33 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0CC7811B3; Sat, 15 Aug 2020 13:26:33 -0700 (PDT) X-Received: from U203705.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C3FE33F66B; Sat, 15 Aug 2020 13:26:32 -0700 (PDT) From: "Samer El-Haj-Mahmoud" To: devel@edk2.groups.io Cc: Leif Lindholm , Pete Batard , Andrei Warkentin , Ard Biesheuvel Subject: [edk2-devel] [edk2-platform][PATCH v1 3/3] Platforms/RaspberryPi: Fix BcmGenetDxe ComponentName2 error checking Date: Sat, 15 Aug 2020 16:26:31 -0400 Message-Id: <20200815202631.29690-4-Samer.El-Haj-Mahmoud@arm.com> In-Reply-To: <20200815202631.29690-1-Samer.El-Haj-Mahmoud@arm.com> References: <20200815202631.29690-1-Samer.El-Haj-Mahmoud@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,samer.el-haj-mahmoud@arm.com X-Gm-Message-State: AombLGzfInB5RKds6MNDlPgjx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1597523197; bh=2gCHVk/Wdt1oH+i47A7MNwICpnzvHVBXlSoIsEgAtyw=; h=Cc:Date:From:Reply-To:Subject:To; b=Bniji0Slb0nX3Ft2Um9qiAhbb4BsV6stZxdyQCElPEJZO014p4yF3+fUXNF+HJ4RGLW uzNWvEc8ELFgq5YDX0ZU10wwymc51cdcVshW7cd2zkdB1m0EZ+kipna7iFcD65WF0we1J R4FvRj4vH6I9ydc7zdJEzjGpqFSni8cVj5c= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Fix input param error checking for the BcmGenetDxe ComponentName2 protocol. This fixes https://github.com/pftf/RPi4/issues/85 Cc: Leif Lindholm Cc: Pete Batard Cc: Andrei Warkentin Cc: Ard Biesheuvel Signed-off-by: Samer El-Haj-Mahmoud Reviewed-by: Pete Batard --- Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h | 1 + Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c | 22 ++++++++++++= ++++++++ Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h b/Silic= on/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h index b39a1326335a..26016330fb3b 100644 --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h @@ -235,6 +235,7 @@ typedef struct { =20 extern EFI_COMPONENT_NAME_PROTOCOL gGenetComponentName; extern EFI_COMPONENT_NAME2_PROTOCOL gGenetComponentName2; +extern EFI_DRIVER_BINDING_PROTOCOL mGenetDriverBinding; =20 extern CONST EFI_SIMPLE_NETWORK_PROTOCOL gGenetSimpleNetworkTemplate; extern CONST EFI_ADAPTER_INFORMATION_PROTOCOL gGenetAdapterInfoTemplate; diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c b/Sil= icon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c index 860e30b4da6b..abc5b7db16c2 100644 --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c @@ -2,6 +2,7 @@ UEFI Component Name(2) protocol implementation for GENET UEFI driver. =20 Copyright (c) 2020 Jared McNeill. All rights reserved. + Copyright (c) 2020, ARM Limited. All rights reserved. =20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -169,6 +170,27 @@ GenetComponentNameGetControllerName ( OUT CHAR16 **ControllerName ) { + EFI_STATUS Status; + + // + // This is a device driver, so ChildHandle must be NULL. + // + if (ChildHandle !=3D NULL) { + return EFI_UNSUPPORTED; + } + + // + // Make sure this driver is currently managing ControllHandle + // + Status =3D EfiTestManagedDevice ( + ControllerHandle, + mGenetDriverBinding.DriverBindingHandle, + &gEfiSimpleNetworkProtocolGuid + ); + if (EFI_ERROR (Status)) { + return Status; + } + if (ChildHandle !=3D NULL) { return EFI_UNSUPPORTED; } diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c b/Sil= icon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c index f9aa006dc799..435ef493564c 100644 --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c @@ -302,7 +302,7 @@ GenetDriverBindingStop ( return EFI_SUCCESS; } =20 -STATIC EFI_DRIVER_BINDING_PROTOCOL mGenetDriverBinding =3D { +EFI_DRIVER_BINDING_PROTOCOL mGenetDriverBinding =3D { GenetDriverBindingSupported, GenetDriverBindingStart, GenetDriverBindingStop, --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#64303): https://edk2.groups.io/g/devel/message/64303 Mute This Topic: https://groups.io/mt/76213603/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-