From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::532; helo=mail-pg1-x532.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 95AEA210C2813 for ; Wed, 8 Aug 2018 23:25:10 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id w10-v6so2259850pgv.2 for ; Wed, 08 Aug 2018 23:25:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=JlE//ZJ7WLTxKgtSe/59teNeQhXgwGl91B3BoTgyUO4=; b=P9KpEZP82SdDAfOFjQYfzG7RigtYbWj6H1lRmHbXptQGMOv1W0hr1nGaXVEmUhzBAM p1O2xLgboca6jrMJFfWsoswcH9A+K7uJQL2gJ+k1oGlmnixY5MiqEusUN8gZ07jBKej+ atCKY/HPIekS03MyK6CvWyJgp9vZu6GEsviNc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=JlE//ZJ7WLTxKgtSe/59teNeQhXgwGl91B3BoTgyUO4=; b=LtxIH3kXNx0vzg9mFACTHVIcpK32yyPD+vibQDZs6s4YORPq3hOLnuHA7b1/zsyKKp BUB7NZNhhQYuOmoLhAUDnUzIts32dyGYJjWcR0AP1P1tljuiiahT8QevTOXVWdxQTbLJ eYFMjLQzS1Nt8uzGBTJQItq8aXhJJr87oCvbm7URpRQJIxK+ZZOqoulS3so/56XvFMHy SWFCJR43SPeFTZfdtdVKlbXzNMRV1Ha783GI2i/9JZHKZYWx1Z9yKxoJXpzj8LqxQvhw 3WMIqXyyyFG9z5AzVtBh9NGjW9KgAsi1jJlti+zCtWvV4z/mkFFitQkxyM8qhkQjNoct FEoQ== X-Gm-Message-State: AOUpUlFdEz6cjPN2ce07wpaFGfdEv5ZxbJyUhOsY/Zq+Mit0zF4tAK58 21DTUuHUFkhgME/Devi5xyQ1PA== X-Google-Smtp-Source: AA+uWPxsPV2ck7VKBYMnx4r1YsQPoVOittHtNAAWS2yHrdBySCSjnCHl/TBjNsMbJu6EW+6j3XPG2w== X-Received: by 2002:a63:ed07:: with SMTP id d7-v6mr808387pgi.429.1533795910250; Wed, 08 Aug 2018 23:25:10 -0700 (PDT) Received: from [10.199.0.182] ([64.64.108.224]) by smtp.gmail.com with ESMTPSA id h190-v6sm8211919pge.85.2018.08.08.23.25.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Aug 2018 23:25:09 -0700 (PDT) To: Leif Lindholm Cc: linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, graeme.gregory@linaro.org, ard.biesheuvel@linaro.org, guoheyi@huawei.com, wanghuiqiang@huawei.com, huangming23@huawei.com, zhangjinsong2@huawei.com, huangdaode@hisilicon.com, john.garry@huawei.com, xinliang.liu@linaro.org, shaochangliang , Heyi Guo References: <20180724070922.63362-1-ming.huang@linaro.org> <20180724070922.63362-25-ming.huang@linaro.org> <20180803152347.htt7el4ghej4yr65@bivouac.eciton.net> From: Ming Message-ID: <058b1e65-48c3-75ca-a991-8f44f5be337e@linaro.org> Date: Thu, 9 Aug 2018 14:24:57 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180803152347.htt7el4ghej4yr65@bivouac.eciton.net> Subject: Re: [PATCH edk2-platforms v1 24/38] Platform/Hisilicon/D06: Add OemNicConfig2P Driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 06:25:10 -0000 Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 8bit ÔÚ 8/3/2018 11:23 PM, Leif Lindholm дµÀ: > On Tue, Jul 24, 2018 at 03:09:08PM +0800, Ming Huang wrote: >> From: shaochangliang >> >> This Driver provide Get/Set Mac function. >> >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: shaochangliang >> Signed-off-by: Ming Huang >> Signed-off-by: Heyi Guo >> --- >> Platform/Hisilicon/D06/D06.dsc | 2 +- >> Platform/Hisilicon/D06/D06.fdf | 2 +- >> Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig.h | 25 +++++++ >> Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.c | 71 ++++++++++++++++++++ >> Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf | 43 ++++++++++++ >> 5 files changed, 141 insertions(+), 2 deletions(-) >> >> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc >> index 744a4a0d6d..49322f8304 100644 >> --- a/Platform/Hisilicon/D06/D06.dsc >> +++ b/Platform/Hisilicon/D06/D06.dsc >> @@ -289,7 +289,7 @@ >> # >> ArmPkg/Drivers/CpuDxe/CpuDxe.inf >> MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf >> - >> + Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf >> >> !if $(SECURE_BOOT_ENABLE) == TRUE >> MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf { >> diff --git a/Platform/Hisilicon/D06/D06.fdf b/Platform/Hisilicon/D06/D06.fdf >> index 1c6ee4e0e4..e65dddd4e9 100644 >> --- a/Platform/Hisilicon/D06/D06.fdf >> +++ b/Platform/Hisilicon/D06/D06.fdf >> @@ -174,7 +174,7 @@ READ_LOCK_STATUS = TRUE >> INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf >> INF Platform/Hisilicon/D06/Drivers/SFC/SfcDxeDriver.inf >> >> - >> + INF Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf >> INF Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf >> INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf >> INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf >> diff --git a/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig.h b/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig.h >> new file mode 100644 >> index 0000000000..35228fdf1d >> --- /dev/null >> +++ b/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig.h >> @@ -0,0 +1,25 @@ >> +/** @file >> +* >> +* Copyright (c) 2016-2018, Hisilicon Limited. All rights reserved. >> +* Copyright (c) 2016-2018, Linaro Limited. All rights reserved. >> +* >> +* This program and the accompanying materials >> +* are licensed and made available under the terms and conditions of the BSD License >> +* which accompanies this distribution. The full text of the license may be found at >> +* http://opensource.org/licenses/bsd-license.php >> +* >> +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, >> +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. >> +* >> +**/ >> + >> +#ifndef __OEM_NIC_CONFIG_H__ >> +#define __OEM_NIC_CONFIG_H__ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#endif >> diff --git a/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.c b/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.c >> new file mode 100644 >> index 0000000000..7e2cee3b86 >> --- /dev/null >> +++ b/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.c >> @@ -0,0 +1,71 @@ >> +/** @file >> +* >> +* Copyright (c) 2016-2018, Hisilicon Limited. All rights reserved. >> +* Copyright (c) 2016-2018, Linaro Limited. All rights reserved. >> +* >> +* This program and the accompanying materials >> +* are licensed and made available under the terms and conditions of the BSD License >> +* which accompanies this distribution. The full text of the license may be found at >> +* http://opensource.org/licenses/bsd-license.php >> +* >> +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, >> +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. >> +* >> +**/ >> + >> +#include >> + >> + >> +EFI_STATUS >> +EFIAPI OemGetMac2P ( >> + IN OUT EFI_MAC_ADDRESS *Mac, >> + IN UINTN Port >> + ) >> +{ >> + OemGetMac (Mac, Port); >> + >> + return EFI_SUCCESS; >> +} >> + >> +EFI_STATUS >> +EFIAPI OemSetMac2P ( >> + IN EFI_MAC_ADDRESS *Mac, >> + IN UINTN Port >> + ) >> +{ >> + OemSetMac (Mac, Port); >> + >> + return EFI_SUCCESS; >> +} >> + >> +HISI_BOARD_NIC_PROTOCOL mHisiBoardNicProtocol2P = { >> + .GetMac = OemGetMac2P, >> + .SetMac = OemSetMac2P, >> +}; >> + >> + >> +EFI_STATUS >> +EFIAPI >> +OemNicConfigEntry ( >> + IN EFI_HANDLE ImageHandle, >> + IN EFI_SYSTEM_TABLE *SystemTable >> + ) >> +{ >> + EFI_STATUS Status; >> + >> + Status = gBS->InstallProtocolInterface ( >> + &ImageHandle, > > Indent to function name (InstallP...), not variable name. Modify it in v2. Thanks. > > / > Leif > >> + &gHisiBoardNicProtocolGuid, >> + EFI_NATIVE_INTERFACE, >> + &mHisiBoardNicProtocol2P >> + ); >> + >> + if (EFI_ERROR (Status)) { >> + DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Install Protocol failed %r\n", >> + __FUNCTION__, __LINE__, Status)); >> + return Status; >> + } >> + >> + return EFI_SUCCESS; >> +} >> + >> diff --git a/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf b/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf >> new file mode 100644 >> index 0000000000..a91f2b6005 >> --- /dev/null >> +++ b/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf >> @@ -0,0 +1,43 @@ >> +#/** @file >> +# >> +# Copyright (c) 2016-2018, Hisilicon Limited. All rights reserved. >> +# Copyright (c) 2016-2018, Linaro Limited. All rights reserved. >> +# >> +# This program and the accompanying materials >> +# are licensed and made available under the terms and conditions of the BSD License >> +# which accompanies this distribution. The full text of the license may be found at >> +# http://opensource.org/licenses/bsd-license.php >> +# >> +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, >> +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. >> +# >> +#**/ >> + >> +[Defines] >> + INF_VERSION = 0x0001001A >> + BASE_NAME = OemNicConfigPangea >> + FILE_GUID = edc95319-ebe9-4c38-96af-1d203fb85231 >> + MODULE_TYPE = DXE_DRIVER >> + VERSION_STRING = 1.0 >> + ENTRY_POINT = OemNicConfigEntry >> + >> +[Sources.common] >> + OemNicConfig2P.c >> + >> +[Packages] >> + MdeModulePkg/MdeModulePkg.dec >> + MdePkg/MdePkg.dec >> + Silicon/Hisilicon/HisiPkg.dec >> + >> +[Protocols] >> + gHisiBoardNicProtocolGuid ##Produce >> + >> +[LibraryClasses] >> + DebugLib >> + IoLib >> + OemNicLib >> + UefiBootServicesTableLib >> + UefiDriverEntryPoint >> + >> +[Depex] >> + TRUE >> -- >> 2.17.0 >>