From patchwork Thu Sep 16 08:53:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 512921 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp1012182jao; Thu, 16 Sep 2021 01:59:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqk/g5ue6yrNsq/00XDq7BaB7cIG2eOWDcnAl76iI3DbgG6uRF33F/mGU5gB60RPluLabb X-Received: by 2002:a05:6402:28ad:: with SMTP id eg45mr5345270edb.226.1631782787576; Thu, 16 Sep 2021 01:59:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631782787; cv=none; d=google.com; s=arc-20160816; b=ruUn8rChN/Aph/23XPMoumZTQfu8dS+2KKkB50INJ4cvSx6I1ONhT1GX4/EtZVqVyq N8FHfVTI1LsgTzNdrpMLOJpVJ7yCvJmjCjiXI7EPH/t0jpt0L5Mq4QbzYIfppdIBICCF rFFrMaP6RyjfqCsXFLlglii3vDS1qLB843zZxVjU50AvdLBPyCTIzmBJdlUsQya7qRGs kDsQTpaza4Y4RfV7zP8CWxjnbkew4GyR41s8MQj2TEoZcLhGJcOS42C6vHZROBT/Yyhw wAFoYp5duylm9VgkpyKRGSUpXarCgWDDjDmRB0B/NsydzKf0Rl82YGy4ps4mZByjGC8B Vvjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=euH7taWnKS6EN6sF95vRGG08aDe82RNM2lP3B2ws+Vc=; b=UQA3+wWsE9TV5z+axy3kwM+T4deG0kdCe5jqk7HC5fMhuS7VmF5XPglQMFogqyZoEg Et1lEopJOFAm4gb7oOx9rYC4cdvabTAxqQzTMMx8kY7K6YV61RG7NAvo1sBr5WzfTqKT iFYvwiKQa5vqPs3UGfbnu3Z/UDpTrc2DsNJH+eQml0b95cO0r6rMxvSNGa0QiLrxqNG6 fHpAZtfk7JLdhTpWaxKbxdgg8dVXW3RkdZKd+b2hvhJkwmKnjRjZONzFUnE9LDlFTNll dV+roEeXebFOOFEyxPMYCMrmiWoODRF6liGjDBZ3zwoMP7IyeXdDiX8b72DnkNmnhTHT Lz3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kMyURmj+; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id l20si2710606ejn.131.2021.09.16.01.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Sep 2021 01:59:47 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kMyURmj+; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6435483146; Thu, 16 Sep 2021 10:59:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="kMyURmj+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E727B83116; Thu, 16 Sep 2021 10:59:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8147E831FE for ; Thu, 16 Sep 2021 10:53:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masami.hiramatsu@linaro.org Received: by mail-pf1-x42d.google.com with SMTP id q22so5346308pfu.0 for ; Thu, 16 Sep 2021 01:53:32 -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=euH7taWnKS6EN6sF95vRGG08aDe82RNM2lP3B2ws+Vc=; b=kMyURmj+umFp8igm+SwvPyiCawq4YqkNeB5zNY615fZ1XT5xRBOqcFdeX7tqeBUId6 uxhw0cCh2NUsrOKzsWEfK7Yn3cJduvlwF0WUa/GOiuBnzuhi0yhaOytqVikPrfCrdcVi iiuC7OmLjQPPaNY2tSX4eTrvfpfCU7CTVoE7VQ96UKcBX1OoTlkeyhPvwJ01oEPUoXec uRuh84FdGOoAQJJWr2owSYPdWLV3/ubM9IOFIRVUbxJhldl1pTKkFfUv20oQrKI0P5id nrEFkwdZUZTDNV/N2aES1Uibeh2i3B4vpoCKTwUUfy9uKQ0Wmgo3mgmK82TiU0TOOOfb ZPYw== 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=euH7taWnKS6EN6sF95vRGG08aDe82RNM2lP3B2ws+Vc=; b=tQKXIVELVOAgifyUf+9GW9Ti7d/8ercz79/9mq+63y49cXsgcJY+3RRfEw4BLI8O4i 50AZlOecMxORvFHcXvZjuQvVXSluLUKMk1cMmr4NsDtNPWGj/LFmZRxss5C2CMwTv8FI DewOH7CYV8BB/bD6FVYxTTvBNsRRMA/Ho2FnFaOKGiy21KzaGxrMKgoaVQRJxKdBZSVU C6i0EAIUpJpK5OA/JW5Ej9E6cjl9G7aweD9GT3hODIsQS3Hg0CtlwfrPdrd1LMrvSq1g CSV0XIhG0fy82lyviyRrVop19aQJwAdQNzEsUYPnPKz0i3dYLXLuYF6xMUUoULMVRUhK +qoA== X-Gm-Message-State: AOAM533RsyqyEIMiuCou6jcdZ0DyqgZv4QJIE+BLp4WhvDaaMCSzJyGM FFN27/pz5UlXE+5KyDMW110Ozg== X-Received: by 2002:a65:6389:: with SMTP id h9mr4000835pgv.83.1631782410719; Thu, 16 Sep 2021 01:53:30 -0700 (PDT) Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id g3sm2089047pjm.22.2021.09.16.01.53.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Sep 2021 01:53:30 -0700 (PDT) From: Masami Hiramatsu To: Heinrich Schuchardt Cc: Kazuhiko Sakamoto , Masami Hiramatsu , Jassi Brar , Ilias Apalodimas , u-boot@lists.denx.de Subject: [PATCH 1/3] efi_selftest: Use EFI_SIMPLE_NETWORK_PROTOCOL::GetStatus() for media check Date: Thu, 16 Sep 2021 17:53:27 +0900 Message-Id: <163178240747.65790.12394686374882007857.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <163178239865.65790.17211919979018423637.stgit@localhost> References: <163178239865.65790.17211919979018423637.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean According to the UEF specification v2.9, the main purpose of the EFI_SIMPLE_NETWORK_PROTOCOL::GetStatus() is for checking the link status via EFI_SIMPLE_NETWORK_MODE::MediaPresent. So this uses net->get_status() for checking the link status before running network test. Signed-off-by: Masami Hiramatsu --- lib/efi_selftest/efi_selftest_snp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/efi_selftest/efi_selftest_snp.c b/lib/efi_selftest/efi_selftest_snp.c index 79f0467803..cb0db7eea2 100644 --- a/lib/efi_selftest/efi_selftest_snp.c +++ b/lib/efi_selftest/efi_selftest_snp.c @@ -309,6 +309,18 @@ static int execute(void) return EFI_ST_FAILURE; } + /* Check media connected */ + ret = net->get_status(net, NULL, NULL); + if (ret != EFI_SUCCESS) { + efi_st_error("Failed to get status"); + return EFI_ST_FAILURE; + } + if (net->mode && net->mode->media_present_supported && + !net->mode->media_present) { + efi_st_error("Network media is not connected"); + return EFI_ST_FAILURE; + } + /* * Send DHCP discover message */