From nobody Mon Nov 25 01:28:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81861+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81861+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1634103440; cv=none; d=zohomail.com; s=zohoarc; b=LcA4E/uwQTeDATuxBNQWcVG1QwqcpXML9nvqoWqY4tDifgAQdAqNg3dxhH49YScmrGsQtC4trBdcUc2PCpfk6xPKMXEDE/QsaOy5/LpzPFRvfGDH8N4eXl7UWga2+rzur0a0pFTjNEflFLVyVvc3ok5FHjc115xRxB58XVihOnE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1634103440; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=f4EuPve9Ct0VV3gQ8jFypDXUrilwAwp2s+FglvOgZm0=; b=i3AHj3FH55CfcMB0VIjiSBOpR2SiK47wWRstXyaAIMLZEkpswE02Vv2IsH0XFsZcuB1eoh4rqbsyse6YGRtlNK2ZgqlNfV3MbqsfNC5ssYTHabRBYRyjt2N6FJLJ0y4RGyaOx66GPXCLafQoM6BxB6JPUJmY0IOSYte6xk0MUAk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81861+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 163410344054377.47160146632655; Tue, 12 Oct 2021 22:37:20 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id FnD9YY1788612xRWQRqnWkJP; Tue, 12 Oct 2021 22:37:20 -0700 X-Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mx.groups.io with SMTP id smtpd.web10.4173.1634103439638195677 for ; Tue, 12 Oct 2021 22:37:19 -0700 X-Received: by mail-pg1-f175.google.com with SMTP id d23so1218616pgh.8 for ; Tue, 12 Oct 2021 22:37:19 -0700 (PDT) X-Gm-Message-State: 6hR3ChkMwGPBGVdqjOmvUYaox1787277AA= X-Google-Smtp-Source: ABdhPJxHbi74Mh6zAnjc5n3LZ5dV3SHdUYhUXZXMCMpQQxoWINmvCafA7MYfIzmB/5QsfjZcuoqSyA== X-Received: by 2002:a63:2b03:: with SMTP id r3mr26482646pgr.188.1634103439252; Tue, 12 Oct 2021 22:37:19 -0700 (PDT) X-Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id mu7sm5215406pjb.12.2021.10.12.22.37.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 22:37:19 -0700 (PDT) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto Subject: [edk2-devel] [PATCH 4/4] Silicon/ChaosKeyDxe: Test the ControllerHandle is managed by this driver Date: Wed, 13 Oct 2021 14:37:16 +0900 Message-Id: <163410343613.323609.5589920422459869029.stgit@localhost> In-Reply-To: <163410340292.323609.10978291802739074305.stgit@localhost> References: <163410340292.323609.10978291802739074305.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,masami.hiramatsu@linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1634103440; bh=ADLjkWY9nHEhlyMZq/xiYUWJ/jW8RlSSz4zmdca/CPw=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=HBOH3ZhR5DVar6kX3fb4j55/UsiVdT1HIwfuG8BUnOMf4EAlEZaxbsIvid1/jtqQZoI HO45IlsFZXHCeJQs1CJ0L173dPdeuDPXPcI0TNQ1z/5Av4am/XB3aIO0x3Dagzrdgxnp8 rym1Rd5/6jF0UJ/HVJmwj/tyjPqHUbk2WxE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1634103442127100002 From: Kazuhiko Sakamoto Test the @ControllerHandle is not NULL and is actually managed by this driver. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Kazuhiko Sakamoto Signed-off-by: Masami Hiramatsu --- Silicon/Openmoko/ChaosKeyDxe/ChaosKeyDriver.h | 1 + Silicon/Openmoko/ChaosKeyDxe/ComponentName.c | 13 +++++++++++++ Silicon/Openmoko/ChaosKeyDxe/DriverBinding.c | 1 - 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Silicon/Openmoko/ChaosKeyDxe/ChaosKeyDriver.h b/Silicon/Openmo= ko/ChaosKeyDxe/ChaosKeyDriver.h index 97cfbbb755..59582b3bf9 100644 --- a/Silicon/Openmoko/ChaosKeyDxe/ChaosKeyDriver.h +++ b/Silicon/Openmoko/ChaosKeyDxe/ChaosKeyDriver.h @@ -38,6 +38,7 @@ typedef struct { CR(a, CHAOSKEY_DEV, Rng, CHAOSKEY_DEV_SIGNATURE) =20 extern EFI_COMPONENT_NAME2_PROTOCOL gChaosKeyDriverComponentName2; +extern EFI_DRIVER_BINDING_PROTOCOL gUsbDriverBinding; =20 EFI_STATUS ChaosKeyInit ( diff --git a/Silicon/Openmoko/ChaosKeyDxe/ComponentName.c b/Silicon/Openmok= o/ChaosKeyDxe/ComponentName.c index 25117e2500..5b0f42cb67 100644 --- a/Silicon/Openmoko/ChaosKeyDxe/ComponentName.c +++ b/Silicon/Openmoko/ChaosKeyDxe/ComponentName.c @@ -159,6 +159,19 @@ ChaosKeyGetControllerName ( OUT CHAR16 **ControllerName ) { + EFI_STATUS Status; + + if (!ControllerHandle) { + return EFI_INVALID_PARAMETER; + } + + Status =3D EfiTestManagedDevice (ControllerHandle, + gUsbDriverBinding.DriverBindingHandle, + &gEfiUsbIoProtocolGuid); + if (EFI_ERROR (Status)) { + return Status; + } + if (ChildHandle !=3D NULL) { return EFI_UNSUPPORTED; } diff --git a/Silicon/Openmoko/ChaosKeyDxe/DriverBinding.c b/Silicon/Openmok= o/ChaosKeyDxe/DriverBinding.c index e7d0d3fe56..4cbd23ad36 100644 --- a/Silicon/Openmoko/ChaosKeyDxe/DriverBinding.c +++ b/Silicon/Openmoko/ChaosKeyDxe/DriverBinding.c @@ -146,7 +146,6 @@ UsbHwrngDriverBindingStop ( } =20 =20 -STATIC EFI_DRIVER_BINDING_PROTOCOL gUsbDriverBinding =3D { UsbHwrngDriverBindingSupported, UsbHwrngDriverBindingStart, -=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 (#81861): https://edk2.groups.io/g/devel/message/81861 Mute This Topic: https://groups.io/mt/86281585/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-