From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mx.groups.io with SMTP id smtpd.web11.4081.1634103414568824284 for ; Tue, 12 Oct 2021 22:36:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=JWnyxYKj; spf=pass (domain: linaro.org, ip: 209.85.216.46, mailfrom: masami.hiramatsu@linaro.org) Received: by mail-pj1-f46.google.com with SMTP id pf6-20020a17090b1d8600b0019fa884ab85so3537922pjb.5 for ; Tue, 12 Oct 2021 22:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=HcRUAlxV3NkyQDLd/1pzW+SUiB/LOHrG8aZ7dh59O5Q=; b=JWnyxYKjjmnAGatXbWWXga8GJMk5edY4gMcEZAU2Wpw6RDKDPIezG/sMLw5//vQYVU teubqVqauoV91CAN9KqMXQLJ62OKxi3ZfRhgcsWZ9oQujpzuAs1MsVlTrIt8G+Vn90/P SxO4APRd0QaT1858xt/1KWmsBrDdKFtBVSHStiaPfeTTAaSLvX1KCOOBOor2MnuxvF+Q gvVCrG0NUHAE5q3iRWniQ2n72r1YYodKb9h1edmefWaUaJsEld98RJ46DPclc2Hew+Wu G1JzDBV+sxxWK43q4WR5b07tUTxUylqVI7iRdliqmsTwv65fKe1T5nOcT+Q6YO2zF+gT 1BHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=HcRUAlxV3NkyQDLd/1pzW+SUiB/LOHrG8aZ7dh59O5Q=; b=Ceb0idKn1eWDaKZgLiOifygHkuFI/ImkRwsjl0M3FLlxrJLq2wUX6aotSxghCbpjnq uP0+LrKQNttggeL32rzuEZcg0NRS0SSCKGPI/cGmcbKcywoi/6Y2r1zEVByWp4VhmKEv +9K9l7+YjJLjRXPyccU9tKuG1TUQsBNw7Zo72zF5QP9L0NUlzTJnkM/9oScNsdKyIcGq 9NANa7AxpNbIZidl9hs7QgsqzPCybCVALEiWStGoq6zEVc/MZoHVn34QZuPveBdSBq0D kg1IzOYO9Z1LyvuIeA8M5+AiMI2plm5Wzf+8yLvhWxAGatfRaWBuZObez4AT/nI9I5ku 0nGg== X-Gm-Message-State: AOAM532jAiWJKSzoqpz/wk2SxeUI1q5HODG6XKKLJjmYZUKRsXM6b+A2 ynONwKRcYI9tPIHKRY53B9uNj2vfkuD80g== X-Google-Smtp-Source: ABdhPJxezfuA8OSR0qBqyqpj62TrAYPi6zbTSb2TqIFPxPZSjwyWpy7mtDhzu/DLkcJEFGYxzJzULg== X-Received: by 2002:a17:90b:4c8d:: with SMTP id my13mr11084456pjb.101.1634103414059; Tue, 12 Oct 2021 22:36:54 -0700 (PDT) Return-Path: Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id k14sm13623271pgg.92.2021.10.12.22.36.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 22:36:53 -0700 (PDT) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto Subject: [PATCH 1/4] Silicon/SynQuacerNetsecDxe: Test the ControllerHandle is managed by this driver Date: Wed, 13 Oct 2021 14:36:51 +0900 Message-Id: <163410341134.323609.17991695355751540906.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <163410340292.323609.10978291802739074305.stgit@localhost> References: <163410340292.323609.10978291802739074305.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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 --- .../Drivers/Net/NetsecDxe/ComponentName.c | 13 +++++++++++++ .../Drivers/Net/NetsecDxe/DriverBinding.c | 1 - .../SynQuacer/Drivers/Net/NetsecDxe/NetsecDxe.h | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/ComponentName.c b/Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/ComponentName.c index 44b3daa0af..743fa88384 100644 --- a/Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/ComponentName.c +++ b/Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/ComponentName.c @@ -159,6 +159,19 @@ NetsecGetControllerName ( OUT CHAR16 **ControllerName ) { + EFI_STATUS Status; + + if (!ControllerHandle) { + return EFI_INVALID_PARAMETER; + } + + Status = EfiTestManagedDevice (ControllerHandle, + gNetsecDriverBinding.DriverBindingHandle, + &gEdkiiNonDiscoverableDeviceProtocolGuid); + if (EFI_ERROR (Status)) { + return Status; + } + if (ChildHandle != NULL) { return EFI_UNSUPPORTED; } diff --git a/Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/DriverBinding.c b/Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/DriverBinding.c index 392d1b474f..fa0c415e98 100644 --- a/Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/DriverBinding.c +++ b/Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/DriverBinding.c @@ -131,7 +131,6 @@ NetsecDriverBindingStop ( } -STATIC EFI_DRIVER_BINDING_PROTOCOL gNetsecDriverBinding = { NetsecDriverBindingSupported, NetsecDriverBindingStart, diff --git a/Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/NetsecDxe.h b/Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/NetsecDxe.h index cf2abb0ab1..9b3d19c033 100644 --- a/Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/NetsecDxe.h +++ b/Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/NetsecDxe.h @@ -27,6 +27,7 @@ #include "netsec_for_uefi/pfdep.h" extern EFI_COMPONENT_NAME2_PROTOCOL gNetsecDriverComponentName2; +extern EFI_DRIVER_BINDING_PROTOCOL gNetsecDriverBinding; /*--------------- Simple Network Driver entry point functions ----------------*/