From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::444; helo=mail-wr1-x444.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (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 6B4D921A00AE6 for ; Fri, 3 Aug 2018 08:23:52 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id u12-v6so5772021wrr.4 for ; Fri, 03 Aug 2018 08:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=2R9OUQyfsOZB/rlu/RLtK0rbi8k8So/tJMbVd6HK/ME=; b=V0XnHjiqA2SDk5htSHs+wSXh5aK6NJQxSNInBP1zJZrMECP14l4EmYkn96LY+6ZZTX izf5tkKXLsc0qzFUXukviFuJ5L+Vf6DPr1F1Ow//4oYXQaF8UgwaaS1YoZUa5iM5q52e dRixsfybVG6nTJyEVfsBguPiXwMuWsjtXPVbU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=2R9OUQyfsOZB/rlu/RLtK0rbi8k8So/tJMbVd6HK/ME=; b=rqBhL2hjg2SfkfuJdp5VKIU92KWYHrv6CSas4DtTJDKDzTjkUWWxaLkQ39ZeE2bSag tmFa+VckSyujx1N9Nz6KJGAg8N+o6cGnCA9vaoOjWUp+RErKOWE7Bxd9hecO3lD1M+bN va5VxHeqkNyt9G7s5xxSfGaHJ7cFytKqFPtq34ORF1MNq4DNb/53TqR+oqIQz36BD2jj nZGG+I2TU+YNUpzPs9+rguSaMSGvICQ2wBEK9hgG32Wo60Xlct+PuVTYkPdOEEz63TsT JKyopMxK19GRNKdxRv9onBpCRNjbsCzjhuj+9ne8xo4QRG1QTm53j3WgWD2pi004101z dblw== X-Gm-Message-State: AOUpUlEV+VDq9ChWs9Wtfh6uqLAuYX9SiGL9clC24RnN7Jks+qCNAMuu 7xV47kcr5g/MyE3hb6cEYSEI2fPC1qY= X-Google-Smtp-Source: AAOMgpeWiwCm45Dimz9F1BD9TIFHNOQRQ3pPfjWpHcVY6iP0EUcCcYsLm/ar6RWTGxwTLPxdaDUgQA== X-Received: by 2002:adf:bb08:: with SMTP id r8-v6mr2768771wrg.244.1533309830978; Fri, 03 Aug 2018 08:23:50 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id i15-v6sm3466236wrw.75.2018.08.03.08.23.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Aug 2018 08:23:49 -0700 (PDT) Date: Fri, 3 Aug 2018 16:23:47 +0100 From: Leif Lindholm To: Ming Huang 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 Message-ID: <20180803152347.htt7el4ghej4yr65@bivouac.eciton.net> References: <20180724070922.63362-1-ming.huang@linaro.org> <20180724070922.63362-25-ming.huang@linaro.org> MIME-Version: 1.0 In-Reply-To: <20180724070922.63362-25-ming.huang@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) 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: Fri, 03 Aug 2018 15:23:53 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. / 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 >