/** @file\r
UEFI Component Name(2) protocol implementation for MnpDxe driver.\r
\r
-Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions\r
-of the BSD License which accompanies this distribution. The full\r
-text of the license may be found at<BR>\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
\r
@param Mnp[in] A pointer to the EFI_MANAGED_NETWORK_PROTOCOL.\r
\r
- \r
+\r
@retval EFI_SUCCESS Update the ControllerNameTable of this instance successfully.\r
@retval EFI_INVALID_PARAMETER The input parameter is invalid.\r
- \r
+\r
**/\r
EFI_STATUS\r
UpdateName (\r
for (Index = 0; Index < SnpModeData.HwAddressSize; Index++) {\r
OffSet += UnicodeSPrint (\r
HandleName + OffSet,\r
- sizeof (HandleName) - OffSet,\r
+ sizeof (HandleName) - OffSet * sizeof (CHAR16),\r
L"%02X-",\r
SnpModeData.CurrentAddress.Addr[Index]\r
);\r
}\r
+ ASSERT (OffSet > 0);\r
//\r
// Remove the last '-'\r
//\r
- OffSet--; \r
+ OffSet--;\r
//\r
// Print the ProtocolType and VLAN ID for this instance.\r
//\r
OffSet += UnicodeSPrint (\r
HandleName + OffSet,\r
- sizeof (HandleName) - OffSet,\r
+ sizeof (HandleName) - OffSet * sizeof (CHAR16),\r
L", ProtocolType=0x%X, VlanId=%d)",\r
MnpConfigData.ProtocolTypeFilter,\r
Instance->MnpServiceData->VlanId\r
} else {\r
return Status;\r
}\r
- \r
+\r
if (gMnpControllerNameTable != NULL) {\r
FreeUnicodeStringTable (gMnpControllerNameTable);\r
gMnpControllerNameTable = NULL;\r
}\r
- \r
+\r
Status = AddUnicodeString2 (\r
"eng",\r
gMnpComponentName.SupportedLanguages,\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
return AddUnicodeString2 (\r
"en",\r
gMnpComponentName2.SupportedLanguages,\r
if (ChildHandle == NULL) {\r
return EFI_UNSUPPORTED;\r
}\r
- \r
- // \r
- // Make sure this driver is currently managing ControllerHandle \r
- // \r
+\r
+ //\r
+ // Make sure this driver is currently managing ControllerHandle\r
+ //\r
Status = EfiTestManagedDevice (\r
ControllerHandle,\r
gMnpDriverBinding.DriverBindingHandle,\r
&gEfiSimpleNetworkProtocolGuid\r
);\r
- if (EFI_ERROR (Status)) { \r
+ if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
- // \r
- // Make sure this driver produced ChildHandle \r
- // \r
+\r
+ //\r
+ // Make sure this driver produced ChildHandle\r
+ //\r
Status = EfiTestChildHandle (\r
ControllerHandle,\r
ChildHandle,\r
return Status;\r
}\r
\r
- // \r
- // Retrieve an instance of a produced protocol from ChildHandle \r
- // \r
+ //\r
+ // Retrieve an instance of a produced protocol from ChildHandle\r
+ //\r
Status = gBS->OpenProtocol (\r
ChildHandle,\r
&gEfiManagedNetworkProtocolGuid,\r