NetworkPkg: Clean up source files

1. Do not use tab characters
2. No trailing white space in one line
3. All files must end with CRLF

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Liming Gao
2018-06-27 21:12:32 +08:00
parent 9095d37b8f
commit f75a7f568e
180 changed files with 3642 additions and 3642 deletions

View File

@@ -1,7 +1,7 @@
/** @file
The implementation of construct ENTRY_INDEXER in IpSecConfig application.
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -50,7 +50,7 @@ ConstructSpdIndexer (
if (ValueStr == NULL) {
return EFI_INVALID_PARAMETER;
}
Value64 = StrToUInteger (ValueStr, &Status);
if (!EFI_ERROR (Status)) {
Indexer->Index = (UINTN) Value64;

View File

@@ -1,10 +1,10 @@
## @file
# Shell application IpSecConfig.
#
#
# This application is used to set and retrieve security and policy related information
# for the EFI IPsec protocol driver.
#
# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License

View File

@@ -4,13 +4,13 @@
// This application is used to set and retrieve security and policy related information
// for the EFI IPsec protocol driver.
//
// Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
//
// 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.
//

View File

@@ -1,7 +1,7 @@
// /** @file
// IpSecConfig Localized Strings and Content
//
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -13,8 +13,8 @@
//
// **/
#string STR_PROPERTIES_MODULE_NAME
#language en-US
#string STR_PROPERTIES_MODULE_NAME
#language en-US
"IpSec Config App"

View File

@@ -1,8 +1,8 @@
/** @file
The internal structure and function declaration of
The internal structure and function declaration of
match policy entry function in IpSecConfig application.
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License

View File

@@ -1,7 +1,7 @@
/** @file
The implementation of policy entry operation function in IpSecConfig application.
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -1875,7 +1875,7 @@ EditOperatePolicyEntry (
Selector
);
ASSERT_EFI_ERROR (Status);
if (CreateNew) {
//
// Edit the entry to a new one. So, we need delete the old entry.

View File

@@ -1,7 +1,7 @@
/** @file
Shell application for VLAN configuration.
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -618,7 +618,7 @@ VlanConfigMain (
EFI_STATUS Status;
mImageHandle = ImageHandle;
//
// Retrieve HII package list from ImageHandle
//

View File

@@ -3,13 +3,13 @@
//
// It is shell application which is used to get and set VLAN configuration.
//
// Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
//
// 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.
//

View File

@@ -1,7 +1,7 @@
// /** @file
// VConfig Localized Strings and Content
//
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -13,8 +13,8 @@
//
// **/
#string STR_PROPERTIES_MODULE_NAME
#language en-US
#string STR_PROPERTIES_MODULE_NAME
#language en-US
"Vlan Config App"

View File

@@ -1,7 +1,7 @@
/** @file
UEFI Component Name(2) protocol implementation for Dhcp6 driver.
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -247,10 +247,10 @@ Dhcp6ComponentNameGetDriverName (
@param Dhcp6[in] A pointer to the EFI_DHCP6_PROTOCOL.
@retval EFI_SUCCESS Update the ControllerNameTable of this instance successfully.
@retval EFI_INVALID_PARAMETER The input parameter is invalid.
**/
EFI_STATUS
UpdateName (
@@ -272,12 +272,12 @@ UpdateName (
if (EFI_ERROR (Status)) {
return Status;
}
if (gDhcp6ControllerNameTable != NULL) {
FreeUnicodeStringTable (gDhcp6ControllerNameTable);
gDhcp6ControllerNameTable = NULL;
}
if (Dhcp6ModeData.Ia == NULL) {
HandleName = L"DHCPv6 (No configured IA)";
} else {
@@ -304,7 +304,7 @@ UpdateName (
if (EFI_ERROR (Status)) {
return Status;
}
return AddUnicodeString2 (
"en",
gDhcp6ComponentName2.SupportedLanguages,
@@ -401,13 +401,13 @@ Dhcp6ComponentNameGetControllerName (
if (ChildHandle == NULL) {
return EFI_UNSUPPORTED;
}
//
// Make sure this driver produced ChildHandle
//
//
// Make sure this driver produced ChildHandle
//
Status = EfiTestChildHandle (
ControllerHandle,
ChildHandle,
ChildHandle,
&gEfiUdp6ProtocolGuid
);
if (EFI_ERROR (Status)) {
@@ -420,7 +420,7 @@ Dhcp6ComponentNameGetControllerName (
Status = gBS->OpenProtocol (
ChildHandle,
&gEfiDhcp6ProtocolGuid,
(VOID **)&Dhcp6,
(VOID **)&Dhcp6,
NULL,
NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL

View File

@@ -2,7 +2,7 @@
Driver Binding functions and Service Binding functions
implementationfor for Dhcp6 Driver.
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -328,7 +328,7 @@ Dhcp6CreateInstance (
/**
Callback function which provided by user to remove one node in NetDestroyLinkList process.
@param[in] Entry The entry to be removed.
@param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
@@ -352,7 +352,7 @@ Dhcp6DestroyChildEntry (
Instance = NET_LIST_USER_STRUCT_S (Entry, DHCP6_INSTANCE, Link, DHCP6_INSTANCE_SIGNATURE);
ServiceBinding = (EFI_SERVICE_BINDING_PROTOCOL *) Context;
return ServiceBinding->DestroyChild (ServiceBinding, Instance->Handle);
}
@@ -558,7 +558,7 @@ Dhcp6DriverBindingStop (
if (!IsListEmpty (&Service->Child)) {
//
// Destroy all the children instances before destory the service.
//
//
List = &Service->Child;
Status = NetDestroyLinkList (
List,
@@ -591,7 +591,7 @@ Dhcp6DriverBindingStop (
Dhcp6DestroyService (Service);
Status = EFI_SUCCESS;
}
ON_EXIT:
return Status;
}

View File

@@ -1,11 +1,11 @@
## @file
# Client-side DHCPv6 services.
#
#
# This driver produces EFI DHCPv6 Protocol which is used to get IPv6 addresses
# and other configuration parameters from DHCPv6 servers.
#
# (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
# Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -74,9 +74,9 @@
gEfiDhcp6ProtocolGuid ## BY_START
gEfiIp6ConfigProtocolGuid ## TO_START
[Guids]
[Guids]
gZeroGuid ## SOMETIMES_CONSUMES ## GUID
[Pcd]
gEfiNetworkPkgTokenSpaceGuid.PcdDhcp6UidType ## SOMETIMES_CONSUMES

View File

@@ -4,13 +4,13 @@
// This driver produces EFI DHCPv6 Protocol which is used to get IPv6 addresses
// and other configuration parameters from DHCPv6 servers.
//
// Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
//
// 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.
//

View File

@@ -1,7 +1,7 @@
// /** @file
// Dhcp6Dxe Localized Strings and Content
//
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -13,8 +13,8 @@
//
// **/
#string STR_PROPERTIES_MODULE_NAME
#language en-US
#string STR_PROPERTIES_MODULE_NAME
#language en-US
"DHCP6 DXE"

View File

@@ -1,7 +1,7 @@
/** @file
This EFI_DHCP6_PROTOCOL interface implementation.
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -237,7 +237,7 @@ EfiDhcp6Stop (
}
Status = Instance->UdpSts;
}
ON_EXIT:
//
// Clean up the session data for the released Ia.
@@ -678,7 +678,7 @@ EfiDhcp6InfoRequest (
return Status;
}
do {
do {
TimerStatus = gBS->CheckEvent (Timer);
if (!EFI_ERROR (TimerStatus)) {
Status = Dhcp6StartInfoRequest (
@@ -694,7 +694,7 @@ EfiDhcp6InfoRequest (
);
}
} while (TimerStatus == EFI_NOT_READY);
gBS->CloseEvent (Timer);
}
if (EFI_ERROR (Status)) {

View File

@@ -1,7 +1,7 @@
/** @file
Dhcp6 internal data structure and definition declaration.
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -132,7 +132,7 @@ struct _DHCP6_INSTANCE {
BOOLEAN MediaPresent;
//
// StartTime is used to calculate the 'elapsed-time' option. Refer to RFC3315,
// the elapsed-time is amount of time since the client began its current DHCP transaction.
// the elapsed-time is amount of time since the client began its current DHCP transaction.
//
UINT64 StartTime;
};

View File

@@ -2,7 +2,7 @@
Dhcp6 internal functions implementation.
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -372,7 +372,7 @@ Dhcp6CleanupRetry (
@retval TRUE The control block is in Instance's retry list.
@retval FALSE The control block is NOT in Instance's retry list.
**/
BOOLEAN
Dhcp6IsValidTxCb (
@@ -1767,12 +1767,12 @@ Dhcp6StartInfoRequest (
if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {
goto ON_ERROR;
}
gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
ON_ERROR:
gBS->RestoreTPL (OldTpl);
gBS->RestoreTPL (OldTpl);
RemoveEntryList (&InfCb->Link);
FreePool (InfCb);
@@ -1896,7 +1896,7 @@ Dhcp6SendInfoRequestMsg (
//
Packet->Length += (UINT32) (Cursor - Packet->Dhcp6.Option);
ASSERT (Packet->Size > Packet->Length + 8);
//
// Clear initial time for current transaction.
//
@@ -2232,15 +2232,15 @@ Dhcp6HandleReplyMsg (
}
} else if (Status == EFI_NOT_FOUND) {
//
// Refer to RFC3315 Chapter 18.1.8, for each IA in the original Renew or Rebind message,
// Refer to RFC3315 Chapter 18.1.8, for each IA in the original Renew or Rebind message,
// the client sends a Renew or Rebind if the IA is not in the Reply message.
// Return EFI_SUCCESS so we can continue to restart the Renew/Rebind process.
//
return EFI_SUCCESS;
}
goto ON_EXIT;
} else if (Option != NULL) {
//
// Any error status code option is found.
@@ -2289,7 +2289,7 @@ Dhcp6HandleReplyMsg (
case Dhcp6StsNoBinding:
if (Instance->IaCb.Ia->State == Dhcp6Renewing || Instance->IaCb.Ia->State == Dhcp6Rebinding) {
//
// Refer to RFC3315 Chapter 18.1.8, for each IA in the original Renew or Rebind message, the client
// Refer to RFC3315 Chapter 18.1.8, for each IA in the original Renew or Rebind message, the client
// sends a Request message if the IA contained a Status Code option with the NoBinding status.
//
Status = Dhcp6SendRequestMsg(Instance);
@@ -2308,7 +2308,7 @@ Dhcp6HandleReplyMsg (
}
return EFI_SUCCESS;
ON_EXIT:
if (!EFI_ERROR(Status)) {
@@ -2318,7 +2318,7 @@ ON_EXIT:
FALSE
);
}
return Status;
}

View File

@@ -2,7 +2,7 @@
Dhcp6 support functions implementation.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -68,7 +68,7 @@ Dhcp6GenerateClientId (
//
//
// The format of DUID-UUID:
//
//
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
// | DUID-Type (4) | UUID (128 bits) |
@@ -91,16 +91,16 @@ Dhcp6GenerateClientId (
// sizeof (Duid-type + UUID-size) = 18 bytes
//
Duid->Length = (UINT16) (18);
//
// Set the Duid-type and copy UUID.
//
WriteUnaligned16 ((UINT16 *) (Duid->Duid), HTONS (Dhcp6DuidTypeUuid));
CopyMem (Duid->Duid + 2, &Uuid, sizeof(EFI_GUID));
} else {
//
//
// The format of DUID-LLT:
@@ -135,12 +135,12 @@ Dhcp6GenerateClientId (
if (Duid == NULL) {
return NULL;
}
//
// sizeof (Duid-type + hardware-type + time) = 8 bytes
//
Duid->Length = (UINT16) (Mode->HwAddressSize + 8);
//
// Set the Duid-type, hardware-type, time and copy the hardware address.
//
@@ -687,7 +687,7 @@ Dhcp6AppendIaAddrOption (
// . IAaddr-options .
// . .
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//
// Fill the value of Ia Address option type
//
@@ -1000,7 +1000,7 @@ Dhcp6SeekIaOption (
}
/**
Check whether the incoming IPv6 address in IaAddr is one of the maintained
Check whether the incoming IPv6 address in IaAddr is one of the maintained
addresses in the IA control blcok.
@param[in] IaAddr The pointer to the IA Address to be checked.
@@ -1019,7 +1019,7 @@ Dhcp6AddrIsInCurrentIa (
UINT32 Index;
ASSERT (IaAddr != NULL && CurrentIa != NULL);
for (Index = 0; Index < CurrentIa->IaAddressCount; Index++) {
if (EFI_IP6_EQUAL(&IaAddr->IpAddress, &CurrentIa->IaAddress[Index].IpAddress)) {
return TRUE;
@@ -1303,7 +1303,7 @@ EFI_STATUS
Dhcp6GetMappingTimeOut (
IN EFI_IP6_CONFIG_PROTOCOL *Ip6Cfg,
OUT UINTN *TimeOut
)
)
{
EFI_STATUS Status;
UINTN DataSize;
@@ -1323,8 +1323,8 @@ Dhcp6GetMappingTimeOut (
if (EFI_ERROR (Status)) {
return Status;
}
*TimeOut = TICKS_PER_SECOND * DadXmits.DupAddrDetectTransmits + DHCP6_DAD_ADDITIONAL_DELAY;
return EFI_SUCCESS;
}

View File

@@ -1,7 +1,7 @@
/** @file
Implementation of EFI_COMPONENT_NAME_PROTOCOL and EFI_COMPONENT_NAME2_PROTOCOL protocol.
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -101,7 +101,7 @@ DnsComponentNameGetControllerName (
///
/// Component Name Protocol instance
///
GLOBAL_REMOVE_IF_UNREFERENCED
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_COMPONENT_NAME_PROTOCOL gDnsComponentName = {
DnsComponentNameGetDriverName,
DnsComponentNameGetControllerName,
@@ -111,7 +111,7 @@ EFI_COMPONENT_NAME_PROTOCOL gDnsComponentName = {
///
/// Component Name 2 Protocol instance
///
GLOBAL_REMOVE_IF_UNREFERENCED
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_COMPONENT_NAME2_PROTOCOL gDnsComponentName2 = {
(EFI_COMPONENT_NAME2_GET_DRIVER_NAME) DnsComponentNameGetDriverName,
(EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) DnsComponentNameGetControllerName,
@@ -121,7 +121,7 @@ EFI_COMPONENT_NAME2_PROTOCOL gDnsComponentName2 = {
///
/// Table of driver names
///
GLOBAL_REMOVE_IF_UNREFERENCED
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_UNICODE_STRING_TABLE mDnsDriverNameTable[] = {
{ "eng;en", (CHAR16 *)L"DNS Network Service Driver" },
{ NULL, NULL }
@@ -173,10 +173,10 @@ DnsComponentNameGetDriverName (
@param Dns4 A pointer to the EFI_DNS4_PROTOCOL.
@retval EFI_SUCCESS Update the ControllerNameTable of this instance successfully.
@retval EFI_INVALID_PARAMETER The input parameter is invalid.
**/
EFI_STATUS
UpdateDns4Name (
@@ -190,7 +190,7 @@ UpdateDns4Name (
if (Dns4 == NULL) {
return EFI_INVALID_PARAMETER;
}
//
// Format the child name into the string buffer as:
// DNSv4 (StationIp=?, LocalPort=?)
@@ -199,7 +199,7 @@ UpdateDns4Name (
if (EFI_ERROR (Status)) {
return Status;
}
UnicodeSPrint (
HandleName,
sizeof (HandleName),
@@ -222,7 +222,7 @@ UpdateDns4Name (
FreeUnicodeStringTable (gDnsControllerNameTable);
gDnsControllerNameTable = NULL;
}
Status = AddUnicodeString2 (
"eng",
gDnsComponentName.SupportedLanguages,
@@ -233,7 +233,7 @@ UpdateDns4Name (
if (EFI_ERROR (Status)) {
return Status;
}
return AddUnicodeString2 (
"en",
gDnsComponentName2.SupportedLanguages,
@@ -248,10 +248,10 @@ UpdateDns4Name (
@param Dns6 A pointer to the EFI_DNS6_PROTOCOL.
@retval EFI_SUCCESS Update the ControllerNameTable of this instance successfully.
@retval EFI_INVALID_PARAMETER The input parameter is invalid.
**/
EFI_STATUS
UpdateDns6Name (
@@ -266,7 +266,7 @@ UpdateDns6Name (
if (Dns6 == NULL) {
return EFI_INVALID_PARAMETER;
}
//
// Format the child name into the string buffer as:
// DNSv6 (StationIp=?, LocalPort=?)
@@ -282,7 +282,7 @@ UpdateDns6Name (
}
UnicodeSPrint (
HandleName,
sizeof (HandleName),
sizeof (HandleName),
L"DNSv6 (StationIp=%s, LocalPort=%d)",
Address,
ModeData.DnsConfigData.LocalPort
@@ -299,7 +299,7 @@ UpdateDns6Name (
FreeUnicodeStringTable (gDnsControllerNameTable);
gDnsControllerNameTable = NULL;
}
Status = AddUnicodeString2 (
"eng",
gDnsComponentName.SupportedLanguages,
@@ -310,7 +310,7 @@ UpdateDns6Name (
if (EFI_ERROR (Status)) {
return Status;
}
return AddUnicodeString2 (
"en",
gDnsComponentName2.SupportedLanguages,
@@ -373,7 +373,7 @@ DnsComponentNameGetControllerName (
EFI_STATUS Status;
EFI_DNS4_PROTOCOL *Dns4;
EFI_DNS6_PROTOCOL *Dns6;
//
// ChildHandle must be NULL for a Device Driver
//

View File

@@ -1,7 +1,7 @@
/** @file
Functions implementation related with DHCPv4/v6 for DNS driver.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -48,7 +48,7 @@ DnsInitSeedPacket (
}
/**
The common notify function.
The common notify function.
@param[in] Event The event signaled.
@param[in] Context The context.
@@ -149,16 +149,16 @@ ParseDhcp4Ack (
}
gBS->FreePool (OptionList);
return Status;
}
/**
EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol
EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol
instance to intercept events that occurs in the DHCPv6 Information Request
exchange process.
@param This Pointer to the EFI_DHCP6_PROTOCOL instance that
@param This Pointer to the EFI_DHCP6_PROTOCOL instance that
is used to configure this callback function.
@param Context Pointer to the context that is initialized in
the EFI_DHCP6_PROTOCOL.InfoRequest().
@@ -186,11 +186,11 @@ ParseDhcp6Ack (
EFI_IPv6_ADDRESS *ServerList;
UINT32 Index;
UINT32 Count;
OptionCount = 0;
ServerCount = 0;
ServerList = NULL;
Status = This->Parse (This, Packet, &OptionCount, NULL);
if (Status != EFI_BUFFER_TOO_SMALL) {
return EFI_DEVICE_ERROR;
@@ -206,7 +206,7 @@ ParseDhcp6Ack (
gBS->FreePool (OptionList);
return EFI_DEVICE_ERROR;
}
DnsServerInfor = (DNS6_SERVER_INFOR *) Context;
for (Index = 0; Index < OptionCount; Index++) {
@@ -223,7 +223,7 @@ ParseDhcp6Ack (
gBS->FreePool (OptionList);
return Status;
}
ServerCount = OptionList[Index]->OpLen/16;
ServerList = AllocatePool (ServerCount * sizeof (EFI_IPv6_ADDRESS));
if (ServerList == NULL) {
@@ -241,7 +241,7 @@ ParseDhcp6Ack (
}
gBS->FreePool (OptionList);
return Status;
}
@@ -270,10 +270,10 @@ GetDns4ServerFromDhcp4 (
EFI_HANDLE Image;
EFI_HANDLE Controller;
EFI_STATUS MediaStatus;
EFI_HANDLE MnpChildHandle;
EFI_HANDLE MnpChildHandle;
EFI_MANAGED_NETWORK_PROTOCOL *Mnp;
EFI_MANAGED_NETWORK_CONFIG_DATA MnpConfigData;
EFI_HANDLE Dhcp4Handle;
EFI_HANDLE Dhcp4Handle;
EFI_DHCP4_PROTOCOL *Dhcp4;
EFI_IP4_CONFIG2_PROTOCOL *Ip4Config2;
UINTN DataSize;
@@ -286,13 +286,13 @@ GetDns4ServerFromDhcp4 (
EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN Token;
BOOLEAN IsDone;
UINTN Index;
Image = Instance->Service->ImageHandle;
Controller = Instance->Service->ControllerHandle;
MnpChildHandle = NULL;
Mnp = NULL;
Dhcp4Handle = NULL;
Dhcp4 = NULL;
@@ -304,11 +304,11 @@ GetDns4ServerFromDhcp4 (
ZeroMem ((UINT8 *) ParaList, sizeof (ParaList));
ZeroMem (&MnpConfigData, sizeof (EFI_MANAGED_NETWORK_CONFIG_DATA));
ZeroMem (&DnsServerInfor, sizeof (DNS4_SERVER_INFOR));
ZeroMem (&Token, sizeof (EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN));
DnsServerInfor.ServerCount = DnsServerCount;
IsDone = FALSE;
@@ -346,7 +346,7 @@ GetDns4ServerFromDhcp4 (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
MnpConfigData.ReceivedQueueTimeoutValue = 0;
MnpConfigData.TransmitQueueTimeoutValue = 0;
MnpConfigData.ProtocolTypeFilter = IP4_ETHER_PROTO;
@@ -362,7 +362,7 @@ GetDns4ServerFromDhcp4 (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
//
// Create a DHCP4 child instance and get the protocol.
//
@@ -395,7 +395,7 @@ GetDns4ServerFromDhcp4 (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
Status = Ip4Config2->GetData (Ip4Config2, Ip4Config2DataTypeInterfaceInfo, &DataSize, Data);
if (EFI_ERROR (Status) && Status != EFI_BUFFER_TOO_SMALL) {
goto ON_EXIT;
@@ -413,7 +413,7 @@ GetDns4ServerFromDhcp4 (
}
InterfaceInfo = (EFI_IP4_CONFIG2_INTERFACE_INFO *)Data;
//
// Build required Token.
//
@@ -427,13 +427,13 @@ GetDns4ServerFromDhcp4 (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
SetMem (&Token.RemoteAddress, sizeof (EFI_IPv4_ADDRESS), 0xff);
Token.RemotePort = 67;
Token.ListenPointCount = 1;
Token.ListenPoints = AllocateZeroPool (Token.ListenPointCount * sizeof (EFI_DHCP4_LISTEN_POINT));
if (Token.ListenPoints == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -447,9 +447,9 @@ GetDns4ServerFromDhcp4 (
CopyMem (&(Token.ListenPoints[0].ListenAddress), &(Instance->Dns4CfgData.StationIp), sizeof (EFI_IPv4_ADDRESS));
CopyMem (&(Token.ListenPoints[0].SubnetMask), &(Instance->Dns4CfgData.SubnetMask), sizeof (EFI_IPv4_ADDRESS));
}
Token.ListenPoints[0].ListenPort = 68;
Token.TimeoutValue = DNS_TIME_TO_GETMAP;
DnsInitSeedPacket (&SeedPacket, InterfaceInfo);
@@ -459,35 +459,35 @@ GetDns4ServerFromDhcp4 (
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
ParaList[0]->OpCode = DHCP4_TAG_TYPE;
ParaList[0]->Length = 1;
ParaList[0]->Data[0] = DHCP4_MSG_REQUEST;
ParaList[1] = AllocateZeroPool (sizeof (EFI_DHCP4_PACKET_OPTION));
if (ParaList[1] == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
ParaList[1]->OpCode = DHCP4_TAG_PARA_LIST;
ParaList[1]->Length = 1;
ParaList[1]->Data[0] = DHCP4_TAG_DNS_SERVER;
Status = Dhcp4->Build (Dhcp4, &SeedPacket, 0, NULL, 2, ParaList, &Token.Packet);
Status = Dhcp4->Build (Dhcp4, &SeedPacket, 0, NULL, 2, ParaList, &Token.Packet);
Token.Packet->Dhcp4.Header.Xid = HTONL(NET_RANDOM (NetRandomInitSeed ()));
Token.Packet->Dhcp4.Header.Reserved = HTONS ((UINT16)0x8000);
if (Instance->Dns4CfgData.UseDefaultSetting) {
CopyMem (&(Token.Packet->Dhcp4.Header.ClientAddr), &(InterfaceInfo->StationAddress), sizeof (EFI_IPv4_ADDRESS));
} else {
CopyMem (&(Token.Packet->Dhcp4.Header.ClientAddr), &(Instance->Dns4CfgData.StationIp), sizeof (EFI_IPv4_ADDRESS));
}
CopyMem (Token.Packet->Dhcp4.Header.ClientHwAddr, &(InterfaceInfo->HwAddress), InterfaceInfo->HwAddressSize);
CopyMem (Token.Packet->Dhcp4.Header.ClientHwAddr, &(InterfaceInfo->HwAddress), InterfaceInfo->HwAddressSize);
Token.Packet->Dhcp4.Header.HwAddrLen = (UINT8)(InterfaceInfo->HwAddressSize);
//
@@ -504,7 +504,7 @@ GetDns4ServerFromDhcp4 (
do {
Status = Mnp->Poll (Mnp);
} while (!IsDone);
//
// Parse the ACK to get required information if received done.
//
@@ -520,7 +520,7 @@ GetDns4ServerFromDhcp4 (
} else {
Status = Token.Status;
}
ON_EXIT:
if (Data != NULL) {
@@ -540,15 +540,15 @@ ON_EXIT:
if (Token.Packet) {
FreePool (Token.Packet);
}
if (Token.ResponseList != NULL) {
FreePool (Token.ResponseList);
}
if (Token.CompletionEvent != NULL) {
gBS->CloseEvent (Token.CompletionEvent);
}
if (Dhcp4 != NULL) {
Dhcp4->Stop (Dhcp4);
Dhcp4->Configure (Dhcp4, NULL);
@@ -560,7 +560,7 @@ ON_EXIT:
Controller
);
}
if (Dhcp4Handle != NULL) {
NetLibDestroyServiceChild (
Controller,
@@ -580,14 +580,14 @@ ON_EXIT:
Controller
);
}
NetLibDestroyServiceChild (
Controller,
Image,
&gEfiManagedNetworkServiceBindingProtocolGuid,
MnpChildHandle
);
return Status;
}
@@ -729,14 +729,14 @@ GetDns6ServerFromDhcp6 (
}
} while (TimerStatus == EFI_NOT_READY);
}
*DnsServerList = DnsServerInfor.ServerList;
ON_EXIT:
if (Oro != NULL) {
FreePool (Oro);
}
}
if (Timer != NULL) {
gBS->CloseEvent (Timer);
@@ -759,6 +759,6 @@ ON_EXIT:
);
return Status;
}

View File

@@ -1,7 +1,7 @@
/** @file
Functions implementation related with DHCPv4/v6 for DNS driver.
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -78,11 +78,11 @@ ParseDhcp4Ack (
);
/**
EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol
EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol
instance to intercept events that occurs in the DHCPv6 Information Request
exchange process.
@param This Pointer to the EFI_DHCP6_PROTOCOL instance that
@param This Pointer to the EFI_DHCP6_PROTOCOL instance that
is used to configure this callback function.
@param Context Pointer to the context that is initialized in
the EFI_DHCP6_PROTOCOL.InfoRequest().
@@ -143,5 +143,5 @@ GetDns6ServerFromDhcp6 (
OUT UINT32 *DnsServerCount,
OUT EFI_IPv6_ADDRESS **DnsServerList
);
#endif
#endif

View File

@@ -1,7 +1,7 @@
/** @file
The driver binding and service binding protocol for DnsDxe driver.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -56,9 +56,9 @@ DnsDestroyInstance (
)
{
ZeroMem (&Instance->Dns4CfgData, sizeof (EFI_DNS4_CONFIG_DATA));
ZeroMem (&Instance->Dns6CfgData, sizeof (EFI_DNS6_CONFIG_DATA));
if (!NetMapIsEmpty (&Instance->Dns4TxTokens)) {
Dns4InstanceCancelToken (Instance, NULL);
}
@@ -66,11 +66,11 @@ DnsDestroyInstance (
if (!NetMapIsEmpty (&Instance->Dns6TxTokens)) {
Dns6InstanceCancelToken (Instance, NULL);
}
if (Instance->UdpIo!= NULL) {
UdpIoFreeIo (Instance->UdpIo);
}
FreePool (Instance);
}
@@ -93,7 +93,7 @@ DnsCreateInstance (
DNS_INSTANCE *DnsIns;
*Instance = NULL;
DnsIns = AllocateZeroPool (sizeof (DNS_INSTANCE));
if (DnsIns == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -104,7 +104,7 @@ DnsCreateInstance (
DnsIns->State = DNS_STATE_UNCONFIGED;
DnsIns->InDestroy = FALSE;
DnsIns->Service = Service;
if (Service->IpVersion == IP_VERSION_4) {
CopyMem (&DnsIns->Dns4, &mDns4Protocol, sizeof (DnsIns->Dns4));
NetMapInit (&DnsIns->Dns4TxTokens);
@@ -124,7 +124,7 @@ DnsCreateInstance (
FreePool (DnsIns);
return EFI_OUT_OF_RESOURCES;
}
*Instance = DnsIns;
return EFI_SUCCESS;
@@ -132,7 +132,7 @@ DnsCreateInstance (
/**
Callback function which provided by user to remove one node in NetDestroyLinkList process.
@param[in] Entry The entry to be removed.
@param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
@@ -202,7 +202,7 @@ DnsDestroyService (
)
{
UdpIoFreeIo (DnsSb->ConnectUdp);
if (DnsSb->TimerToGetMap != NULL){
gBS->CloseEvent (DnsSb->TimerToGetMap);
}
@@ -241,7 +241,7 @@ DnsCreateService (
{
EFI_STATUS Status;
DNS_SERVICE *DnsSb;
Status = EFI_SUCCESS;
DnsSb = NULL;
@@ -259,7 +259,7 @@ DnsCreateService (
} else {
DnsSb->ServiceBinding = mDns6ServiceBinding;
}
DnsSb->Dns4ChildrenNum = 0;
InitializeListHead (&DnsSb->Dns4ChildrenList);
@@ -270,9 +270,9 @@ DnsCreateService (
DnsSb->ImageHandle = Image;
DnsSb->TimerToGetMap = NULL;
DnsSb->Timer = NULL;
DnsSb->IpVersion = IpVersion;
//
@@ -290,7 +290,7 @@ DnsCreateService (
FreePool (DnsSb);
return Status;
}
//
// Create the timer to retransmit packets.
//
@@ -308,7 +308,7 @@ DnsCreateService (
FreePool (DnsSb);
return Status;
}
DnsSb->ConnectUdp = NULL;
DnsSb->ConnectUdp = UdpIoCreateIo (
Controller,
@@ -339,7 +339,7 @@ DnsCreateService (
@retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.
**/
EFI_STATUS
EFI_STATUS
EFIAPI
DnsUnload (
IN EFI_HANDLE ImageHandle
@@ -357,7 +357,7 @@ DnsUnload (
ItemServerIp4 = NULL;
ItemCache6 = NULL;
ItemServerIp6 = NULL;
//
// Disconnect the driver specified by ImageHandle
//
@@ -373,7 +373,7 @@ DnsUnload (
if (mDriverData->Timer != NULL) {
gBS->CloseEvent (mDriverData->Timer);
}
while (!IsListEmpty (&mDriverData->Dns4CacheList)) {
Entry = NetListRemoveHead (&mDriverData->Dns4CacheList);
ItemCache4 = NET_LIST_USER_STRUCT (Entry, DNS4_CACHE, AllCacheLink);
@@ -409,10 +409,10 @@ DnsUnload (
ItemServerIp6 = NET_LIST_USER_STRUCT (Entry, DNS6_SERVER_IP, AllServerLink);
FreePool (ItemServerIp6);
}
FreePool (mDriverData);
}
return Status;
}
@@ -490,7 +490,7 @@ DnsDriverEntryPoint (
if (EFI_ERROR (Status)) {
goto Error3;
}
Status = gBS->SetTimer (mDriverData->Timer, TimerPeriodic, TICKS_PER_SECOND);
if (EFI_ERROR (Status)) {
goto Error4;
@@ -500,7 +500,7 @@ DnsDriverEntryPoint (
InitializeListHead (&mDriverData->Dns4ServerList);
InitializeListHead (&mDriverData->Dns6CacheList);
InitializeListHead (&mDriverData->Dns6ServerList);
return Status;
Error4:
@@ -508,18 +508,18 @@ DnsDriverEntryPoint (
Error3:
FreePool (mDriverData);
Error2:
Error2:
gBS->UninstallMultipleProtocolInterfaces (
gDns6DriverBinding.DriverBindingHandle,
&gEfiDriverBindingProtocolGuid,
&gDns6DriverBinding,
&gDns6DriverBinding,
&gEfiComponentName2ProtocolGuid,
&gDnsComponentName2,
&gEfiComponentNameProtocolGuid,
&gDnsComponentName,
NULL
);
);
Error1:
gBS->UninstallMultipleProtocolInterfaces (
@@ -532,38 +532,38 @@ DnsDriverEntryPoint (
&gDnsComponentName,
NULL
);
return Status;
}
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -622,28 +622,28 @@ Dns4DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -668,14 +668,14 @@ Dns4DriverBindingStart (
if (EFI_ERROR (Status)) {
return Status;
}
ASSERT (DnsSb != NULL);
Status = gBS->SetTimer (DnsSb->Timer, TimerPeriodic, TICKS_PER_SECOND);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
//
// Install the Dns4ServiceBinding Protocol onto ControllerHandle.
//
@@ -699,10 +699,10 @@ ON_ERROR:
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -710,13 +710,13 @@ ON_ERROR:
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -788,7 +788,7 @@ Dns4DriverBindingStop (
);
DnsDestroyService (DnsSb);
if (gDnsControllerNameTable != NULL) {
FreeUnicodeStringTable (gDnsControllerNameTable);
gDnsControllerNameTable = NULL;
@@ -801,33 +801,33 @@ Dns4DriverBindingStop (
}
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -886,28 +886,28 @@ Dns6DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -932,14 +932,14 @@ Dns6DriverBindingStart (
if (EFI_ERROR (Status)) {
return Status;
}
ASSERT (DnsSb != NULL);
Status = gBS->SetTimer (DnsSb->Timer, TimerPeriodic, TICKS_PER_SECOND);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
//
// Install the Dns6ServiceBinding Protocol onto ControllerHandle
//
@@ -964,10 +964,10 @@ ON_ERROR:
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -975,13 +975,13 @@ ON_ERROR:
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -1053,12 +1053,12 @@ Dns6DriverBindingStop (
);
DnsDestroyService (DnsSb);
if (gDnsControllerNameTable != NULL) {
FreeUnicodeStringTable (gDnsControllerNameTable);
gDnsControllerNameTable = NULL;
}
Status = EFI_SUCCESS;
}
@@ -1067,14 +1067,14 @@ Dns6DriverBindingStop (
/**
Creates a child handle and installs a protocol.
The CreateChild() function installs a protocol on ChildHandle.
If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
The CreateChild() function installs a protocol on ChildHandle.
If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,
then a new handle is created. If it is a pointer to an existing UEFI handle,
then a new handle is created. If it is a pointer to an existing UEFI handle,
then the protocol is added to the existing UEFI handle.
@retval EFI_SUCCES The protocol was added to ChildHandle.
@@ -1142,7 +1142,7 @@ Dns4ServiceBindingCreateChild (
&Instance->Dns4,
NULL
);
goto ON_ERROR;
}
@@ -1167,14 +1167,14 @@ Dns4ServiceBindingCreateChild (
gDns4DriverBinding.DriverBindingHandle,
ChildHandle
);
gBS->UninstallMultipleProtocolInterfaces (
Instance->ChildHandle,
&gEfiDns4ProtocolGuid,
&Instance->Dns4,
NULL
);
goto ON_ERROR;
}
@@ -1198,9 +1198,9 @@ ON_ERROR:
/**
Destroys a child handle with a protocol installed on it.
The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
that was installed by CreateChild() from ChildHandle. If the removed protocol is the
The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
that was installed by CreateChild() from ChildHandle. If the removed protocol is the
last protocol on ChildHandle, then ChildHandle is destroyed.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@@ -1260,7 +1260,7 @@ Dns4ServiceBindingDestroyChild (
}
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
Instance->InDestroy = TRUE;
//
@@ -1292,7 +1292,7 @@ Dns4ServiceBindingDestroyChild (
);
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (EFI_ERROR (Status)) {
Instance->InDestroy = FALSE;
gBS->RestoreTPL (OldTpl);
@@ -1310,14 +1310,14 @@ Dns4ServiceBindingDestroyChild (
/**
Creates a child handle and installs a protocol.
The CreateChild() function installs a protocol on ChildHandle.
If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
The CreateChild() function installs a protocol on ChildHandle.
If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,
then a new handle is created. If it is a pointer to an existing UEFI handle,
then a new handle is created. If it is a pointer to an existing UEFI handle,
then the protocol is added to the existing UEFI handle.
@retval EFI_SUCCES The protocol was added to ChildHandle.
@@ -1385,7 +1385,7 @@ Dns6ServiceBindingCreateChild (
&Instance->Dns6,
NULL
);
goto ON_ERROR;
}
@@ -1410,14 +1410,14 @@ Dns6ServiceBindingCreateChild (
gDns6DriverBinding.DriverBindingHandle,
ChildHandle
);
gBS->UninstallMultipleProtocolInterfaces (
Instance->ChildHandle,
&gEfiDns6ProtocolGuid,
&Instance->Dns6,
NULL
);
goto ON_ERROR;
}
@@ -1441,9 +1441,9 @@ ON_ERROR:
/**
Destroys a child handle with a protocol installed on it.
The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
that was installed by CreateChild() from ChildHandle. If the removed protocol is the
The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
that was installed by CreateChild() from ChildHandle. If the removed protocol is the
last protocol on ChildHandle, then ChildHandle is destroyed.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.

View File

@@ -1,7 +1,7 @@
/** @file
The header files of the driver binding and service binding protocol for DnsDxe driver.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -35,11 +35,11 @@ typedef struct _DNS_INSTANCE DNS_INSTANCE;
#define DNS_SERVICE_SIGNATURE SIGNATURE_32 ('D', 'N', 'S', 'S')
#define DNS_INSTANCE_SIGNATURE SIGNATURE_32 ('D', 'N', 'S', 'I')
#define DNS_INSTANCE_SIGNATURE SIGNATURE_32 ('D', 'N', 'S', 'I')
struct _DNS_DRIVER_DATA {
EFI_EVENT Timer; /// Ticking timer for DNS cache update.
LIST_ENTRY Dns4CacheList;
LIST_ENTRY Dns4ServerList;
@@ -59,7 +59,7 @@ struct _DNS_SERVICE {
EFI_HANDLE ControllerHandle;
EFI_HANDLE ImageHandle;
EFI_EVENT TimerToGetMap;
EFI_EVENT Timer; /// Ticking timer for packet retransmission.
@@ -71,10 +71,10 @@ struct _DNS_SERVICE {
struct _DNS_INSTANCE {
UINT32 Signature;
LIST_ENTRY Link;
EFI_DNS4_PROTOCOL Dns4;
EFI_DNS6_PROTOCOL Dns6;
INTN State;
BOOLEAN InDestroy;
@@ -139,7 +139,7 @@ DnsCreateInstance (
/**
Callback function which provided by user to remove one node in NetDestroyLinkList process.
@param[in] Entry The entry to be removed.
@param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
@@ -218,7 +218,7 @@ DnsCreateService (
@retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.
**/
EFI_STATUS
EFI_STATUS
EFIAPI
DnsUnload (
IN EFI_HANDLE ImageHandle
@@ -243,33 +243,33 @@ DnsDriverEntryPoint (
);
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -296,28 +296,28 @@ Dns4DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -337,10 +337,10 @@ Dns4DriverBindingStart (
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -348,13 +348,13 @@ Dns4DriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -371,33 +371,33 @@ Dns4DriverBindingStop (
);
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -424,28 +424,28 @@ Dns6DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -465,10 +465,10 @@ Dns6DriverBindingStart (
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -476,13 +476,13 @@ Dns6DriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -500,14 +500,14 @@ Dns6DriverBindingStop (
/**
Creates a child handle and installs a protocol.
The CreateChild() function installs a protocol on ChildHandle.
If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
The CreateChild() function installs a protocol on ChildHandle.
If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,
then a new handle is created. If it is a pointer to an existing UEFI handle,
then a new handle is created. If it is a pointer to an existing UEFI handle,
then the protocol is added to the existing UEFI handle.
@retval EFI_SUCCES The protocol was added to ChildHandle.
@@ -526,9 +526,9 @@ Dns4ServiceBindingCreateChild (
/**
Destroys a child handle with a protocol installed on it.
The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
that was installed by CreateChild() from ChildHandle. If the removed protocol is the
The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
that was installed by CreateChild() from ChildHandle. If the removed protocol is the
last protocol on ChildHandle, then ChildHandle is destroyed.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@@ -551,14 +551,14 @@ Dns4ServiceBindingDestroyChild (
/**
Creates a child handle and installs a protocol.
The CreateChild() function installs a protocol on ChildHandle.
If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
The CreateChild() function installs a protocol on ChildHandle.
If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,
then a new handle is created. If it is a pointer to an existing UEFI handle,
then a new handle is created. If it is a pointer to an existing UEFI handle,
then the protocol is added to the existing UEFI handle.
@retval EFI_SUCCES The protocol was added to ChildHandle.
@@ -577,9 +577,9 @@ Dns6ServiceBindingCreateChild (
/**
Destroys a child handle with a protocol installed on it.
The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
that was installed by CreateChild() from ChildHandle. If the removed protocol is the
The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
that was installed by CreateChild() from ChildHandle. If the removed protocol is the
last protocol on ChildHandle, then ChildHandle is destroyed.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.

View File

@@ -1,7 +1,7 @@
## @file
# Implementation of EFI_DNS4_PROTOCOL and EFI_DNS6_PROTOCOL interfaces.
#
# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -37,8 +37,8 @@
DnsProtocol.c
DnsDhcp.h
DnsDhcp.c
[LibraryClasses]
BaseLib
UefiLib
@@ -52,7 +52,7 @@
DpcLib
PrintLib
UdpIoLib
[Protocols]
gEfiDns4ServiceBindingProtocolGuid ## BY_START
@@ -64,7 +64,7 @@
gEfiIp4Config2ProtocolGuid ## SOMETIMES_CONSUMES
gEfiManagedNetworkServiceBindingProtocolGuid ## SOMETIMES_CONSUMES
gEfiManagedNetworkProtocolGuid ## SOMETIMES_CONSUMES
gEfiDns6ServiceBindingProtocolGuid ## BY_START
gEfiDns6ProtocolGuid ## BY_START
gEfiUdp6ServiceBindingProtocolGuid ## TO_START

View File

@@ -2,15 +2,15 @@
// UEFI DNS DXE Driver.
//
// This driver provides UEFI 2.5 DNS protocols. It could work with an IPv4 and IPv6 stack.
//
//
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
//
// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
//
// 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.
//

View File

@@ -1,7 +1,7 @@
// /** @file
// DnsDxe Localized Strings and Content
//
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -13,8 +13,8 @@
//
// **/
#string STR_PROPERTIES_MODULE_NAME
#language en-US
#string STR_PROPERTIES_MODULE_NAME
#language en-US
"UEFI DNS DXE"

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
/** @file
DnsDxe support functions implementation.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -95,22 +95,22 @@ typedef union _DNS_FLAGS DNS_FLAGS;
typedef struct {
LIST_ENTRY AllCacheLink;
EFI_DNS4_CACHE_ENTRY DnsCache;
EFI_DNS4_CACHE_ENTRY DnsCache;
} DNS4_CACHE;
typedef struct {
LIST_ENTRY AllCacheLink;
EFI_DNS6_CACHE_ENTRY DnsCache;
EFI_DNS6_CACHE_ENTRY DnsCache;
} DNS6_CACHE;
typedef struct {
LIST_ENTRY AllServerLink;
EFI_IPv4_ADDRESS Dns4ServerIp;
EFI_IPv4_ADDRESS Dns4ServerIp;
} DNS4_SERVER_IP;
typedef struct {
LIST_ENTRY AllServerLink;
EFI_IPv6_ADDRESS Dns6ServerIp;
EFI_IPv6_ADDRESS Dns6ServerIp;
} DNS6_SERVER_IP;
typedef struct {
@@ -206,7 +206,7 @@ Dns4RemoveTokenEntry (
@retval EFI_SUCCESS Remove TokenEntry from TokenMap sucessfully.
@retval EFI_NOT_FOUND TokenEntry is not found in TokenMap.
**/
EFI_STATUS
Dns6RemoveTokenEntry (
@@ -277,7 +277,7 @@ EFI_STATUS
EFIAPI
GetDns4TokenEntry (
IN NET_MAP *TokensMap,
IN EFI_DNS4_COMPLETION_TOKEN *Token,
IN EFI_DNS4_COMPLETION_TOKEN *Token,
OUT DNS4_TOKEN_ENTRY **TokenEntry
);
@@ -296,7 +296,7 @@ EFI_STATUS
EFIAPI
GetDns6TokenEntry (
IN NET_MAP *TokensMap,
IN EFI_DNS6_COMPLETION_TOKEN *Token,
IN EFI_DNS6_COMPLETION_TOKEN *Token,
OUT DNS6_TOKEN_ENTRY **TokenEntry
);
@@ -406,9 +406,9 @@ DnsDummyExtFree (
/**
Poll the UDP to get the IP4 default address, which may be retrieved
by DHCP.
The default time out value is 5 seconds. If IP has retrieved the default address,
by DHCP.
The default time out value is 5 seconds. If IP has retrieved the default address,
the UDP is reconfigured.
@param Instance The DNS instance
@@ -447,10 +447,10 @@ Dns6GetMapping (
/**
Configure the UDP.
@param Instance The DNS session
@param UdpIo The UDP_IO instance
@retval EFI_SUCCESS The UDP is successfully configured for the
session.
@@ -463,7 +463,7 @@ Dns4ConfigUdp (
/**
Configure the UDP.
@param Instance The DNS session
@param UdpIo The UDP_IO instance
@@ -479,17 +479,17 @@ Dns6ConfigUdp (
/**
Update Dns4 cache to shared list of caches of all DNSv4 instances.
@param Dns4CacheList All Dns4 cache list.
@param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
If TRUE, this function will delete matching DNS Cache entry.
@param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
@param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
If TRUE, this function will delete matching DNS Cache entry.
@param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.
@param DnsCacheEntry Entry Pointer to DNS Cache entry.
@retval EFI_SUCCESS Update Dns4 cache successfully.
@retval Others Failed to update Dns4 cache.
@retval Others Failed to update Dns4 cache.
**/
EFI_STATUS
EFIAPI
@@ -501,18 +501,18 @@ UpdateDns4Cache (
);
/**
Update Dns6 cache to shared list of caches of all DNSv6 instances.
Update Dns6 cache to shared list of caches of all DNSv6 instances.
@param Dns6CacheList All Dns6 cache list.
@param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
If TRUE, this function will delete matching DNS Cache entry.
@param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
@param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
If TRUE, this function will delete matching DNS Cache entry.
@param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.
@param DnsCacheEntry Entry Pointer to DNS Cache entry.
@retval EFI_SUCCESS Update Dns6 cache successfully.
@retval Others Failed to update Dns6 cache.
**/
**/
EFI_STATUS
EFIAPI
UpdateDns6Cache (
@@ -523,14 +523,14 @@ UpdateDns6Cache (
);
/**
Add Dns4 ServerIp to common list of addresses of all configured DNSv4 server.
Add Dns4 ServerIp to common list of addresses of all configured DNSv4 server.
@param Dns4ServerList Common list of addresses of all configured DNSv4 server.
@param ServerIp DNS server Ip.
@param Dns4ServerList Common list of addresses of all configured DNSv4 server.
@param ServerIp DNS server Ip.
@retval EFI_SUCCESS Add Dns4 ServerIp to common list successfully.
@retval Others Failed to add Dns4 ServerIp to common list.
**/
EFI_STATUS
EFIAPI
@@ -540,15 +540,15 @@ AddDns4ServerIp (
);
/**
Add Dns6 ServerIp to common list of addresses of all configured DNSv6 server.
Add Dns6 ServerIp to common list of addresses of all configured DNSv6 server.
@param Dns6ServerList Common list of addresses of all configured DNSv6 server.
@param ServerIp DNS server Ip.
@param Dns6ServerList Common list of addresses of all configured DNSv6 server.
@param ServerIp DNS server Ip.
@retval EFI_SUCCESS Add Dns6 ServerIp to common list successfully.
@retval Others Failed to add Dns6 ServerIp to common list.
**/
**/
EFI_STATUS
EFIAPI
AddDns6ServerIp (
@@ -559,16 +559,16 @@ AddDns6ServerIp (
/**
Find out whether the response is valid or invalid.
@param TokensMap All DNS transmittal Tokens entry.
@param Identification Identification for queried packet.
@param TokensMap All DNS transmittal Tokens entry.
@param Identification Identification for queried packet.
@param Type Type for queried packet.
@param Class Class for queried packet.
@param Item Return corresponding Token entry.
@retval TRUE The response is valid.
@retval FALSE The response is invalid.
**/
**/
BOOLEAN
IsValidDnsResponse (
IN NET_MAP *TokensMap,
@@ -583,12 +583,12 @@ IsValidDnsResponse (
@param Instance The DNS instance
@param RxString Received buffer.
@param Completed Flag to indicate that Dns response is valid.
@param Completed Flag to indicate that Dns response is valid.
@retval EFI_SUCCESS Parse Dns Response successfully.
@retval Others Failed to parse Dns Response.
**/
**/
EFI_STATUS
ParseDnsResponse (
IN OUT DNS_INSTANCE *Instance,
@@ -604,7 +604,7 @@ ParseDnsResponse (
@param IoStatus The status of the UDP receive
@param Context The opaque parameter to the function.
**/
**/
VOID
EFIAPI
DnsOnPacketReceived (
@@ -652,9 +652,9 @@ DoDnsQuery (
Construct the Packet according query section.
@param Instance The DNS instance
@param QueryName Queried Name
@param Type Queried Type
@param Class Queried Class
@param QueryName Queried Name
@param Type Queried Type
@param Class Queried Class
@param Packet The packet for query
@retval EFI_SUCCESS The packet is constructed.
@@ -674,7 +674,7 @@ ConstructDNSQuery (
Retransmit the packet.
@param Instance The DNS instance
@param Packet Retransmit the packet
@param Packet Retransmit the packet
@retval EFI_SUCCESS The packet is retransmitted.
@retval Others Failed to retransmit.
@@ -748,7 +748,7 @@ Dns4GetModeData (
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_UNSUPPORTED The designated protocol is not supported.
@retval EFI_INVALID_PARAMTER Thisis NULL.
The StationIp address provided in DnsConfigData is not a
The StationIp address provided in DnsConfigData is not a
valid unicast.
DnsServerList is NULL while DnsServerListCount
is not ZERO.
@@ -758,8 +758,8 @@ Dns4GetModeData (
allocated.
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The
EFI DNSv4 Protocol instance is not configured.
@retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To
reconfigure the instance the caller must call Configure()
@retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To
reconfigure the instance the caller must call Configure()
with NULL first to return driver to unconfigured state.
**/
EFI_STATUS
@@ -800,7 +800,7 @@ Dns4HostNameToIp (
/**
IPv4 address to host name translation also known as Reverse DNS lookup.
The IpToHostName() function is used to translate the host address to host name. A type PTR
The IpToHostName() function is used to translate the host address to host name. A type PTR
query is used to get the primary name of the host. Support of this function is optional.
@param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
@@ -828,7 +828,7 @@ Dns4IpToHostName (
);
/**
Retrieve arbitrary information from the DNS server.
Retrieve arbitrary information from the DNS server.
This GeneralLookup() function retrieves arbitrary information from the DNS. The caller
supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All
@@ -859,7 +859,7 @@ EFIAPI
Dns4GeneralLookUp (
IN EFI_DNS4_PROTOCOL *This,
IN CHAR8 *QName,
IN UINT16 QType,
IN UINT16 QType,
IN UINT16 QClass,
IN EFI_DNS4_COMPLETION_TOKEN *Token
);
@@ -965,7 +965,7 @@ Dns4Cancel (
This function is used to retrieve DNS mode data for this DNS instance.
@param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
@param[out] DnsModeData Pointer to the caller-allocated storage for the
@param[out] DnsModeData Pointer to the caller-allocated storage for the
EFI_DNS6_MODE_DATA data.
@retval EFI_SUCCESS The operation completed successfully.
@@ -989,7 +989,7 @@ Dns6GetModeData (
EFI DNSv6 Protocol driver instance. Reset the DNS instance if DnsConfigData is NULL.
@param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
@param[in] DnsConfigData Pointer to the configuration data structure. All associated
@param[in] DnsConfigData Pointer to the configuration data structure. All associated
storage to be allocated and released by caller.
@retval EFI_SUCCESS The operation completed successfully.
@@ -1001,8 +1001,8 @@ Dns6GetModeData (
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The
EFI DNSv6 Protocol instance is not configured.
@retval EFI_UNSUPPORTED The designated protocol is not supported.
@retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To
reconfigure the instance the caller must call Configure() with
@retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To
reconfigure the instance the caller must call Configure() with
NULL first to return driver to unconfigured state.
**/
EFI_STATUS
@@ -1107,7 +1107,7 @@ EFIAPI
Dns6GeneralLookUp (
IN EFI_DNS6_PROTOCOL *This,
IN CHAR8 *QName,
IN UINT16 QType,
IN UINT16 QType,
IN UINT16 QClass,
IN EFI_DNS6_COMPLETION_TOKEN *Token
);

View File

@@ -1,7 +1,7 @@
/** @file
Implementation of EFI_DNS4_PROTOCOL and EFI_DNS6_PROTOCOL interfaces.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -59,14 +59,14 @@ Dns4GetModeData (
)
{
DNS_INSTANCE *Instance;
EFI_TPL OldTpl;
UINTN Index;
LIST_ENTRY *Entry;
LIST_ENTRY *Next;
DNS4_SERVER_IP *ServerItem;
EFI_IPv4_ADDRESS *ServerList;
DNS4_CACHE *CacheItem;
@@ -78,24 +78,24 @@ Dns4GetModeData (
CacheItem = NULL;
CacheList = NULL;
Status = EFI_SUCCESS;
if ((This == NULL) || (DnsModeData == NULL)) {
return EFI_INVALID_PARAMETER;
}
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL4 (This);
if (Instance->State == DNS_STATE_UNCONFIGED) {
Status = EFI_NOT_STARTED;
goto ON_EXIT;
}
ZeroMem (DnsModeData, sizeof (EFI_DNS4_MODE_DATA));
//
// Get the current configuration data of this instance.
// Get the current configuration data of this instance.
//
Status = Dns4CopyConfigure (&DnsModeData->DnsConfigData, &Instance->Dns4CfgData);
if (EFI_ERROR (Status)) {
@@ -116,7 +116,7 @@ Dns4GetModeData (
Dns4CleanConfigure (&DnsModeData->DnsConfigData);
goto ON_EXIT;
}
Index = 0;
NET_LIST_FOR_EACH_SAFE (Entry, Next, &mDriverData->Dns4ServerList) {
ServerItem = NET_LIST_USER_STRUCT (Entry, DNS4_SERVER_IP, AllServerLink);
@@ -140,7 +140,7 @@ Dns4GetModeData (
FreePool (ServerList);
goto ON_EXIT;
}
Index =0;
NET_LIST_FOR_EACH_SAFE (Entry, Next, &mDriverData->Dns4CacheList) {
CacheItem = NET_LIST_USER_STRUCT (Entry, DNS4_CACHE, AllCacheLink);
@@ -165,7 +165,7 @@ ON_EXIT:
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_UNSUPPORTED The designated protocol is not supported.
@retval EFI_INVALID_PARAMTER Thisis NULL.
The StationIp address provided in DnsConfigData is not a
The StationIp address provided in DnsConfigData is not a
valid unicast.
DnsServerList is NULL while DnsServerListCount
is not ZERO.
@@ -175,8 +175,8 @@ ON_EXIT:
allocated.
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The
EFI DNSv4 Protocol instance is not configured.
@retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To
reconfigure the instance the caller must call Configure()
@retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To
reconfigure the instance the caller must call Configure()
with NULL first to return driver to unconfigured state.
**/
EFI_STATUS
@@ -188,19 +188,19 @@ Dns4Configure (
{
EFI_STATUS Status;
DNS_INSTANCE *Instance;
EFI_TPL OldTpl;
IP4_ADDR Ip;
IP4_ADDR Netmask;
UINT32 ServerListCount;
EFI_IPv4_ADDRESS *ServerList;
EFI_IPv4_ADDRESS *ServerList;
Status = EFI_SUCCESS;
ServerList = NULL;
if (This == NULL ||
(DnsConfigData != NULL && ((DnsConfigData->DnsServerListCount != 0 && DnsConfigData->DnsServerList == NULL) ||
if (This == NULL ||
(DnsConfigData != NULL && ((DnsConfigData->DnsServerListCount != 0 && DnsConfigData->DnsServerList == NULL) ||
(DnsConfigData->DnsServerListCount == 0 && DnsConfigData->DnsServerList != NULL)))) {
return EFI_INVALID_PARAMETER;
}
@@ -215,7 +215,7 @@ Dns4Configure (
if (DnsConfigData == NULL) {
ZeroMem (&Instance->SessionDnsServer, sizeof (EFI_IP_ADDRESS));
//
// Reset the Instance if ConfigData is NULL
//
@@ -226,12 +226,12 @@ Dns4Configure (
if (Instance->UdpIo != NULL){
UdpIoCleanIo (Instance->UdpIo);
}
if (Instance->Dns4CfgData.DnsServerList != NULL) {
FreePool (Instance->Dns4CfgData.DnsServerList);
}
ZeroMem (&Instance->Dns4CfgData, sizeof (EFI_DNS4_CONFIG_DATA));
Instance->State = DNS_STATE_UNCONFIGED;
} else {
//
@@ -255,14 +255,14 @@ Dns4Configure (
}
if (DnsConfigData->DnsServerListCount == 0) {
gBS->RestoreTPL (OldTpl);
gBS->RestoreTPL (OldTpl);
//
// The DNS instance will retrieve DNS server from DHCP Server
//
Status = GetDns4ServerFromDhcp4 (
Instance,
&ServerListCount,
&ServerListCount,
&ServerList
);
if (EFI_ERROR (Status)) {
@@ -270,7 +270,7 @@ Dns4Configure (
}
ASSERT(ServerList != NULL);
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
CopyMem (&Instance->SessionDnsServer.v4, &ServerList[0], sizeof (EFI_IPv4_ADDRESS));
@@ -301,7 +301,7 @@ Dns4Configure (
}
goto ON_EXIT;
}
Instance->State = DNS_STATE_CONFIGED;
}
@@ -339,42 +339,42 @@ Dns4HostNameToIp (
)
{
EFI_STATUS Status;
DNS_INSTANCE *Instance;
EFI_DNS4_CONFIG_DATA *ConfigData;
UINTN Index;
DNS4_CACHE *Item;
LIST_ENTRY *Entry;
LIST_ENTRY *Next;
CHAR8 *QueryName;
DNS4_TOKEN_ENTRY *TokenEntry;
NET_BUF *Packet;
EFI_TPL OldTpl;
Status = EFI_SUCCESS;
Item = NULL;
QueryName = NULL;
TokenEntry = NULL;
Packet = NULL;
//
// Validate the parameters
//
if ((This == NULL) || (HostName == NULL) || Token == NULL) {
return EFI_INVALID_PARAMETER;
}
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL4 (This);
ConfigData = &(Instance->Dns4CfgData);
if (Instance->State != DNS_STATE_CONFIGED) {
Status = EFI_NOT_STARTED;
goto ON_EXIT;
@@ -395,9 +395,9 @@ Dns4HostNameToIp (
if (Token->RetryInterval == 0) {
Token->RetryInterval = ConfigData->RetryInterval;
}
//
// Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second.
// Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second.
//
if (Token->RetryInterval < DNS_DEFAULT_TIMEOUT) {
Token->RetryInterval = DNS_DEFAULT_TIMEOUT;
@@ -428,7 +428,7 @@ Dns4HostNameToIp (
if (Token->RspData.H2AData != NULL) {
FreePool (Token->RspData.H2AData);
}
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
@@ -438,12 +438,12 @@ Dns4HostNameToIp (
Item = NET_LIST_USER_STRUCT (Entry, DNS4_CACHE, AllCacheLink);
if ((UINT32)Index < Token->RspData.H2AData->IpCount && StrCmp (HostName, Item->DnsCache.HostName) == 0) {
CopyMem ((Token->RspData.H2AData->IpList) + Index, Item->DnsCache.IpAddress, sizeof (EFI_IPv4_ADDRESS));
Index++;
Index++;
}
}
Token->Status = EFI_SUCCESS;
if (Token->Event != NULL) {
gBS->SignalEvent (Token->Event);
DispatchDpc ();
@@ -451,7 +451,7 @@ Dns4HostNameToIp (
Status = Token->Status;
goto ON_EXIT;
}
}
}
//
@@ -462,7 +462,7 @@ Dns4HostNameToIp (
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
TokenEntry->PacketToLive = Token->RetryInterval;
TokenEntry->Token = Token;
TokenEntry->QueryHostName = AllocateZeroPool (StrSize (HostName));
@@ -470,9 +470,9 @@ Dns4HostNameToIp (
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
CopyMem (TokenEntry->QueryHostName, HostName, StrSize (HostName));
//
// Construct QName.
//
@@ -481,12 +481,12 @@ Dns4HostNameToIp (
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
//
// Construct DNS Query Packet.
//
Status = ConstructDNSQuery (Instance, QueryName, DNS_TYPE_A, DNS_CLASS_INET, &Packet);
if (EFI_ERROR (Status)) {
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
@@ -499,7 +499,7 @@ Dns4HostNameToIp (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
//
// Dns Query Ip
//
@@ -507,7 +507,7 @@ Dns4HostNameToIp (
if (EFI_ERROR (Status)) {
Dns4RemoveTokenEntry (&Instance->Dns4TxTokens, TokenEntry);
}
ON_EXIT:
if (EFI_ERROR (Status)) {
@@ -515,19 +515,19 @@ ON_EXIT:
if (TokenEntry->QueryHostName != NULL) {
FreePool (TokenEntry->QueryHostName);
}
FreePool (TokenEntry);
}
if (Packet != NULL) {
NetbufFree (Packet);
}
}
if (QueryName != NULL) {
FreePool (QueryName);
}
gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -535,7 +535,7 @@ ON_EXIT:
/**
IPv4 address to host name translation also known as Reverse DNS lookup.
The IpToHostName() function is used to translate the host address to host name. A type PTR
The IpToHostName() function is used to translate the host address to host name. A type PTR
query is used to get the primary name of the host. Support of this function is optional.
@param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
@@ -566,7 +566,7 @@ Dns4IpToHostName (
}
/**
Retrieve arbitrary information from the DNS server.
Retrieve arbitrary information from the DNS server.
This GeneralLookup() function retrieves arbitrary information from the DNS. The caller
supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All
@@ -597,37 +597,37 @@ EFIAPI
Dns4GeneralLookUp (
IN EFI_DNS4_PROTOCOL *This,
IN CHAR8 *QName,
IN UINT16 QType,
IN UINT16 QType,
IN UINT16 QClass,
IN EFI_DNS4_COMPLETION_TOKEN *Token
)
{
EFI_STATUS Status;
DNS_INSTANCE *Instance;
EFI_DNS4_CONFIG_DATA *ConfigData;
DNS4_TOKEN_ENTRY *TokenEntry;
NET_BUF *Packet;
EFI_TPL OldTpl;
Status = EFI_SUCCESS;
TokenEntry = NULL;
Packet = NULL;
//
// Validate the parameters
//
if ((This == NULL) || (QName == NULL) || Token == NULL) {
return EFI_INVALID_PARAMETER;
}
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL4 (This);
ConfigData = &(Instance->Dns4CfgData);
if (Instance->State != DNS_STATE_CONFIGED) {
@@ -636,14 +636,14 @@ Dns4GeneralLookUp (
}
Token->Status = EFI_NOT_READY;
//
// If zero, use the parameter configured through Dns.Configure() interface.
//
if (Token->RetryCount == 0) {
Token->RetryCount = ConfigData->RetryCount;
}
//
// If zero, use the parameter configured through Dns.Configure() interface.
//
@@ -652,7 +652,7 @@ Dns4GeneralLookUp (
}
//
// Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second.
// Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second.
//
if (Token->RetryInterval < DNS_DEFAULT_TIMEOUT) {
Token->RetryInterval = DNS_DEFAULT_TIMEOUT;
@@ -666,7 +666,7 @@ Dns4GeneralLookUp (
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
TokenEntry->PacketToLive = Token->RetryInterval;
TokenEntry->GeneralLookUp = TRUE;
TokenEntry->Token = Token;
@@ -679,7 +679,7 @@ Dns4GeneralLookUp (
if (TokenEntry != NULL) {
FreePool (TokenEntry);
}
goto ON_EXIT;
}
@@ -693,12 +693,12 @@ Dns4GeneralLookUp (
if (TokenEntry != NULL) {
FreePool (TokenEntry);
}
NetbufFree (Packet);
goto ON_EXIT;
}
//
// Dns Query Ip
//
@@ -709,10 +709,10 @@ Dns4GeneralLookUp (
if (TokenEntry != NULL) {
FreePool (TokenEntry);
}
NetbufFree (Packet);
}
ON_EXIT:
gBS->RestoreTPL (OldTpl);
return Status;
@@ -753,15 +753,15 @@ Dns4UpdateDnsCache (
IN EFI_DNS4_CACHE_ENTRY DnsCacheEntry
)
{
EFI_STATUS Status;
EFI_STATUS Status;
EFI_TPL OldTpl;
Status = EFI_SUCCESS;
if (DnsCacheEntry.HostName == NULL || DnsCacheEntry.IpAddress == NULL || DnsCacheEntry.Timeout == 0) {
return EFI_INVALID_PARAMETER;
return EFI_INVALID_PARAMETER;
}
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
@@ -770,7 +770,7 @@ Dns4UpdateDnsCache (
Status = UpdateDns4Cache (&mDriverData->Dns4CacheList, DeleteFlag, Override, DnsCacheEntry);
gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -817,7 +817,7 @@ Dns4Poll (
}
Udp = Instance->UdpIo->Protocol.Udp4;
return Udp->Poll (Udp);
}
@@ -890,7 +890,7 @@ Dns4Cancel (
This function is used to retrieve DNS mode data for this DNS instance.
@param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
@param[out] DnsModeData Pointer to the caller-allocated storage for the
@param[out] DnsModeData Pointer to the caller-allocated storage for the
EFI_DNS6_MODE_DATA data.
@retval EFI_SUCCESS The operation completed successfully.
@@ -908,11 +908,11 @@ Dns6GetModeData (
)
{
DNS_INSTANCE *Instance;
EFI_TPL OldTpl;
UINTN Index;
LIST_ENTRY *Entry;
LIST_ENTRY *Next;
@@ -933,7 +933,7 @@ Dns6GetModeData (
}
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL6 (This);
if (Instance->State == DNS_STATE_UNCONFIGED) {
Status = EFI_NOT_STARTED;
@@ -943,13 +943,13 @@ Dns6GetModeData (
ZeroMem (DnsModeData, sizeof (EFI_DNS6_MODE_DATA));
//
// Get the current configuration data of this instance.
// Get the current configuration data of this instance.
//
Status = Dns6CopyConfigure (&DnsModeData->DnsConfigData, &Instance->Dns6CfgData);
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
//
// Get the DnsServerCount and DnsServerList
//
@@ -964,7 +964,7 @@ Dns6GetModeData (
Dns6CleanConfigure (&DnsModeData->DnsConfigData);
goto ON_EXIT;
}
Index = 0;
NET_LIST_FOR_EACH_SAFE (Entry, Next, &mDriverData->Dns6ServerList) {
ServerItem = NET_LIST_USER_STRUCT (Entry, DNS6_SERVER_IP, AllServerLink);
@@ -988,7 +988,7 @@ Dns6GetModeData (
FreePool (ServerList);
goto ON_EXIT;
}
Index =0;
NET_LIST_FOR_EACH_SAFE (Entry, Next, &mDriverData->Dns6CacheList) {
CacheItem = NET_LIST_USER_STRUCT (Entry, DNS6_CACHE, AllCacheLink);
@@ -996,7 +996,7 @@ Dns6GetModeData (
Index++;
}
DnsModeData->DnsCacheList = CacheList;
ON_EXIT:
gBS->RestoreTPL (OldTpl);
return Status;
@@ -1009,7 +1009,7 @@ ON_EXIT:
EFI DNSv6 Protocol driver instance. Reset the DNS instance if DnsConfigData is NULL.
@param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
@param[in] DnsConfigData Pointer to the configuration data structure. All associated
@param[in] DnsConfigData Pointer to the configuration data structure. All associated
storage to be allocated and released by caller.
@retval EFI_SUCCESS The operation completed successfully.
@@ -1021,8 +1021,8 @@ ON_EXIT:
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The
EFI DNSv6 Protocol instance is not configured.
@retval EFI_UNSUPPORTED The designated protocol is not supported.
@retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To
reconfigure the instance the caller must call Configure() with
@retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To
reconfigure the instance the caller must call Configure() with
NULL first to return driver to unconfigured state.
**/
EFI_STATUS
@@ -1034,17 +1034,17 @@ Dns6Configure (
{
EFI_STATUS Status;
DNS_INSTANCE *Instance;
EFI_TPL OldTpl;
UINT32 ServerListCount;
EFI_IPv6_ADDRESS *ServerList;
EFI_IPv6_ADDRESS *ServerList;
Status = EFI_SUCCESS;
ServerList = NULL;
if (This == NULL ||
(DnsConfigData != NULL && ((DnsConfigData->DnsServerCount != 0 && DnsConfigData->DnsServerList == NULL) ||
if (This == NULL ||
(DnsConfigData != NULL && ((DnsConfigData->DnsServerCount != 0 && DnsConfigData->DnsServerList == NULL) ||
(DnsConfigData->DnsServerCount == 0 && DnsConfigData->DnsServerList != NULL)))) {
return EFI_INVALID_PARAMETER;
}
@@ -1075,7 +1075,7 @@ Dns6Configure (
FreePool (Instance->Dns6CfgData.DnsServerList);
}
ZeroMem (&Instance->Dns6CfgData, sizeof (EFI_DNS6_CONFIG_DATA));
Instance->State = DNS_STATE_UNCONFIGED;
} else {
//
@@ -1099,14 +1099,14 @@ Dns6Configure (
//
Status = GetDns6ServerFromDhcp6 (
Instance->Service->ImageHandle,
Instance->Service->ControllerHandle,
&ServerListCount,
Instance->Service->ControllerHandle,
&ServerListCount,
&ServerList
);
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
ASSERT(ServerList != NULL);
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
@@ -1141,7 +1141,7 @@ Dns6Configure (
}
goto ON_EXIT;
}
Instance->State = DNS_STATE_CONFIGED;
}
@@ -1181,23 +1181,23 @@ Dns6HostNameToIp (
)
{
EFI_STATUS Status;
DNS_INSTANCE *Instance;
EFI_DNS6_CONFIG_DATA *ConfigData;
UINTN Index;
UINTN Index;
DNS6_CACHE *Item;
LIST_ENTRY *Entry;
LIST_ENTRY *Next;
CHAR8 *QueryName;
DNS6_TOKEN_ENTRY *TokenEntry;
NET_BUF *Packet;
EFI_TPL OldTpl;
Status = EFI_SUCCESS;
Item = NULL;
QueryName = NULL;
@@ -1212,9 +1212,9 @@ Dns6HostNameToIp (
}
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL6 (This);
ConfigData = &(Instance->Dns6CfgData);
if (Instance->State != DNS_STATE_CONFIGED) {
@@ -1237,9 +1237,9 @@ Dns6HostNameToIp (
if (Token->RetryInterval == 0) {
Token->RetryInterval = ConfigData->RetryInterval;
}
//
// Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second.
// Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second.
//
if (Token->RetryInterval < DNS_DEFAULT_TIMEOUT) {
Token->RetryInterval = DNS_DEFAULT_TIMEOUT;
@@ -1270,7 +1270,7 @@ Dns6HostNameToIp (
if (Token->RspData.H2AData != NULL) {
FreePool (Token->RspData.H2AData);
}
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
@@ -1283,17 +1283,17 @@ Dns6HostNameToIp (
Index++;
}
}
Token->Status = EFI_SUCCESS;
if (Token->Event != NULL) {
gBS->SignalEvent (Token->Event);
DispatchDpc ();
}
Status = Token->Status;
goto ON_EXIT;
}
}
}
//
@@ -1304,7 +1304,7 @@ Dns6HostNameToIp (
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
TokenEntry->PacketToLive = Token->RetryInterval;
TokenEntry->Token = Token;
TokenEntry->QueryHostName = AllocateZeroPool (StrSize (HostName));
@@ -1312,7 +1312,7 @@ Dns6HostNameToIp (
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
CopyMem (TokenEntry->QueryHostName, HostName, StrSize (HostName));
//
@@ -1323,7 +1323,7 @@ Dns6HostNameToIp (
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
//
// Construct DNS Query Packet.
//
@@ -1341,7 +1341,7 @@ Dns6HostNameToIp (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
//
// Dns Query Ip
//
@@ -1349,7 +1349,7 @@ Dns6HostNameToIp (
if (EFI_ERROR (Status)) {
Dns6RemoveTokenEntry (&Instance->Dns6TxTokens, TokenEntry);
}
ON_EXIT:
if (EFI_ERROR (Status)) {
@@ -1357,19 +1357,19 @@ ON_EXIT:
if (TokenEntry->QueryHostName != NULL) {
FreePool (TokenEntry->QueryHostName);
}
FreePool (TokenEntry);
}
if (Packet != NULL) {
NetbufFree (Packet);
}
}
if (QueryName != NULL) {
FreePool (QueryName);
}
gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -1442,37 +1442,37 @@ EFIAPI
Dns6GeneralLookUp (
IN EFI_DNS6_PROTOCOL *This,
IN CHAR8 *QName,
IN UINT16 QType,
IN UINT16 QType,
IN UINT16 QClass,
IN EFI_DNS6_COMPLETION_TOKEN *Token
)
{
EFI_STATUS Status;
DNS_INSTANCE *Instance;
EFI_DNS6_CONFIG_DATA *ConfigData;
DNS6_TOKEN_ENTRY *TokenEntry;
NET_BUF *Packet;
EFI_TPL OldTpl;
Status = EFI_SUCCESS;
TokenEntry = NULL;
Packet = NULL;
//
// Validate the parameters
//
if ((This == NULL) || (QName == NULL) || Token == NULL) {
return EFI_INVALID_PARAMETER;
}
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL6 (This);
ConfigData = &(Instance->Dns6CfgData);
if (Instance->State != DNS_STATE_CONFIGED) {
@@ -1481,14 +1481,14 @@ Dns6GeneralLookUp (
}
Token->Status = EFI_NOT_READY;
//
// If zero, use the parameter configured through Dns.Configure() interface.
//
if (Token->RetryCount == 0) {
Token->RetryCount = ConfigData->RetryCount;
}
//
// If zero, use the parameter configured through Dns.Configure() interface.
//
@@ -1497,7 +1497,7 @@ Dns6GeneralLookUp (
}
//
// Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second.
// Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second.
//
if (Token->RetryInterval < DNS_DEFAULT_TIMEOUT) {
Token->RetryInterval = DNS_DEFAULT_TIMEOUT;
@@ -1511,7 +1511,7 @@ Dns6GeneralLookUp (
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
TokenEntry->PacketToLive = Token->RetryInterval;
TokenEntry->GeneralLookUp = TRUE;
TokenEntry->Token = Token;
@@ -1524,7 +1524,7 @@ Dns6GeneralLookUp (
if (TokenEntry != NULL) {
FreePool (TokenEntry);
}
goto ON_EXIT;
}
@@ -1538,12 +1538,12 @@ Dns6GeneralLookUp (
if (TokenEntry != NULL) {
FreePool (TokenEntry);
}
NetbufFree (Packet);
goto ON_EXIT;
}
//
// Dns Query Ip
//
@@ -1554,10 +1554,10 @@ Dns6GeneralLookUp (
if (TokenEntry != NULL) {
FreePool (TokenEntry);
}
NetbufFree (Packet);
}
ON_EXIT:
gBS->RestoreTPL (OldTpl);
return Status;
@@ -1599,24 +1599,24 @@ Dns6UpdateDnsCache (
IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry
)
{
EFI_STATUS Status;
EFI_STATUS Status;
EFI_TPL OldTpl;
Status = EFI_SUCCESS;
if (DnsCacheEntry.HostName == NULL || DnsCacheEntry.IpAddress == NULL || DnsCacheEntry.Timeout == 0) {
return EFI_INVALID_PARAMETER;
return EFI_INVALID_PARAMETER;
}
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Update Dns6Cache here.
//
Status = UpdateDns6Cache (&mDriverData->Dns6CacheList, DeleteFlag, Override, DnsCacheEntry);
gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -1665,7 +1665,7 @@ Dns6Poll (
}
Udp = Instance->UdpIo->Protocol.Udp6;
return Udp->Poll (Udp);
}

View File

@@ -3,12 +3,12 @@
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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,
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.
**/
@@ -23,7 +23,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@retval EFI_SUCCESS Device patch successfully updated.
@retval EFI_OUT_OF_RESOURCES Could not allocate needed resources.
@retval Others Unexpected error happened.
**/
EFI_STATUS
HttpBootUpdateDevicePath (
@@ -39,7 +39,7 @@ HttpBootUpdateDevicePath (
TmpIpDevicePath = NULL;
TmpDnsDevicePath = NULL;
//
// Update the IP node with DHCP assigned information.
//
@@ -67,13 +67,13 @@ HttpBootUpdateDevicePath (
SetDevicePathNodeLength (Node, sizeof (IPv6_DEVICE_PATH));
Node->Ipv6.PrefixLength = IP6_PREFIX_LENGTH;
Node->Ipv6.RemotePort = Private->Port;
Node->Ipv6.Protocol = EFI_IP_PROTO_TCP;
Node->Ipv6.Protocol = EFI_IP_PROTO_TCP;
Node->Ipv6.IpAddressOrigin = 0;
CopyMem (&Node->Ipv6.LocalIpAddress, &Private->StationIp.v6, sizeof (EFI_IPv6_ADDRESS));
CopyMem (&Node->Ipv6.RemoteIpAddress, &Private->ServerIp.v6, sizeof (EFI_IPv6_ADDRESS));
CopyMem (&Node->Ipv6.GatewayIpAddress, &Private->GatewayIp.v6, sizeof (EFI_IPv6_ADDRESS));
}
TmpIpDevicePath = AppendDevicePathNode (Private->ParentDevicePath, (EFI_DEVICE_PATH_PROTOCOL*) Node);
FreePool (Node);
if (TmpIpDevicePath == NULL) {
@@ -95,7 +95,7 @@ HttpBootUpdateDevicePath (
SetDevicePathNodeLength (Node, Length);
Node->Dns.IsIPv6 = Private->UsingIpv6 ? 0x01 : 0x00;
CopyMem ((UINT8*) Node + sizeof (EFI_DEVICE_PATH_PROTOCOL) + sizeof (Node->Dns.IsIPv6), Private->DnsServerIp, Private->DnsServerCount * sizeof (EFI_IP_ADDRESS));
TmpDnsDevicePath = AppendDevicePathNode (TmpIpDevicePath, (EFI_DEVICE_PATH_PROTOCOL*) Node);
FreePool (Node);
FreePool (TmpIpDevicePath);
@@ -150,7 +150,7 @@ HttpBootUpdateDevicePath (
if (EFI_ERROR (Status)) {
return Status;
}
FreePool (Private->Ip4Nic->DevicePath);
Private->Ip4Nic->DevicePath = NewDevicePath;
} else {
@@ -169,7 +169,7 @@ HttpBootUpdateDevicePath (
FreePool (Private->Ip6Nic->DevicePath);
Private->Ip6Nic->DevicePath = NewDevicePath;
}
return EFI_SUCCESS;
}
@@ -201,7 +201,7 @@ HttpBootDhcp4ExtractUriInfo (
ASSERT (SelectIndex < HTTP_BOOT_OFFER_MAX_NUM);
DnsServerIndex = 0;
Status = EFI_SUCCESS;
//
@@ -213,7 +213,7 @@ HttpBootDhcp4ExtractUriInfo (
//
// In Corporate environment, we need a HttpOffer.
//
if ((SelectOffer->OfferType == HttpOfferTypeDhcpIpUri) ||
if ((SelectOffer->OfferType == HttpOfferTypeDhcpIpUri) ||
(SelectOffer->OfferType == HttpOfferTypeDhcpIpUriDns) ||
(SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns)) {
HttpOffer = SelectOffer;
@@ -246,7 +246,7 @@ HttpBootDhcp4ExtractUriInfo (
return Status;
}
if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) ||
if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) ||
(SelectOffer->OfferType == HttpOfferTypeDhcpDns) ||
(SelectOffer->OfferType == HttpOfferTypeDhcpIpUriDns)) {
Option = SelectOffer->OptList[HTTP_BOOT_DHCP4_TAG_INDEX_DNS_SERVER];
@@ -265,10 +265,10 @@ HttpBootDhcp4ExtractUriInfo (
for (DnsServerIndex = 0; DnsServerIndex < Private->DnsServerCount; DnsServerIndex++) {
CopyMem (&(Private->DnsServerIp[DnsServerIndex].v4), &(((EFI_IPv4_ADDRESS *) Option->Data)[DnsServerIndex]), sizeof (EFI_IPv4_ADDRESS));
}
//
// Configure the default DNS server if server assigned.
//
//
Status = HttpBootRegisterIp4Dns (
Private,
Option->Length,
@@ -292,7 +292,7 @@ HttpBootDhcp4ExtractUriInfo (
if (EFI_ERROR (Status) || Private->Port == 0) {
Private->Port = 80;
}
//
// All boot informations are valid here.
//
@@ -402,7 +402,7 @@ HttpBootDhcp6ExtractUriInfo (
return Status;
}
if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) ||
if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) ||
(SelectOffer->OfferType == HttpOfferTypeDhcpDns) ||
(SelectOffer->OfferType == HttpOfferTypeDhcpIpUriDns)) {
Option = SelectOffer->OptList[HTTP_BOOT_DHCP6_IDX_DNS_SERVER];
@@ -434,9 +434,9 @@ HttpBootDhcp6ExtractUriInfo (
goto Error;
}
}
//
// Extract the HTTP server Ip from URL. This is used to Check route table
// Extract the HTTP server Ip from URL. This is used to Check route table
// whether can send message to HTTP Server Ip through the GateWay.
//
Status = HttpUrlGetIp6 (
@@ -444,7 +444,7 @@ HttpBootDhcp6ExtractUriInfo (
Private->BootFileUriParser,
&IpAddr
);
if (EFI_ERROR (Status)) {
//
// The Http server address is expressed by Name Ip, so perform DNS resolution
@@ -464,23 +464,23 @@ HttpBootDhcp6ExtractUriInfo (
Status = EFI_OUT_OF_RESOURCES;
goto Error;
}
AsciiStrToUnicodeStrS (HostName, HostNameStr, HostNameSize);
if (HostName != NULL) {
FreePool (HostName);
}
Status = HttpBootDns (Private, HostNameStr, &IpAddr);
FreePool (HostNameStr);
if (EFI_ERROR (Status)) {
AsciiPrint ("\n Error: Could not retrieve the host address from DNS server.\n");
goto Error;
}
}
}
}
CopyMem (&Private->ServerIp.v6, &IpAddr, sizeof (EFI_IPv6_ADDRESS));
//
// Extract the port from URL, and use default HTTP port 80 if not provided.
//
@@ -492,7 +492,7 @@ HttpBootDhcp6ExtractUriInfo (
if (EFI_ERROR (Status) || Private->Port == 0) {
Private->Port = 80;
}
//
// All boot informations are valid here.
//
@@ -504,7 +504,7 @@ HttpBootDhcp6ExtractUriInfo (
if (EFI_ERROR (Status)) {
goto Error;
}
return Status;
Error:
@@ -512,7 +512,7 @@ Error:
FreePool (Private->DnsServerIp);
Private->DnsServerIp = NULL;
}
return Status;
}
@@ -532,7 +532,7 @@ HttpBootDiscoverBootInfo (
)
{
EFI_STATUS Status;
//
// Start D.O.R.A/S.A.R.R exchange to acquire station ip address and
// other Http boot information.
@@ -557,7 +557,7 @@ HttpBootDiscoverBootInfo (
@param[in] EventType Indicate the Event type that occurs in the current callback.
@param[in] Message HTTP message which will be send to, or just received from HTTP server.
@param[in] Context The Callback Context pointer.
@retval EFI_SUCCESS Tells the HttpIo to continue the HTTP process.
@retval Others Tells the HttpIo to abort the current HTTP process.
**/
@@ -706,7 +706,7 @@ HttpBootFreeCacheList (
LIST_ENTRY *Entry;
LIST_ENTRY *NextEntry;
HTTP_BOOT_CACHE_CONTENT *Cache;
NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Private->CacheList) {
Cache = NET_LIST_USER_STRUCT (Entry, HTTP_BOOT_CACHE_CONTENT, Link);
RemoveEntryList (&Cache->Link);
@@ -746,7 +746,7 @@ HttpBootGetFileFromCache (
HTTP_BOOT_CACHE_CONTENT *Cache;
HTTP_BOOT_ENTITY_DATA *EntityData;
UINTN CopyedSize;
if (Uri == NULL || BufferSize == NULL || Buffer == NULL || ImageType == NULL) {
return EFI_INVALID_PARAMETER;
}
@@ -808,7 +808,7 @@ HttpBootGetFileFromCache (
@retval EFI_SUCCESS Continue to parser the message body.
@retval Others Abort the parse.
**/
EFI_STATUS
EFIAPI
@@ -878,7 +878,7 @@ HttpBootGetBootFileCallback (
/**
This function download the boot file by using UEFI HTTP protocol.
@param[in] Private The pointer to the driver's private data.
@param[in] HeaderOnly Only request the response header, it could save a lot of time if
the caller only want to know the size of the requested file.
@@ -926,7 +926,7 @@ HttpBootGetBootFile (
CHAR16 *Url;
BOOLEAN IdentityMode;
UINTN ReceivedSize;
ASSERT (Private != NULL);
ASSERT (Private->HttpCreated);
@@ -1116,7 +1116,7 @@ HttpBootGetBootFile (
Cache->ResponseData = ResponseData;
Cache->ImageType = *ImageType;
}
//
// 3.3 Init a message-body parser from the header information.
//
@@ -1278,7 +1278,7 @@ HttpBootGetBootFile (
}
return Status;
ERROR_6:
if (Parser != NULL) {
HttpFreeMsgParser (Parser);
@@ -1287,7 +1287,7 @@ ERROR_6:
FreePool (Context.Block);
}
HttpBootFreeCache (Cache);
ERROR_5:
if (ResponseData != NULL) {
FreePool (ResponseData);

View File

@@ -1,14 +1,14 @@
/** @file
Declaration of the boot file download function.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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,
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.
**/
@@ -98,7 +98,7 @@ HttpBootCreateHttpIo (
/**
This function download the boot file by using UEFI HTTP protocol.
@param[in] Private The pointer to the driver's private data.
@param[in] HeaderOnly Only request the response header, it could save a lot of time if
the caller only want to know the size of the requested file.

View File

@@ -1,13 +1,13 @@
/** @file
Implementation of EFI_COMPONENT_NAME_PROTOCOL and EFI_COMPONENT_NAME2_PROTOCOL protocol.
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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,
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.
**/
@@ -17,7 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
///
/// Component Name Protocol instance
///
GLOBAL_REMOVE_IF_UNREFERENCED
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_COMPONENT_NAME_PROTOCOL gHttpBootDxeComponentName = {
(EFI_COMPONENT_NAME_GET_DRIVER_NAME) HttpBootDxeComponentNameGetDriverName,
(EFI_COMPONENT_NAME_GET_CONTROLLER_NAME)HttpBootDxeComponentNameGetControllerName,
@@ -27,7 +27,7 @@ EFI_COMPONENT_NAME_PROTOCOL gHttpBootDxeComponentName = {
///
/// Component Name 2 Protocol instance
///
GLOBAL_REMOVE_IF_UNREFERENCED
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_COMPONENT_NAME2_PROTOCOL gHttpBootDxeComponentName2 = {
HttpBootDxeComponentNameGetDriverName,
HttpBootDxeComponentNameGetControllerName,
@@ -37,7 +37,7 @@ EFI_COMPONENT_NAME2_PROTOCOL gHttpBootDxeComponentName2 = {
///
/// Table of driver names
///
GLOBAL_REMOVE_IF_UNREFERENCED
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_UNICODE_STRING_TABLE mHttpBootDxeDriverNameTable[] = {
{ "eng;en", (CHAR16 *)L"UEFI HTTP Boot Driver" },
{ NULL, NULL }
@@ -46,7 +46,7 @@ EFI_UNICODE_STRING_TABLE mHttpBootDxeDriverNameTable[] = {
///
/// Table of controller names
///
GLOBAL_REMOVE_IF_UNREFERENCED
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_UNICODE_STRING_TABLE mHttpBootDxeControllerNameTable[] = {
{ "eng;en", (CHAR16 *)L"UEFI Http Boot Controller" },
{ NULL, NULL }
@@ -148,7 +148,7 @@ HttpBootDxeComponentNameGetControllerName (
if (ControllerHandle == NULL || ChildHandle != NULL) {
return EFI_UNSUPPORTED;
}
NicHandle = HttpBootGetNicByIp4Children (ControllerHandle);
if (NicHandle == NULL) {
NicHandle = HttpBootGetNicByIp6Children(ControllerHandle);

View File

@@ -1,14 +1,14 @@
/** @file
Declaration of HTTP boot driver's EFI_COMPONENT_NAME_PROTOCOL and
Declaration of HTTP boot driver's EFI_COMPONENT_NAME_PROTOCOL and
EFI_COMPONENT_NAME2_PROTOCOL function.
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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,
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.
**/

View File

@@ -1,7 +1,7 @@
/** @file
Helper functions for configuring or getting the parameters relating to HTTP Boot.
Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -24,7 +24,7 @@ CHAR16 mHttpBootConfigStorageName[] = L"HTTP_BOOT_CONFIG_IFR_NVDATA";
@param[in] UsingIpv6 Set to TRUE if creating boot option for IPv6.
@param[in] Description The description text of the boot option.
@param[in] Uri The URI string of the boot file.
@retval EFI_SUCCESS The boot option is created successfully.
@retval Others Failed to create new boot option.
@@ -72,7 +72,7 @@ HttpBootAddBootOption (
if ((StrLen (Uri) != 0) && (StrnCmp (Uri, L"http://", 7) != 0) && (StrnCmp (Uri, L"https://", 8) != 0)) {
return EFI_INVALID_PARAMETER;
}
//
// Create a new device path by appending the IP node and URI node to
// the driver's parent device path
@@ -154,7 +154,7 @@ ON_EXIT:
}
/**
This function allows the caller to request the current
configuration for one or more named elements. The resulting
string is in <ConfigAltResp> format. Also, any and all alternative
@@ -183,7 +183,7 @@ ON_EXIT:
to the most recent "&" before the first
failing name / value pair (or the beginning
of the string if the failure is in the first
name / value pair) if the request was not successful.
name / value pair) if the request was not successful.
@param[out] Results A null-terminated Unicode string in
<ConfigAltResp> format which has all values
@@ -204,7 +204,7 @@ ON_EXIT:
would result in this type of
error. In this case, the
Progress parameter would be
set to NULL.
set to NULL.
@retval EFI_NOT_FOUND Routing data doesn't match any
known driver. Progress set to the
@@ -249,7 +249,7 @@ HttpBootFormExtractConfig (
if ((Request != NULL) && !HiiIsConfigHdrMatch (Request, &gHttpBootConfigGuid, mHttpBootConfigStorageName)) {
return EFI_NOT_FOUND;
}
ConfigRequestHdr = NULL;
ConfigRequest = NULL;
AllocatedRequest = FALSE;
@@ -289,7 +289,7 @@ HttpBootFormExtractConfig (
Results,
Progress
);
//
// Free the allocated config request string.
//
@@ -310,7 +310,7 @@ HttpBootFormExtractConfig (
}
/**
This function applies changes in a driver's configuration.
Input is a Configuration, which has the routing data for this
driver followed by name / value configuration pairs. The driver
@@ -323,8 +323,8 @@ HttpBootFormExtractConfig (
@param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
@param[in] Configuration A null-terminated Unicode string in
<ConfigString> format.
<ConfigString> format.
@param[out] Progress A pointer to a string filled in with the
offset of the most recent '&' before the
first failing name / value pair (or the
@@ -335,16 +335,16 @@ HttpBootFormExtractConfig (
@retval EFI_SUCCESS The results have been distributed or are
awaiting distribution.
@retval EFI_OUT_OF_RESOURCES Not enough memory to store the
parts of the results that must be
stored awaiting possible future
protocols.
@retval EFI_INVALID_PARAMETERS Passing in a NULL for the
Results parameter would result
in this type of error.
@retval EFI_NOT_FOUND Target for the specified routing data
was not found.
@@ -381,7 +381,7 @@ HttpBootFormRouteConfig (
CallbackInfo = HTTP_BOOT_FORM_CALLBACK_INFO_FROM_CONFIG_ACCESS (This);
Private = HTTP_BOOT_PRIVATE_DATA_FROM_CALLBACK_INFO (CallbackInfo);
BufferSize = sizeof (HTTP_BOOT_CONFIG_IFR_NVDATA);
ZeroMem (&CallbackInfo->HttpBootNvData, BufferSize);
@@ -405,12 +405,12 @@ HttpBootFormRouteConfig (
CallbackInfo->HttpBootNvData.Description,
CallbackInfo->HttpBootNvData.Uri
);
return EFI_SUCCESS;
}
/**
This function is called to provide results data to the driver.
This data consists of a unique key that is used to identify
which data is either being passed back or being asked for.
@@ -419,7 +419,7 @@ HttpBootFormRouteConfig (
@param[in] Action Specifies the type of action taken by the browser.
@param[in] QuestionId A unique value which is sent to the original
exporting driver so that it can identify the type
of data to expect. The format of the data tends to
of data to expect. The format of the data tends to
vary based on the opcode that generated the callback.
@param[in] Type The type of value for the question.
@param[in, out] Value A pointer to the data being sent to the original
@@ -456,17 +456,17 @@ HttpBootFormCallback (
UriLen = 0;
AsciiUri = NULL;
Status = EFI_SUCCESS;
if (This == NULL || Value == NULL) {
return EFI_INVALID_PARAMETER;
}
CallbackInfo = HTTP_BOOT_FORM_CALLBACK_INFO_FROM_CONFIG_ACCESS (This);
if (Action != EFI_BROWSER_ACTION_CHANGING) {
return EFI_UNSUPPORTED;
}
switch (QuestionId) {
case KEY_INITIATOR_URI:
//
@@ -474,8 +474,8 @@ HttpBootFormCallback (
//
Uri = HiiGetString (CallbackInfo->RegisteredHandle, Value->string, NULL);
if(Uri == NULL) {
return EFI_INVALID_PARAMETER;
}
return EFI_INVALID_PARAMETER;
}
//
// The URI should be either an empty string (for corporate environment) ,or http(s) for home environment.
@@ -492,7 +492,7 @@ HttpBootFormCallback (
UnicodeStrToAsciiStrS (Uri, AsciiUri, UriLen);
Status = HttpBootCheckUriScheme (AsciiUri);
if (Status == EFI_INVALID_PARAMETER) {
DEBUG ((EFI_D_ERROR, "HttpBootFormCallback: %r.\n", Status));
@@ -503,11 +503,11 @@ HttpBootFormCallback (
L"ERROR: Unsupported URI!",
L"Only supports HTTP and HTTPS",
NULL
);
);
} else if (Status == EFI_ACCESS_DENIED) {
DEBUG ((EFI_D_ERROR, "HttpBootFormCallback: %r.\n", Status));
CreatePopUp (
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
&Key,
@@ -524,8 +524,8 @@ HttpBootFormCallback (
if (AsciiUri != NULL) {
FreePool (AsciiUri);
}
}
break;
default:
@@ -561,7 +561,7 @@ HttpBootConfigFormInit (
if (CallbackInfo->Initilized) {
return EFI_SUCCESS;
}
CallbackInfo->Signature = HTTP_BOOT_FORM_CALLBACK_INFO_SIGNATURE;
//
@@ -586,7 +586,7 @@ HttpBootConfigFormInit (
CallbackInfo->ConfigAccess.ExtractConfig = HttpBootFormExtractConfig;
CallbackInfo->ConfigAccess.RouteConfig = HttpBootFormRouteConfig;
CallbackInfo->ConfigAccess.Callback = HttpBootFormCallback;
//
// Install Device Path Protocol and Config Access protocol to driver handle.
//
@@ -623,25 +623,25 @@ HttpBootConfigFormInit (
Status = NetLibGetMacString (Private->Controller, NULL, &MacString);
if (!EFI_ERROR (Status)) {
OldMenuString = HiiGetString (
CallbackInfo->RegisteredHandle,
STRING_TOKEN (STR_HTTP_BOOT_CONFIG_FORM_HELP),
CallbackInfo->RegisteredHandle,
STRING_TOKEN (STR_HTTP_BOOT_CONFIG_FORM_HELP),
NULL
);
UnicodeSPrint (MenuString, 128, L"%s (MAC:%s)", OldMenuString, MacString);
HiiSetString (
CallbackInfo->RegisteredHandle,
STRING_TOKEN (STR_HTTP_BOOT_CONFIG_FORM_HELP),
MenuString,
CallbackInfo->RegisteredHandle,
STRING_TOKEN (STR_HTTP_BOOT_CONFIG_FORM_HELP),
MenuString,
NULL
);
FreePool (MacString);
FreePool (OldMenuString);
CallbackInfo->Initilized = TRUE;
return EFI_SUCCESS;
}
Error:
HttpBootConfigFormUnload (Private);

View File

@@ -1,7 +1,7 @@
/** @file
VFR file used by the HTTP Boot configuration component.
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -24,7 +24,7 @@ formset
varstore HTTP_BOOT_CONFIG_IFR_NVDATA,
name = HTTP_BOOT_CONFIG_IFR_NVDATA,
guid = HTTP_BOOT_CONFIG_GUID;
form formid = FORMID_MAIN_FORM,
title = STRING_TOKEN(STR_HTTP_BOOT_CONFIG_FORM_TITLE);

View File

@@ -1,13 +1,13 @@
/** @file
Functions implementation related with DHCPv4 for HTTP boot driver.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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,
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.
**/
@@ -267,7 +267,7 @@ HttpBootParseDhcp4Packet (
HTTP_BOOT_OFFER_TYPE OfferType;
EFI_IPv4_ADDRESS IpAddr;
BOOLEAN FileFieldOverloaded;
IsDnsOffer = FALSE;
IpExpressedUri = FALSE;
IsProxyOffer = FALSE;
@@ -291,7 +291,7 @@ HttpBootParseDhcp4Packet (
);
}
//
// Second, Check if bootfilename and serverhostname is overloaded to carry DHCP options refers to rfc-2132.
// Second, Check if bootfilename and serverhostname is overloaded to carry DHCP options refers to rfc-2132.
// If yes, try to parse options from the BootFileName field, then ServerName field.
//
Option = Options[HTTP_BOOT_DHCP4_TAG_INDEX_OVERLOAD];
@@ -379,7 +379,7 @@ HttpBootParseDhcp4Packet (
}
//
// Try to retrieve the IP of HTTP server from URI.
// Try to retrieve the IP of HTTP server from URI.
//
if (IsHttpOffer) {
Status = HttpParseUrl (
@@ -428,7 +428,7 @@ HttpBootParseDhcp4Packet (
return EFI_DEVICE_ERROR;
}
}
Cache4->OfferType = OfferType;
return EFI_SUCCESS;
}
@@ -506,70 +506,70 @@ HttpBootSelectDhcpOffer (
// The offer with DNS server address takes priority here.
//
if (Private->OfferCount[HttpOfferTypeDhcpDns] > 0) {
Private->SelectIndex = Private->OfferIndex[HttpOfferTypeDhcpDns][0] + 1;
} else if (Private->OfferCount[HttpOfferTypeDhcpIpUriDns] > 0) {
Private->SelectIndex = Private->OfferIndex[HttpOfferTypeDhcpIpUriDns][0] + 1;
} else if (Private->OfferCount[HttpOfferTypeDhcpNameUriDns] > 0) {
Private->SelectIndex = Private->OfferIndex[HttpOfferTypeDhcpNameUriDns][0] + 1;
} else if (Private->OfferCount[HttpOfferTypeDhcpOnly] > 0) {
Private->SelectIndex = Private->OfferIndex[HttpOfferTypeDhcpOnly][0] + 1;
} else if (Private->OfferCount[HttpOfferTypeDhcpIpUri] > 0) {
Private->SelectIndex = Private->OfferIndex[HttpOfferTypeDhcpIpUri][0] + 1;
}
} else {
//
// We are in corporate environment.
//
// Priority1: HttpOfferTypeDhcpIpUri or HttpOfferTypeDhcpIpUriDns
// Priority2: HttpOfferTypeDhcpNameUriDns
// Priority3: HttpOfferTypeDhcpOnly + HttpOfferTypeProxyIpUri
// Priority4: HttpOfferTypeDhcpDns + HttpOfferTypeProxyIpUri
// Priority2: HttpOfferTypeDhcpNameUriDns
// Priority3: HttpOfferTypeDhcpOnly + HttpOfferTypeProxyIpUri
// Priority4: HttpOfferTypeDhcpDns + HttpOfferTypeProxyIpUri
// Priority5: HttpOfferTypeDhcpDns + HttpOfferTypeProxyNameUri
// Priority6: HttpOfferTypeDhcpDns + HttpOfferTypeDhcpNameUri
//
// Priority6: HttpOfferTypeDhcpDns + HttpOfferTypeDhcpNameUri
//
if (Private->OfferCount[HttpOfferTypeDhcpIpUri] > 0) {
Private->SelectIndex = Private->OfferIndex[HttpOfferTypeDhcpIpUri][0] + 1;
} else if (Private->OfferCount[HttpOfferTypeDhcpIpUriDns] > 0) {
Private->SelectIndex = Private->OfferIndex[HttpOfferTypeDhcpIpUriDns][0] + 1;
}else if (Private->OfferCount[HttpOfferTypeDhcpNameUriDns] > 0) {
Private->SelectIndex = Private->OfferIndex[HttpOfferTypeDhcpNameUriDns][0] + 1;
} else if (Private->OfferCount[HttpOfferTypeDhcpOnly] > 0 &&
Private->OfferCount[HttpOfferTypeProxyIpUri] > 0) {
Private->SelectIndex = Private->OfferIndex[HttpOfferTypeDhcpOnly][0] + 1;
Private->SelectProxyType = HttpOfferTypeProxyIpUri;
} else if (Private->OfferCount[HttpOfferTypeDhcpDns] > 0 &&
Private->OfferCount[HttpOfferTypeProxyIpUri] > 0) {
Private->SelectIndex = Private->OfferIndex[HttpOfferTypeDhcpDns][0] + 1;
Private->SelectProxyType = HttpOfferTypeProxyIpUri;
} else if (Private->OfferCount[HttpOfferTypeDhcpDns] > 0 &&
Private->OfferCount[HttpOfferTypeProxyNameUri] > 0) {
Private->SelectIndex = Private->OfferIndex[HttpOfferTypeDhcpDns][0] + 1;
Private->SelectProxyType = HttpOfferTypeProxyNameUri;
} else if (Private->OfferCount[HttpOfferTypeDhcpDns] > 0 &&
Private->OfferCount[HttpOfferTypeDhcpNameUri] > 0) {
Private->SelectIndex = Private->OfferIndex[HttpOfferTypeDhcpDns][0] + 1;
Private->SelectProxyType = HttpOfferTypeDhcpNameUri;
}
@@ -614,14 +614,14 @@ HttpBootDhcp4CallBack (
EFI_STATUS Status;
BOOLEAN Received;
if ((Dhcp4Event != Dhcp4SendDiscover) &&
(Dhcp4Event != Dhcp4RcvdOffer) &&
(Dhcp4Event != Dhcp4SendRequest) &&
(Dhcp4Event != Dhcp4RcvdAck) &&
if ((Dhcp4Event != Dhcp4SendDiscover) &&
(Dhcp4Event != Dhcp4RcvdOffer) &&
(Dhcp4Event != Dhcp4SendRequest) &&
(Dhcp4Event != Dhcp4RcvdAck) &&
(Dhcp4Event != Dhcp4SelectOffer)) {
return EFI_SUCCESS;
}
Private = (HTTP_BOOT_PRIVATE_DATA *) Context;
//
@@ -636,14 +636,14 @@ HttpBootDhcp4CallBack (
Value = HTONS (HTTP_BOOT_DHCP4_PACKET_MAX_SIZE);
CopyMem (MaxMsgSize->Data, &Value, sizeof (Value));
}
//
// Callback to user if any packets sent or received.
//
if (Private->HttpBootCallback != NULL && Dhcp4Event != Dhcp4SelectOffer) {
Received = (BOOLEAN) (Dhcp4Event == Dhcp4RcvdOffer || Dhcp4Event == Dhcp4RcvdAck);
Status = Private->HttpBootCallback->Callback (
Private->HttpBootCallback,
Private->HttpBootCallback,
HttpBootDhcp4,
Received,
Packet->Length,
@@ -676,7 +676,7 @@ HttpBootDhcp4CallBack (
case Dhcp4SelectOffer:
//
// Select offer according to the priority in UEFI spec, and record the SelectIndex
// Select offer according to the priority in UEFI spec, and record the SelectIndex
// and SelectProxyType.
//
HttpBootSelectDhcpOffer (Private);
@@ -687,7 +687,7 @@ HttpBootDhcp4CallBack (
*NewPacket = &Private->OfferBuffer[Private->SelectIndex - 1].Dhcp4.Packet.Offer;
}
break;
default:
break;
}
@@ -697,7 +697,7 @@ HttpBootDhcp4CallBack (
/**
This function will register the IPv4 gateway address to the network device.
@param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
@retval EFI_SUCCESS The new IP configuration has been configured successfully.
@@ -736,7 +736,7 @@ HttpBootRegisterIp4Gateway (
/**
This function will register the default DNS addresses to the network device.
@param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
@param[in] DataLength Size of the buffer pointed to by DnsServerData in bytes.
@param[in] DnsServerData Point a list of DNS server address in an array
@@ -754,11 +754,11 @@ HttpBootRegisterIp4Dns (
)
{
EFI_IP4_CONFIG2_PROTOCOL *Ip4Config2;
ASSERT (!Private->UsingIpv6);
Ip4Config2 = Private->Ip4Config2;
return Ip4Config2->SetData (
Ip4Config2,
Ip4Config2DataTypeDnsServer,
@@ -810,7 +810,7 @@ HttpBootSetIp4Policy (
);
if (EFI_ERROR (Status)) {
return Status;
}
}
}
return EFI_SUCCESS;
@@ -837,7 +837,7 @@ HttpBootDhcp4Dora (
EFI_DHCP4_CONFIG_DATA Config;
EFI_STATUS Status;
EFI_DHCP4_MODE_DATA Mode;
Dhcp4 = Private->Dhcp4;
ASSERT (Dhcp4 != NULL);

View File

@@ -1,13 +1,13 @@
/** @file
Functions declaration related with DHCPv4 for HTTP boot driver.
Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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,
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.
**/
@@ -28,7 +28,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define HTTP_BOOT_DHCP4_OVERLOAD_SERVER_NAME 2
///
/// HTTP Tag definition that identifies the processor
/// HTTP Tag definition that identifies the processor
/// and programming environment of the client system.
/// These identifiers are defined by IETF:
/// http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml
@@ -236,7 +236,7 @@ HttpBootDhcp4Dora (
/**
This function will register the default DNS addresses to the network device.
@param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
@param[in] DataLength Size of the buffer pointed to by DnsServerData in bytes.
@param[in] DnsServerData Point a list of DNS server address in an array

View File

@@ -1,13 +1,13 @@
/** @file
Functions implementation related with DHCPv6 for HTTP boot driver.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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,
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.
**/
@@ -192,14 +192,14 @@ HttpBootParseDhcp6Packet (
EFI_STATUS Status;
UINT32 Offset;
UINT32 Length;
IsDnsOffer = FALSE;
IpExpressedUri = FALSE;
IsProxyOffer = TRUE;
IsHttpOffer = FALSE;
Offer = &Cache6->Packet.Offer;
Options = Cache6->OptList;
ZeroMem (Cache6->OptList, sizeof (Cache6->OptList));
Option = (EFI_DHCP6_PACKET_OPTION *) (Offer->Dhcp6.Option);
@@ -270,9 +270,9 @@ HttpBootParseDhcp6Packet (
if (IsHttpOffer && Options[HTTP_BOOT_DHCP6_IDX_BOOT_FILE_URL] == NULL) {
return EFI_DEVICE_ERROR;
}
//
// Try to retrieve the IP of HTTP server from URI.
// Try to retrieve the IP of HTTP server from URI.
//
if (IsHttpOffer) {
Status = HttpParseUrl (
@@ -318,7 +318,7 @@ HttpBootParseDhcp6Packet (
return EFI_DEVICE_ERROR;
}
}
Cache6->OfferType = OfferType;
return EFI_SUCCESS;
}
@@ -345,7 +345,7 @@ HttpBootCacheDhcp6Packet (
CopyMem (&Dst->Dhcp6, &Src->Dhcp6, Src->Length);
Dst->Length = Src->Length;
return EFI_SUCCESS;
}
@@ -397,7 +397,7 @@ HttpBootCacheDhcp6Offer (
Private->OfferIndex[OfferType][Private->OfferCount[OfferType]] = Private->OfferNum;
Private->OfferCount[OfferType]++;
Private->OfferNum++;
return EFI_SUCCESS;
}
@@ -435,7 +435,7 @@ HttpBootDhcp6CallBack (
EFI_DHCP6_PACKET *SelectAd;
EFI_STATUS Status;
BOOLEAN Received;
if ((Dhcp6Event != Dhcp6SendSolicit) &&
(Dhcp6Event != Dhcp6RcvdAdvertise) &&
(Dhcp6Event != Dhcp6SendRequest) &&
@@ -445,13 +445,13 @@ HttpBootDhcp6CallBack (
}
ASSERT (Packet != NULL);
Private = (HTTP_BOOT_PRIVATE_DATA *) Context;
Status = EFI_SUCCESS;
if (Private->HttpBootCallback != NULL && Dhcp6Event != Dhcp6SelectAdvertise) {
Received = (BOOLEAN) (Dhcp6Event == Dhcp6RcvdAdvertise || Dhcp6Event == Dhcp6RcvdReply);
Status = Private->HttpBootCallback->Callback (
Private->HttpBootCallback,
Private->HttpBootCallback,
HttpBootDhcp6,
Received,
Packet->Length,
@@ -462,7 +462,7 @@ HttpBootDhcp6CallBack (
}
}
switch (Dhcp6Event) {
case Dhcp6RcvdAdvertise:
Status = EFI_NOT_READY;
if (Packet->Length > HTTP_BOOT_DHCP6_PACKET_MAX_SIZE) {
@@ -500,17 +500,17 @@ HttpBootDhcp6CallBack (
CopyMem (*NewPacket, SelectAd, SelectAd->Size);
}
break;
default:
break;
}
return Status;
return Status;
}
/**
Check whether IP driver could route the message which will be sent to ServerIp address.
This function will check the IP6 route table every 1 seconds until specified timeout is expired, if a valid
route is found in IP6 route table, the address will be filed in GatewayAddr and return.
@@ -521,7 +521,7 @@ HttpBootDhcp6CallBack (
@retval EFI_SUCCESS Found a valid gateway address successfully.
@retval EFI_TIMEOUT The operation is time out.
@retval Other Unexpect error happened.
**/
EFI_STATUS
HttpBootCheckRouteTable (
@@ -553,7 +553,7 @@ HttpBootCheckRouteTable (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
//
// Find out the gateway address which can route the message which send to ServerIp.
//
@@ -583,13 +583,13 @@ HttpBootCheckRouteTable (
if (Ip6ModeData.IcmpTypeList != NULL) {
FreePool (Ip6ModeData.IcmpTypeList);
}
if (GatewayIsFound || RetryCount == TimeOutInSecond) {
break;
}
RetryCount++;
//
// Delay 1 second then recheck it again.
//
@@ -614,19 +614,19 @@ HttpBootCheckRouteTable (
Ip6->Poll (Ip6);
}
}
ON_EXIT:
if (TimeOutEvt != NULL) {
gBS->CloseEvent (TimeOutEvt);
}
if (GatewayIsFound) {
Status = EFI_SUCCESS;
} else if (RetryCount == TimeOutInSecond) {
Status = EFI_TIMEOUT;
}
return Status;
return Status;
}
/**
@@ -650,7 +650,7 @@ HttpBootSetIp6Policy (
Ip6Config = Private->Ip6Config;
DataSize = sizeof (EFI_IP6_CONFIG_POLICY);
//
// Get and store the current policy of IP6 driver.
//
@@ -681,7 +681,7 @@ HttpBootSetIp6Policy (
/**
This function will register the default DNS addresses to the network device.
@param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
@param[in] DataLength Size of the buffer pointed to by DnsServerData in bytes.
@param[in] DnsServerData Point a list of DNS server address in an array
@@ -699,11 +699,11 @@ HttpBootSetIp6Dns (
)
{
EFI_IP6_CONFIG_PROTOCOL *Ip6Config;
ASSERT (Private->UsingIpv6);
Ip6Config = Private->Ip6Config;
return Ip6Config->SetData (
Ip6Config,
Ip6ConfigDataTypeDnsServer,
@@ -714,7 +714,7 @@ HttpBootSetIp6Dns (
/**
This function will register the IPv6 gateway address to the network device.
@param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
@retval EFI_SUCCESS The new IP configuration has been configured successfully.
@@ -731,9 +731,9 @@ HttpBootSetIp6Gateway (
ASSERT (Private->UsingIpv6);
Ip6Config = Private->Ip6Config;
//
// Set the default gateway address.
// Set the default gateway address.
//
if (!Private->NoGateway && !NetIp6IsUnspecifiedAddr (&Private->GatewayIp.v6)) {
Status = Ip6Config->SetData (
@@ -752,7 +752,7 @@ HttpBootSetIp6Gateway (
/**
This function will register the station IP address.
@param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
@retval EFI_SUCCESS The new IP address has been configured successfully.
@@ -772,29 +772,29 @@ HttpBootSetIp6Address (
EFI_IPv6_ADDRESS *Ip6Addr;
EFI_IPv6_ADDRESS GatewayAddr;
EFI_IP6_CONFIG_DATA Ip6CfgData;
EFI_EVENT MappedEvt;
EFI_EVENT MappedEvt;
UINTN DataSize;
BOOLEAN IsAddressOk;
UINTN Index;
ASSERT (Private->UsingIpv6);
MappedEvt = NULL;
IsAddressOk = FALSE;
Ip6Addr = NULL;
Ip6Cfg = Private->Ip6Config;
Ip6 = Private->Ip6;
ZeroMem (&CfgAddr, sizeof (EFI_IP6_CONFIG_MANUAL_ADDRESS));
CopyMem (&CfgAddr, &Private->StationIp.v6, sizeof (EFI_IPv6_ADDRESS));
ZeroMem (&Ip6CfgData, sizeof (EFI_IP6_CONFIG_DATA));
Ip6CfgData.AcceptIcmpErrors = TRUE;
Ip6CfgData.DefaultProtocol = IP6_ICMP;
Ip6CfgData.HopLimit = HTTP_BOOT_DEFAULT_HOPLIMIT;
Ip6CfgData.ReceiveTimeout = HTTP_BOOT_DEFAULT_LIFETIME;
Ip6CfgData.TransmitTimeout = HTTP_BOOT_DEFAULT_LIFETIME;
Status = Ip6->Configure (Ip6, &Ip6CfgData);
if (EFI_ERROR (Status)) {
goto ON_EXIT;
@@ -823,7 +823,7 @@ HttpBootSetIp6Address (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
//
// Create a notify event to set address flag when DAD if IP6 driver succeeded.
//
@@ -837,7 +837,7 @@ HttpBootSetIp6Address (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
//
// Set static host ip6 address. This is a asynchronous process.
//
@@ -855,7 +855,7 @@ HttpBootSetIp6Address (
Ip6ConfigDataTypeManualAddress,
sizeof (EFI_IP6_CONFIG_MANUAL_ADDRESS),
&CfgAddr
);
);
if (EFI_ERROR (Status) && Status != EFI_NOT_READY) {
goto ON_EXIT;
} else if (Status == EFI_NOT_READY) {
@@ -879,7 +879,7 @@ HttpBootSetIp6Address (
Status = EFI_DEVICE_ERROR;
goto ON_EXIT;
}
Ip6Addr = AllocatePool (DataSize);
if (Ip6Addr == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -903,9 +903,9 @@ HttpBootSetIp6Address (
if (Index == DataSize / sizeof (EFI_IPv6_ADDRESS)) {
Status = EFI_ABORTED;
goto ON_EXIT;
}
}
}
ON_EXIT:
if (MappedEvt != NULL) {
Ip6Cfg->UnregisterDataNotify (
@@ -919,8 +919,8 @@ ON_EXIT:
if (Ip6Addr != NULL) {
FreePool (Ip6Addr);
}
return Status;
return Status;
}
/**
@@ -954,15 +954,15 @@ HttpBootDhcp6Sarr (
//
OptCount = HttpBootBuildDhcp6Options (Private, OptList, Buffer);
ASSERT (OptCount >0);
Retransmit = AllocateZeroPool (sizeof (EFI_DHCP6_RETRANSMISSION));
if (Retransmit == NULL) {
return EFI_OUT_OF_RESOURCES;
}
ZeroMem (&Mode, sizeof (EFI_DHCP6_MODE_DATA));
ZeroMem (&Config, sizeof (EFI_DHCP6_CONFIG_DATA));
Config.OptionCount = OptCount;
Config.OptionList = OptList;
Config.Dhcp6Callback = HttpBootDhcp6CallBack;
@@ -977,7 +977,7 @@ HttpBootDhcp6Sarr (
Retransmit->Mrc = 4;
Retransmit->Mrt = 32;
Retransmit->Mrd = 60;
//
// Configure the DHCPv6 instance for HTTP boot.
//
@@ -993,7 +993,7 @@ HttpBootDhcp6Sarr (
Private->SelectIndex = 0;
ZeroMem (Private->OfferCount, sizeof (Private->OfferCount));
ZeroMem (Private->OfferIndex, sizeof (Private->OfferIndex));
//
// Start DHCPv6 S.A.R.R. process to acquire IPv6 address.
//
@@ -1001,7 +1001,7 @@ HttpBootDhcp6Sarr (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
//
// Get the acquired IPv6 address and store them.
//
@@ -1009,14 +1009,14 @@ HttpBootDhcp6Sarr (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
ASSERT (Mode.Ia->State == Dhcp6Bound);
CopyMem (&Private->StationIp.v6, &Mode.Ia->IaAddress[0].IpAddress, sizeof (EFI_IPv6_ADDRESS));
AsciiPrint ("\n Station IPv6 address is ");
HttpBootShowIp6Addr (&Private->StationIp.v6);
AsciiPrint ("\n");
ON_EXIT:
if (EFI_ERROR (Status)) {
Dhcp6->Stop (Dhcp6);
@@ -1032,7 +1032,7 @@ ON_EXIT:
}
}
return Status;
return Status;
}

View File

@@ -1,13 +1,13 @@
/** @file
Functions declaration related with DHCPv6 for HTTP boot driver.
Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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,
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.
**/
@@ -127,7 +127,7 @@ HttpBootSetIp6Policy (
/**
This function will register the default DNS addresses to the network device.
@param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
@param[in] DataLength Size of the buffer pointed to by DnsServerData in bytes.
@param[in] DnsServerData Point a list of DNS server address in an array
@@ -146,7 +146,7 @@ HttpBootSetIp6Dns (
/**
This function will register the IPv6 gateway address to the network device.
@param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
@retval EFI_SUCCESS The new IP configuration has been configured successfully.
@@ -160,7 +160,7 @@ HttpBootSetIp6Gateway (
/**
This function will register the station IP address.
@param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
@retval EFI_SUCCESS The new IP address has been configured successfully.

View File

@@ -1,14 +1,14 @@
/** @file
Driver Binding functions implementation for UEFI HTTP boot.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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.
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.
**/
@@ -75,7 +75,7 @@ HttpBootCheckIpv6Support (
//
// Get the NIC handle by SNP protocol.
//
//
Handle = NetLibGetSnpHandle (Private->Controller, NULL);
if (Handle == NULL) {
return EFI_NOT_FOUND;
@@ -121,11 +121,11 @@ HttpBootCheckIpv6Support (
if (EFI_ERROR (Status) || InfoBlock == NULL) {
FreePool (InfoBlock);
return EFI_NOT_FOUND;
}
}
*Ipv6Support = ((EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT *) InfoBlock)->Ipv6Support;
FreePool (InfoBlock);
return EFI_SUCCESS;
}
@@ -167,14 +167,14 @@ HttpBootDestroyIp4Children (
}
if (Private->Ip4Nic != NULL) {
gBS->CloseProtocol (
Private->Controller,
&gEfiCallerIdGuid,
This->DriverBindingHandle,
Private->Ip4Nic->Controller
);
gBS->UninstallMultipleProtocolInterfaces (
Private->Ip4Nic->Controller,
&gEfiLoadFileProtocolGuid,
@@ -204,7 +204,7 @@ HttpBootDestroyIp6Children (
{
ASSERT (This != NULL);
ASSERT (Private != NULL);
if (Private->Ip6Child != NULL) {
gBS->CloseProtocol (
Private->Ip6Child,
@@ -241,16 +241,16 @@ HttpBootDestroyIp6Children (
HttpIoDestroyIo(&Private->HttpIo);
Private->HttpCreated = FALSE;
}
if (Private->Ip6Nic != NULL) {
gBS->CloseProtocol (
Private->Controller,
&gEfiCallerIdGuid,
This->DriverBindingHandle,
Private->Ip6Nic->Controller
);
gBS->UninstallMultipleProtocolInterfaces (
Private->Ip6Nic->Controller,
&gEfiLoadFileProtocolGuid,
@@ -265,33 +265,33 @@ HttpBootDestroyIp6Children (
}
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -315,7 +315,7 @@ HttpBootIp4DxeDriverBindingSupported (
)
{
EFI_STATUS Status;
//
// Try to open the DHCP4, HTTP4 and Device Path protocol.
//
@@ -360,28 +360,28 @@ HttpBootIp4DxeDriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -421,7 +421,7 @@ HttpBootIp4DxeDriverBindingStart (
Private = HTTP_BOOT_PRIVATE_DATA_FROM_ID(Id);
} else {
FirstStart = TRUE;
//
// Initialize the private data structure.
//
@@ -483,16 +483,16 @@ HttpBootIp4DxeDriverBindingStart (
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
}
if (Private->Ip4Nic != NULL) {
//
// Already created before
//
return EFI_SUCCESS;
}
Private->Ip4Nic = AllocateZeroPool (sizeof (HTTP_BOOT_VIRTUAL_NIC));
if (Private->Ip4Nic == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -501,7 +501,7 @@ HttpBootIp4DxeDriverBindingStart (
Private->Ip4Nic->Private = Private;
Private->Ip4Nic->ImageHandle = This->DriverBindingHandle;
Private->Ip4Nic->Signature = HTTP_BOOT_VIRTUAL_NIC_SIGNATURE;
//
// Create DHCP4 child instance.
//
@@ -514,7 +514,7 @@ HttpBootIp4DxeDriverBindingStart (
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
Status = gBS->OpenProtocol (
Private->Dhcp4Child,
&gEfiDhcp4ProtocolGuid,
@@ -526,7 +526,7 @@ HttpBootIp4DxeDriverBindingStart (
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
//
// Get the Ip4Config2 protocol, it's required to configure the default gateway address.
//
@@ -541,7 +541,7 @@ HttpBootIp4DxeDriverBindingStart (
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
//
// Append IPv4 device path node.
//
@@ -560,7 +560,7 @@ HttpBootIp4DxeDriverBindingStart (
Status = EFI_OUT_OF_RESOURCES;
goto ON_ERROR;
}
//
// Append URI device path node.
//
@@ -579,7 +579,7 @@ HttpBootIp4DxeDriverBindingStart (
Status = EFI_OUT_OF_RESOURCES;
goto ON_ERROR;
}
//
// Create a child handle for the HTTP boot and install DevPath and Load file protocol on it.
//
@@ -595,7 +595,7 @@ HttpBootIp4DxeDriverBindingStart (
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
//
// Open the Caller Id child to setup a parent-child relationship between
// real NIC handle and the HTTP boot Ipv4 NIC handle.
@@ -611,9 +611,9 @@ HttpBootIp4DxeDriverBindingStart (
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
return EFI_SUCCESS;
ON_ERROR:
if (Private != NULL) {
if (FirstStart) {
@@ -623,7 +623,7 @@ ON_ERROR:
&Private->Id
);
}
HttpBootDestroyIp4Children (This, Private);
HttpBootConfigFormUnload (Private);
@@ -638,10 +638,10 @@ ON_ERROR:
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -649,13 +649,13 @@ ON_ERROR:
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -729,7 +729,7 @@ HttpBootIp4DxeDriverBindingStop (
// Destory all child instance and uninstall protocol interface.
//
HttpBootDestroyIp4Children (This, Private);
if (Private->Ip4Nic == NULL && Private->Ip6Nic == NULL) {
//
// Release the cached data.
@@ -740,7 +740,7 @@ HttpBootIp4DxeDriverBindingStop (
// Unload the config form.
//
HttpBootConfigFormUnload (Private);
gBS->UninstallProtocolInterface (
NicHandle,
&gEfiCallerIdGuid,
@@ -754,33 +754,33 @@ HttpBootIp4DxeDriverBindingStop (
}
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -804,7 +804,7 @@ HttpBootIp6DxeDriverBindingSupported (
)
{
EFI_STATUS Status;
//
// Try to open the DHCP6, HTTP and Device Path protocol.
//
@@ -849,28 +849,28 @@ HttpBootIp6DxeDriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -897,7 +897,7 @@ HttpBootIp6DxeDriverBindingStart (
BOOLEAN FirstStart;
FirstStart = FALSE;
Status = gBS->OpenProtocol (
ControllerHandle,
&gEfiCallerIdGuid,
@@ -906,12 +906,12 @@ HttpBootIp6DxeDriverBindingStart (
ControllerHandle,
EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
if (!EFI_ERROR (Status)) {
Private = HTTP_BOOT_PRIVATE_DATA_FROM_ID(Id);
} else {
FirstStart = TRUE;
//
// Initialize the private data structure.
//
@@ -973,16 +973,16 @@ HttpBootIp6DxeDriverBindingStart (
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
}
//
// Set IPv6 available flag.
//
//
Status = HttpBootCheckIpv6Support (Private, &Ipv6Available);
if (EFI_ERROR (Status)) {
//
// Fail to get the data whether UNDI supports IPv6.
// Fail to get the data whether UNDI supports IPv6.
// Set default value to TRUE.
//
Ipv6Available = TRUE;
@@ -992,14 +992,14 @@ HttpBootIp6DxeDriverBindingStart (
Status = EFI_UNSUPPORTED;
goto ON_ERROR;
}
if (Private->Ip6Nic != NULL) {
//
// Already created before
//
return EFI_SUCCESS;
}
Private->Ip6Nic = AllocateZeroPool (sizeof (HTTP_BOOT_VIRTUAL_NIC));
if (Private->Ip6Nic == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -1008,7 +1008,7 @@ HttpBootIp6DxeDriverBindingStart (
Private->Ip6Nic->Private = Private;
Private->Ip6Nic->ImageHandle = This->DriverBindingHandle;
Private->Ip6Nic->Signature = HTTP_BOOT_VIRTUAL_NIC_SIGNATURE;
//
// Create Dhcp6 child and open Dhcp6 protocol
Status = NetLibCreateServiceChild (
@@ -1144,7 +1144,7 @@ HttpBootIp6DxeDriverBindingStart (
}
return EFI_SUCCESS;
ON_ERROR:
if (Private != NULL) {
if (FirstStart) {
@@ -1168,10 +1168,10 @@ ON_ERROR:
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -1179,13 +1179,13 @@ ON_ERROR:
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -1317,7 +1317,7 @@ HttpBootDxeDriverEntryPoint (
if (EFI_ERROR (Status)) {
return Status;
}
Status = EfiLibInstallDriverBindingComponentName2 (
ImageHandle,
SystemTable,

View File

@@ -1,15 +1,15 @@
/** @file
UEFI HTTP boot driver's private data structure and interfaces declaration.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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.
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.
**/
@@ -77,7 +77,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define HTTP_BOOT_DXE_VERSION 0xa
//
// Standard Media Types defined in
// Standard Media Types defined in
// http://www.iana.org/assignments/media-types
//
#define HTTP_CONTENT_TYPE_APP_EFI "application/efi"
@@ -136,7 +136,7 @@ struct _HTTP_BOOT_VIRTUAL_NIC {
CallbackInfo, \
HTTP_BOOT_PRIVATE_DATA_SIGNATURE \
)
#define HTTP_BOOT_PRIVATE_DATA_FROM_CALLBACK_PROTOCOL(CallbackProtocol) \
CR ( \
CallbackProtocol, \
@@ -172,7 +172,7 @@ struct _HTTP_BOOT_PRIVATE_DATA {
EFI_DHCP6_PROTOCOL *Dhcp6;
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
//
// Produced protocol
//
@@ -273,33 +273,33 @@ struct _HTTP_BOOT_PRIVATE_DATA {
extern EFI_LOAD_FILE_PROTOCOL gHttpBootDxeLoadFile;
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -326,28 +326,28 @@ HttpBootIp4DxeDriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -367,10 +367,10 @@ HttpBootIp4DxeDriverBindingStart (
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -378,13 +378,13 @@ HttpBootIp4DxeDriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -401,33 +401,33 @@ HttpBootIp4DxeDriverBindingStop (
);
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -454,28 +454,28 @@ HttpBootIp6DxeDriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -495,10 +495,10 @@ HttpBootIp6DxeDriverBindingStart (
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -506,13 +506,13 @@ HttpBootIp6DxeDriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.

View File

@@ -1,15 +1,15 @@
## @file
# This modules produce the Load File Protocol for UEFI HTTP boot.
#
# Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
#
# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
# 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]
@@ -68,7 +68,7 @@
## TO_START
## BY_START
gEfiDevicePathProtocolGuid
gEfiLoadFileProtocolGuid ## BY_START
gEfiHttpServiceBindingProtocolGuid ## CONSUMES
gEfiHttpProtocolGuid ## CONSUMES
@@ -99,7 +99,7 @@
gEfiAdapterInfoUndiIpv6SupportGuid ## SOMETIMES_CONSUMES ## GUID
[Pcd]
gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections ## CONSUMES
gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections ## CONSUMES
[UserExtensions.TianoCore."ExtraFiles"]
HttpBootDxeExtra.uni

View File

@@ -3,15 +3,15 @@
//
// This driver provides EFI Load File Protocol which is used to download
// the boot image from HTTP server. It could work with an IPv4 or IPv6 stack.
//
//
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
//
// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
//
// 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.
//

View File

@@ -1,7 +1,7 @@
// /** @file
// HttpBootDxe Localized Strings and Content
//
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -13,8 +13,8 @@
//
// **/
#string STR_PROPERTIES_MODULE_NAME
#language en-US
#string STR_PROPERTIES_MODULE_NAME
#language en-US
"UEFI HTTP BOOT DXE"

View File

@@ -3,12 +3,12 @@
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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,
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.
**/
@@ -96,7 +96,7 @@ HttpBootUninstallCallback (
/**
Enable the use of UEFI HTTP boot function.
If the driver has already been started but not satisfy the requirement (IP stack and
If the driver has already been started but not satisfy the requirement (IP stack and
specified boot file path), this function will stop the driver and start it again.
@param[in] Private The pointer to the driver's private data.
@@ -110,7 +110,7 @@ HttpBootUninstallCallback (
@retval EFI_INVALID_PARAMETER The FilePath doesn't contain a valid URI device path node.
@retval EFI_ALREADY_STARTED The driver is already in started state.
@retval EFI_OUT_OF_RESOURCES There are not enough resources.
**/
EFI_STATUS
HttpBootStart (
@@ -124,20 +124,20 @@ HttpBootStart (
CHAR8 *Uri;
Uri = NULL;
if (Private == NULL || FilePath == NULL) {
return EFI_INVALID_PARAMETER;
}
//
// Check the URI in the input FilePath, in order to see whether it is
// required to boot from a new specified boot file.
// required to boot from a new specified boot file.
//
Status = HttpBootParseFilePath (FilePath, &Uri);
if (EFI_ERROR (Status)) {
return EFI_INVALID_PARAMETER;
}
//
// Check whether we need to stop and restart the HTTP boot driver.
//
@@ -148,7 +148,7 @@ HttpBootStart (
// 2. The specified boot file URI in FilePath is different with the one we have
// recorded before.
//
if ((UsingIpv6 != Private->UsingIpv6) ||
if ((UsingIpv6 != Private->UsingIpv6) ||
((Uri != NULL) && (AsciiStrCmp (Private->BootFileUri, Uri) != 0))) {
//
// Restart is required, first stop then continue this start function.
@@ -201,7 +201,7 @@ HttpBootStart (
return Status;
}
}
//
// Init the content of cached DHCP offer list.
//
@@ -241,7 +241,7 @@ HttpBootStart (
@retval EFI_NOT_STARTED The driver is in stopped state.
@retval EFI_DEVICE_ERROR An unexpected network error occurred.
@retval Others Other errors as indicated.
**/
EFI_STATUS
HttpBootDhcp (
@@ -253,7 +253,7 @@ HttpBootDhcp (
if (Private == NULL) {
return EFI_INVALID_PARAMETER;
}
if (!Private->Started) {
return EFI_NOT_STARTED;
}
@@ -292,11 +292,11 @@ HttpBootDhcp (
@retval EFI_INVALID_PARAMETER Private is NULL, or ImageType is NULL, or BufferSize is NULL.
@retval EFI_INVALID_PARAMETER *BufferSize is not zero, and Buffer is NULL.
@retval EFI_NOT_STARTED The driver is in stopped state.
@retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the boot file. BufferSize has
@retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the boot file. BufferSize has
been updated with the size needed to complete the request.
@retval EFI_DEVICE_ERROR An unexpected network error occurred.
@retval Others Other errors as indicated.
**/
EFI_STATUS
HttpBootLoadFile (
@@ -315,7 +315,7 @@ HttpBootLoadFile (
if (*BufferSize != 0 && Buffer == NULL) {
return EFI_INVALID_PARAMETER;
}
if (!Private->Started) {
return EFI_NOT_STARTED;
}
@@ -397,10 +397,10 @@ HttpBootLoadFile (
Buffer,
ImageType
);
ON_EXIT:
HttpBootUninstallCallback (Private);
if (EFI_ERROR (Status)) {
if (Status == EFI_ACCESS_DENIED) {
AsciiPrint ("\n Error: Could not establish connection with HTTP server.\n");
@@ -418,7 +418,7 @@ ON_EXIT:
AsciiPrint ("\n Error: Unexpected network error.\n");
}
}
return Status;
}
@@ -431,7 +431,7 @@ ON_EXIT:
@retval EFI_NOT_STARTED The driver is already in stopped state.
@retval EFI_INVALID_PARAMETER Private is NULL.
@retval Others Unexpected error when stop the function.
**/
EFI_STATUS
HttpBootStop (
@@ -443,16 +443,16 @@ HttpBootStop (
if (Private == NULL) {
return EFI_INVALID_PARAMETER;
}
if (!Private->Started) {
return EFI_NOT_STARTED;
}
if (Private->HttpCreated) {
HttpIoDestroyIo (&Private->HttpIo);
Private->HttpCreated = FALSE;
}
Private->Started = FALSE;
ZeroMem (&Private->StationIp, sizeof (EFI_IP_ADDRESS));
ZeroMem (&Private->SubnetMask, sizeof (EFI_IP_ADDRESS));
@@ -462,7 +462,7 @@ HttpBootStop (
Private->BootFileUriParser = NULL;
Private->BootFileSize = 0;
Private->SelectIndex = 0;
Private->SelectProxyType = HttpOfferTypeMax;
Private->SelectProxyType = HttpOfferTypeMax;
if (!Private->UsingIpv6) {
//
@@ -482,7 +482,7 @@ HttpBootStop (
//
Private->Dhcp6->Stop (Private->Dhcp6);
Private->Dhcp6->Configure (Private->Dhcp6, NULL);
for (Index = 0; Index < HTTP_BOOT_OFFER_MAX_NUM; Index++) {
if (Private->OfferBuffer[Index].Dhcp6.UriParser) {
HttpUrlFreeParser (Private->OfferBuffer[Index].Dhcp6.UriParser);
@@ -501,14 +501,14 @@ HttpBootStop (
Private->FilePathUri = NULL;
Private->FilePathUriParser = NULL;
}
ZeroMem (Private->OfferBuffer, sizeof (Private->OfferBuffer));
Private->OfferNum = 0;
ZeroMem (Private->OfferCount, sizeof (Private->OfferCount));
ZeroMem (Private->OfferIndex, sizeof (Private->OfferIndex));
HttpBootFreeCacheList (Private);
return EFI_SUCCESS;
}
@@ -573,7 +573,7 @@ HttpBootDxeLoadFile (
VirtualNic = HTTP_BOOT_VIRTUAL_NIC_FROM_LOADFILE (This);
Private = VirtualNic->Private;
//
// Check media status before HTTP boot start
//
@@ -583,7 +583,7 @@ HttpBootDxeLoadFile (
AsciiPrint ("\n Error: Could not detect network connection.\n");
return EFI_NO_MEDIA;
}
//
// Check whether the virtual nic is using IPv6 or not.
//
@@ -599,7 +599,7 @@ HttpBootDxeLoadFile (
if (Status != EFI_SUCCESS && Status != EFI_ALREADY_STARTED) {
return Status;
}
//
// Load the boot file.
//
@@ -636,7 +636,7 @@ HttpBootDxeLoadFile (
///
/// Load File Protocol instance
///
GLOBAL_REMOVE_IF_UNREFERENCED
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_LOAD_FILE_PROTOCOL gHttpBootDxeLoadFile = {
HttpBootDxeLoadFile
};
@@ -658,7 +658,7 @@ EFI_LOAD_FILE_PROTOCOL gHttpBootDxeLoadFile = {
@param[in] DataLength The length in bytes of the buffer pointed to by Data.
@param[in] Data A pointer to the buffer of data, the data type is specified by
DataType.
@retval EFI_SUCCESS Tells the HTTP Boot driver to continue the HTTP Boot process.
@retval EFI_ABORTED Tells the HTTP Boot driver to abort the current HTTP Boot process.
**/
@@ -698,7 +698,7 @@ HttpBootCallback (
case HttpBootHttpResponse:
if (Data != NULL) {
HttpMessage = (EFI_HTTP_MESSAGE *) Data;
if (HttpMessage->Data.Response != NULL) {
if (HttpBootIsHttpRedirectStatusCode (HttpMessage->Data.Response->StatusCode)) {
//
@@ -714,10 +714,10 @@ HttpBootCallback (
if (HttpHeader != NULL) {
Print (L"\n HTTP ERROR: Resource Redirected.\n New Location: %a\n", HttpHeader->FieldValue);
}
break;
break;
}
}
HttpHeader = HttpFindHeader (
HttpMessage->HeaderCount,
HttpMessage->Headers,
@@ -767,7 +767,7 @@ HttpBootCallback (
///
/// HTTP Boot Callback Protocol instance
///
GLOBAL_REMOVE_IF_UNREFERENCED
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_HTTP_BOOT_CALLBACK_PROTOCOL gHttpBootDxeHttpBootCallback = {
HttpBootCallback
};

View File

@@ -1,13 +1,13 @@
/** @file
The declaration of UEFI HTTP boot function.
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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,
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.
**/
@@ -26,7 +26,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@retval EFI_NOT_STARTED The driver is in stopped state.
@retval EFI_DEVICE_ERROR An unexpected network error occurred.
@retval Others Other errors as indicated.
**/
EFI_STATUS
HttpBootDhcp (
@@ -42,7 +42,7 @@ HttpBootDhcp (
@retval EFI_NOT_STARTED The driver is already in stopped state.
@retval EFI_INVALID_PARAMETER Private is NULL.
@retval Others Unexpected error when stop the function.
**/
EFI_STATUS
HttpBootStop (

View File

@@ -1,14 +1,14 @@
/** @file
Support functions implementation for UEFI HTTP boot driver.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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,
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.
**/
@@ -162,27 +162,27 @@ HttpBootPrintErrorMessage (
switch (StatusCode) {
case HTTP_STATUS_300_MULTIPLE_CHOICES:
AsciiPrint ("\n Redirection: 300 Multiple Choices");
break;
break;
case HTTP_STATUS_301_MOVED_PERMANENTLY:
AsciiPrint ("\n Redirection: 301 Moved Permanently");
break;
break;
case HTTP_STATUS_302_FOUND:
AsciiPrint ("\n Redirection: 302 Found");
break;
break;
case HTTP_STATUS_303_SEE_OTHER:
AsciiPrint ("\n Redirection: 303 See Other");
break;
break;
case HTTP_STATUS_304_NOT_MODIFIED:
AsciiPrint ("\n Redirection: 304 Not Modified");
break;
break;
case HTTP_STATUS_305_USE_PROXY:
AsciiPrint ("\n Redirection: 305 Use Proxy");
break;
break;
case HTTP_STATUS_307_TEMPORARY_REDIRECT:
AsciiPrint ("\n Redirection: 307 Temporary Redirect");
@@ -190,16 +190,16 @@ HttpBootPrintErrorMessage (
case HTTP_STATUS_308_PERMANENT_REDIRECT:
AsciiPrint ("\n Redirection: 308 Permanent Redirect");
break;
break;
case HTTP_STATUS_400_BAD_REQUEST:
AsciiPrint ("\n Client Error: 400 Bad Request");
break;
case HTTP_STATUS_401_UNAUTHORIZED:
AsciiPrint ("\n Client Error: 401 Unauthorized");
break;
case HTTP_STATUS_402_PAYMENT_REQUIRED:
AsciiPrint ("\n Client Error: 402 Payment Required");
break;
@@ -289,7 +289,7 @@ HttpBootPrintErrorMessage (
break;
default: ;
}
}
@@ -319,13 +319,13 @@ HttpBootCommonNotify (
@retval EFI_SUCCESS Operation succeeded.
@retval EFI_DEVICE_ERROR An unexpected network error occurred.
@retval Others Other errors as indicated.
@retval Others Other errors as indicated.
**/
EFI_STATUS
HttpBootDns (
IN HTTP_BOOT_PRIVATE_DATA *Private,
IN CHAR16 *HostName,
OUT EFI_IPv6_ADDRESS *IpAddress
OUT EFI_IPv6_ADDRESS *IpAddress
)
{
EFI_STATUS Status;
@@ -337,14 +337,14 @@ HttpBootDns (
EFI_IPv6_ADDRESS *DnsServerList;
UINTN DnsServerListCount;
UINTN DataSize;
BOOLEAN IsDone;
BOOLEAN IsDone;
DnsServerList = NULL;
DnsServerListCount = 0;
Dns6 = NULL;
Dns6Handle = NULL;
ZeroMem (&Token, sizeof (EFI_DNS6_COMPLETION_TOKEN));
//
// Get DNS server list from EFI IPv6 Configuration protocol.
//
@@ -359,7 +359,7 @@ HttpBootDns (
DnsServerList = AllocatePool (DataSize);
if (DnsServerList == NULL) {
return EFI_OUT_OF_RESOURCES;
}
}
Status = Ip6Config->GetData (Ip6Config, Ip6ConfigDataTypeDnsServer, &DataSize, DnsServerList);
if (EFI_ERROR (Status)) {
@@ -381,8 +381,8 @@ HttpBootDns (
);
if (EFI_ERROR (Status)) {
goto Exit;
}
}
Status = gBS->OpenProtocol (
Dns6Handle,
&gEfiDns6ProtocolGuid,
@@ -411,7 +411,7 @@ HttpBootDns (
if (EFI_ERROR (Status)) {
goto Exit;
}
Token.Status = EFI_NOT_READY;
IsDone = FALSE;
//
@@ -439,11 +439,11 @@ HttpBootDns (
while (!IsDone) {
Dns6->Poll (Dns6);
}
//
// Name resolution is done, check result.
//
Status = Token.Status;
Status = Token.Status;
if (!EFI_ERROR (Status)) {
if (Token.RspData.H2AData == NULL) {
Status = EFI_DEVICE_ERROR;
@@ -473,7 +473,7 @@ Exit:
if (Dns6 != NULL) {
Dns6->Configure (Dns6, NULL);
gBS->CloseProtocol (
Dns6Handle,
&gEfiDns6ProtocolGuid,
@@ -494,8 +494,8 @@ Exit:
if (DnsServerList != NULL) {
FreePool (DnsServerList);
}
return Status;
return Status;
}
/**
Create a HTTP_IO_HEADER to hold the HTTP header items.
@@ -503,7 +503,7 @@ Exit:
@param[in] MaxHeaderCount The maximun number of HTTP header in this holder.
@return A pointer of the HTTP header holder or NULL if failed.
**/
HTTP_IO_HEADER *
HttpBootCreateHeader (
@@ -528,7 +528,7 @@ HttpBootCreateHeader (
}
/**
Destroy the HTTP_IO_HEADER and release the resouces.
Destroy the HTTP_IO_HEADER and release the resouces.
@param[in] HttpIoHeader Point to the HTTP header holder to be destroyed.
@@ -539,7 +539,7 @@ HttpBootFreeHeader (
)
{
UINTN Index;
if (HttpIoHeader != NULL) {
if (HttpIoHeader->HeaderCount != 0) {
for (Index = 0; Index < HttpIoHeader->HeaderCount; Index++) {
@@ -562,7 +562,7 @@ HttpBootFreeHeader (
@retval EFI_INVALID_PARAMETER Any input parameter is invalid.
@retval EFI_OUT_OF_RESOURCES Insufficient resource to complete the operation.
@retval Other Unexpected error happened.
**/
EFI_STATUS
HttpBootSetHeader (
@@ -574,7 +574,7 @@ HttpBootSetHeader (
EFI_HTTP_HEADER *Header;
UINTN StrSize;
CHAR8 *NewFieldValue;
if (HttpIoHeader == NULL || FieldName == NULL || FieldValue == NULL) {
return EFI_INVALID_PARAMETER;
}
@@ -618,7 +618,7 @@ HttpBootSetHeader (
}
CopyMem (NewFieldValue, FieldValue, StrSize);
NewFieldValue[StrSize -1] = '\0';
if (Header->FieldValue != NULL) {
FreePool (Header->FieldValue);
}
@@ -675,7 +675,7 @@ HttpIoNotify (
HTTP_IO_CALLBACK_EVENT happened.
@param[in] Context The Context data which will be passed to the Callback function.
@param[out] HttpIo The HTTP_IO.
@retval EFI_SUCCESS The HTTP_IO is created and configured.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_UNSUPPORTED One or more of the control options are not
@@ -701,7 +701,7 @@ HttpIoCreateIo (
EFI_HTTPv6_ACCESS_POINT Http6AccessPoint;
EFI_HTTP_PROTOCOL *Http;
EFI_EVENT Event;
if ((Image == NULL) || (Controller == NULL) || (ConfigData == NULL) || (HttpIo == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -711,10 +711,10 @@ HttpIoCreateIo (
}
ZeroMem (HttpIo, sizeof (HTTP_IO));
//
// Create the HTTP child instance and get the HTTP protocol.
//
//
Status = NetLibCreateServiceChild (
Controller,
Image,
@@ -752,19 +752,19 @@ HttpIoCreateIo (
HttpConfigData.TimeOutMillisec = ConfigData->Config4.RequestTimeOut;
if (HttpIo->IpVersion == IP_VERSION_4) {
HttpConfigData.LocalAddressIsIPv6 = FALSE;
Http4AccessPoint.UseDefaultAddress = ConfigData->Config4.UseDefaultAddress;
Http4AccessPoint.LocalPort = ConfigData->Config4.LocalPort;
IP4_COPY_ADDRESS (&Http4AccessPoint.LocalAddress, &ConfigData->Config4.LocalIp);
IP4_COPY_ADDRESS (&Http4AccessPoint.LocalSubnet, &ConfigData->Config4.SubnetMask);
HttpConfigData.AccessPoint.IPv4Node = &Http4AccessPoint;
HttpConfigData.AccessPoint.IPv4Node = &Http4AccessPoint;
} else {
HttpConfigData.LocalAddressIsIPv6 = TRUE;
Http6AccessPoint.LocalPort = ConfigData->Config6.LocalPort;
IP6_COPY_ADDRESS (&Http6AccessPoint.LocalAddress, &ConfigData->Config6.LocalIp);
HttpConfigData.AccessPoint.IPv6Node = &Http6AccessPoint;
}
Status = Http->Configure (Http, &HttpConfigData);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
@@ -815,7 +815,7 @@ HttpIoCreateIo (
HttpIo->TimeoutEvent = Event;
return EFI_SUCCESS;
ON_ERROR:
HttpIoDestroyIo (HttpIo);
@@ -823,7 +823,7 @@ ON_ERROR:
}
/**
Destroy the HTTP_IO and release the resouces.
Destroy the HTTP_IO and release the resouces.
@param[in] HttpIo The HTTP_IO which wraps the HTTP service to be destroyed.
@@ -854,7 +854,7 @@ HttpIoDestroyIo (
if (Event != NULL) {
gBS->CloseEvent (Event);
}
Http = HttpIo->Http;
if (Http != NULL) {
Http->Configure (Http, NULL);
@@ -876,14 +876,14 @@ HttpIoDestroyIo (
/**
Synchronously send a HTTP REQUEST message to the server.
@param[in] HttpIo The HttpIo wrapping the HTTP service.
@param[in] Request A pointer to storage such data as URL and HTTP method.
@param[in] HeaderCount Number of HTTP header structures in Headers list.
@param[in] HeaderCount Number of HTTP header structures in Headers list.
@param[in] Headers Array containing list of HTTP headers.
@param[in] BodyLength Length in bytes of the HTTP body.
@param[in] Body Body associated with the HTTP request.
@param[in] Body Body associated with the HTTP request.
@retval EFI_SUCCESS The HTTP request is trasmitted.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
@@ -951,12 +951,12 @@ HttpIoSendRequest (
/**
Synchronously receive a HTTP RESPONSE message from the server.
@param[in] HttpIo The HttpIo wrapping the HTTP service.
@param[in] RecvMsgHeader TRUE to receive a new HTTP response (from message header).
FALSE to continue receive the previous response message.
@param[out] ResponseData Point to a wrapper of the received response data.
@retval EFI_SUCCESS The HTTP response is received.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
@@ -1006,7 +1006,7 @@ HttpIoRecvResponse (
Http,
&HttpIo->RspToken
);
if (EFI_ERROR (Status)) {
gBS->SetTimer (HttpIo->TimeoutEvent, TimerCancel, 0);
return Status;
@@ -1026,15 +1026,15 @@ HttpIoRecvResponse (
// Timeout occurs, cancel the response token.
//
Http->Cancel (Http, &HttpIo->RspToken);
Status = EFI_TIMEOUT;
return Status;
} else {
HttpIo->IsRxDone = FALSE;
}
if ((HttpIo->Callback != NULL) &&
if ((HttpIo->Callback != NULL) &&
(HttpIo->RspToken.Status == EFI_SUCCESS || HttpIo->RspToken.Status == EFI_HTTP_ERROR)) {
Status = HttpIo->Callback (
HttpIoResponse,
@@ -1061,7 +1061,7 @@ HttpIoRecvResponse (
This function checks the HTTP(S) URI scheme.
@param[in] Uri The pointer to the URI string.
@retval EFI_SUCCESS The URI scheme is valid.
@retval EFI_INVALID_PARAMETER The URI scheme is not HTTP or HTTPS.
@retval EFI_ACCESS_DENIED HTTP is disabled and the URI is HTTP.
@@ -1096,7 +1096,7 @@ HttpBootCheckUriScheme (
DEBUG ((EFI_D_ERROR, "HttpBootCheckUriScheme: Invalid Uri.\n"));
return EFI_INVALID_PARAMETER;
}
//
// HTTP is disabled, return EFI_ACCESS_DENIED if the URI is HTTP.
//
@@ -1112,10 +1112,10 @@ HttpBootCheckUriScheme (
Get the URI address string from the input device path.
Caller need to free the buffer in the UriAddress pointer.
@param[in] FilePath Pointer to the device path which contains a URI device path node.
@param[out] UriAddress The URI address string extract from the device path.
@retval EFI_SUCCESS The URI string is returned.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
@@ -1176,11 +1176,11 @@ HttpBootParseFilePath (
and also the image's URI info.
@param[in] Uri The pointer to the image's URI string.
@param[in] UriParser URI Parse result returned by NetHttpParseUrl().
@param[in] HeaderCount Number of HTTP header structures in Headers list.
@param[in] UriParser URI Parse result returned by NetHttpParseUrl().
@param[in] HeaderCount Number of HTTP header structures in Headers list.
@param[in] Headers Array containing list of HTTP headers.
@param[out] ImageType The image type of the downloaded file.
@retval EFI_SUCCESS The image type is returned in ImageType.
@retval EFI_INVALID_PARAMETER ImageType, Uri or UriParser is NULL.
@retval EFI_INVALID_PARAMETER HeaderCount is not zero, and Headers is NULL.
@@ -1263,7 +1263,7 @@ HttpBootCheckImageType (
/**
This function register the RAM disk info to the system.
@param[in] Private The pointer to the driver's private data.
@param[in] BufferSize The size of Buffer in bytes.
@param[in] Buffer The base address of the RAM disk.
@@ -1287,7 +1287,7 @@ HttpBootRegisterRamDisk (
EFI_STATUS Status;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
EFI_GUID *RamDiskType;
ASSERT (Private != NULL);
ASSERT (Buffer != NULL);
ASSERT (BufferSize != 0);
@@ -1305,7 +1305,7 @@ HttpBootRegisterRamDisk (
} else {
return EFI_UNSUPPORTED;
}
Status = RamDisk->Register (
(UINTN)Buffer,
(UINT64)BufferSize,
@@ -1322,7 +1322,7 @@ HttpBootRegisterRamDisk (
/**
Indicate if the HTTP status code indicates a redirection.
@param[in] StatusCode HTTP status code from server.
@return TRUE if it's redirection.

View File

@@ -1,13 +1,13 @@
/** @file
Support functions declaration for UEFI HTTP boot driver.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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,
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.
**/
@@ -107,7 +107,7 @@ typedef struct {
@param[in] MaxHeaderCount The maximun number of HTTP header in this holder.
@return A pointer of the HTTP header holder or NULL if failed.
**/
HTTP_IO_HEADER *
HttpBootCreateHeader (
@@ -115,7 +115,7 @@ HttpBootCreateHeader (
);
/**
Destroy the HTTP_IO_HEADER and release the resouces.
Destroy the HTTP_IO_HEADER and release the resouces.
@param[in] HttpIoHeader Point to the HTTP header holder to be destroyed.
@@ -129,14 +129,14 @@ HttpBootFreeHeader (
Set or update a HTTP header with the field name and corresponding value.
@param[in] HttpIoHeader Point to the HTTP header holder.
@param[in] FieldName Null terminated string which describes a field name.
@param[in] FieldName Null terminated string which describes a field name.
@param[in] FieldValue Null terminated string which describes the corresponding field value.
@retval EFI_SUCCESS The HTTP header has been set or updated.
@retval EFI_INVALID_PARAMETER Any input parameter is invalid.
@retval EFI_OUT_OF_RESOURCES Insufficient resource to complete the operation.
@retval Other Unexpected error happened.
**/
EFI_STATUS
HttpBootSetHeader (
@@ -159,7 +159,7 @@ typedef enum {
@param[in] EventType Indicate the Event type that occurs in the current callback.
@param[in] Message HTTP message which will be send to, or just received from HTTP server.
@param[in] Context The Callback Context pointer.
@retval EFI_SUCCESS Tells the HttpIo to continue the HTTP process.
@retval Others Tells the HttpIo to abort the current HTTP process.
**/
@@ -212,7 +212,7 @@ typedef struct {
EFI_HANDLE Image;
EFI_HANDLE Controller;
EFI_HANDLE Handle;
EFI_HTTP_PROTOCOL *Http;
HTTP_IO_CALLBACK Callback;
@@ -250,13 +250,13 @@ typedef struct {
@retval EFI_SUCCESS Operation succeeded.
@retval EFI_DEVICE_ERROR An unexpected network error occurred.
@retval Others Other errors as indicated.
@retval Others Other errors as indicated.
**/
EFI_STATUS
HttpBootDns (
IN HTTP_BOOT_PRIVATE_DATA *Private,
IN CHAR16 *HostName,
OUT EFI_IPv6_ADDRESS *IpAddress
OUT EFI_IPv6_ADDRESS *IpAddress
);
/**
@@ -285,7 +285,7 @@ HttpBootCommonNotify (
HTTP_IO_CALLBACK_EVENT happened.
@param[in] Context The Context data which will be passed to the Callback function.
@param[out] HttpIo The HTTP_IO.
@retval EFI_SUCCESS The HTTP_IO is created and configured.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_UNSUPPORTED One or more of the control options are not
@@ -306,7 +306,7 @@ HttpIoCreateIo (
);
/**
Destroy the HTTP_IO and release the resouces.
Destroy the HTTP_IO and release the resouces.
@param[in] HttpIo The HTTP_IO which wraps the HTTP service to be destroyed.
@@ -318,14 +318,14 @@ HttpIoDestroyIo (
/**
Synchronously send a HTTP REQUEST message to the server.
@param[in] HttpIo The HttpIo wrapping the HTTP service.
@param[in] Request A pointer to storage such data as URL and HTTP method.
@param[in] HeaderCount Number of HTTP header structures in Headers list.
@param[in] HeaderCount Number of HTTP header structures in Headers list.
@param[in] Headers Array containing list of HTTP headers.
@param[in] BodyLength Length in bytes of the HTTP body.
@param[in] Body Body associated with the HTTP request.
@param[in] Body Body associated with the HTTP request.
@retval EFI_SUCCESS The HTTP request is trasmitted.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
@@ -345,12 +345,12 @@ HttpIoSendRequest (
/**
Synchronously receive a HTTP RESPONSE message from the server.
@param[in] HttpIo The HttpIo wrapping the HTTP service.
@param[in] RecvMsgHeader TRUE to receive a new HTTP response (from message header).
FALSE to continue receive the previous response message.
@param[out] ResponseData Point to a wrapper of the received response data.
@retval EFI_SUCCESS The HTTP response is received.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
@@ -369,7 +369,7 @@ HttpIoRecvResponse (
This function checks the HTTP(S) URI scheme.
@param[in] Uri The pointer to the URI string.
@retval EFI_SUCCESS The URI scheme is valid.
@retval EFI_INVALID_PARAMETER The URI scheme is not HTTP or HTTPS.
@retval EFI_ACCESS_DENIED HTTP is disabled and the URI is HTTP.
@@ -384,10 +384,10 @@ HttpBootCheckUriScheme (
Get the URI address string from the input device path.
Caller need to free the buffer in the UriAddress pointer.
@param[in] FilePath Pointer to the device path which contains a URI device path node.
@param[out] UriAddress The URI address string extract from the device path.
@retval EFI_SUCCESS The URI string is returned.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
@@ -403,11 +403,11 @@ HttpBootParseFilePath (
and also the image's URI info.
@param[in] Uri The pointer to the image's URI string.
@param[in] UriParser URI Parse result returned by NetHttpParseUrl().
@param[in] HeaderCount Number of HTTP header structures in Headers list.
@param[in] UriParser URI Parse result returned by NetHttpParseUrl().
@param[in] HeaderCount Number of HTTP header structures in Headers list.
@param[in] Headers Array containing list of HTTP headers.
@param[out] ImageType The image type of the downloaded file.
@retval EFI_SUCCESS The image type is returned in ImageType.
@retval EFI_INVALID_PARAMETER ImageType, Uri or UriParser is NULL.
@retval EFI_INVALID_PARAMETER HeaderCount is not zero, and Headers is NULL.
@@ -426,7 +426,7 @@ HttpBootCheckImageType (
/**
This function register the RAM disk info to the system.
@param[in] Private The pointer to the driver's private data.
@param[in] BufferSize The size of Buffer in bytes.
@param[in] Buffer The base address of the RAM disk.
@@ -448,7 +448,7 @@ HttpBootRegisterRamDisk (
/**
Indicate if the HTTP status code indicates a redirection.
@param[in] StatusCode HTTP status code from server.
@return TRUE if it's redirection.

View File

@@ -2,7 +2,7 @@
Implementation of EFI_COMPONENT_NAME_PROTOCOL and
EFI_COMPONENT_NAME2_PROTOCOL protocol.
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -19,7 +19,7 @@
///
/// Component Name Protocol instance
///
GLOBAL_REMOVE_IF_UNREFERENCED
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_COMPONENT_NAME_PROTOCOL gHttpDxeComponentName = {
(EFI_COMPONENT_NAME_GET_DRIVER_NAME) HttpDxeComponentNameGetDriverName,
(EFI_COMPONENT_NAME_GET_CONTROLLER_NAME) HttpDxeComponentNameGetControllerName,
@@ -29,7 +29,7 @@ EFI_COMPONENT_NAME_PROTOCOL gHttpDxeComponentName = {
///
/// Component Name 2 Protocol instance
///
GLOBAL_REMOVE_IF_UNREFERENCED
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_COMPONENT_NAME2_PROTOCOL gHttpDxeComponentName2 = {
HttpDxeComponentNameGetDriverName,
HttpDxeComponentNameGetControllerName,
@@ -39,7 +39,7 @@ EFI_COMPONENT_NAME2_PROTOCOL gHttpDxeComponentName2 = {
///
/// Table of driver names
///
GLOBAL_REMOVE_IF_UNREFERENCED
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_UNICODE_STRING_TABLE mHttpDxeDriverNameTable[] = {
{ "eng;en", (CHAR16 *) L"HttpDxe" },
{ NULL, NULL }

View File

@@ -1,7 +1,7 @@
/** @file
Routines for HttpDxe driver to perform DNS resolution based on UEFI DNS protocols.
Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -25,13 +25,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
@retval EFI_DEVICE_ERROR An unexpected network error occurred.
@retval Others Other errors as indicated.
**/
EFI_STATUS
HttpDns4 (
IN HTTP_PROTOCOL *HttpInstance,
IN CHAR16 *HostName,
OUT EFI_IPv4_ADDRESS *IpAddress
OUT EFI_IPv4_ADDRESS *IpAddress
)
{
EFI_STATUS Status;
@@ -45,7 +45,7 @@ HttpDns4 (
UINTN DnsServerListCount;
EFI_IPv4_ADDRESS *DnsServerList;
UINTN DataSize;
Service = HttpInstance->Service;
ASSERT (Service != NULL);
@@ -82,7 +82,7 @@ HttpDns4 (
Dns4Handle = NULL;
Dns4 = NULL;
//
// Create a DNS child instance and get the protocol.
//
@@ -94,7 +94,7 @@ HttpDns4 (
);
if (EFI_ERROR (Status)) {
goto Exit;
}
}
Status = gBS->OpenProtocol (
Dns4Handle,
@@ -128,7 +128,7 @@ HttpDns4 (
if (EFI_ERROR (Status)) {
goto Exit;
}
//
// Create event to set the is done flag when name resolution is finished.
//
@@ -161,7 +161,7 @@ HttpDns4 (
//
// Name resolution is done, check result.
//
Status = Token.Status;
Status = Token.Status;
if (!EFI_ERROR (Status)) {
if (Token.RspData.H2AData == NULL) {
Status = EFI_DEVICE_ERROR;
@@ -179,7 +179,7 @@ HttpDns4 (
}
Exit:
if (Token.Event != NULL) {
gBS->CloseEvent (Token.Event);
}
@@ -192,7 +192,7 @@ Exit:
if (Dns4 != NULL) {
Dns4->Configure (Dns4, NULL);
gBS->CloseProtocol (
Dns4Handle,
&gEfiDns4ProtocolGuid,
@@ -213,7 +213,7 @@ Exit:
if (DnsServerList != NULL) {
FreePool (DnsServerList);
}
return Status;
}
@@ -228,13 +228,13 @@ Exit:
@retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
@retval EFI_DEVICE_ERROR An unexpected network error occurred.
@retval Others Other errors as indicated.
**/
EFI_STATUS
HttpDns6 (
IN HTTP_PROTOCOL *HttpInstance,
IN CHAR16 *HostName,
OUT EFI_IPv6_ADDRESS *IpAddress
OUT EFI_IPv6_ADDRESS *IpAddress
)
{
EFI_STATUS Status;
@@ -248,7 +248,7 @@ HttpDns6 (
UINTN DnsServerListCount;
UINTN DataSize;
BOOLEAN IsDone;
Service = HttpInstance->Service;
ASSERT (Service != NULL);
@@ -258,7 +258,7 @@ HttpDns6 (
Dns6 = NULL;
Dns6Handle = NULL;
ZeroMem (&Token, sizeof (EFI_DNS6_COMPLETION_TOKEN));
//
// Get DNS server list from EFI IPv6 Configuration protocol.
//
@@ -273,7 +273,7 @@ HttpDns6 (
DnsServerList = AllocatePool (DataSize);
if (DnsServerList == NULL) {
return EFI_OUT_OF_RESOURCES;
}
}
Status = Ip6Config->GetData (Ip6Config, Ip6ConfigDataTypeDnsServer, &DataSize, DnsServerList);
if (EFI_ERROR (Status)) {
@@ -296,8 +296,8 @@ HttpDns6 (
);
if (EFI_ERROR (Status)) {
goto Exit;
}
}
Status = gBS->OpenProtocol (
Dns6Handle,
&gEfiDns6ProtocolGuid,
@@ -358,7 +358,7 @@ HttpDns6 (
//
// Name resolution is done, check result.
//
Status = Token.Status;
Status = Token.Status;
if (!EFI_ERROR (Status)) {
if (Token.RspData.H2AData == NULL) {
Status = EFI_DEVICE_ERROR;
@@ -374,7 +374,7 @@ HttpDns6 (
IP6_COPY_ADDRESS (IpAddress, Token.RspData.H2AData->IpList);
Status = EFI_SUCCESS;
}
Exit:
if (Token.Event != NULL) {
@@ -389,7 +389,7 @@ Exit:
if (Dns6 != NULL) {
Dns6->Configure (Dns6, NULL);
gBS->CloseProtocol (
Dns6Handle,
&gEfiDns6ProtocolGuid,
@@ -410,6 +410,6 @@ Exit:
if (DnsServerList != NULL) {
FreePool (DnsServerList);
}
return Status;
return Status;
}

View File

@@ -1,7 +1,7 @@
/** @file
The header file of routines for HttpDxe driver to perform DNS resolution based on UEFI DNS protocols.
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -26,13 +26,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
@retval EFI_DEVICE_ERROR An unexpected network error occurred.
@retval Others Other errors as indicated.
**/
EFI_STATUS
HttpDns4 (
IN HTTP_PROTOCOL *HttpInstance,
IN CHAR16 *HostName,
OUT EFI_IPv4_ADDRESS *IpAddress
OUT EFI_IPv4_ADDRESS *IpAddress
);
/**
@@ -46,13 +46,13 @@ HttpDns4 (
@retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
@retval EFI_DEVICE_ERROR An unexpected network error occurred.
@retval Others Other errors as indicated.
**/
EFI_STATUS
HttpDns6 (
IN HTTP_PROTOCOL *HttpInstance,
IN CHAR16 *HostName,
OUT EFI_IPv6_ADDRESS *IpAddress
OUT EFI_IPv6_ADDRESS *IpAddress
);
#endif
#endif

View File

@@ -1,7 +1,7 @@
/** @file
The driver binding and service binding protocol for HttpDxe driver.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
@@ -73,7 +73,7 @@ HttpCreateService (
HttpService->ControllerHandle = Controller;
HttpService->ChildrenNumber = 0;
InitializeListHead (&HttpService->ChildrenList);
*ServiceData = HttpService;
return EFI_SUCCESS;
}
@@ -91,8 +91,8 @@ HttpCleanService (
IN HTTP_SERVICE *HttpService,
IN BOOLEAN UsingIpv6
)
{
{
if (HttpService == NULL) {
return ;
}
@@ -104,14 +104,14 @@ HttpCleanService (
HttpService->Ip4DriverBindingHandle,
HttpService->ControllerHandle
);
NetLibDestroyServiceChild (
HttpService->ControllerHandle,
HttpService->Ip4DriverBindingHandle,
&gEfiTcp4ServiceBindingProtocolGuid,
HttpService->Tcp4ChildHandle
);
HttpService->Tcp4ChildHandle = NULL;
}
} else {
@@ -122,18 +122,18 @@ HttpCleanService (
HttpService->Ip6DriverBindingHandle,
HttpService->ControllerHandle
);
NetLibDestroyServiceChild (
HttpService->ControllerHandle,
HttpService->Ip6DriverBindingHandle,
&gEfiTcp6ServiceBindingProtocolGuid,
HttpService->Tcp6ChildHandle
);
HttpService->Tcp6ChildHandle = NULL;
}
}
}
/**
@@ -152,11 +152,11 @@ HttpUtilitiesInstalledCallback (
)
{
gBS->LocateProtocol (
&gEfiHttpUtilitiesProtocolGuid,
NULL,
&gEfiHttpUtilitiesProtocolGuid,
NULL,
(VOID **) &mHttpUtilities
);
//
// Close the event if Http utilities protocol is loacted.
//
@@ -183,13 +183,13 @@ HttpDxeDriverEntryPoint (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
{
EFI_STATUS Status;
VOID *Registration;
gBS->LocateProtocol (
&gEfiHttpUtilitiesProtocolGuid,
NULL,
&gEfiHttpUtilitiesProtocolGuid,
NULL,
(VOID **) &mHttpUtilities
);
@@ -246,7 +246,7 @@ HttpDxeDriverEntryPoint (
/**
Callback function which provided by user to remove one node in NetDestroyLinkList process.
@param[in] Entry The entry to be removed.
@param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
@@ -292,7 +292,7 @@ HttpDestroyChildEntryInHandleBuffer (
@param[in] RemainingDevicePath Optional parameter used to pick a specific child
device to be started.
@param[in] IpVersion IP_VERSION_4 or IP_VERSION_6.
@retval EFI_SUCCESS This driver supports this device.
@retval EFI_UNSUPPORTED This driver does not support this device.
@@ -383,9 +383,9 @@ HttpDxeStart (
if (EFI_ERROR (Status)) {
return Status;
}
ASSERT (HttpService != NULL);
//
// Install the HttpServiceBinding Protocol onto Controller
//
@@ -395,7 +395,7 @@ HttpDxeStart (
&HttpService->ServiceBinding,
NULL
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
@@ -414,11 +414,11 @@ HttpDxeStart (
&gEfiTcp4ServiceBindingProtocolGuid,
&HttpService->Tcp4ChildHandle
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
Status = gBS->OpenProtocol (
HttpService->Tcp4ChildHandle,
&gEfiTcp4ProtocolGuid,
@@ -427,11 +427,11 @@ HttpDxeStart (
ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
} else {
return EFI_ALREADY_STARTED;
}
@@ -450,11 +450,11 @@ HttpDxeStart (
&gEfiTcp6ServiceBindingProtocolGuid,
&HttpService->Tcp6ChildHandle
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
Status = gBS->OpenProtocol (
HttpService->Tcp6ChildHandle,
&gEfiTcp6ProtocolGuid,
@@ -463,11 +463,11 @@ HttpDxeStart (
ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
} else {
return EFI_ALREADY_STARTED;
}
@@ -475,16 +475,16 @@ HttpDxeStart (
}
return EFI_SUCCESS;
ON_ERROR:
if (HttpService != NULL) {
HttpCleanService (HttpService, UsingIpv6);
if (HttpService->Tcp4ChildHandle == NULL && HttpService->Tcp6ChildHandle == NULL) {
FreePool (HttpService);
}
}
return Status;
@@ -551,9 +551,9 @@ HttpDxeStop (
);
if (!EFI_ERROR (Status)) {
HttpService = HTTP_SERVICE_FROM_PROTOCOL (ServiceBinding);
if (NumberOfChildren != 0) {
//
// Destroy the HTTP child instance in ChildHandleBuffer.
@@ -569,9 +569,9 @@ HttpDxeStop (
NULL
);
} else {
HttpCleanService (HttpService, UsingIpv6);
if (HttpService->Tcp4ChildHandle == NULL && HttpService->Tcp6ChildHandle == NULL) {
gBS->UninstallProtocolInterface (
NicHandle,
@@ -581,41 +581,41 @@ HttpDxeStop (
FreePool (HttpService);
}
Status = EFI_SUCCESS;
}
}
}
return Status;
}
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -650,28 +650,28 @@ HttpDxeIp4DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -700,10 +700,10 @@ HttpDxeIp4DriverBindingStart (
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -711,13 +711,13 @@ HttpDxeIp4DriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -743,33 +743,33 @@ HttpDxeIp4DriverBindingStop (
}
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -791,7 +791,7 @@ HttpDxeIp6DriverBindingSupported (
IN EFI_HANDLE ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
)
{
{
return HttpDxeSupported (
This,
ControllerHandle,
@@ -805,28 +805,28 @@ HttpDxeIp6DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -855,10 +855,10 @@ HttpDxeIp6DriverBindingStart (
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -866,13 +866,13 @@ HttpDxeIp6DriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -936,7 +936,7 @@ HttpServiceBindingCreateChild (
if (HttpInstance == NULL) {
return EFI_OUT_OF_RESOURCES;
}
HttpInstance->Signature = HTTP_PROTOCOL_SIGNATURE;
HttpInstance->Service = HttpService;
HttpInstance->Method = HttpMethodMax;
@@ -972,9 +972,9 @@ HttpServiceBindingCreateChild (
gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
ON_ERROR:
NetMapClean (&HttpInstance->TxTokens);
NetMapClean (&HttpInstance->RxTokens);
FreePool (HttpInstance);
@@ -1010,7 +1010,7 @@ HttpServiceBindingDestroyChild (
EFI_HTTP_PROTOCOL *Http;
EFI_STATUS Status;
EFI_TPL OldTpl;
if ((This == NULL) || (ChildHandle == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -1027,7 +1027,7 @@ HttpServiceBindingDestroyChild (
if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
}
HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (Http);
if (HttpInstance->Service != HttpService) {
return EFI_INVALID_PARAMETER;
@@ -1052,16 +1052,16 @@ HttpServiceBindingDestroyChild (
HttpInstance->InDestroy = FALSE;
return Status;
}
HttpCleanProtocol (HttpInstance);
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
RemoveEntryList (&HttpInstance->Link);
HttpService->ChildrenNumber--;
gBS->RestoreTPL (OldTpl);
FreePool (HttpInstance);
return EFI_SUCCESS;
}

View File

@@ -97,33 +97,33 @@ typedef struct {
} HTTP_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT;
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -150,28 +150,28 @@ HttpDxeIp4DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -191,10 +191,10 @@ HttpDxeIp4DriverBindingStart (
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -202,13 +202,13 @@ HttpDxeIp4DriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -225,33 +225,33 @@ HttpDxeIp4DriverBindingStop (
);
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -278,28 +278,28 @@ HttpDxeIp6DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -320,10 +320,10 @@ HttpDxeIp6DriverBindingStart (
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -331,13 +331,13 @@ HttpDxeIp6DriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.

View File

@@ -78,7 +78,7 @@
gEfiCertX509Guid ## SOMETIMES_CONSUMES ## GUID # Check the cert type
[Pcd]
gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections ## CONSUMES
gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections ## CONSUMES
[UserExtensions.TianoCore."ExtraFiles"]
HttpDxeExtra.uni

View File

@@ -2,15 +2,15 @@
// UEFI HTTP DXE Driver.
//
// This driver provides UEFI 2.5 HTTP protocols. It could work with an IPv4 or IPv6 stack.
//
//
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
//
// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
//
// 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.
//

View File

@@ -1,7 +1,7 @@
// /** @file
// HttpDxe Localized Strings and Content
//
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -13,8 +13,8 @@
//
// **/
#string STR_PROPERTIES_MODULE_NAME
#language en-US
#string STR_PROPERTIES_MODULE_NAME
#language en-US
"UEFI HTTP DXE"

View File

@@ -33,17 +33,17 @@ EFI_HTTP_PROTOCOL mEfiHttpTemplate = {
@param[in] This Pointer to EFI_HTTP_PROTOCOL instance.
@param[out] HttpConfigData Point to buffer for operational parameters of this
HTTP instance. It is the responsibility of the caller
to allocate the memory for HttpConfigData and
HttpConfigData->AccessPoint.IPv6Node/IPv4Node. In fact,
it is recommended to allocate sufficient memory to record
IPv6Node since it is big enough for all possibilities.
HTTP instance. It is the responsibility of the caller
to allocate the memory for HttpConfigData and
HttpConfigData->AccessPoint.IPv6Node/IPv4Node. In fact,
it is recommended to allocate sufficient memory to record
IPv6Node since it is big enough for all possibilities.
@retval EFI_SUCCESS Operation succeeded.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
This is NULL.
HttpConfigData is NULL.
HttpConfigData->AccessPoint.IPv4Node or
HttpConfigData->AccessPoint.IPv4Node or
HttpConfigData->AccessPoint.IPv6Node is NULL.
@retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been started.
@@ -132,16 +132,16 @@ EFIAPI
EfiHttpConfigure (
IN EFI_HTTP_PROTOCOL *This,
IN EFI_HTTP_CONFIG_DATA *HttpConfigData OPTIONAL
)
)
{
HTTP_PROTOCOL *HttpInstance;
EFI_STATUS Status;
//
// Check input parameters.
//
if (This == NULL ||
(HttpConfigData != NULL &&
(HttpConfigData != NULL &&
((HttpConfigData->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IPv6Node == NULL) ||
(!HttpConfigData->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IPv4Node == NULL)))) {
return EFI_INVALID_PARAMETER;
@@ -166,8 +166,8 @@ EfiHttpConfigure (
HttpInstance->HttpVersion = HttpConfigData->HttpVersion;
HttpInstance->TimeOutMillisec = HttpConfigData->TimeOutMillisec;
HttpInstance->LocalAddressIsIPv6 = HttpConfigData->LocalAddressIsIPv6;
if (HttpConfigData->LocalAddressIsIPv6) {
if (HttpConfigData->LocalAddressIsIPv6) {
CopyMem (
&HttpInstance->Ipv6Node,
HttpConfigData->AccessPoint.IPv6Node,
@@ -180,7 +180,7 @@ EfiHttpConfigure (
sizeof (HttpInstance->IPv4Node)
);
}
//
// Creat Tcp child
//
@@ -188,7 +188,7 @@ EfiHttpConfigure (
if (EFI_ERROR (Status)) {
return Status;
}
HttpInstance->State = HTTP_STATE_HTTP_CONFIGED;
return EFI_SUCCESS;
@@ -201,7 +201,7 @@ EfiHttpConfigure (
return EFI_SUCCESS;
}
}
/**
The Request() function queues an HTTP request to this HTTP instance.
@@ -284,8 +284,8 @@ EfiHttpRequest (
// Only support GET, HEAD, DELETE, PATCH, PUT and POST method in current implementation.
//
if ((Request != NULL) && (Request->Method != HttpMethodGet) &&
(Request->Method != HttpMethodHead) && (Request->Method != HttpMethodDelete) &&
(Request->Method != HttpMethodPut) && (Request->Method != HttpMethodPost) &&
(Request->Method != HttpMethodHead) && (Request->Method != HttpMethodDelete) &&
(Request->Method != HttpMethodPut) && (Request->Method != HttpMethodPost) &&
(Request->Method != HttpMethodPatch)) {
return EFI_UNSUPPORTED;
}
@@ -307,8 +307,8 @@ EfiHttpRequest (
//
// Request would be NULL only for PUT/POST/PATCH operation (in the current implementation)
//
if ((HttpInstance->Method != HttpMethodPut) &&
(HttpInstance->Method != HttpMethodPost) &&
if ((HttpInstance->Method != HttpMethodPut) &&
(HttpInstance->Method != HttpMethodPost) &&
(HttpInstance->Method != HttpMethodPatch)) {
return EFI_INVALID_PARAMETER;
}
@@ -358,7 +358,7 @@ EfiHttpRequest (
UnicodeStrToAsciiStrS (Request->Url, Url, UrlLen);
//
// From the information in Url, the HTTP instance will
// From the information in Url, the HTTP instance will
// be able to determine whether to use http or https.
//
HttpInstance->UseHttps = IsHttpsUrl (Url);
@@ -367,7 +367,7 @@ EfiHttpRequest (
// HTTP is disabled, return directly if the URI is not HTTPS.
//
if (!PcdGetBool (PcdAllowHttpConnections) && !(HttpInstance->UseHttps)) {
DEBUG ((EFI_D_ERROR, "EfiHttpRequest: HTTP is disabled.\n"));
return EFI_ACCESS_DENIED;
@@ -434,9 +434,9 @@ EfiHttpRequest (
ReConfigure = FALSE;
} else {
if ((HttpInstance->RemotePort == RemotePort) &&
(AsciiStrCmp (HttpInstance->RemoteHost, HostName) == 0) &&
(!HttpInstance->UseHttps || (HttpInstance->UseHttps &&
!TlsConfigure &&
(AsciiStrCmp (HttpInstance->RemoteHost, HostName) == 0) &&
(!HttpInstance->UseHttps || (HttpInstance->UseHttps &&
!TlsConfigure &&
HttpInstance->TlsSessionState == EfiTlsSessionDataTransferring))) {
//
// Host Name and port number of the request URL are the same with previous call to Request().
@@ -495,7 +495,7 @@ EfiHttpRequest (
}
}
}
}
}
if (Configure) {
//
@@ -514,14 +514,14 @@ EfiHttpRequest (
Status = EFI_OUT_OF_RESOURCES;
goto Error1;
}
AsciiStrToUnicodeStrS (HostName, HostNameStr, HostNameSize);
if (!HttpInstance->LocalAddressIsIPv6) {
Status = HttpDns4 (HttpInstance, HostNameStr, &HttpInstance->RemoteAddr);
} else {
Status = HttpDns6 (HttpInstance, HostNameStr, &HttpInstance->RemoteIpv6Addr);
}
FreePool (HostNameStr);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Error: Could not retrieve the host address from DNS server.\n"));
@@ -553,10 +553,10 @@ EfiHttpRequest (
if (EFI_ERROR (Status)) {
goto Error1;
}
TlsCloseTxRxEvent (HttpInstance);
}
HttpCloseConnection (HttpInstance);
EfiHttpCancel (This, NULL);
}
@@ -575,11 +575,11 @@ EfiHttpRequest (
if (Request != NULL) {
Wrap->TcpWrap.Method = Request->Method;
}
Status = HttpInitSession (
HttpInstance,
Wrap,
Configure || ReConfigure,
HttpInstance,
Wrap,
Configure || ReConfigure,
TlsConfigure
);
if (EFI_ERROR (Status)) {
@@ -588,14 +588,14 @@ EfiHttpRequest (
if (!Configure && !ReConfigure && !TlsConfigure) {
//
// For the new HTTP token, create TX TCP token events.
// For the new HTTP token, create TX TCP token events.
//
Status = HttpCreateTcpTxEvent (Wrap);
if (EFI_ERROR (Status)) {
goto Error1;
}
}
//
// Create request message.
//
@@ -647,11 +647,11 @@ EfiHttpRequest (
RequestMsgSize
);
if (EFI_ERROR (Status)) {
goto Error5;
goto Error5;
}
DispatchDpc ();
if (HostName != NULL) {
FreePool (HostName);
}
@@ -659,7 +659,7 @@ EfiHttpRequest (
if (UrlParser != NULL) {
HttpUrlFreeParser (UrlParser);
}
return EFI_SUCCESS;
Error5:
@@ -674,7 +674,7 @@ Error5:
Error4:
if (RequestMsg != NULL) {
FreePool (RequestMsg);
}
}
Error3:
if (HttpInstance->UseHttps) {
@@ -684,7 +684,7 @@ Error3:
Error2:
HttpCloseConnection (HttpInstance);
HttpCloseTcpConnCloseEvent (HttpInstance);
if (NULL != Wrap->TcpWrap.Tx4Token.CompletionToken.Event) {
gBS->CloseEvent (Wrap->TcpWrap.Tx4Token.CompletionToken.Event);
@@ -707,12 +707,12 @@ Error1:
}
return Status;
}
/**
Cancel a user's Token.
Cancel a user's Token.
@param[in] Map The HTTP instance's token queue.
@param[in] Item Object container for one HTTP token and token's wrap.
@param[in] Context The user's token to cancel.
@@ -746,7 +746,7 @@ HttpCancelTokens (
Wrap = (HTTP_TOKEN_WRAP *) Item->Value;
ASSERT (Wrap != NULL);
HttpInstance = Wrap->HttpInstance;
if (!HttpInstance->LocalAddressIsIPv6) {
if (Wrap->TcpWrap.Rx4Token.CompletionToken.Event != NULL) {
//
@@ -781,7 +781,7 @@ HttpCancelTokens (
return EFI_ABORTED;
}
return EFI_SUCCESS;
return EFI_SUCCESS;
}
/**
@@ -794,7 +794,7 @@ HttpCancelTokens (
cancelled.
@retval EFI_SUCCESS The token is cancelled.
@retval EFI_NOT_FOUND The asynchronous request or response token is not found.
@retval EFI_NOT_FOUND The asynchronous request or response token is not found.
@retval Others Other error as indicated.
**/
@@ -814,7 +814,7 @@ HttpCancel (
if (Token != NULL) {
if (Status == EFI_ABORTED) {
return EFI_SUCCESS;
}
}
} else {
return Status;
}
@@ -843,7 +843,7 @@ HttpCancel (
HttpInstance->Tcp6->Cancel (HttpInstance->Tcp6, &HttpInstance->Tcp6TlsRxToken.CompletionToken);
}
}
return EFI_SUCCESS;
}
@@ -936,7 +936,7 @@ HttpBodyParserCallback (
} else {
Wrap->HttpInstance->NextMsg = NULL;
}
//
// Free Tx4Token or Tx6Token since already received corrsponding HTTP response.
@@ -953,7 +953,7 @@ HttpBodyParserCallback (
@retval EFI_SUCCESS Allocation succeeded.
@retval EFI_OUT_OF_RESOURCES Failed to complete the opration due to lack of resources.
@retval EFI_NOT_READY Can't find a corresponding Tx4Token/Tx6Token or
@retval EFI_NOT_READY Can't find a corresponding Tx4Token/Tx6Token or
the EFI_HTTP_UTILITIES_PROTOCOL is not available.
**/
@@ -983,7 +983,7 @@ HttpResponseWorker (
if (Wrap == NULL || Wrap->HttpInstance == NULL) {
return EFI_INVALID_PARAMETER;
}
HttpInstance = Wrap->HttpInstance;
Token = Wrap->HttpToken;
HttpMsg = Token->Message;
@@ -998,7 +998,7 @@ HttpResponseWorker (
ValueInItem = NULL;
Fragment.Len = 0;
Fragment.Bulk = NULL;
if (HttpMsg->Data.Response != NULL) {
//
// Check whether we have cached header from previous call.
@@ -1025,8 +1025,8 @@ HttpResponseWorker (
//
// Check whether we cached the whole HTTP headers.
//
EndofHeader = AsciiStrStr (HttpHeaders, HTTP_END_OF_HDR_STR);
}
EndofHeader = AsciiStrStr (HttpHeaders, HTTP_END_OF_HDR_STR);
}
HttpInstance->EndofHeader = &EndofHeader;
HttpInstance->HttpHeaders = &HttpHeaders;
@@ -1239,7 +1239,7 @@ HttpResponseWorker (
//
// We have a cached HTTP message which includes a part of HTTP header of next message.
//
BodyLen = HttpInstance->NextMsg - (HttpInstance->CacheBody + HttpInstance->CacheOffset);
BodyLen = HttpInstance->NextMsg - (HttpInstance->CacheBody + HttpInstance->CacheOffset);
} else {
BodyLen = HttpInstance->CacheLen - HttpInstance->CacheOffset;
}
@@ -1274,7 +1274,7 @@ HttpResponseWorker (
//
Status = EFI_SUCCESS;
goto Exit;
}
}
if (BodyLen == 0 && HttpInstance->MsgParser == NULL) {
//
@@ -1282,8 +1282,8 @@ HttpResponseWorker (
//
HttpMsg->BodyLength = 0;
Status = EFI_SUCCESS;
goto Exit;
}
goto Exit;
}
}
ASSERT (HttpInstance->MsgParser != NULL);
@@ -1297,7 +1297,7 @@ HttpResponseWorker (
if (EFI_ERROR (Status)) {
goto Error2;
}
} else {
if (HttpInstance->TimeoutEvent == NULL) {
//
@@ -1322,11 +1322,11 @@ HttpResponseWorker (
if (EFI_ERROR (Status)) {
goto Error2;
}
Status = HttpsReceive (HttpInstance, &Fragment, HttpInstance->TimeoutEvent);
gBS->SetTimer (HttpInstance->TimeoutEvent, TimerCancel, 0);
if (EFI_ERROR (Status)) {
goto Error2;
}
@@ -1357,19 +1357,19 @@ HttpResponseWorker (
if (HttpInstance->NextMsg != NULL) {
HttpMsg->BodyLength = MIN ((UINTN) HttpInstance->NextMsg - (UINTN) Fragment.Bulk, HttpMsg->BodyLength);
CopyMem (HttpMsg->Body, Fragment.Bulk, HttpMsg->BodyLength);
HttpInstance->CacheLen = Fragment.Len - HttpMsg->BodyLength;
if (HttpInstance->CacheLen != 0) {
if (HttpInstance->CacheBody != NULL) {
FreePool (HttpInstance->CacheBody);
}
HttpInstance->CacheBody = AllocateZeroPool (HttpInstance->CacheLen);
if (HttpInstance->CacheBody == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Error2;
}
CopyMem (HttpInstance->CacheBody, Fragment.Bulk + HttpMsg->BodyLength, HttpInstance->CacheLen);
HttpInstance->CacheOffset = 0;
@@ -1383,7 +1383,7 @@ HttpResponseWorker (
if (HttpInstance->CacheBody != NULL) {
FreePool (HttpInstance->CacheBody);
}
HttpInstance->CacheBody = AllocateZeroPool (HttpInstance->CacheLen);
if (HttpInstance->CacheBody == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -1438,7 +1438,7 @@ Error:
} else {
FreePool (Wrap);
}
if (HttpHeaders != NULL) {
FreePool (HttpHeaders);
HttpHeaders = NULL;
@@ -1467,7 +1467,7 @@ Error:
gBS->SignalEvent (Token->Event);
return Status;
return Status;
}
@@ -1539,7 +1539,7 @@ EfiHttpResponse (
if (HttpMsg == NULL) {
return EFI_INVALID_PARAMETER;
}
HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);
if (HttpInstance->State != HTTP_STATE_TCP_CONNECTED) {
@@ -1550,7 +1550,7 @@ EfiHttpResponse (
// Check whether the token already existed.
//
if (EFI_ERROR (NetMapIterate (&HttpInstance->RxTokens, HttpTokenExist, Token))) {
return EFI_ACCESS_DENIED;
return EFI_ACCESS_DENIED;
}
Wrap = AllocateZeroPool (sizeof (HTTP_TOKEN_WRAP));
@@ -1562,8 +1562,8 @@ EfiHttpResponse (
Wrap->HttpToken = Token;
//
// Notes: For Https, receive token wrapped in HTTP_TOKEN_WRAP is not used to
// receive the https response. A special TlsRxToken is used for receiving TLS
// Notes: For Https, receive token wrapped in HTTP_TOKEN_WRAP is not used to
// receive the https response. A special TlsRxToken is used for receiving TLS
// related messages. It should be a blocking response.
//
if (!HttpInstance->UseHttps) {
@@ -1597,9 +1597,9 @@ Error:
gBS->CloseEvent (Wrap->TcpWrap.Rx6Token.CompletionToken.Event);
}
FreePool (Wrap);
}
}
return Status;
return Status;
}
/**
@@ -1640,7 +1640,7 @@ EfiHttpPoll (
if (HttpInstance->State != HTTP_STATE_TCP_CONNECTED) {
return EFI_NOT_STARTED;
}
if (HttpInstance->LocalAddressIsIPv6) {
if (HttpInstance->Tcp6 == NULL) {
return EFI_NOT_STARTED;
@@ -1652,8 +1652,8 @@ EfiHttpPoll (
}
Status = HttpInstance->Tcp4->Poll (HttpInstance->Tcp4);
}
DispatchDpc ();
return Status;
}

View File

@@ -1,8 +1,8 @@
/** @file
The header files of implementation of EFI_HTTP_PROTOCOL protocol interfaces.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -33,17 +33,17 @@
@param[in] This Pointer to EFI_HTTP_PROTOCOL instance.
@param[out] HttpConfigData Point to buffer for operational parameters of this
HTTP instance. It is the responsibility of the caller
to allocate the memory for HttpConfigData and
HttpConfigData->AccessPoint.IPv6Node/IPv4Node. In fact,
it is recommended to allocate sufficient memory to record
HTTP instance. It is the responsibility of the caller
to allocate the memory for HttpConfigData and
HttpConfigData->AccessPoint.IPv6Node/IPv4Node. In fact,
it is recommended to allocate sufficient memory to record
IPv6Node since it is big enough for all possibilities.
@retval EFI_SUCCESS Operation succeeded.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
This is NULL.
HttpConfigData is NULL.
HttpConfigData->AccessPoint.IPv4Node or
HttpConfigData->AccessPoint.IPv4Node or
HttpConfigData->AccessPoint.IPv6Node is NULL.
@retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been started.
@@ -65,7 +65,7 @@ EfiHttpGetModeData (
connections with remote hosts, canceling all asynchronous tokens, and flush request
and response buffers without informing the appropriate hosts.
No other EFI HTTP function can be executed by this instance until the Configure()
No other EFI HTTP function can be executed by this instance until the Configure()
function is executed and returns successfully.
@param[in] This Pointer to EFI_HTTP_PROTOCOL instance.

View File

@@ -16,7 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "HttpDriver.h"
/**
The common notify function used in HTTP driver.
The common notify function used in HTTP driver.
@param[in] Event The event signaled.
@param[in] Context The context.
@@ -54,10 +54,10 @@ HttpTcpTransmitNotifyDpc (
if (Context == NULL) {
return ;
}
Wrap = (HTTP_TOKEN_WRAP *) Context;
HttpInstance = Wrap->HttpInstance;
if (!HttpInstance->LocalAddressIsIPv6) {
Wrap->HttpToken->Status = Wrap->TcpWrap.Tx4Token.CompletionToken.Status;
gBS->SignalEvent (Wrap->HttpToken->Event);
@@ -72,11 +72,11 @@ HttpTcpTransmitNotifyDpc (
if (Wrap->TcpWrap.Tx4Token.CompletionToken.Event != NULL) {
gBS->CloseEvent (Wrap->TcpWrap.Tx4Token.CompletionToken.Event);
}
} else {
Wrap->HttpToken->Status = Wrap->TcpWrap.Tx6Token.CompletionToken.Status;
gBS->SignalEvent (Wrap->HttpToken->Event);
//
// Free resources.
//
@@ -86,7 +86,7 @@ HttpTcpTransmitNotifyDpc (
if (Wrap->TcpWrap.Tx6Token.CompletionToken.Event != NULL) {
gBS->CloseEvent (Wrap->TcpWrap.Tx6Token.CompletionToken.Event);
}
}
}
@@ -145,11 +145,11 @@ HttpTcpReceiveNotifyDpc (
Wrap = (HTTP_TOKEN_WRAP *) Context;
HttpInstance = Wrap->HttpInstance;
UsingIpv6 = HttpInstance->LocalAddressIsIPv6;
if (UsingIpv6) {
gBS->CloseEvent (Wrap->TcpWrap.Rx6Token.CompletionToken.Event);
Wrap->TcpWrap.Rx6Token.CompletionToken.Event = NULL;
if (EFI_ERROR (Wrap->TcpWrap.Rx6Token.CompletionToken.Status)) {
DEBUG ((EFI_D_ERROR, "HttpTcpReceiveNotifyDpc: %r!\n", Wrap->TcpWrap.Rx6Token.CompletionToken.Status));
Wrap->HttpToken->Status = Wrap->TcpWrap.Rx6Token.CompletionToken.Status;
@@ -159,30 +159,30 @@ HttpTcpReceiveNotifyDpc (
if (Item != NULL) {
NetMapRemoveItem (&HttpInstance->RxTokens, Item, NULL);
}
FreePool (Wrap);
Wrap = NULL;
return ;
}
} else {
gBS->CloseEvent (Wrap->TcpWrap.Rx4Token.CompletionToken.Event);
Wrap->TcpWrap.Rx4Token.CompletionToken.Event = NULL;
if (EFI_ERROR (Wrap->TcpWrap.Rx4Token.CompletionToken.Status)) {
DEBUG ((EFI_D_ERROR, "HttpTcpReceiveNotifyDpc: %r!\n", Wrap->TcpWrap.Rx4Token.CompletionToken.Status));
Wrap->HttpToken->Status = Wrap->TcpWrap.Rx4Token.CompletionToken.Status;
gBS->SignalEvent (Wrap->HttpToken->Event);
Item = NetMapFindKey (&HttpInstance->RxTokens, Wrap->HttpToken);
if (Item != NULL) {
NetMapRemoveItem (&HttpInstance->RxTokens, Item, NULL);
}
FreePool (Wrap);
Wrap = NULL;
return ;
}
}
@@ -220,7 +220,7 @@ HttpTcpReceiveNotifyDpc (
// We receive part of header of next HTTP msg.
//
if (HttpInstance->NextMsg != NULL) {
Wrap->HttpToken->Message->BodyLength = HttpInstance->NextMsg -
Wrap->HttpToken->Message->BodyLength = HttpInstance->NextMsg -
(CHAR8 *) Wrap->HttpToken->Message->Body;
HttpInstance->CacheLen = Length - Wrap->HttpToken->Message->BodyLength;
if (HttpInstance->CacheLen != 0) {
@@ -246,7 +246,7 @@ HttpTcpReceiveNotifyDpc (
} else {
Wrap->HttpToken->Status = Wrap->TcpWrap.Rx4Token.CompletionToken.Status;
}
gBS->SignalEvent (Wrap->HttpToken->Event);
@@ -323,7 +323,7 @@ HttpCreateTcpConnCloseEvent (
if (EFI_ERROR (Status)) {
goto ERROR;
}
} else {
//
// Create events for variuos asynchronous operations.
@@ -353,7 +353,7 @@ HttpCreateTcpConnCloseEvent (
goto ERROR;
}
}
return EFI_SUCCESS;
ERROR:
@@ -401,7 +401,7 @@ HttpCloseTcpConnCloseEvent (
HttpInstance->Tcp4CloseToken.CompletionToken.Event = NULL;
}
}
}
/**
@@ -436,7 +436,7 @@ HttpCreateTcpTxEvent (
if (EFI_ERROR (Status)) {
return Status;
}
TcpWrap->Tx4Data.Push = TRUE;
TcpWrap->Tx4Data.Urgent = FALSE;
TcpWrap->Tx4Data.FragmentCount = 1;
@@ -460,9 +460,9 @@ HttpCreateTcpTxEvent (
TcpWrap->Tx6Data.FragmentCount = 1;
TcpWrap->Tx6Token.Packet.TxData = &Wrap->TcpWrap.Tx6Data;
TcpWrap->Tx6Token.CompletionToken.Status =EFI_NOT_READY;
}
return EFI_SUCCESS;
}
@@ -493,7 +493,7 @@ HttpCreateTcpRxEventForHeader (
if (EFI_ERROR (Status)) {
return Status;
}
HttpInstance->Rx4Data.FragmentCount = 1;
HttpInstance->Rx4Token.Packet.RxData = &HttpInstance->Rx4Data;
HttpInstance->Rx4Token.CompletionToken.Status = EFI_NOT_READY;
@@ -513,7 +513,7 @@ HttpCreateTcpRxEventForHeader (
HttpInstance->Rx6Data.FragmentCount =1;
HttpInstance->Rx6Token.Packet.RxData = &HttpInstance->Rx6Data;
HttpInstance->Rx6Token.CompletionToken.Status = EFI_NOT_READY;
}
@@ -531,7 +531,7 @@ HttpCreateTcpRxEventForHeader (
**/
EFI_STATUS
HttpCreateTcpRxEvent (
IN HTTP_TOKEN_WRAP *Wrap
IN HTTP_TOKEN_WRAP *Wrap
)
{
EFI_STATUS Status;
@@ -551,7 +551,7 @@ HttpCreateTcpRxEvent (
if (EFI_ERROR (Status)) {
return Status;
}
TcpWrap->Rx4Data.FragmentCount = 1;
TcpWrap->Rx4Token.Packet.RxData = &Wrap->TcpWrap.Rx4Data;
TcpWrap->Rx4Token.CompletionToken.Status = EFI_NOT_READY;
@@ -563,7 +563,7 @@ HttpCreateTcpRxEvent (
HttpTcpReceiveNotify,
Wrap,
&TcpWrap->Rx6Token.CompletionToken.Event
);
);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -572,7 +572,7 @@ HttpCreateTcpRxEvent (
TcpWrap->Rx6Token.Packet.RxData = &Wrap->TcpWrap.Rx6Data;
TcpWrap->Rx6Token.CompletionToken.Status = EFI_NOT_READY;
}
return EFI_SUCCESS;
}
@@ -580,7 +580,7 @@ HttpCreateTcpRxEvent (
Close Events for Tcp Receive Tokens for HTTP body and HTTP header.
@param[in] Wrap Pointer to HTTP token's wrap data.
**/
VOID
HttpCloseTcpRxEvent (
@@ -591,7 +591,7 @@ HttpCloseTcpRxEvent (
ASSERT (Wrap != NULL);
HttpInstance = Wrap->HttpInstance;
if (HttpInstance->LocalAddressIsIPv6) {
if (Wrap->TcpWrap.Rx6Token.CompletionToken.Event != NULL) {
gBS->CloseEvent (Wrap->TcpWrap.Rx6Token.CompletionToken.Event);
@@ -605,7 +605,7 @@ HttpCloseTcpRxEvent (
if (Wrap->TcpWrap.Rx4Token.CompletionToken.Event != NULL) {
gBS->CloseEvent (Wrap->TcpWrap.Rx4Token.CompletionToken.Event);
}
if (HttpInstance->Rx4Token.CompletionToken.Event != NULL) {
gBS->CloseEvent (HttpInstance->Rx4Token.CompletionToken.Event);
HttpInstance->Rx4Token.CompletionToken.Event = NULL;
@@ -619,7 +619,7 @@ HttpCloseTcpRxEvent (
@param[in, out] HttpInstance Pointer to HTTP_PROTOCOL structure.
@param[in] IpVersion Indicate us TCP4 protocol or TCP6 protocol.
@retval EFI_SUCCESS HTTP_PROTOCOL structure is initialized successfully.
@retval EFI_SUCCESS HTTP_PROTOCOL structure is initialized successfully.
@retval Others Other error as indicated.
**/
@@ -632,10 +632,10 @@ HttpInitProtocol (
EFI_STATUS Status;
VOID *Interface;
BOOLEAN UsingIpv6;
ASSERT (HttpInstance != NULL);
UsingIpv6 = IpVersion;
if (!UsingIpv6) {
//
// Create TCP4 child.
@@ -659,7 +659,7 @@ HttpInitProtocol (
HttpInstance->Service->ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
@@ -710,7 +710,7 @@ HttpInitProtocol (
HttpInstance->Service->ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
@@ -723,10 +723,10 @@ HttpInitProtocol (
HttpInstance->Handle,
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
);
if (EFI_ERROR(Status)) {
goto ON_ERROR;
}
}
Status = gBS->OpenProtocol (
HttpInstance->Service->Tcp6ChildHandle,
@@ -741,7 +741,7 @@ HttpInitProtocol (
goto ON_ERROR;
}
}
HttpInstance->Url = AllocateZeroPool (HTTP_URL_BUFFER_LEN);
if (HttpInstance->Url == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -751,7 +751,7 @@ HttpInitProtocol (
return EFI_SUCCESS;
ON_ERROR:
if (HttpInstance->Tcp4ChildHandle != NULL) {
gBS->CloseProtocol (
HttpInstance->Tcp4ChildHandle,
@@ -765,8 +765,8 @@ ON_ERROR:
&gEfiTcp4ProtocolGuid,
HttpInstance->Service->Ip4DriverBindingHandle,
HttpInstance->Handle
);
);
NetLibDestroyServiceChild (
HttpInstance->Service->ControllerHandle,
HttpInstance->Service->Ip4DriverBindingHandle,
@@ -774,7 +774,7 @@ ON_ERROR:
HttpInstance->Tcp4ChildHandle
);
}
if (HttpInstance->Service->Tcp4ChildHandle != NULL) {
gBS->CloseProtocol (
HttpInstance->Service->Tcp4ChildHandle,
@@ -783,7 +783,7 @@ ON_ERROR:
HttpInstance->Handle
);
}
if (HttpInstance->Tcp6ChildHandle != NULL) {
gBS->CloseProtocol (
HttpInstance->Tcp6ChildHandle,
@@ -798,7 +798,7 @@ ON_ERROR:
HttpInstance->Service->Ip6DriverBindingHandle,
HttpInstance->Handle
);
NetLibDestroyServiceChild (
HttpInstance->Service->ControllerHandle,
HttpInstance->Service->Ip6DriverBindingHandle,
@@ -806,7 +806,7 @@ ON_ERROR:
HttpInstance->Tcp6ChildHandle
);
}
if (HttpInstance->Service->Tcp6ChildHandle != NULL) {
gBS->CloseProtocol (
HttpInstance->Service->Tcp6ChildHandle,
@@ -817,7 +817,7 @@ ON_ERROR:
}
return EFI_UNSUPPORTED;
}
/**
@@ -832,7 +832,7 @@ HttpCleanProtocol (
)
{
HttpCloseConnection (HttpInstance);
HttpCloseTcpConnCloseEvent (HttpInstance);
if (HttpInstance->TimeoutEvent != NULL) {
@@ -855,18 +855,18 @@ HttpCleanProtocol (
HttpFreeMsgParser (HttpInstance->MsgParser);
HttpInstance->MsgParser = NULL;
}
if (HttpInstance->Url != NULL) {
FreePool (HttpInstance->Url);
HttpInstance->Url = NULL;
}
NetMapClean (&HttpInstance->TxTokens);
NetMapClean (&HttpInstance->RxTokens);
if (HttpInstance->TlsSb != NULL && HttpInstance->TlsChildHandle != NULL) {
//
// Destroy the TLS instance.
// Destroy the TLS instance.
//
HttpInstance->TlsSb->DestroyChild (HttpInstance->TlsSb, HttpInstance->TlsChildHandle);
}
@@ -885,7 +885,7 @@ HttpCleanProtocol (
HttpInstance->Service->Ip4DriverBindingHandle,
HttpInstance->Handle
);
NetLibDestroyServiceChild (
HttpInstance->Service->ControllerHandle,
HttpInstance->Service->Ip4DriverBindingHandle,
@@ -901,7 +901,7 @@ HttpCleanProtocol (
HttpInstance->Service->Ip4DriverBindingHandle,
HttpInstance->Handle
);
}
}
if (HttpInstance->Tcp6ChildHandle != NULL) {
gBS->CloseProtocol (
@@ -917,7 +917,7 @@ HttpCleanProtocol (
HttpInstance->Service->Ip6DriverBindingHandle,
HttpInstance->Handle
);
NetLibDestroyServiceChild (
HttpInstance->Service->ControllerHandle,
HttpInstance->Service->Ip6DriverBindingHandle,
@@ -925,7 +925,7 @@ HttpCleanProtocol (
HttpInstance->Tcp6ChildHandle
);
}
if (HttpInstance->Service->Tcp6ChildHandle != NULL) {
gBS->CloseProtocol (
HttpInstance->Service->Tcp6ChildHandle,
@@ -935,7 +935,7 @@ HttpCleanProtocol (
);
}
TlsCloseTxRxEvent (HttpInstance);
TlsCloseTxRxEvent (HttpInstance);
}
/**
@@ -965,13 +965,13 @@ HttpCreateConnection (
DEBUG ((EFI_D_ERROR, "HttpCreateConnection: Tcp4->Connect() = %r\n", Status));
return Status;
}
while (!HttpInstance->IsTcp4ConnDone) {
HttpInstance->Tcp4->Poll (HttpInstance->Tcp4);
}
Status = HttpInstance->Tcp4ConnToken.CompletionToken.Status;
} else {
HttpInstance->IsTcp6ConnDone = FALSE;
HttpInstance->Tcp6ConnToken.CompletionToken.Status = EFI_NOT_READY;
@@ -985,9 +985,9 @@ HttpCreateConnection (
HttpInstance->Tcp6->Poll (HttpInstance->Tcp6);
}
Status = HttpInstance->Tcp6ConnToken.CompletionToken.Status;
Status = HttpInstance->Tcp6ConnToken.CompletionToken.Status;
}
if (!EFI_ERROR (Status)) {
HttpInstance->State = HTTP_STATE_TCP_CONNECTED;
}
@@ -1024,7 +1024,7 @@ HttpCloseConnection (
while (!HttpInstance->IsTcp6CloseDone) {
HttpInstance->Tcp6->Poll (HttpInstance->Tcp6);
}
} else {
HttpInstance->Tcp4CloseToken.AbortOnClose = TRUE;
HttpInstance->IsTcp4CloseDone = FALSE;
@@ -1070,7 +1070,7 @@ HttpConfigureTcp4 (
Tcp4CfgData = &HttpInstance->Tcp4CfgData;
ZeroMem (Tcp4CfgData, sizeof (EFI_TCP4_CONFIG_DATA));
Tcp4CfgData->TypeOfService = HTTP_TOS_DEAULT;
Tcp4CfgData->TimeToLive = HTTP_TTL_DEAULT;
Tcp4CfgData->ControlOption = &HttpInstance->Tcp4Option;
@@ -1081,7 +1081,7 @@ HttpConfigureTcp4 (
IP4_COPY_ADDRESS (&Tcp4AP->StationAddress, &HttpInstance->IPv4Node.LocalAddress);
IP4_COPY_ADDRESS (&Tcp4AP->SubnetMask, &HttpInstance->IPv4Node.LocalSubnet);
}
Tcp4AP->StationPort = HttpInstance->IPv4Node.LocalPort;
Tcp4AP->RemotePort = HttpInstance->RemotePort;
Tcp4AP->ActiveFlag = TRUE;
@@ -1141,16 +1141,16 @@ HttpConfigureTcp6 (
EFI_TCP6_CONFIG_DATA *Tcp6CfgData;
EFI_TCP6_ACCESS_POINT *Tcp6Ap;
EFI_TCP6_OPTION *Tcp6Option;
ASSERT (HttpInstance != NULL);
Tcp6CfgData = &HttpInstance->Tcp6CfgData;
ZeroMem (Tcp6CfgData, sizeof (EFI_TCP6_CONFIG_DATA));
Tcp6CfgData->TrafficClass = 0;
Tcp6CfgData->HopLimit = 255;
Tcp6CfgData->ControlOption = &HttpInstance->Tcp6Option;
Tcp6Ap = &Tcp6CfgData->AccessPoint;
Tcp6Ap->ActiveFlag = TRUE;
Tcp6Ap->StationPort = HttpInstance->Ipv6Node.LocalPort;
@@ -1175,7 +1175,7 @@ HttpConfigureTcp6 (
DEBUG ((EFI_D_ERROR, "HttpConfigureTcp6 - %r\n", Status));
return Status;
}
Status = HttpCreateTcpConnCloseEvent (HttpInstance);
if (EFI_ERROR (Status)) {
return Status;
@@ -1189,11 +1189,11 @@ HttpConfigureTcp6 (
HttpInstance->State = HTTP_STATE_TCP_CONFIGED;
return EFI_SUCCESS;
}
/**
Check existing TCP connection, if in error state, recover TCP4 connection. Then,
Check existing TCP connection, if in error state, recover TCP4 connection. Then,
connect one TLS session if required.
@param[in] HttpInstance The HTTP instance private data.
@@ -1217,8 +1217,8 @@ HttpConnectTcp4 (
}
Status = HttpInstance->Tcp4->GetModeData(
HttpInstance->Tcp4,
&Tcp4State,
HttpInstance->Tcp4,
&Tcp4State,
NULL,
NULL,
NULL,
@@ -1240,7 +1240,7 @@ HttpConnectTcp4 (
DEBUG ((EFI_D_ERROR, "Tcp4 Connection fail - %x\n", Status));
return Status;
}
//
// Tls session connection.
//
@@ -1270,11 +1270,11 @@ HttpConnectTcp4 (
TlsCloseTxRxEvent (HttpInstance);
return Status;
}
Status = TlsConnectSession (HttpInstance, HttpInstance->TimeoutEvent);
gBS->SetTimer (HttpInstance->TimeoutEvent, TimerCancel, 0);
if (EFI_ERROR (Status)) {
TlsCloseTxRxEvent (HttpInstance);
return Status;
@@ -1285,7 +1285,7 @@ HttpConnectTcp4 (
}
/**
Check existing TCP connection, if in error state, recover TCP6 connection. Then,
Check existing TCP connection, if in error state, recover TCP6 connection. Then,
connect one TLS session if required.
@param[in] HttpInstance The HTTP instance private data.
@@ -1315,7 +1315,7 @@ HttpConnectTcp6 (
NULL,
NULL
);
if (EFI_ERROR(Status)){
DEBUG ((EFI_D_ERROR, "Tcp6 GetModeData fail - %x\n", Status));
return Status;
@@ -1332,7 +1332,7 @@ HttpConnectTcp6 (
DEBUG ((EFI_D_ERROR, "Tcp6 Connection fail - %x\n", Status));
return Status;
}
//
// Tls session connection.
//
@@ -1362,11 +1362,11 @@ HttpConnectTcp6 (
TlsCloseTxRxEvent (HttpInstance);
return Status;
}
Status = TlsConnectSession (HttpInstance, HttpInstance->TimeoutEvent);
gBS->SetTimer (HttpInstance->TimeoutEvent, TimerCancel, 0);
if (EFI_ERROR (Status)) {
TlsCloseTxRxEvent (HttpInstance);
return Status;
@@ -1384,7 +1384,7 @@ HttpConnectTcp6 (
@param[in] Configure The Flag indicates whether need to initialize session.
@param[in] TlsConfigure The Flag indicates whether it's the new Tls session.
@retval EFI_SUCCESS The initialization of session is done.
@retval EFI_SUCCESS The initialization of session is done.
@retval Others Other error as indicated.
**/
@@ -1446,9 +1446,9 @@ HttpInitSession (
return Status;
}
}
return EFI_SUCCESS;
}
/**
@@ -1476,7 +1476,7 @@ HttpTransmitTcp (
EFI_TCP4_PROTOCOL *Tcp4;
EFI_TCP6_IO_TOKEN *Tx6Token;
EFI_TCP6_PROTOCOL *Tcp6;
UINT8 *TlsRecord;
UINT8 *TlsRecord;
UINT16 PayloadSize;
NET_FRAGMENT TempFragment;
NET_FRAGMENT Fragment;
@@ -1522,19 +1522,19 @@ HttpTransmitTcp (
RemainingLen = TxStringLen;
while (RemainingLen != 0) {
PayloadSize = (UINT16) MIN (TLS_PLAINTEXT_RECORD_MAX_PAYLOAD_LENGTH, RemainingLen);
((TLS_RECORD_HEADER *) TlsRecord)->ContentType = TlsContentTypeApplicationData;
((TLS_RECORD_HEADER *) TlsRecord)->Version.Major = HttpInstance->TlsConfigData.Version.Major;
((TLS_RECORD_HEADER *) TlsRecord)->Version.Minor = HttpInstance->TlsConfigData.Version.Minor;
((TLS_RECORD_HEADER *) TlsRecord)->Length = PayloadSize;
CopyMem (TlsRecord + TLS_RECORD_HEADER_LENGTH, TxString + (TxStringLen - RemainingLen), PayloadSize);
Status = TlsProcessMessage (
HttpInstance,
TlsRecord,
TLS_RECORD_HEADER_LENGTH + PayloadSize,
EfiTlsEncrypt,
HttpInstance,
TlsRecord,
TLS_RECORD_HEADER_LENGTH + PayloadSize,
EfiTlsEncrypt,
&TempFragment
);
if (EFI_ERROR (Status)) {
@@ -1542,7 +1542,7 @@ HttpTransmitTcp (
}
//
// Record the processed/encrypted Packet.
// Record the processed/encrypted Packet.
//
CopyMem (Fragment.Bulk + Fragment.Len, TempFragment.Bulk, TempFragment.Len);
Fragment.Len += TempFragment.Len;
@@ -1550,7 +1550,7 @@ HttpTransmitTcp (
FreePool (TempFragment.Bulk);
TempFragment.Len = 0;
TempFragment.Bulk = NULL;
RemainingLen -= (UINTN) PayloadSize;
ZeroMem (TlsRecord, TLS_RECORD_HEADER_LENGTH + TLS_PLAINTEXT_RECORD_MAX_PAYLOAD_LENGTH);
}
@@ -1558,7 +1558,7 @@ HttpTransmitTcp (
FreePool (TlsRecord);
TlsRecord = NULL;
}
if (!HttpInstance->LocalAddressIsIPv6) {
Tcp4 = HttpInstance->Tcp4;
Tx4Token = &Wrap->TcpWrap.Tx4Token;
@@ -1572,9 +1572,9 @@ HttpTransmitTcp (
Tx4Token->Packet.TxData->FragmentTable[0].FragmentLength = (UINT32) TxStringLen;
Tx4Token->Packet.TxData->FragmentTable[0].FragmentBuffer = (VOID *) TxString;
}
Tx4Token->CompletionToken.Status = EFI_NOT_READY;
Tx4Token->CompletionToken.Status = EFI_NOT_READY;
Wrap->TcpWrap.IsTxDone = FALSE;
Status = Tcp4->Transmit (Tcp4, Tx4Token);
if (EFI_ERROR (Status)) {
@@ -1585,7 +1585,7 @@ HttpTransmitTcp (
} else {
Tcp6 = HttpInstance->Tcp6;
Tx6Token = &Wrap->TcpWrap.Tx6Token;
if (HttpInstance->UseHttps) {
Tx6Token->Packet.TxData->DataLength = Fragment.Len;
Tx6Token->Packet.TxData->FragmentTable[0].FragmentLength = Fragment.Len;
@@ -1595,7 +1595,7 @@ HttpTransmitTcp (
Tx6Token->Packet.TxData->FragmentTable[0].FragmentLength = (UINT32) TxStringLen;
Tx6Token->Packet.TxData->FragmentTable[0].FragmentBuffer = (VOID *) TxString;
}
Tx6Token->CompletionToken.Status = EFI_NOT_READY;
Wrap->TcpWrap.IsTxDone = FALSE;
@@ -1605,17 +1605,17 @@ HttpTransmitTcp (
goto ON_ERROR;
}
}
return Status;
ON_ERROR:
if (HttpInstance->UseHttps) {
if (TlsRecord != NULL) {
FreePool (TlsRecord);
TlsRecord = NULL;
}
if (Fragment.Bulk != NULL) {
FreePool (Fragment.Bulk);
Fragment.Bulk = NULL;
@@ -1686,7 +1686,7 @@ HttpTcpNotReady (
if (!ValueInItem->TcpWrap.IsTxDone) {
return EFI_NOT_READY;
}
return EFI_SUCCESS;
}
@@ -1798,8 +1798,8 @@ HttpTcpReceive (
@param[in, out] SizeofHeaders The HTTP header length.
@param[in, out] BufferSize The size of buffer to cacahe the header message.
@param[in] Timeout The time to wait for receiving the header packet.
@retval EFI_SUCCESS The HTTP header is received.
@retval EFI_SUCCESS The HTTP header is received.
@retval Others Other errors as indicated.
**/
@@ -1832,7 +1832,7 @@ HttpTcpReceiveHeader (
Rx6Token = NULL;
Fragment.Len = 0;
Fragment.Bulk = NULL;
if (HttpInstance->LocalAddressIsIPv6) {
ASSERT (Tcp6 != NULL);
} else {
@@ -1855,7 +1855,7 @@ HttpTcpReceiveHeader (
return Status;
}
}
//
// Receive the HTTP headers only when EFI_HTTP_RESPONSE_DATA is not NULL.
//
@@ -1887,7 +1887,7 @@ HttpTcpReceiveHeader (
if (EFI_ERROR (Status)) {
return Status;
}
Fragment.Len = Rx4Token->Packet.RxData->FragmentTable[0].FragmentLength;
Fragment.Bulk = (UINT8 *) Rx4Token->Packet.RxData->FragmentTable[0].FragmentBuffer;
} else {
@@ -1895,7 +1895,7 @@ HttpTcpReceiveHeader (
FreePool (Fragment.Bulk);
Fragment.Bulk = NULL;
}
Status = HttpsReceive (HttpInstance, &Fragment, Timeout);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Tcp4 receive failed: %r\n", Status));
@@ -1931,7 +1931,7 @@ HttpTcpReceiveHeader (
//
*EndofHeader = AsciiStrStr (*HttpHeaders, HTTP_END_OF_HDR_STR);
};
//
// Free the buffer.
//
@@ -1944,7 +1944,7 @@ HttpTcpReceiveHeader (
if (Fragment.Bulk != NULL) {
FreePool (Fragment.Bulk);
Fragment.Bulk = NULL;
}
}
} else {
if (!HttpInstance->UseHttps) {
Rx6Token = &HttpInstance->Rx6Token;
@@ -1954,7 +1954,7 @@ HttpTcpReceiveHeader (
return Status;
}
}
//
// Receive the HTTP headers only when EFI_HTTP_RESPONSE_DATA is not NULL.
//
@@ -1986,7 +1986,7 @@ HttpTcpReceiveHeader (
if (EFI_ERROR (Status)) {
return Status;
}
Fragment.Len = Rx6Token->Packet.RxData->FragmentTable[0].FragmentLength;
Fragment.Bulk = (UINT8 *) Rx6Token->Packet.RxData->FragmentTable[0].FragmentBuffer;
} else {
@@ -1994,7 +1994,7 @@ HttpTcpReceiveHeader (
FreePool (Fragment.Bulk);
Fragment.Bulk = NULL;
}
Status = HttpsReceive (HttpInstance, &Fragment, Timeout);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Tcp6 receive failed: %r\n", Status));
@@ -2028,7 +2028,7 @@ HttpTcpReceiveHeader (
//
// Check whether we received end of HTTP headers.
//
*EndofHeader = AsciiStrStr (*HttpHeaders, HTTP_END_OF_HDR_STR);
*EndofHeader = AsciiStrStr (*HttpHeaders, HTTP_END_OF_HDR_STR);
};
//
@@ -2044,7 +2044,7 @@ HttpTcpReceiveHeader (
FreePool (Fragment.Bulk);
Fragment.Bulk = NULL;
}
}
}
//
// Skip the CRLF after the HTTP headers.
@@ -2062,7 +2062,7 @@ HttpTcpReceiveHeader (
@param[in] Wrap The HTTP token's wrap data.
@param[in] HttpMsg The HTTP message data.
@retval EFI_SUCCESS The HTTP body is received.
@retval EFI_SUCCESS The HTTP body is received.
@retval Others Other error as indicated.
**/
@@ -2078,19 +2078,19 @@ HttpTcpReceiveBody (
EFI_TCP6_IO_TOKEN *Rx6Token;
EFI_TCP4_PROTOCOL *Tcp4;
EFI_TCP4_IO_TOKEN *Rx4Token;
HttpInstance = Wrap->HttpInstance;
Tcp4 = HttpInstance->Tcp4;
Tcp6 = HttpInstance->Tcp6;
Rx4Token = NULL;
Rx6Token = NULL;
if (HttpInstance->LocalAddressIsIPv6) {
ASSERT (Tcp6 != NULL);
} else {
ASSERT (Tcp4 != NULL);
}
if (HttpInstance->LocalAddressIsIPv6) {
Rx6Token = &Wrap->TcpWrap.Rx6Token;
Rx6Token ->Packet.RxData->DataLength = (UINT32) MIN (MAX_UINT32, HttpMsg->BodyLength);
@@ -2108,7 +2108,7 @@ HttpTcpReceiveBody (
Rx4Token->Packet.RxData->DataLength = (UINT32) MIN (MAX_UINT32, HttpMsg->BodyLength);
Rx4Token->Packet.RxData->FragmentTable[0].FragmentLength = (UINT32) MIN (MAX_UINT32, HttpMsg->BodyLength);
Rx4Token->Packet.RxData->FragmentTable[0].FragmentBuffer = (VOID *) HttpMsg->Body;
Rx4Token->CompletionToken.Status = EFI_NOT_READY;
Status = Tcp4->Receive (Tcp4, Rx4Token);
if (EFI_ERROR (Status)) {
@@ -2125,13 +2125,13 @@ HttpTcpReceiveBody (
Clean up Tcp Tokens while the Tcp transmission error occurs.
@param[in] Wrap Pointer to HTTP token's wrap data.
**/
VOID
HttpTcpTokenCleanup (
IN HTTP_TOKEN_WRAP *Wrap
)
{
{
HTTP_PROTOCOL *HttpInstance;
EFI_TCP4_IO_TOKEN *Rx4Token;
EFI_TCP6_IO_TOKEN *Rx6Token;
@@ -2140,10 +2140,10 @@ HttpTcpTokenCleanup (
HttpInstance = Wrap->HttpInstance;
Rx4Token = NULL;
Rx6Token = NULL;
if (HttpInstance->LocalAddressIsIPv6) {
Rx6Token = &Wrap->TcpWrap.Rx6Token;
if (Rx6Token->CompletionToken.Event != NULL) {
gBS->CloseEvent (Rx6Token->CompletionToken.Event);
Rx6Token->CompletionToken.Event = NULL;
@@ -2152,25 +2152,25 @@ HttpTcpTokenCleanup (
FreePool (Wrap);
Rx6Token = &HttpInstance->Rx6Token;
if (Rx6Token->CompletionToken.Event != NULL) {
gBS->CloseEvent (Rx6Token->CompletionToken.Event);
Rx6Token->CompletionToken.Event = NULL;
}
if (Rx6Token->Packet.RxData->FragmentTable[0].FragmentBuffer != NULL) {
FreePool (Rx6Token->Packet.RxData->FragmentTable[0].FragmentBuffer);
Rx6Token->Packet.RxData->FragmentTable[0].FragmentBuffer = NULL;
}
} else {
Rx4Token = &Wrap->TcpWrap.Rx4Token;
if (Rx4Token->CompletionToken.Event != NULL) {
gBS->CloseEvent (Rx4Token->CompletionToken.Event);
Rx4Token->CompletionToken.Event = NULL;
}
FreePool (Wrap);
Rx4Token = &HttpInstance->Rx4Token;
@@ -2179,8 +2179,8 @@ HttpTcpTokenCleanup (
gBS->CloseEvent (Rx4Token->CompletionToken.Event);
Rx4Token->CompletionToken.Event = NULL;
}
if (Rx4Token->Packet.RxData->FragmentTable[0].FragmentBuffer != NULL) {
FreePool (Rx4Token->Packet.RxData->FragmentTable[0].FragmentBuffer);
Rx4Token->Packet.RxData->FragmentTable[0].FragmentBuffer = NULL;

View File

@@ -1,7 +1,7 @@
/** @file
The header files of miscellaneous routines for HttpDxe driver.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -117,18 +117,18 @@ typedef struct _HTTP_PROTOCOL {
CHAR8 *RemoteHost;
UINT16 RemotePort;
EFI_IPv4_ADDRESS RemoteAddr;
EFI_HANDLE Tcp6ChildHandle;
EFI_TCP6_PROTOCOL *Tcp6;
EFI_TCP6_CONFIG_DATA Tcp6CfgData;
EFI_TCP6_OPTION Tcp6Option;
EFI_TCP6_CONNECTION_TOKEN Tcp6ConnToken;
BOOLEAN IsTcp6ConnDone;
EFI_TCP6_CLOSE_TOKEN Tcp6CloseToken;
BOOLEAN IsTcp6CloseDone;
EFI_IPv6_ADDRESS RemoteIpv6Addr;
//
// Rx4Token or Rx6Token used for receiving HTTP header.
//
@@ -149,7 +149,7 @@ typedef struct _HTTP_PROTOCOL {
// HTTP message-body parser.
//
VOID *MsgParser;
EFI_HTTP_VERSION HttpVersion;
UINT32 TimeOutMillisec;
BOOLEAN LocalAddressIsIPv6;
@@ -211,7 +211,7 @@ typedef struct {
)
/**
The common notify function used in HTTP driver.
The common notify function used in HTTP driver.
@param[in] Event The event signaled.
@param[in] Context The context.
@@ -288,14 +288,14 @@ HttpCreateTcpRxEventForHeader (
**/
EFI_STATUS
HttpCreateTcpRxEvent (
IN HTTP_TOKEN_WRAP *Wrap
IN HTTP_TOKEN_WRAP *Wrap
);
/**
Close Events for Tcp Receive Tokens for HTTP body and HTTP header.
@param[in] Wrap Pointer to HTTP token's wrap data.
**/
VOID
HttpCloseTcpRxEvent (
@@ -308,7 +308,7 @@ HttpCloseTcpRxEvent (
@param[in, out] HttpInstance Pointer to HTTP_PROTOCOL structure.
@param[in] IpVersion Indicate us TCP4 protocol or TCP6 protocol.
@retval EFI_SUCCESS HTTP_PROTOCOL structure is initialized successfully.
@retval EFI_SUCCESS HTTP_PROTOCOL structure is initialized successfully.
@retval Others Other error as indicated.
**/
@@ -390,7 +390,7 @@ HttpConfigureTcp6 (
);
/**
Check existing TCP connection, if in error state, recover TCP4 connection. Then,
Check existing TCP connection, if in error state, recover TCP4 connection. Then,
connect one TLS session if required.
@param[in] HttpInstance The HTTP instance private data.
@@ -406,7 +406,7 @@ HttpConnectTcp4 (
);
/**
Check existing TCP connection, if in error state, recover TCP6 connection. Then,
Check existing TCP connection, if in error state, recover TCP6 connection. Then,
connect one TLS session if required.
@param[in] HttpInstance The HTTP instance private data.
@@ -490,7 +490,7 @@ HttpTcpNotReady (
@param[in] Configure The Flag indicates whether need to initialize session.
@param[in] TlsConfigure The Flag indicates whether it's the new Tls session.
@retval EFI_SUCCESS The initialization of session is done.
@retval EFI_SUCCESS The initialization of session is done.
@retval Others Other error as indicated.
**/
@@ -550,7 +550,7 @@ HttpTcpReceive (
@param[in, out] BufferSize The size of buffer to cacahe the header message.
@param[in] Timeout The time to wait for receiving the header packet.
@retval EFI_SUCCESS The HTTP header is received.
@retval EFI_SUCCESS The HTTP header is received.
@retval Others Other errors as indicated.
**/
@@ -568,7 +568,7 @@ HttpTcpReceiveHeader (
@param[in] Wrap The HTTP token's wrap data.
@param[in] HttpMsg The HTTP message data.
@retval EFI_SUCCESS The HTTP body is received.
@retval EFI_SUCCESS The HTTP body is received.
@retval Others Other error as indicated.
**/
@@ -582,7 +582,7 @@ HttpTcpReceiveBody (
Clean up Tcp Tokens while the Tcp transmission error occurs.
@param[in] Wrap Pointer to HTTP token's wrap data.
**/
VOID
HttpTcpTokenCleanup (

View File

@@ -603,9 +603,9 @@ TlsConfigCipherList (
CipherListSize
);
ON_EXIT:
ON_EXIT:
FreePool (CipherList);
return Status;
}
@@ -1453,18 +1453,18 @@ TlsCloseSession (
Process one message according to the CryptMode.
@param[in] HttpInstance Pointer to HTTP_PROTOCOL structure.
@param[in] Message Pointer to the message buffer needed to processed.
@param[in] Message Pointer to the message buffer needed to processed.
If ProcessMode is EfiTlsEncrypt, the message contain the TLS
header and plain text TLS APP payload.
If ProcessMode is EfiTlsDecrypt, the message contain the TLS
If ProcessMode is EfiTlsDecrypt, the message contain the TLS
header and cipher text TLS APP payload.
@param[in] MessageSize Pointer to the message buffer size.
@param[in] ProcessMode Process mode.
@param[in, out] Fragment Only one Fragment returned after the Message is
processed successfully.
If ProcessMode is EfiTlsEncrypt, the fragment contain the TLS
If ProcessMode is EfiTlsEncrypt, the fragment contain the TLS
header and cipher text TLS APP payload.
If ProcessMode is EfiTlsDecrypt, the fragment contain the TLS
If ProcessMode is EfiTlsDecrypt, the fragment contain the TLS
header and plain text TLS APP payload.
@retval EFI_SUCCESS Message is processed successfully.

View File

@@ -217,18 +217,18 @@ TlsCloseSession (
Process one message according to the CryptMode.
@param[in] HttpInstance Pointer to HTTP_PROTOCOL structure.
@param[in] Message Pointer to the message buffer needed to processed.
@param[in] Message Pointer to the message buffer needed to processed.
If ProcessMode is EfiTlsEncrypt, the message contain the TLS
header and plain text TLS APP payload.
If ProcessMode is EfiTlsDecrypt, the message contain the TLS
If ProcessMode is EfiTlsDecrypt, the message contain the TLS
header and cipher text TLS APP payload.
@param[in] MessageSize Pointer to the message buffer size.
@param[in] ProcessMode Process mode.
@param[in, out] Fragment Only one Fragment returned after the Message is
processed successfully.
If ProcessMode is EfiTlsEncrypt, the fragment contain the TLS
If ProcessMode is EfiTlsEncrypt, the fragment contain the TLS
header and cipher text TLS APP payload.
If ProcessMode is EfiTlsDecrypt, the fragment contain the TLS
If ProcessMode is EfiTlsDecrypt, the fragment contain the TLS
header and plain text TLS APP payload.
@retval EFI_SUCCESS Message is processed successfully.

View File

@@ -1,7 +1,7 @@
/** @file
The DriverEntryPoint and Unload for HttpUtilities driver.
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -25,7 +25,7 @@
@retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.
**/
EFI_STATUS
EFI_STATUS
EFIAPI
HttpUtilitiesDxeUnload (
IN EFI_HANDLE ImageHandle
@@ -59,11 +59,11 @@ HttpUtilitiesDxeUnload (
// Firstly, find HttpUtilitiesProtocol interface
//
Status = gBS->OpenProtocol (
HandleBuffer[Index],
&gEfiHttpUtilitiesProtocolGuid,
(VOID **) &HttpUtilitiesProtocol,
ImageHandle,
NULL,
HandleBuffer[Index],
&gEfiHttpUtilitiesProtocolGuid,
(VOID **) &HttpUtilitiesProtocol,
ImageHandle,
NULL,
EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL
);
if (EFI_ERROR (Status)) {
@@ -72,7 +72,7 @@ HttpUtilitiesDxeUnload (
//
// Then, uninstall HttpUtilities interface
//
//
Status = gBS->UninstallMultipleProtocolInterfaces (
HandleBuffer[Index],
&gEfiHttpUtilitiesProtocolGuid, HttpUtilitiesProtocol,
@@ -120,7 +120,7 @@ HttpUtilitiesDxeDriverEntryPoint (
&mHttpUtilitiesProtocol,
NULL
);
return Status;
}

View File

@@ -2,15 +2,15 @@
// This module produces Http Utilities Protocol.
//
// This module produces Http Utilities Protocol.
//
//
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
//
// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
//
// 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.
//

View File

@@ -1,7 +1,7 @@
// /** @file
// HttpUtilitiesDxe Localized Strings and Content
//
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -13,8 +13,8 @@
//
// **/
#string STR_PROPERTIES_MODULE_NAME
#language en-US
#string STR_PROPERTIES_MODULE_NAME
#language en-US
"UEFI HTTP UTILITIES DXE"

View File

@@ -1,7 +1,7 @@
/** @file
Implementation of EFI_HTTP_PROTOCOL protocol interfaces.
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -91,17 +91,17 @@ HttpUtilitiesBuild (
NewMessagePtr = NULL;
*NewMessageSize = 0;
Status = EFI_SUCCESS;
if (This == NULL) {
return EFI_INVALID_PARAMETER;
}
if (SeedMessage != NULL) {
Status = This->Parse (
This,
SeedMessage,
SeedMessageSize,
&SeedHeaderFields,
This,
SeedMessage,
SeedMessageSize,
&SeedHeaderFields,
&SeedFieldCount
);
if (EFI_ERROR (Status)) {
@@ -118,15 +118,15 @@ HttpUtilitiesBuild (
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
for (Index = 0, TempFieldCount = 0; Index < SeedFieldCount; Index++) {
//
// Check whether each SeedHeaderFields member is in DeleteList
//
if (HttpIsValidHttpHeader( DeleteList, DeleteCount, SeedHeaderFields[Index].FieldName)) {
Status = HttpSetFieldNameAndValue (
&TempHeaderFields[TempFieldCount],
SeedHeaderFields[Index].FieldName,
&TempHeaderFields[TempFieldCount],
SeedHeaderFields[Index].FieldName,
SeedHeaderFields[Index].FieldValue
);
if (EFI_ERROR (Status)) {
@@ -151,23 +151,23 @@ HttpUtilitiesBuild (
for (Index = 0; Index < TempFieldCount; Index++) {
Status = HttpSetFieldNameAndValue (
&NewHeaderFields[Index],
TempHeaderFields[Index].FieldName,
&NewHeaderFields[Index],
TempHeaderFields[Index].FieldName,
TempHeaderFields[Index].FieldValue
);
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
}
NewFieldCount = TempFieldCount;
for (Index = 0; Index < AppendCount; Index++) {
HttpHeader = HttpFindHeader (NewFieldCount, NewHeaderFields, AppendList[Index]->FieldName);
if (HttpHeader != NULL) {
Status = HttpSetFieldNameAndValue (
HttpHeader,
AppendList[Index]->FieldName,
HttpHeader,
AppendList[Index]->FieldName,
AppendList[Index]->FieldValue
);
if (EFI_ERROR (Status)) {
@@ -175,8 +175,8 @@ HttpUtilitiesBuild (
}
} else {
Status = HttpSetFieldNameAndValue (
&NewHeaderFields[NewFieldCount],
AppendList[Index]->FieldName,
&NewHeaderFields[NewFieldCount],
AppendList[Index]->FieldName,
AppendList[Index]->FieldValue
);
if (EFI_ERROR (Status)) {
@@ -241,13 +241,13 @@ HttpUtilitiesBuild (
ASSERT (*NewMessageSize == (UINTN)NewMessagePtr - (UINTN)(*NewMessage));
//
// Free allocated buffer
// Free allocated buffer
//
ON_EXIT:
if (SeedHeaderFields != NULL) {
HttpFreeHeaderFields(SeedHeaderFields, SeedFieldCount);
}
if (TempHeaderFields != NULL) {
HttpFreeHeaderFields(TempHeaderFields, TempFieldCount);
}
@@ -255,7 +255,7 @@ ON_EXIT:
if (NewHeaderFields != NULL) {
HttpFreeHeaderFields(NewHeaderFields, NewFieldCount);
}
return Status;
}
@@ -298,7 +298,7 @@ HttpUtilitiesParse (
CHAR8 *FieldName;
CHAR8 *FieldValue;
UINTN Index;
Status = EFI_SUCCESS;
TempHttpMessage = NULL;
Token = NULL;
@@ -306,18 +306,18 @@ HttpUtilitiesParse (
FieldName = NULL;
FieldValue = NULL;
Index = 0;
if (This == NULL || HttpMessage == NULL || HeaderFields == NULL || FieldCount == NULL) {
return EFI_INVALID_PARAMETER;
}
TempHttpMessage = AllocateZeroPool (HttpMessageSize);
if (TempHttpMessage == NULL) {
return EFI_OUT_OF_RESOURCES;
}
CopyMem (TempHttpMessage, HttpMessage, HttpMessageSize);
//
// Get header number
//
@@ -339,7 +339,7 @@ HttpUtilitiesParse (
Status = EFI_INVALID_PARAMETER;
goto ON_EXIT;
}
//
// Allocate buffer for header
//
@@ -349,9 +349,9 @@ HttpUtilitiesParse (
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
CopyMem (TempHttpMessage, HttpMessage, HttpMessageSize);
//
// Set Field and Value to each header
//
@@ -371,17 +371,17 @@ HttpUtilitiesParse (
HttpFreeHeaderFields (*HeaderFields, Index);
goto ON_EXIT;
}
Index++;
}
//
// Free allocated buffer
// Free allocated buffer
//
ON_EXIT:
if (TempHttpMessage != NULL) {
FreePool (TempHttpMessage);
}
return Status;
}
}

View File

@@ -1,7 +1,7 @@
/** @file
UEFI Component Name(2) protocol implementation for iSCSI.
Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -106,11 +106,11 @@ IScsiComponentNameGetDriverName (
@param[in] IScsiExtScsiPassThru A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
@param[in] Ipv6Flag TRUE if IP6 network stack is used.
@retval EFI_SUCCESS Update the ControllerNameTable of this instance successfully.
@retval EFI_INVALID_PARAMETER The input parameter is invalid.
@retval EFI_UNSUPPORTED Can't get the corresponding NIC info from the Controller handle.
**/
EFI_STATUS
UpdateName (
@@ -126,10 +126,10 @@ UpdateName (
if (IScsiExtScsiPassThru == NULL) {
return EFI_INVALID_PARAMETER;
}
Private = ISCSI_DRIVER_DATA_FROM_EXT_SCSI_PASS_THRU (IScsiExtScsiPassThru);
NicIndex = Private->Session->ConfigData->NicIndex;
UnicodeSPrint (
HandleName,
sizeof (HandleName),
@@ -242,14 +242,14 @@ IScsiComponentNameGetControllerName (
)
{
EFI_STATUS Status;
EFI_HANDLE IScsiController;
BOOLEAN Ipv6Flag;
EFI_GUID *IScsiPrivateGuid;
ISCSI_PRIVATE_PROTOCOL *IScsiIdentifier;
EFI_EXT_SCSI_PASS_THRU_PROTOCOL *IScsiExtScsiPassThru;
if (ControllerHandle == NULL) {
return EFI_UNSUPPORTED;
}
@@ -309,7 +309,7 @@ IScsiComponentNameGetControllerName (
return Status;
}
}
//
// Retrieve an instance of a produced protocol from ChildHandle
//
@@ -324,7 +324,7 @@ IScsiComponentNameGetControllerName (
if (EFI_ERROR (Status)) {
return Status;
}
//
// Update the component name for this child handle.
//

View File

@@ -1,7 +1,7 @@
/** @file
This file is for Challenge-Handshake Authentication Protocol (CHAP) Configuration.
Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -16,14 +16,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
/**
Initator calculates its own expected hash value.
@param[in] ChapIdentifier iSCSI CHAP identifier sent by authenticator.
@param[in] ChapSecret iSCSI CHAP secret of the authenticator.
@param[in] SecretLength The length of iSCSI CHAP secret.
@param[in] ChapChallenge The challenge message sent by authenticator.
@param[in] ChallengeLength The length of iSCSI CHAP challenge message.
@param[out] ChapResponse The calculation of the expected hash value.
@retval EFI_SUCCESS The expected hash value was calculatedly successfully.
@retval EFI_PROTOCOL_ERROR The length of the secret should be at least the
length of the hash value for the hashing algorithm chosen.
@@ -95,10 +95,10 @@ Exit:
/**
The initator checks the CHAP response replied by target against its own
calculation of the expected hash value.
@param[in] AuthData iSCSI CHAP authentication data.
@param[in] TargetResponse The response from target.
calculation of the expected hash value.
@param[in] AuthData iSCSI CHAP authentication data.
@param[in] TargetResponse The response from target.
@retval EFI_SUCCESS The response from target passed authentication.
@retval EFI_SECURITY_VIOLATION The response from target was not expected value.
@@ -267,12 +267,12 @@ IScsiCHAPOnRspReceived (
//
// Process the CHAP identifier and CHAP Challenge from Target.
// Calculate Response value.
//
//
Result = IScsiNetNtoi (Identifier);
if (Result > 0xFF) {
goto ON_EXIT;
}
}
AuthData->InIdentifier = (UINT32) Result;
AuthData->InChallengeLength = ISCSI_CHAP_AUTH_MAX_LEN;
IScsiHexToBin ((UINT8 *) AuthData->InChallenge, &AuthData->InChallengeLength, Challenge);
@@ -331,7 +331,7 @@ ON_EXIT:
if (KeyValueList != NULL) {
IScsiFreeKeyValueList (KeyValueList);
}
}
FreePool (Data);

View File

@@ -1,7 +1,7 @@
/** @file
The header file of CHAP configuration.
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
///
/// MD5_HASHSIZE
///
#define ISCSI_CHAP_RSP_LEN 16
#define ISCSI_CHAP_RSP_LEN 16
#define ISCSI_CHAP_STEP_ONE 1
#define ISCSI_CHAP_STEP_TWO 2

View File

@@ -1,7 +1,7 @@
/** @file
Helper functions for configuring or getting the parameters relating to iSCSI.
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -34,7 +34,7 @@ HII_VENDOR_DEVICE_PATH mIScsiHiiVendorDevicePath = {
{
END_DEVICE_PATH_TYPE,
END_ENTIRE_DEVICE_PATH_SUBTYPE,
{
{
(UINT8) (END_DEVICE_PATH_LENGTH),
(UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)
}
@@ -939,7 +939,7 @@ IScsiConvertIfrNvDataToAttemptConfigData (
L"CHAP Name or CHAP Secret is invalid!",
NULL
);
return EFI_INVALID_PARAMETER;
}
@@ -951,7 +951,7 @@ IScsiConvertIfrNvDataToAttemptConfigData (
&Key,
L"Reverse CHAP Name or Reverse CHAP Secret is invalid!",
NULL
);
);
return EFI_INVALID_PARAMETER;
}
}
@@ -970,7 +970,7 @@ IScsiConvertIfrNvDataToAttemptConfigData (
if (AttemptName2 == NULL) {
FreePool (AttemptName1);
return EFI_OUT_OF_RESOURCES;
}
}
AsciiStrToUnicodeStrS (Attempt->AttemptName, AttemptName1, ATTEMPT_NAME_SIZE);
AsciiStrToUnicodeStrS (SameNicAttempt->AttemptName, AttemptName2, ATTEMPT_NAME_SIZE);
@@ -988,7 +988,7 @@ IScsiConvertIfrNvDataToAttemptConfigData (
&Key,
mPrivate->PortString,
NULL
);
);
FreePool (AttemptName1);
FreePool (AttemptName2);
@@ -2026,7 +2026,7 @@ IScsiConfigAddAttempt (
PortTitleHelpToken = HiiSetString (mCallbackInfo->RegisteredHandle, 0, mPrivate->PortString, NULL);
if (PortTitleHelpToken == 0) {
Status = EFI_INVALID_PARAMETER;
goto Exit;
goto Exit;
}
HiiCreateGotoOpCode (
@@ -2050,14 +2050,14 @@ IScsiConfigAddAttempt (
Exit:
HiiFreeOpCodeHandle (StartOpCodeHandle);
HiiFreeOpCodeHandle (EndOpCodeHandle);
return Status;
}
/**
Add the attempts by keyword 'iSCSIAddAttempts', you can use this keyword with
value 'attempt:1 attempt:2' etc to add one or more attempts once. This is different
with IScsiConfigAddAttempt function which is used to add attempt by UI configuration.
with IScsiConfigAddAttempt function which is used to add attempt by UI configuration.
@param[in] AttemptList The new attempt List will be added.
@@ -2505,7 +2505,7 @@ IScsiConfigDisplayDeleteAttempts (
FORMID_DELETE_FORM, // Form ID
StartOpCodeHandle, // Label for where to insert opcodes
EndOpCodeHandle // Replace data
);
);
HiiFreeOpCodeHandle (StartOpCodeHandle);
HiiFreeOpCodeHandle (EndOpCodeHandle);
@@ -2536,8 +2536,8 @@ IScsiConfigDisplayOrderAttempts (
EFI_IFR_GUID_LABEL *StartLabel;
VOID *EndOpCodeHandle;
EFI_IFR_GUID_LABEL *EndLabel;
VOID *OptionsOpCodeHandle;
VOID *OptionsOpCodeHandle;
Status = IScsiCreateOpCode (
ORDER_ENTRY_LABEL,
&StartOpCodeHandle,
@@ -2589,14 +2589,14 @@ IScsiConfigDisplayOrderAttempts (
DYNAMIC_ORDERED_LIST_QUESTION_ID, // Question ID
CONFIGURATION_VARSTORE_ID, // VarStore ID
DYNAMIC_ORDERED_LIST_VAR_OFFSET, // Offset in Buffer Storage
STRING_TOKEN (STR_ORDER_ATTEMPT_ENTRY), // Question prompt text
STRING_TOKEN (STR_ORDER_ATTEMPT_ENTRY), // Question help text
STRING_TOKEN (STR_ORDER_ATTEMPT_ENTRY), // Question prompt text
STRING_TOKEN (STR_ORDER_ATTEMPT_ENTRY), // Question help text
0, // Question flag
EFI_IFR_UNIQUE_SET, // Ordered list flag, e.g. EFI_IFR_UNIQUE_SET
EFI_IFR_NUMERIC_SIZE_1, // Data type of Question value
ISCSI_MAX_ATTEMPTS_NUM, // Maximum container
OptionsOpCodeHandle, // Option Opcode list
NULL // Default Opcode is NULL
OptionsOpCodeHandle, // Option Opcode list
NULL // Default Opcode is NULL
);
Exit:
@@ -2606,11 +2606,11 @@ Exit:
FORMID_ORDER_FORM, // Form ID
StartOpCodeHandle, // Label for where to insert opcodes
EndOpCodeHandle // Replace data
);
);
Error:
HiiFreeOpCodeHandle (StartOpCodeHandle);
HiiFreeOpCodeHandle (EndOpCodeHandle);
HiiFreeOpCodeHandle (EndOpCodeHandle);
if (OptionsOpCodeHandle != NULL) {
HiiFreeOpCodeHandle (OptionsOpCodeHandle);
}
@@ -2821,10 +2821,10 @@ IScsiConfigProcessDefault (
if (AttemptConfigData == NULL || AttemptConfigData->Actived == ISCSI_ACTIVE_ENABLED) {
continue;
}
break;
}
if (Index > PcdGet8 (PcdMaxIScsiAttemptNumber)) {
CreatePopUp (
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
@@ -2858,7 +2858,7 @@ IScsiConfigProcessDefault (
// Generate OUI-format ISID based on MAC address.
//
CopyMem (AttemptConfigData->SessionConfigData.IsId, &NicInfo->PermanentAddress, 6);
AttemptConfigData->SessionConfigData.IsId[0] =
AttemptConfigData->SessionConfigData.IsId[0] =
(UINT8) (AttemptConfigData->SessionConfigData.IsId[0] & 0x3F);
//
@@ -2908,7 +2908,7 @@ IScsiConfigProcessDefault (
ZeroMem (IfrNvData->ReverseCHAPName, sizeof (IfrNvData->ReverseCHAPName));
ZeroMem (IfrNvData->ReverseCHAPSecret, sizeof (IfrNvData->ReverseCHAPSecret));
}
IScsiConvertAttemptConfigDataToIfrNvData (AttemptConfigData, IfrNvData);
//
@@ -2921,7 +2921,7 @@ IScsiConfigProcessDefault (
/**
This function allows the caller to request the current
configuration for one or more named elements. The resulting
string is in <ConfigAltResp> format. Also, any and all alternative
@@ -2950,7 +2950,7 @@ IScsiConfigProcessDefault (
to the most recent "&" before the first
failing name / value pair (or the beginning
of the string if the failure is in the first
name / value pair) if the request was not successful.
name / value pair) if the request was not successful.
@param[out] Results A null-terminated Unicode string in
<ConfigAltResp> format which has all values
@@ -2971,7 +2971,7 @@ IScsiConfigProcessDefault (
would result in this type of
error. In this case, the
Progress parameter would be
set to NULL.
set to NULL.
@retval EFI_NOT_FOUND Routing data doesn't match any
known driver. Progress set to the
@@ -3046,7 +3046,7 @@ IScsiFormExtractConfig (
FreePool (IfrNvData);
return EFI_OUT_OF_RESOURCES;
}
Status = gIScsiInitiatorName.Get (&gIScsiInitiatorName, &BufferSize, InitiatorName);
if (EFI_ERROR (Status)) {
IfrNvData->InitiatorName[0] = L'\0';
@@ -3114,7 +3114,7 @@ IScsiFormExtractConfig (
/**
This function applies changes in a driver's configuration.
Input is a Configuration, which has the routing data for this
driver followed by name / value configuration pairs. The driver
@@ -3127,8 +3127,8 @@ IScsiFormExtractConfig (
@param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
@param[in] Configuration A null-terminated Unicode string in
<ConfigString> format.
<ConfigString> format.
@param[out] Progress A pointer to a string filled in with the
offset of the most recent '&' before the
first failing name / value pair (or the
@@ -3139,16 +3139,16 @@ IScsiFormExtractConfig (
@retval EFI_SUCCESS The results have been distributed or are
awaiting distribution.
@retval EFI_OUT_OF_RESOURCES Not enough memory to store the
parts of the results that must be
stored awaiting possible future
protocols.
@retval EFI_INVALID_PARAMETERS Passing in a NULL for the
Results parameter would result
in this type of error.
@retval EFI_NOT_FOUND Target for the specified routing data
was not found.
@@ -3374,7 +3374,7 @@ Exit:
}
/**
This function is called to provide results data to the driver.
This data consists of a unique key that is used to identify
which data is either being passed back or being asked for.
@@ -3383,7 +3383,7 @@ Exit:
@param[in] Action Specifies the type of action taken by the browser.
@param[in] QuestionId A unique value which is sent to the original
exporting driver so that it can identify the type
of data to expect. The format of the data tends to
of data to expect. The format of the data tends to
vary based on the opcode that generated the callback.
@param[in] Type The type of value for the question.
@param[in, out] Value A pointer to the data being sent to the original
@@ -3445,29 +3445,29 @@ IScsiFormCallback (
}
Private = ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK (This);
//
// Retrieve uncommitted data from Browser
//
BufferSize = sizeof (ISCSI_CONFIG_IFR_NVDATA);
IfrNvData = AllocateZeroPool (BufferSize);
if (IfrNvData == NULL) {
return EFI_OUT_OF_RESOURCES;
}
IScsiName = (CHAR8 *) AllocateZeroPool (ISCSI_NAME_MAX_SIZE);
if (IScsiName == NULL) {
FreePool (IfrNvData);
return EFI_OUT_OF_RESOURCES;
}
Status = EFI_SUCCESS;
ZeroMem (&OldIfrNvData, BufferSize);
HiiGetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData);
CopyMem (&OldIfrNvData, IfrNvData, BufferSize);
if (Action == EFI_BROWSER_ACTION_CHANGING) {
@@ -3488,10 +3488,10 @@ IScsiFormCallback (
&Key,
L"Error: please configure iSCSI initiator name first!",
NULL
);
);
break;
}
Status = IScsiConfigAddAttempt ();
break;
@@ -3515,12 +3515,12 @@ IScsiFormCallback (
);
IScsiConfigDisplayOrderAttempts ();
break;
default:
Status = IScsiConfigProcessDefault (QuestionId, IfrNvData);
break;
}
} else if (Action == EFI_BROWSER_ACTION_CHANGED) {
} else if (Action == EFI_BROWSER_ACTION_CHANGED) {
switch (QuestionId) {
case KEY_INITIATOR_NAME:
UnicodeStrToAsciiStrS (IfrNvData->InitiatorName, IScsiName, ISCSI_NAME_MAX_SIZE);
@@ -3533,12 +3533,12 @@ IScsiFormCallback (
&Key,
L"Invalid iSCSI Name!",
NULL
);
);
}
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
break;
case KEY_SAVE_ATTEMPT_CONFIG:
Status = IScsiConvertIfrNvDataToAttemptConfigData (IfrNvData, Private->Current);
if (EFI_ERROR (Status)) {
@@ -3595,17 +3595,17 @@ IScsiFormCallback (
case KEY_IP_MODE:
switch (Value->u8) {
case IP_MODE_IP6:
NicInfo = IScsiGetNicInfoByIndex (Private->Current->NicIndex);
NicInfo = IScsiGetNicInfoByIndex (Private->Current->NicIndex);
if(NicInfo == NULL) {
break;
}
if(!NicInfo->Ipv6Available) {
//
// Current NIC doesn't Support IPv6, hence use IPv4.
//
if(!NicInfo->Ipv6Available) {
//
// Current NIC doesn't Support IPv6, hence use IPv4.
//
IfrNvData->IpMode = IP_MODE_IP4;
CreatePopUp (
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
&Key,
@@ -3613,7 +3613,7 @@ IScsiFormCallback (
NULL
);
}
case IP_MODE_IP4:
ZeroMem (IfrNvData->LocalIp, sizeof (IfrNvData->LocalIp));
ZeroMem (IfrNvData->SubnetMask, sizeof (IfrNvData->SubnetMask));
@@ -3624,7 +3624,7 @@ IScsiFormCallback (
ZeroMem (&Private->Current->SessionConfigData.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
ZeroMem (&Private->Current->SessionConfigData.Gateway, sizeof (EFI_IP_ADDRESS));
ZeroMem (&Private->Current->SessionConfigData.TargetIp, sizeof (EFI_IP_ADDRESS));
break;
}
@@ -3632,16 +3632,16 @@ IScsiFormCallback (
case KEY_LOCAL_IP:
Status = NetLibStrToIp4 (IfrNvData->LocalIp, &HostIp.v4);
if (EFI_ERROR (Status) ||
((Private->Current->SessionConfigData.SubnetMask.Addr[0] != 0) &&
if (EFI_ERROR (Status) ||
((Private->Current->SessionConfigData.SubnetMask.Addr[0] != 0) &&
!NetIp4IsUnicast (NTOHL (HostIp.Addr[0]), NTOHL(*(UINT32*)Private->Current->SessionConfigData.SubnetMask.Addr)))) {
CreatePopUp (
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
&Key,
L"Invalid IP address!",
NULL
);
);
Status = EFI_INVALID_PARAMETER;
} else {
CopyMem (&Private->Current->SessionConfigData.LocalIp, &HostIp.v4, sizeof (HostIp.v4));
@@ -3657,8 +3657,8 @@ IScsiFormCallback (
&Key,
L"Invalid Subnet Mask!",
NULL
);
);
Status = EFI_INVALID_PARAMETER;
} else {
CopyMem (&Private->Current->SessionConfigData.SubnetMask, &SubnetMask.v4, sizeof (SubnetMask.v4));
@@ -3668,16 +3668,16 @@ IScsiFormCallback (
case KEY_GATE_WAY:
Status = NetLibStrToIp4 (IfrNvData->Gateway, &Gateway.v4);
if (EFI_ERROR (Status) ||
((Gateway.Addr[0] != 0) &&
(Private->Current->SessionConfigData.SubnetMask.Addr[0] != 0) &&
if (EFI_ERROR (Status) ||
((Gateway.Addr[0] != 0) &&
(Private->Current->SessionConfigData.SubnetMask.Addr[0] != 0) &&
!NetIp4IsUnicast (NTOHL (Gateway.Addr[0]), NTOHL(*(UINT32*)Private->Current->SessionConfigData.SubnetMask.Addr)))) {
CreatePopUp (
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
&Key,
L"Invalid Gateway!",
NULL
);
);
Status = EFI_INVALID_PARAMETER;
} else {
CopyMem (&Private->Current->SessionConfigData.Gateway, &Gateway.v4, sizeof (Gateway.v4));
@@ -3734,7 +3734,7 @@ IScsiFormCallback (
&Key,
L"Invalid LUN string!",
NULL
);
);
} else {
CopyMem (Private->Current->SessionConfigData.BootLun, &Lun, sizeof (Lun));
}
@@ -3851,7 +3851,7 @@ IScsiConfigFormInit (
NULL
);
ASSERT_EFI_ERROR (Status);
//
// Publish our HII data.
//

View File

@@ -1,6 +1,6 @@
// *++
//
// Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
// 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
@@ -26,8 +26,8 @@
#langdef en-US "English"
#langdef x-UEFI-ns "UefiNameSpace"
#string STR_ISCSI_CONFIG_FORM_TITLE #language en-US "iSCSI Configuration"
#string STR_ISCSI_CONFIG_FORM_HELP #language en-US "Configure the iSCSI parameters."
#string STR_ISCSI_CONFIG_FORM_TITLE #language en-US "iSCSI Configuration"
#string STR_ISCSI_CONFIG_FORM_HELP #language en-US "Configure the iSCSI parameters."
#string STR_ISCSI_MAIN_FORM_TITLE #language en-US "iSCSI Configuration"
#string STR_ISCSI_MAC_FORM_TITLE #language en-US "MAC Selection"
#string STR_ISCSI_CONFIG_INIT_NAME #language en-US "iSCSI Initiator Name"

View File

@@ -1,7 +1,7 @@
/** @file
VFR file used by the iSCSI configuration component.
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -113,7 +113,7 @@ formset
text = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
flags = INTERACTIVE,
key = KEY_IGNORE_DELETE_ATTEMPT;
endform;
endform;
form formid = FORMID_ATTEMPT_FORM,
title = STRING_TOKEN(STR_ISCSI_ATTEMPT_FORM_TITLE);
@@ -157,8 +157,8 @@ formset
minimum = CONNECT_MIN_RETRY,
maximum = CONNECT_MAX_RETRY,
step = 0,
endnumeric;
endnumeric;
numeric varid = ISCSI_CONFIG_IFR_NVDATA.ConnectTimeout,
prompt = STRING_TOKEN(STR_ISCSI_CONFIG_TIMEOUT),
help = STRING_TOKEN(STR_ISCSI_CONFIG_TIMEOUT_HELP),
@@ -171,7 +171,7 @@ formset
subtitle text = STRING_TOKEN(STR_NULL);
string varid = ISCSI_CONFIG_IFR_NVDATA.IsId,
string varid = ISCSI_CONFIG_IFR_NVDATA.IsId,
prompt = STRING_TOKEN(STR_ISCSI_CONFIG_ISID),
help = STRING_TOKEN(STR_ISCSI_CONFIG_ISID_HELP),
flags = INTERACTIVE,
@@ -191,9 +191,9 @@ formset
endcheckbox;
endif;
suppressif ideqval ISCSI_CONFIG_IFR_NVDATA.IpMode == IP_MODE_IP6 OR
suppressif ideqval ISCSI_CONFIG_IFR_NVDATA.IpMode == IP_MODE_IP6 OR
ideqval ISCSI_CONFIG_IFR_NVDATA.IpMode == IP_MODE_AUTOCONFIG;
grayoutif ideqval ISCSI_CONFIG_IFR_NVDATA.InitiatorInfoFromDhcp == 0x01;
string varid = ISCSI_CONFIG_IFR_NVDATA.LocalIp,
prompt = STRING_TOKEN(STR_ISCSI_LOCAL_IP_ADDRESS),
@@ -222,12 +222,12 @@ formset
maxsize = IP4_MAX_SIZE,
endstring;
endif;
endif;
suppressif ideqval ISCSI_CONFIG_IFR_NVDATA.IpMode == IP_MODE_AUTOCONFIG;
subtitle text = STRING_TOKEN(STR_NULL);
endif;
endif;
suppressif ideqval ISCSI_CONFIG_IFR_NVDATA.IpMode == IP_MODE_AUTOCONFIG OR
ideqval ISCSI_CONFIG_IFR_NVDATA.InitiatorInfoFromDhcp == 0x00;
@@ -276,22 +276,22 @@ formset
minsize = LUN_MIN_SIZE,
maxsize = LUN_MAX_SIZE,
endstring;
endif;
suppressif ideqval ISCSI_CONFIG_IFR_NVDATA.IpMode == IP_MODE_AUTOCONFIG;
subtitle text = STRING_TOKEN(STR_NULL);
endif;
endif;
oneof varid = ISCSI_CONFIG_IFR_NVDATA.AuthenticationType,
questionid = KEY_AUTH_TYPE,
questionid = KEY_AUTH_TYPE,
prompt = STRING_TOKEN(STR_AUTHEN_TYPE_PROMPT),
help = STRING_TOKEN(STR_AUTHEN_TYPE_HELP),
option text = STRING_TOKEN(STR_AUTHEN_TYPE_CHAP), value = ISCSI_AUTH_TYPE_CHAP, flags = 0;
option text = STRING_TOKEN(STR_AUTHEN_TYPE_NONE), value = ISCSI_AUTH_TYPE_NONE, flags = DEFAULT;
endoneof;
suppressif NOT ideqval ISCSI_CONFIG_IFR_NVDATA.AuthenticationType == ISCSI_AUTH_TYPE_CHAP;
suppressif NOT ideqval ISCSI_CONFIG_IFR_NVDATA.AuthenticationType == ISCSI_AUTH_TYPE_CHAP;
oneof varid = ISCSI_CONFIG_IFR_NVDATA.CHAPType,
prompt = STRING_TOKEN(STR_CHAP_TYPE_PROMPT),
help = STRING_TOKEN(STR_CHAP_TYPE_HELP),
@@ -393,7 +393,7 @@ formset
text = STRING_TOKEN (STR_SAVE_CHANGES),
flags = INTERACTIVE,
key = KEY_SAVE_ATTEMPT_CONFIG;
goto FORMID_MAIN_FORM,
prompt = STRING_TOKEN (STR_RETURN_MAIN_FORM),
help = STRING_TOKEN (STR_RETURN_MAIN_FORM),

View File

@@ -1,7 +1,7 @@
/** @file
iSCSI DHCP4 related configuration routines.
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -201,14 +201,14 @@ ON_EXIT:
/**
The callback function registerd to the DHCP4 instance that is used to select
the qualified DHCP OFFER.
@param[in] This The DHCP4 protocol.
@param[in] Context The context set when configuring the DHCP4 protocol.
@param[in] CurrentState The current state of the DHCP4 protocol.
@param[in] Dhcp4Event The event occurs in the current state.
@param[in] Packet The DHCP packet that is to be sent or was already received.
@param[in] Packet The DHCP packet that is to be sent or was already received.
@param[out] NewPacket The packet used to replace the above Packet.
@retval EFI_SUCCESS Either the DHCP OFFER is qualified or we're not intereseted
in the Dhcp4Event.
@retval EFI_NOT_READY The DHCP OFFER packet doesn't match our requirements.
@@ -411,7 +411,7 @@ IScsiSetIp4Policy (
);
if (EFI_ERROR (Status)) {
return Status;
}
}
}
return EFI_SUCCESS;
@@ -462,10 +462,10 @@ IScsiDoDhcp (
}
//
// DHCP4 service allows only one of its children to be configured in
// the active state, If the DHCP4 D.O.R.A started by IP4 auto
// configuration and has not been completed, the Dhcp4 state machine
// will not be in the right state for the iSCSI to start a new round D.O.R.A.
// DHCP4 service allows only one of its children to be configured in
// the active state, If the DHCP4 D.O.R.A started by IP4 auto
// configuration and has not been completed, the Dhcp4 state machine
// will not be in the right state for the iSCSI to start a new round D.O.R.A.
// So, we need to switch it's policy to static.
//
Status = gBS->HandleProtocol (Controller, &gEfiIp4Config2ProtocolGuid, (VOID **) &Ip4Config2);

View File

@@ -1,7 +1,7 @@
/** @file
iSCSI DHCP6 related configuration routines.
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -47,7 +47,7 @@ IScsiDhcp6ExtractRootPath (
UINT8 Index;
ISCSI_SESSION_CONFIG_NVDATA *ConfigNvData;
EFI_IP_ADDRESS Ip;
UINT8 IpMode;
UINT8 IpMode;
ConfigNvData = &ConfigData->SessionConfigData;
ConfigNvData->DnsMode = FALSE;
@@ -156,7 +156,7 @@ IScsiDhcp6ExtractRootPath (
//
// Get the IP address of the target.
//
Field = &Fields[RP_FIELD_IDX_SERVERNAME];
Field = &Fields[RP_FIELD_IDX_SERVERNAME];
if (ConfigNvData->IpMode < IP_MODE_AUTOCONFIG) {
IpMode = ConfigNvData->IpMode;
} else {
@@ -238,11 +238,11 @@ ON_EXIT:
}
/**
EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol
EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol
instance to intercept events that occurs in the DHCPv6 Information Request
exchange process.
@param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance that
@param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance that
is used to configure this callback function.
@param[in] Context Pointer to the context that is initialized in
the EFI_DHCP6_PROTOCOL.InfoRequest().
@@ -276,10 +276,10 @@ IScsiDhcp6ParseReply (
EFI_DHCP6_PACKET_OPTION **OptionList;
ISCSI_ATTEMPT_CONFIG_NVDATA *ConfigData;
UINT16 ParaLen;
OptionCount = 0;
BootFileOpt = NULL;
Status = This->Parse (This, Packet, &OptionCount, NULL);
if (Status != EFI_BUFFER_TOO_SMALL) {
return EFI_NOT_READY;
@@ -353,7 +353,7 @@ IScsiDhcp6ParseReply (
Status = EFI_UNSUPPORTED;
goto Exit;
}
//
// Get iSCSI root path from Boot File Uniform Resource Locator (URL) Option
//
@@ -524,7 +524,7 @@ ON_EXIT:
if (Oro != NULL) {
FreePool (Oro);
}
}
if (Timer != NULL) {
gBS->CloseEvent (Timer);

View File

@@ -2,7 +2,7 @@
The header file of routines for IScsi driver to perform DNS
resolution based on UEFI DNS protocols.
Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -56,4 +56,4 @@ IScsiDns6 (
IN OUT ISCSI_SESSION_CONFIG_NVDATA *NvData
);
#endif
#endif

View File

@@ -1,7 +1,7 @@
/** @file
The entry point of IScsi driver.
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2017 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
@@ -39,14 +39,14 @@ EFI_GUID gIScsiV6PrivateGuid = ISCSI_V6_PRIVATE_GUID;
ISCSI_PRIVATE_DATA *mPrivate = NULL;
/**
Tests to see if this driver supports the RemainingDevicePath.
Tests to see if this driver supports the RemainingDevicePath.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The RemainingDevicePath is supported or NULL.
@@ -222,15 +222,15 @@ Exit:
IScsiIp4(6)DriverBindingSupported.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@param[in] IpVersion IP_VERSION_4 or IP_VERSION_6.
@@ -437,7 +437,7 @@ IScsiStart (
return EFI_ABORTED;
}
}
//
// Record the incoming NIC info.
//
@@ -479,13 +479,13 @@ IScsiStart (
ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
//
// Always install private protocol no matter what happens later. We need to
// Always install private protocol no matter what happens later. We need to
// keep the relationship between ControllerHandle and ChildHandle.
//
Status = gBS->InstallProtocolInterface (
@@ -497,7 +497,7 @@ IScsiStart (
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
if (IpVersion == IP_VERSION_4) {
mPrivate->Ipv6Flag = FALSE;
} else {
@@ -900,8 +900,8 @@ IScsiStart (
ExistPrivate->Controller,
IScsiPrivateGuid,
&ExistPrivate->IScsiIdentifier
);
);
IScsiRemoveNic (ExistPrivate->Controller);
if (ExistPrivate->Session != NULL) {
IScsiSessionAbort (ExistPrivate->Session);
@@ -973,7 +973,7 @@ IScsiStart (
Image,
Private->ExtScsiPassThruHandle,
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
);
);
if (EFI_ERROR (Status)) {
gBS->UninstallMultipleProtocolInterfaces (
Private->ExtScsiPassThruHandle,
@@ -983,7 +983,7 @@ IScsiStart (
Private->DevicePath,
NULL
);
goto ON_ERROR;
}
@@ -1010,16 +1010,16 @@ ON_ERROR:
/**
Stops a device controller or a bus controller. This is the worker function for
IScsiIp4(6)DriverBindingStop.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@param[in] IpVersion IP_VERSION_4 or IP_VERSION_6.
@retval EFI_SUCCESS The device was stopped.
@retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
@retval EFI_INVALID_PARAMETER Child handle is NULL.
@@ -1084,7 +1084,7 @@ IScsiStop (
Private->Image,
Private->ExtScsiPassThruHandle
);
gBS->CloseProtocol (
Conn->TcpIo.Handle,
ProtocolGuid,
@@ -1094,7 +1094,7 @@ IScsiStop (
return EFI_SUCCESS;
}
//
// Get the handle of the controller we are controling.
//
@@ -1134,7 +1134,7 @@ IScsiStop (
This->DriverBindingHandle,
IScsiController
);
ASSERT (!EFI_ERROR (Status));
Status = NetLibDestroyServiceChild (
@@ -1151,7 +1151,7 @@ IScsiStop (
IScsiController,
ProtocolGuid,
&Private->IScsiIdentifier
);
);
//
// Remove this NIC.
@@ -1177,33 +1177,33 @@ IScsiStop (
}
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Since ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Since ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -1238,28 +1238,28 @@ IScsiIp4DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -1289,10 +1289,10 @@ IScsiIp4DriverBindingStart (
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -1300,13 +1300,13 @@ IScsiIp4DriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -1332,33 +1332,33 @@ IScsiIp4DriverBindingStop (
}
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Since ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Since ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -1393,28 +1393,28 @@ IScsiIp6DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -1444,10 +1444,10 @@ IScsiIp6DriverBindingStart (
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -1455,13 +1455,13 @@ IScsiIp6DriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -1573,7 +1573,7 @@ IScsiUnload (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
//
// Uninstall the protocols installed by iSCSI driver.
//
@@ -1586,7 +1586,7 @@ IScsiUnload (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
if (gIScsiControllerNameTable!= NULL) {
Status = FreeUnicodeStringTable (gIScsiControllerNameTable);
if (EFI_ERROR (Status)) {
@@ -1615,7 +1615,7 @@ IScsiUnload (
goto ON_EXIT;
}
}
Status = gBS->HandleProtocol (
gIScsiIp4DriverBinding.DriverBindingHandle,
&gEfiComponentName2ProtocolGuid,
@@ -1653,7 +1653,7 @@ IScsiUnload (
goto ON_EXIT;
}
}
Status = gBS->HandleProtocol (
gIScsiIp6DriverBinding.DriverBindingHandle,
&gEfiComponentName2ProtocolGuid,
@@ -1698,7 +1698,7 @@ ON_EXIT:
if (DeviceHandleBuffer != NULL) {
FreePool (DeviceHandleBuffer);
}
return Status;
}
@@ -1706,11 +1706,11 @@ ON_EXIT:
This is the declaration of an EFI image entry point. This entry point is
the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
both device drivers and bus drivers.
The entry point for iSCSI driver which initializes the global variables and
installs the driver binding, component name protocol, iSCSI initiator name
protocol and Authentication Info protocol on its image.
@param[in] ImageHandle The firmware allocated handle for the UEFI image.
@param[in] SystemTable A pointer to the EFI System Table.
@@ -1767,7 +1767,7 @@ IScsiDriverEntryPoint (
if (EFI_ERROR (Status)) {
goto Error1;
}
//
// Install the iSCSI Initiator Name Protocol.
//
@@ -1779,7 +1779,7 @@ IScsiDriverEntryPoint (
);
if (EFI_ERROR (Status)) {
goto Error2;
}
}
//
// Create the private data structures.
@@ -1835,7 +1835,7 @@ IScsiDriverEntryPoint (
);
if (EFI_ERROR (Status)) {
goto Error6;
}
}
}
return EFI_SUCCESS;

View File

@@ -1,7 +1,7 @@
/** @file
The header file of IScsiDriver.c.
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2017 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
@@ -93,33 +93,33 @@ typedef struct _ISCSI_PRIVATE_PROTOCOL {
//
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Since ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Since ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -146,28 +146,28 @@ IScsiIp4DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -187,10 +187,10 @@ IScsiIp4DriverBindingStart (
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -198,13 +198,13 @@ IScsiIp4DriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -221,33 +221,33 @@ IScsiIp4DriverBindingStop (
);
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Since ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Since ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -274,28 +274,28 @@ IScsiIp6DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -315,10 +315,10 @@ IScsiIp6DriverBindingStart (
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -326,13 +326,13 @@ IScsiIp6DriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -434,11 +434,11 @@ IScsiComponentNameGetDriverName (
language of the driver name that the caller is
requesting, and it must match one of the
languages specified in SupportedLanguages. The
number of languages supported by a driver is
determined by the driver writer. Language is
specified inRFC 4646 or ISO 639-2 language code
number of languages supported by a driver is
determined by the driver writer. Language is
specified inRFC 4646 or ISO 639-2 language code
format.
@param[out] ControllerName A pointer to the Unicode string to return.
This Unicode string is the name of the
controller specified by ControllerHandle and
@@ -597,19 +597,19 @@ IScsiSetAuthenticationInfo (
/**
Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel.
This function supports both blocking I/O and nonblocking I/O. The blocking I/O
functionality is required, and the nonblocking I/O functionality is optional.
functionality is required, and the nonblocking I/O functionality is optional.
@param[in] This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
@param[in] Target The Target is an array of size TARGET_MAX_BYTES and it
represents the id of the SCSI device to send the SCSI
Request Packet. Each transport driver may choose to
utilize a subset of this size to suit the needs
of transport target representation. For example, a
of transport target representation. For example, a
Fibre Channel driver may use only 8 bytes (WWN)
to represent an FC target.
@param[in] Lun The LUN of the SCSI device to send the SCSI Request Packet.
@param[in, out] Packet A pointer to the SCSI Request Packet to send to the
SCSI device specified by Target and Lun.
SCSI device specified by Target and Lun.
@param[in] Event If nonblocking I/O is not supported then Event is ignored,
and blocking I/O is performed. If Event is NULL, then
blocking I/O is performed. If Event is not NULL and non
@@ -618,7 +618,7 @@ IScsiSetAuthenticationInfo (
completes.
@retval EFI_SUCCESS The SCSI Request Packet was sent by the host. For
bi-directional commands, InTransferLength bytes
bi-directional commands, InTransferLength bytes
were transferred from InDataBuffer.
For write and bi-directional commands, OutTransferLength
bytes were transferred by OutDataBuffer.
@@ -631,7 +631,7 @@ IScsiSetAuthenticationInfo (
there are too many SCSI Request Packets already
queued. The caller may retry later.
@retval EFI_DEVICE_ERROR A device error occurred while attempting to send
the SCSI Request Packet.
the SCSI Request Packet.
@retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket
are invalid.
@retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
@@ -658,9 +658,9 @@ IScsiExtScsiPassThruFunction (
Used to retrieve the list of legal Target IDs and LUNs for SCSI devices on
a SCSI channel. These can either be the list SCSI devices that are actually
present on the SCSI channel, or the list of legal Target Ids and LUNs for the
SCSI channel. Regardless, the caller of this function must probe the Target ID
and LUN returned to see if a SCSI device is actually present at that location
on the SCSI channel.
SCSI channel. Regardless, the caller of this function must probe the Target ID
and LUN returned to see if a SCSI device is actually present at that location
on the SCSI channel.
@param[in] This The EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
@param[in, out] Target On input, a pointer to the Target ID of a SCSI
@@ -790,7 +790,7 @@ IScsiExtScsiPassThruResetTargetLun (
);
/**
Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.
Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.
@param[in] This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL
instance.
@@ -800,7 +800,7 @@ IScsiExtScsiPassThruResetTargetLun (
next SCSI device present on a SCSI channel.
An input value of 0xF(all bytes in the array are 0xF)
in the Target array retrieves the Target ID of the
first SCSI device present on a SCSI channel.
first SCSI device present on a SCSI channel.
@retval EFI_SUCCESS The Target ID of the next SCSI device on the SCSI
channel was returned in Target.

View File

@@ -3,8 +3,8 @@
#
# The iSCSI driver provides iSCSI service in the preboot environment and supports
# booting over iSCSI.
#
# Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
#
# Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
# 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
@@ -57,7 +57,7 @@
IScsiExtScsiPassThru.c
IScsiIbft.c
IScsiIbft.h
IScsiInitiatorName.c
IScsiInitiatorName.c
IScsiImpl.h
IScsiMisc.c
IScsiMisc.h
@@ -82,7 +82,7 @@
PrintLib
UefiBootServicesTableLib
UefiDriverEntryPoint
UefiLib
UefiLib
UefiRuntimeServicesTableLib
UefiHiiServicesLib
BaseCryptLib
@@ -113,7 +113,7 @@
## PRODUCES
## UNDEFINED # Variable
gEfiIScsiInitiatorNameProtocolGuid
## PRODUCES
## PRODUCES
gEfiAuthenticationInfoProtocolGuid
## SOMETIMES_CONSUMES
gEfiAdapterInformationProtocolGuid
@@ -127,7 +127,7 @@
gEfiAcpi20TableGuid ## SOMETIMES_CONSUMES ## SystemTable
gEfiAdapterInfoNetworkBootGuid ## SOMETIMES_CONSUMES ## UNDEFINED
gEfiAdapterInfoUndiIpv6SupportGuid ## SOMETIMES_CONSUMES ## GUID
## SOMETIMES_PRODUCES ## Variable:L"AttemptOrder"
## SOMETIMES_CONSUMES ## Variable:L"AttemptOrder"
## SOMETIMES_PRODUCES ## Variable:L"InitialAttemptOrder"

View File

@@ -4,13 +4,13 @@
// The iSCSI driver provides iSCSI service in the preboot environment and supports
// booting over iSCSI.
//
// Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
//
// 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.
//

View File

@@ -1,7 +1,7 @@
// /** @file
// IScsiDxe Localized Strings and Content
//
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -14,7 +14,7 @@
// **/
#string STR_PROPERTIES_MODULE_NAME
#language en-US
#language en-US
"iSCSI DXE"

View File

@@ -1,7 +1,7 @@
/** @file
The implementation of EFI_EXT_SCSI_PASS_THRU_PROTOCOL.
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -29,19 +29,19 @@ EFI_EXT_SCSI_PASS_THRU_PROTOCOL gIScsiExtScsiPassThruProtocolTemplate = {
/**
Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel.
This function supports both blocking I/O and nonblocking I/O. The blocking I/O
functionality is required, and the nonblocking I/O functionality is optional.
functionality is required, and the nonblocking I/O functionality is optional.
@param[in] This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
@param[in] Target The Target is an array of size TARGET_MAX_BYTES and it
represents the id of the SCSI device to send the SCSI
Request Packet. Each transport driver may choose to
utilize a subset of this size to suit the needs
of transport target representation. For example, a
of transport target representation. For example, a
Fibre Channel driver may use only 8 bytes (WWN)
to represent an FC target.
@param[in] Lun The LUN of the SCSI device to send the SCSI Request Packet.
@param[in, out] Packet A pointer to the SCSI Request Packet to send to the
SCSI device specified by Target and Lun.
SCSI device specified by Target and Lun.
@param[in] Event If nonblocking I/O is not supported then Event is ignored,
and blocking I/O is performed. If Event is NULL, then
blocking I/O is performed. If Event is not NULL and non
@@ -50,7 +50,7 @@ EFI_EXT_SCSI_PASS_THRU_PROTOCOL gIScsiExtScsiPassThruProtocolTemplate = {
completes.
@retval EFI_SUCCESS The SCSI Request Packet was sent by the host. For
bi-directional commands, InTransferLength bytes
bi-directional commands, InTransferLength bytes
were transferred from InDataBuffer.
For write and bi-directional commands, OutTransferLength
bytes were transferred by OutDataBuffer.
@@ -63,7 +63,7 @@ EFI_EXT_SCSI_PASS_THRU_PROTOCOL gIScsiExtScsiPassThruProtocolTemplate = {
there are too many SCSI Request Packets already
queued. The caller may retry later.
@retval EFI_DEVICE_ERROR A device error occurred while attempting to send
the SCSI Request Packet.
the SCSI Request Packet.
@retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket,
are invalid.
@retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
@@ -88,7 +88,7 @@ IScsiExtScsiPassThruFunction (
{
EFI_STATUS Status;
ISCSI_DRIVER_DATA *Private;
if (Target[0] != 0) {
return EFI_INVALID_PARAMETER;
}
@@ -118,9 +118,9 @@ IScsiExtScsiPassThruFunction (
Used to retrieve the list of legal Target IDs and LUNs for SCSI devices on
a SCSI channel. These can either be the list SCSI devices that are actually
present on the SCSI channel, or the list of legal Target Ids and LUNs for the
SCSI channel. Regardless, the caller of this function must probe the Target ID
and LUN returned to see if a SCSI device is actually present at that location
on the SCSI channel.
SCSI channel. Regardless, the caller of this function must probe the Target ID
and LUN returned to see if a SCSI device is actually present at that location
on the SCSI channel.
@param[in] This The EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
@param[in, out] Target On input, a pointer to the Target ID of a SCSI
@@ -298,7 +298,7 @@ IScsiExtScsiPassThruBuildDevicePath (
@retval EFI_INVALID_PARAMETER DevicePath/Target/Lun is NULL.
@retval EFI_UNSUPPORTED This driver does not support the device path node
type in DevicePath.
@retval EFI_NOT_FOUND A valid translation does not exist from DevicePath
@retval EFI_NOT_FOUND A valid translation does not exist from DevicePath
to a TargetID and LUN.
**/
@@ -382,7 +382,7 @@ IScsiExtScsiPassThruResetTargetLun (
}
/**
Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.
Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.
@param[in] This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL
instance.
@@ -392,7 +392,7 @@ IScsiExtScsiPassThruResetTargetLun (
next SCSI device present on a SCSI channel.
An input value of 0xF(all bytes in the array are 0xF)
in the Target array retrieves the Target ID of the
first SCSI device present on a SCSI channel.
first SCSI device present on a SCSI channel.
@retval EFI_SUCCESS The Target ID of the next SCSI device on the SCSI
channel was returned in Target.

View File

@@ -1,7 +1,7 @@
/** @file
Implementation for iSCSI Boot Firmware Table publication.
Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -19,7 +19,7 @@ UINTN mTableKey;
/**
Initialize the header of the iSCSI Boot Firmware Table.
@param[out] Header The header of the iSCSI Boot Firmware Table.
@param[in] OemId The OEM ID.
@param[in] OemTableId The OEM table ID for the iBFT.

View File

@@ -1,7 +1,7 @@
/** @file
Some extra definitions for iBFT.
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -16,7 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define _ISCSI_IBFT_H_
#include <IndustryStandard/Acpi.h>
#include <IndustryStandard/IScsiBootFirmwareTable.h>
#include <IndustryStandard/IScsiBootFirmwareTable.h>
#include <Protocol/AcpiTable.h>
#include <Protocol/PciIo.h>

View File

@@ -1,7 +1,7 @@
/** @file
The shared head file for iSCSI driver.
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -201,7 +201,7 @@ struct _ISCSI_DRIVER_DATA {
EFI_EXT_SCSI_PASS_THRU_MODE ExtScsiPassThruMode;
EFI_HANDLE ExtScsiPassThruHandle;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
EFI_HANDLE ChildHandle;
EFI_HANDLE ChildHandle;
ISCSI_SESSION *Session;
};

View File

@@ -20,7 +20,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 IScsiHexString[] = "0123456789ABCDEFa
Removes (trims) specified leading and trailing characters from a string.
@param[in, out] Str Pointer to the null-terminated string to be trimmed.
On return, Str will hold the trimmed string.
On return, Str will hold the trimmed string.
@param[in] CharC Character will be trimmed from str.
@@ -33,18 +33,18 @@ IScsiStrTrim (
{
CHAR16 *Pointer1;
CHAR16 *Pointer2;
if (*Str == 0) {
return ;
}
//
// Trim off the leading and trailing characters c
//
for (Pointer1 = Str; (*Pointer1 != 0) && (*Pointer1 == CharC); Pointer1++) {
;
}
Pointer2 = Str;
if (Pointer2 == Pointer1) {
while (*Pointer1 != 0) {
@@ -52,19 +52,19 @@ IScsiStrTrim (
Pointer1++;
}
} else {
while (*Pointer1 != 0) {
*Pointer2 = *Pointer1;
while (*Pointer1 != 0) {
*Pointer2 = *Pointer1;
Pointer1++;
Pointer2++;
}
*Pointer2 = 0;
}
for (Pointer1 = Str + StrLen(Str) - 1; Pointer1 >= Str && *Pointer1 == CharC; Pointer1--) {
;
}
if (Pointer1 != Str + StrLen(Str) - 1) {
if (Pointer1 != Str + StrLen(Str) - 1) {
*(Pointer1 + 1) = 0;
}
}
@@ -131,11 +131,11 @@ IScsiAsciiStrToLun (
CHAR8 TemStr[2];
UINT8 TemValue;
UINT16 Value[4];
ZeroMem (Lun, 8);
ZeroMem (TemStr, 2);
ZeroMem ((UINT8 *) Value, sizeof (Value));
SizeStr = AsciiStrLen (Str);
SizeStr = AsciiStrLen (Str);
IndexValue = 0;
IndexNum = 0;
@@ -150,7 +150,7 @@ IScsiAsciiStrToLun (
return EFI_INVALID_PARAMETER;
}
}
if ((TemValue == 0) && (TemStr[0] == '-')) {
//
// Next Lun value.
@@ -167,24 +167,24 @@ IScsiAsciiStrToLun (
IndexNum = 0;
continue;
}
if (++IndexNum > 4) {
//
//
// Each Lun Str can't exceed size 4, because it will be as UINT16 value.
//
return EFI_INVALID_PARAMETER;
}
//
// Combine UINT16 value.
//
Value[IndexValue] = (UINT16) ((Value[IndexValue] << 4) + TemValue);
}
for (Index = 0; Index <= IndexValue; Index ++) {
*((UINT16 *) &Lun[Index * 2]) = HTONS (Value[Index]);
}
return EFI_SUCCESS;
}
@@ -319,7 +319,7 @@ IScsiMacAddrToStr (
@param[in, out] HexStr Pointer to the string.
@param[in, out] HexLength The length of the string.
@retval EFI_SUCCESS The binary data is converted to the hexadecimal string
@retval EFI_SUCCESS The binary data is converted to the hexadecimal string
and the length of the string is updated.
@retval EFI_BUFFER_TOO_SMALL The string is too small.
@retval EFI_INVALID_PARAMETER The IP string is malformatted.
@@ -385,7 +385,7 @@ IScsiHexToBin (
UINTN Length;
UINT8 Digit;
CHAR8 TemStr[2];
ZeroMem (TemStr, sizeof (TemStr));
//
@@ -394,7 +394,7 @@ IScsiHexToBin (
if ((HexStr[0] == '0') && ((HexStr[1] == 'x') || (HexStr[1] == 'X'))) {
HexStr += 2;
}
Length = AsciiStrLen (HexStr);
for (Index = 0; Index < Length; Index ++) {
@@ -412,7 +412,7 @@ IScsiHexToBin (
BinBuffer [Index/2] = (UINT8) ((BinBuffer [Index/2] << 4) + Digit);
}
}
*BinLength = (UINT32) ((Index + 1)/2);
return EFI_SUCCESS;
@@ -492,7 +492,7 @@ IScsiCheckIpv6Support (
BOOLEAN Supported;
VOID *InfoBlock;
UINTN InfoBlockSize;
EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL *Nii;
ASSERT (Ipv6Support != NULL);
@@ -515,7 +515,7 @@ IScsiCheckIpv6Support (
//
// Get the NIC handle by SNP protocol.
//
//
Handle = NetLibGetSnpHandle (ControllerHandle, NULL);
if (Handle == NULL) {
return EFI_NOT_FOUND;
@@ -561,11 +561,11 @@ IScsiCheckIpv6Support (
if (EFI_ERROR (Status) || InfoBlock == NULL) {
FreePool (InfoBlock);
return EFI_NOT_FOUND;
}
}
*Ipv6Support = ((EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT *) InfoBlock)->Ipv6Support;
FreePool (InfoBlock);
return EFI_SUCCESS;
}
@@ -615,19 +615,19 @@ IScsiAddNic (
CompareMem (&NicInfo->PermanentAddress, MacAddr.Addr, HwAddressSize) == 0 &&
NicInfo->VlanId == VlanId) {
mPrivate->CurrentNic = NicInfo->NicIndex;
//
//
// Set IPv6 available flag.
//
//
Status = IScsiCheckIpv6Support (Controller, Image, &NicInfo->Ipv6Available);
if (EFI_ERROR (Status)) {
//
// Fail to get the data whether UNDI supports IPv6.
// Fail to get the data whether UNDI supports IPv6.
// Set default value to TRUE.
//
NicInfo->Ipv6Available = TRUE;
}
return EFI_SUCCESS;
}
@@ -649,19 +649,19 @@ IScsiAddNic (
NicInfo->VlanId = VlanId;
NicInfo->NicIndex = (UINT8) (mPrivate->MaxNic + 1);
mPrivate->MaxNic = NicInfo->NicIndex;
//
// Set IPv6 available flag.
//
//
Status = IScsiCheckIpv6Support (Controller, Image, &NicInfo->Ipv6Available);
if (EFI_ERROR (Status)) {
//
// Fail to get the data whether UNDI supports IPv6.
// Fail to get the data whether UNDI supports IPv6.
// Set default value to TRUE.
//
NicInfo->Ipv6Available = TRUE;
}
//
// Get the PCI location.
//
@@ -1799,7 +1799,7 @@ IScsiCleanDriverData (
EXIT:
if (Private->ExitBootServiceEvent != NULL) {
gBS->CloseEvent (Private->ExitBootServiceEvent);
gBS->CloseEvent (Private->ExitBootServiceEvent);
}
mCallbackInfo->Current = NULL;
@@ -1813,10 +1813,10 @@ EXIT:
@param[in] Controller The handle of the controller.
@param[in] IpVersion IP_VERSION_4 or IP_VERSION_6.
@retval TRUE The handle of the controller need the Dhcp protocol.
@retval FALSE The handle of the controller does not need the Dhcp protocol.
**/
BOOLEAN
IScsiDhcpIsConfigured (
@@ -1835,7 +1835,7 @@ IScsiDhcpIsConfigured (
CHAR16 MacString[ISCSI_MAX_MAC_STRING_LEN];
CHAR16 AttemptMacString[ISCSI_MAX_MAC_STRING_LEN];
CHAR16 AttemptName[ISCSI_NAME_IFR_MAX_SIZE];
AttemptConfigOrder = IScsiGetVariableAndSize (
L"AttemptOrder",
&gIScsiConfigGuid,
@@ -1844,7 +1844,7 @@ IScsiDhcpIsConfigured (
if (AttemptConfigOrder == NULL || AttemptConfigOrderSize == 0) {
return FALSE;
}
//
// Get MAC address of this network device.
//
@@ -1857,7 +1857,7 @@ IScsiDhcpIsConfigured (
//
VlanId = NetLibGetVlanId (Controller);
IScsiMacAddrToStr (&MacAddr, (UINT32) HwAddressSize, VlanId, MacString);
for (Index = 0; Index < AttemptConfigOrderSize / sizeof (UINT8); Index++) {
UnicodeSPrint (
AttemptName,
@@ -1874,7 +1874,7 @@ IScsiDhcpIsConfigured (
if(AttemptTmp == NULL || EFI_ERROR (Status)) {
continue;
}
ASSERT (AttemptConfigOrder[Index] == AttemptTmp->AttemptConfigIndex);
if (AttemptTmp->SessionConfigData.Enabled == ISCSI_DISABLED) {
@@ -1882,7 +1882,7 @@ IScsiDhcpIsConfigured (
continue;
}
if (AttemptTmp->SessionConfigData.IpMode != IP_MODE_AUTOCONFIG &&
if (AttemptTmp->SessionConfigData.IpMode != IP_MODE_AUTOCONFIG &&
AttemptTmp->SessionConfigData.IpMode != ((IpVersion == IP_VERSION_4) ? IP_MODE_IP4 : IP_MODE_IP6)) {
FreePool (AttemptTmp);
continue;
@@ -1896,7 +1896,7 @@ IScsiDhcpIsConfigured (
if(AttemptTmp->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG ||
AttemptTmp->SessionConfigData.InitiatorInfoFromDhcp == TRUE ||
AttemptTmp->SessionConfigData.TargetInfoFromDhcp == TRUE) {
AttemptTmp->SessionConfigData.TargetInfoFromDhcp == TRUE) {
FreePool (AttemptTmp);
FreePool (AttemptConfigOrder);
return TRUE;
@@ -1904,7 +1904,7 @@ IScsiDhcpIsConfigured (
FreePool (AttemptTmp);
}
FreePool (AttemptConfigOrder);
return FALSE;
}
@@ -1913,10 +1913,10 @@ IScsiDhcpIsConfigured (
Check whether the Controller handle is configured to use DNS protocol.
@param[in] Controller The handle of the controller.
@retval TRUE The handle of the controller need the Dns protocol.
@retval FALSE The handle of the controller does not need the Dns protocol.
**/
BOOLEAN
IScsiDnsIsConfigured (
@@ -1934,7 +1934,7 @@ IScsiDnsIsConfigured (
CHAR16 AttemptMacString[ISCSI_MAX_MAC_STRING_LEN];
CHAR16 MacString[ISCSI_MAX_MAC_STRING_LEN];
CHAR16 AttemptName[ISCSI_NAME_IFR_MAX_SIZE];
AttemptConfigOrder = IScsiGetVariableAndSize (
L"AttemptOrder",
&gIScsiConfigGuid,
@@ -1943,7 +1943,7 @@ IScsiDnsIsConfigured (
if (AttemptConfigOrder == NULL || AttemptConfigOrderSize == 0) {
return FALSE;
}
//
// Get MAC address of this network device.
//
@@ -1956,7 +1956,7 @@ IScsiDnsIsConfigured (
//
VlanId = NetLibGetVlanId (Controller);
IScsiMacAddrToStr (&MacAddr, (UINT32) HwAddressSize, VlanId, MacString);
for (Index = 0; Index < AttemptConfigOrderSize / sizeof (UINT8); Index++) {
UnicodeSPrint (
AttemptName,
@@ -1974,7 +1974,7 @@ IScsiDnsIsConfigured (
if(AttemptTmp == NULL || EFI_ERROR (Status)) {
continue;
}
ASSERT (AttemptConfigOrder[Index] == AttemptTmp->AttemptConfigIndex);
AsciiStrToUnicodeStrS (AttemptTmp->MacString, AttemptMacString, sizeof (AttemptMacString) / sizeof (AttemptMacString[0]));
@@ -1983,7 +1983,7 @@ IScsiDnsIsConfigured (
FreePool (AttemptTmp);
continue;
}
if (AttemptTmp->SessionConfigData.DnsMode || AttemptTmp->SessionConfigData.TargetInfoFromDhcp) {
FreePool (AttemptTmp);
FreePool (AttemptConfigOrder);
@@ -2060,7 +2060,7 @@ IScsiGetConfigData (
//
// Check whether the attempt exists in AttemptConfig.
//
AttemptTmp = IScsiConfigGetAttemptByConfigIndex (AttemptConfigOrder[Index]);
AttemptTmp = IScsiConfigGetAttemptByConfigIndex (AttemptConfigOrder[Index]);
if (AttemptTmp != NULL && AttemptTmp->SessionConfigData.Enabled == ISCSI_DISABLED) {
continue;
} else if (AttemptTmp != NULL && AttemptTmp->SessionConfigData.Enabled != ISCSI_DISABLED) {
@@ -2126,11 +2126,11 @@ IScsiGetConfigData (
continue;
}
} else if (AttemptTmp->SessionConfigData.InitiatorInfoFromDhcp &&
!AttemptTmp->ValidPath &&
} else if (AttemptTmp->SessionConfigData.InitiatorInfoFromDhcp &&
!AttemptTmp->ValidPath &&
AttemptTmp->NicIndex == mPrivate->CurrentNic) {
//
// If the attempt associates with the current NIC, we can
// If the attempt associates with the current NIC, we can
// get DHCP information for already added, but failed, attempt.
//
AttemptTmp->DhcpSuccess = FALSE;
@@ -2213,7 +2213,7 @@ IScsiGetConfigData (
(UINT8) (mPrivate->Ipv6Flag ? IP_MODE_AUTOCONFIG_IP6 : IP_MODE_AUTOCONFIG_IP4);
AttemptConfigData->AutoConfigureSuccess = FALSE;
}
//
// Get some information from dhcp server.
//
@@ -2384,7 +2384,7 @@ IScsiGetTcpConnDevicePath (
Conn->TcpIo.Handle,
&gEfiDevicePathProtocolGuid,
(VOID **) &DevicePath
);
);
if (EFI_ERROR (Status)) {
return NULL;
}
@@ -2403,7 +2403,7 @@ IScsiGetTcpConnDevicePath (
if (!Conn->Ipv6Flag && DevicePathSubType (&DPathNode->DevPath) == MSG_IPv4_DP) {
DPathNode->Ipv4.LocalPort = 0;
DPathNode->Ipv4.StaticIpAddress =
DPathNode->Ipv4.StaticIpAddress =
(BOOLEAN) (!Session->ConfigData->SessionConfigData.InitiatorInfoFromDhcp);
//
@@ -2414,9 +2414,9 @@ IScsiGetTcpConnDevicePath (
//
PathLen = DevicePathNodeLength (&DPathNode->Ipv4);
if (PathLen == IP4_NODE_LEN_NEW_VERSIONS) {
if (PathLen == IP4_NODE_LEN_NEW_VERSIONS) {
IP4_COPY_ADDRESS (
&DPathNode->Ipv4.GatewayIpAddress,
&Session->ConfigData->SessionConfigData.Gateway
@@ -2427,7 +2427,7 @@ IScsiGetTcpConnDevicePath (
&Session->ConfigData->SessionConfigData.SubnetMask
);
}
break;
} else if (Conn->Ipv6Flag && DevicePathSubType (&DPathNode->DevPath) == MSG_IPv6_DP) {
DPathNode->Ipv6.LocalPort = 0;
@@ -2436,28 +2436,28 @@ IScsiGetTcpConnDevicePath (
// Add a judgement here to support previous versions of IPv6_DEVICE_PATH.
// In previous versions of IPv6_DEVICE_PATH, IpAddressOrigin, PrefixLength
// and GatewayIpAddress do not exist.
// In new version of IPv6_DEVICE_PATH, structure length is 60, while in
// In new version of IPv6_DEVICE_PATH, structure length is 60, while in
// old versions, the length is 43.
//
PathLen = DevicePathNodeLength (&DPathNode->Ipv6);
if (PathLen == IP6_NODE_LEN_NEW_VERSIONS ) {
if (PathLen == IP6_NODE_LEN_NEW_VERSIONS ) {
DPathNode->Ipv6.IpAddressOrigin = 0;
DPathNode->Ipv6.PrefixLength = IP6_PREFIX_LENGTH;
ZeroMem (&DPathNode->Ipv6.GatewayIpAddress, sizeof (EFI_IPv6_ADDRESS));
}
else if (PathLen == IP6_NODE_LEN_OLD_VERSIONS) {
else if (PathLen == IP6_NODE_LEN_OLD_VERSIONS) {
//
// StaticIPAddress is a field in old versions of IPv6_DEVICE_PATH, while ignored in new
// StaticIPAddress is a field in old versions of IPv6_DEVICE_PATH, while ignored in new
// version. Set StaticIPAddress through its' offset in old IPv6_DEVICE_PATH.
//
*((UINT8 *)(&DPathNode->Ipv6) + IP6_OLD_IPADDRESS_OFFSET) =
*((UINT8 *)(&DPathNode->Ipv6) + IP6_OLD_IPADDRESS_OFFSET) =
(BOOLEAN) (!Session->ConfigData->SessionConfigData.InitiatorInfoFromDhcp);
}
break;
}
}
@@ -2486,10 +2486,10 @@ IScsiOnExitBootService (
ISCSI_DRIVER_DATA *Private;
Private = (ISCSI_DRIVER_DATA *) Context;
gBS->CloseEvent (Private->ExitBootServiceEvent);
Private->ExitBootServiceEvent = NULL;
if (Private->Session != NULL) {
IScsiSessionAbort (Private->Session);
}
@@ -2502,7 +2502,7 @@ IScsiOnExitBootService (
currently managing the controller specified by ControllerHandle. This test
is performed by evaluating if the the protocol specified by ProtocolGuid is
present on ControllerHandle and is was opened by DriverBindingHandle and Nic
Device handle with an attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
Device handle with an attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
If ProtocolGuid is NULL, then ASSERT().
@param ControllerHandle A handle for a controller to test.

View File

@@ -1,7 +1,7 @@
/** @file
Miscellaneous definitions for iSCSI driver.
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -62,7 +62,7 @@ typedef struct _ISCSI_SESSION_CONFIG_NVDATA {
BOOLEAN DnsMode; // Flag indicate whether the Target address is expressed as URL format.
CHAR8 TargetUrl[ISCSI_TARGET_URI_MAX_SIZE];
} ISCSI_SESSION_CONFIG_NVDATA;
#pragma pack()
@@ -81,7 +81,7 @@ IScsiGetSubnetMaskPrefixLength (
);
/**
Convert the hexadecimal encoded LUN string into the 64-bit LUN.
Convert the hexadecimal encoded LUN string into the 64-bit LUN.
@param[in] Str The hexadecimal encoded LUN string.
@param[out] Lun Storage to return the 64-bit LUN.
@@ -153,7 +153,7 @@ IScsiAsciiStrToIp (
@param[in, out] HexStr Pointer to the string.
@param[in, out] HexLength The length of the string.
@retval EFI_SUCCESS The binary data is converted to the hexadecimal string
@retval EFI_SUCCESS The binary data is converted to the hexadecimal string
and the length of the string is updated.
@retval EFI_BUFFER_TOO_SMALL The string is too small.
@retval EFI_INVALID_PARAMETER The IP string is malformatted.
@@ -372,10 +372,10 @@ IScsiCleanDriverData (
@param[in] Controller The handle of the controller.
@param[in] IpVersion IP_VERSION_4 or IP_VERSION_6.
@retval TRUE The handle of the controller need the Dhcp protocol.
@retval FALSE The handle of the controller does not need the Dhcp protocol.
**/
BOOLEAN
IScsiDhcpIsConfigured (
@@ -387,10 +387,10 @@ IScsiDhcpIsConfigured (
Check wheather the Controller handle is configured to use DNS protocol.
@param[in] Controller The handle of the controller.
@retval TRUE The handle of the controller need the DNS protocol.
@retval FALSE The handle of the controller does not need the DNS protocol.
**/
BOOLEAN
IScsiDnsIsConfigured (
@@ -447,7 +447,7 @@ IScsiOnExitBootService (
currently managing the controller specified by ControllerHandle. This test
is performed by evaluating if the the protocol specified by ProtocolGuid is
present on ControllerHandle and is was opened by DriverBindingHandle and Nic
Device handle with an attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
Device handle with an attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
If ProtocolGuid is NULL, then ASSERT().
@param ControllerHandle A handle for a controller to test.

View File

@@ -1,7 +1,7 @@
/** @file
The implementation of iSCSI protocol based on RFC3720.
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -17,7 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
UINT32 mDataSegPad = 0;
/**
Attach the iSCSI connection to the iSCSI session.
Attach the iSCSI connection to the iSCSI session.
@param[in, out] Session The iSCSI session.
@param[in, out] Conn The iSCSI connection.
@@ -35,7 +35,7 @@ IScsiAttatchConnection (
}
/**
Detach the iSCSI connection from the session it belongs to.
Detach the iSCSI connection from the session it belongs to.
@param[in, out] Conn The iSCSI connection.
@@ -52,7 +52,7 @@ IScsiDetatchConnection (
/**
Check the sequence number according to RFC3720.
Check the sequence number according to RFC3720.
@param[in, out] ExpSN The currently expected sequence number.
@param[in] NewSN The sequence number to check.
@@ -124,7 +124,7 @@ IScsiUpdateCmdSN (
@retval EFI_SUCCESS The iSCSI connection is logged into the iSCSI target.
@retval EFI_TIMEOUT Timeout occurred during the login procedure.
@retval Others Other errors as indicated.
@retval Others Other errors as indicated.
**/
EFI_STATUS
@@ -274,7 +274,7 @@ IScsiCreateConnection (
if (!Conn->Ipv6Flag) {
Tcp4IoConfig = &TcpIoConfig.Tcp4IoConfigData;
CopyMem (&Tcp4IoConfig->LocalIp, &NvData->LocalIp, sizeof (EFI_IPv4_ADDRESS));
CopyMem (&Tcp4IoConfig->SubnetMask, &NvData->SubnetMask, sizeof (EFI_IPv4_ADDRESS));
CopyMem (&Tcp4IoConfig->Gateway, &NvData->Gateway, sizeof (EFI_IPv4_ADDRESS));
@@ -285,7 +285,7 @@ IScsiCreateConnection (
Tcp4IoConfig->StationPort = 0;
} else {
Tcp6IoConfig = &TcpIoConfig.Tcp6IoConfigData;
CopyMem (&Tcp6IoConfig->RemoteIp, &NvData->TargetIp, sizeof (EFI_IPv6_ADDRESS));
Tcp6IoConfig->RemotePort = NvData->TargetPort;
Tcp6IoConfig->ActiveFlag = TRUE;
@@ -338,7 +338,7 @@ IScsiDestroyConnection (
@retval EFI_SUCCESS Get the NIC information successfully.
@retval Others Other errors as indicated.
**/
EFI_STATUS
IScsiGetIp6NicInfo (
@@ -494,7 +494,7 @@ IScsiSessionLogin (
Session->State = SESSION_STATE_LOGGED_IN;
if (!Conn->Ipv6Flag) {
ProtocolGuid = &gEfiTcp4ProtocolGuid;
ProtocolGuid = &gEfiTcp4ProtocolGuid;
} else {
ProtocolGuid = &gEfiTcp6ProtocolGuid;
}
@@ -505,7 +505,7 @@ IScsiSessionLogin (
(VOID **) &Tcp,
Session->Private->Image,
Session->Private->ExtScsiPassThruHandle,
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
);
ASSERT_EFI_ERROR (Status);
@@ -612,7 +612,7 @@ IScsiSendLoginReq (
Receive and process the iSCSI login response.
@param[in] Conn The connection in the iSCSI login phase.
@retval EFI_SUCCESS The iSCSI login response PDU is received and processed.
@retval Others Other errors as indicated.
@@ -793,7 +793,7 @@ IScsiPrepareLoginReq (
case ISCSI_SECURITY_NEGOTIATION:
//
// Both none authentication and CHAP authentication share the CHAP path.
//
//
//
if (Session->AuthType != ISCSI_AUTH_TYPE_KRB) {
Status = IScsiCHAPToSendReq (Conn, Nbuf);
@@ -808,7 +808,7 @@ IScsiPrepareLoginReq (
if (!Conn->ParamNegotiated) {
IScsiFillOpParams (Conn, Nbuf);
}
ISCSI_SET_FLAG (LoginReq, ISCSI_LOGIN_REQ_PDU_FLAG_TRANSIT);
break;
@@ -964,7 +964,7 @@ IScsiProcessLoginRsp (
// the value presented in CmdSN as the target value for ExpCmdSN.
//
if ((Session->State == SESSION_STATE_FREE) && (Session->CmdSN != LoginRsp->ExpCmdSN)) {
return EFI_PROTOCOL_ERROR;
return EFI_PROTOCOL_ERROR;
}
//
@@ -1072,7 +1072,7 @@ IScsiProcessLoginRsp (
@param[in] Data The data segment that should contain the
TargetAddress key-value list.
@param[in] Len Length of the data.
@retval EFI_SUCCESS The target address is updated.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
@retval EFI_NOT_FOUND The TargetAddress key is not found.
@@ -1101,7 +1101,7 @@ IScsiUpdateTargetAddress (
Status = EFI_NOT_FOUND;
NvData = &Session->ConfigData->SessionConfigData;
while (TRUE) {
TargetAddress = IScsiGetValueByKeyFromList (KeyValueList, ISCSI_KEY_TARGET_ADDRESS);
if (TargetAddress == NULL) {
@@ -1188,7 +1188,7 @@ IScsiUpdateTargetAddress (
//
// Save the origial user setting which specifies the proxy/virtual iSCSI target.
//
//
CopyMem (&NvData->OriginalTargetIp, &NvData->TargetIp, sizeof (EFI_IP_ADDRESS));
//
@@ -1365,7 +1365,7 @@ IScsiReceivePdu (
switch (ISCSI_GET_OPCODE (Header)) {
case ISCSI_OPCODE_SCSI_DATA_IN:
//
// To reduce memory copy overhead, try to use the buffer described by Context
// To reduce memory copy overhead, try to use the buffer described by Context
// if the PDU is an iSCSI SCSI data.
//
InDataOffset = ISCSI_GET_BUFFER_OFFSET (Header);
@@ -1713,7 +1713,7 @@ IScsiCheckOpParams (
IScsiGetValueByKeyFromList (KeyValueList, ISCSI_KEY_TARGET_ALIAS);
IScsiGetValueByKeyFromList (KeyValueList, ISCSI_KEY_TARGET_PORTAL_GROUP_TAG);
//
// Remove the key-value that may not needed for result function is OR.
//
@@ -2228,7 +2228,7 @@ IScsiNewScsiCmdPdu (
if (ScsiCmd == NULL) {
NetbufFree (PduHeader);
return NULL;
}
}
Header = (ISCSI_ADDITIONAL_HEADER *) (ScsiCmd + 1);
ZeroMem (ScsiCmd, Length);
@@ -2902,8 +2902,8 @@ IScsiOnNopInRcvd (
@param[in] Lun The LUN.
@param[in, out] Packet The request packet containing IO request, SCSI command
buffer and buffers to read/write.
@retval EFI_SUCCES The SCSI command is executed and the result is updated to
@retval EFI_SUCCES The SCSI command is executed and the result is updated to
the Packet.
@retval EFI_DEVICE_ERROR Session state was not as required.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
@@ -3197,7 +3197,7 @@ IScsiSessionAbort (
if (!Conn->Ipv6Flag) {
ProtocolGuid = &gEfiTcp4ProtocolGuid;
} else {
ProtocolGuid = &gEfiTcp6ProtocolGuid;
ProtocolGuid = &gEfiTcp6ProtocolGuid;
}
gBS->CloseProtocol (

View File

@@ -1,7 +1,7 @@
/** @file
The header file of iSCSI Protocol that defines many specific data structures.
Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -627,7 +627,7 @@ typedef struct _ISCSI_KEY_VALUE_PAIR {
} ISCSI_KEY_VALUE_PAIR;
/**
Attach the iSCSI connection to the iSCSI session.
Attach the iSCSI connection to the iSCSI session.
@param[in, out] Session The iSCSI session.
@param[in, out] Conn The iSCSI connection.
@@ -640,7 +640,7 @@ IScsiAttatchConnection (
);
/**
Detach the iSCSI connection from the session it belongs to.
Detach the iSCSI connection from the session it belongs to.
@param[in, out] Conn The iSCSI connection.
@@ -658,7 +658,7 @@ IScsiDetatchConnection (
@retval EFI_SUCCESS The iSCSI connection is logged into the iSCSI target.
@retval EFI_TIMEOUT Timeout occurred during the login procedure.
@retval Others Other errors as indicated.
@retval Others Other errors as indicated.
**/
EFI_STATUS
@@ -743,7 +743,7 @@ IScsiSendLoginReq (
Receive and process the iSCSI login response.
@param[in] Conn The connection in the iSCSI login phase.
@retval EFI_SUCCESS The iSCSI login response PDU is received and processed.
@retval Others Other errors as indicated.
@@ -815,7 +815,7 @@ IScsiProcessLoginRsp (
@param[in] Data The data segment which should contain the
TargetAddress key-value list.
@param[in] Len Length of the data.
@retval EFI_SUCCESS The target address is updated.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
@retval EFI_NOT_FOUND The TargetAddress key is not found.
@@ -983,8 +983,8 @@ IScsiNormalizeName (
@param[in] Lun The LUN.
@param[in, out] Packet The request packet containing IO request, SCSI command
buffer and buffers to read/write.
@retval EFI_SUCCES The SCSI command is executed and the result is updated to
@retval EFI_SUCCES The SCSI command is executed and the result is updated to
the Packet.
@retval EFI_DEVICE_ERROR Session state was not as required.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
@@ -1026,7 +1026,7 @@ IScsiSessionInit (
IN OUT ISCSI_SESSION *Session,
IN BOOLEAN Recovery
);
/**
Abort the iSCSI session, that is, reset all the connection and free the
resources.

View File

@@ -1,13 +1,13 @@
/** @file
GUIDs used as HII FormSet and HII Package list GUID in HTTP boot driver.
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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,
Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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.
**/

View File

@@ -1,7 +1,7 @@
/** @file
This file defines the HttpTlsCipherList variable for HTTPS to configure Tls Cipher List.
Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2018 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
@@ -17,10 +17,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
// Private Variable for HTTPS to configure Tls Cipher List.
// The valid contents of variable must follow the TLS CipherList format defined in RFC 5246.
// The valid contents of variable must follow the TLS CipherList format defined in RFC 5246.
// The valid length of variable must be an integral multiple of 2.
// For example, if below cipher suites are preferred:
// CipherSuite TLS_RSA_WITH_AES_128_CBC_SHA256 = {0x00,0x3C}
// CipherSuite TLS_RSA_WITH_AES_128_CBC_SHA256 = {0x00,0x3C}
// CipherSuite TLS_RSA_WITH_AES_256_CBC_SHA256 = {0x00,0x3D}
// Then, the contents of variable should be:
// {0x00,0x3C,0x00,0x3D}
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
{ \
0x46ddb415, 0x5244, 0x49c7, { 0x93, 0x74, 0xf0, 0xe2, 0x98, 0xe7, 0xd3, 0x86 } \
}
#define EDKII_HTTP_TLS_CIPHER_LIST_VARIABLE L"HttpTlsCipherList"
extern EFI_GUID gEdkiiHttpTlsCipherListGuid;

View File

@@ -1,14 +1,14 @@
/** @file
GUIDs used as HII FormSet and HII Package list GUID in IScsiConfig driver
that supports IP4 and IP6 both.
Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
GUIDs used as HII FormSet and HII Package list GUID in IScsiConfig driver
that supports IP4 and IP6 both.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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.
**/

View File

@@ -1,13 +1,13 @@
/** @file
GUIDs used as HII FormSet and HII Package list GUID in Ip6Config driver.
Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
GUIDs used as HII FormSet and HII Package list GUID in Ip6Config driver.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that 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.
**/

View File

@@ -2,7 +2,7 @@
Implementation of EFI_COMPONENT_NAME_PROTOCOL and
EFI_COMPONENT_NAME2_PROTOCOL protocol.
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -238,10 +238,10 @@ Ip6ComponentNameGetDriverName (
@param Ip6[in] A pointer to the EFI_IP6_PROTOCOL.
@retval EFI_SUCCESS Update the ControllerNameTable of this instance successfully.
@retval EFI_INVALID_PARAMETER The input parameter is invalid.
**/
EFI_STATUS
UpdateName (
@@ -320,7 +320,7 @@ UpdateName (
FreeUnicodeStringTable (gIp6ControllerNameTable);
gIp6ControllerNameTable = NULL;
}
Status = AddUnicodeString2 (
"eng",
gIp6ComponentName.SupportedLanguages,
@@ -331,7 +331,7 @@ UpdateName (
if (EFI_ERROR (Status)) {
return Status;
}
return AddUnicodeString2 (
"en",
gIp6ComponentName2.SupportedLanguages,
@@ -421,7 +421,7 @@ Ip6ComponentNameGetControllerName (
{
EFI_STATUS Status;
EFI_IP6_PROTOCOL *Ip6;
//
// Only provide names for child handles.
//
@@ -430,7 +430,7 @@ Ip6ComponentNameGetControllerName (
}
//
// Make sure this driver produced ChildHandle
// Make sure this driver produced ChildHandle
//
Status = EfiTestChildHandle (
ControllerHandle,

View File

@@ -1,7 +1,7 @@
/** @file
The implementation of common functions shared by IP6 driver.
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -330,7 +330,7 @@ Ip6AddAddr (
/**
Callback function which provided by user to remove one node in NetDestroyLinkList process.
@param[in] Entry The entry to be removed.
@param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
@@ -348,7 +348,7 @@ Ip6DestroyChildEntryByAddr (
IP6_PROTOCOL *Instance;
EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding;
EFI_IPv6_ADDRESS *Address;
Instance = NET_LIST_USER_STRUCT_S (Entry, IP6_PROTOCOL, Link, IP6_PROTOCOL_SIGNATURE);
ServiceBinding = ((IP6_DESTROY_CHILD_BY_ADDR_CALLBACK_CONTEXT*) Context)->ServiceBinding;
Address = ((IP6_DESTROY_CHILD_BY_ADDR_CALLBACK_CONTEXT*) Context)->Address;
@@ -356,7 +356,7 @@ Ip6DestroyChildEntryByAddr (
if ((Instance->State == IP6_STATE_CONFIGED) && EFI_IP6_EQUAL (&Instance->ConfigData.StationAddress, Address)) {
return ServiceBinding->DestroyChild (ServiceBinding, Instance->Handle);
}
return EFI_SUCCESS;
}

View File

@@ -1,7 +1,7 @@
/** @file
The implementation of EFI IPv6 Configuration Protocol.
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -58,7 +58,7 @@ Ip6ConfigOnPolicyChanged (
BOOLEAN Recovery;
Recovery = FALSE;
//
// Currently there are only two policies: Manual and Automatic. Regardless of
// what transition is going on, i.e., Manual -> Automatic and Automatic ->
@@ -86,14 +86,14 @@ Ip6ConfigOnPolicyChanged (
}
if (!IsListEmpty (&IpSb->DefaultInterface->AddressList) && IpSb->DefaultInterface->AddressCount > 0) {
//
// If any IPv6 children (Instance) in configured state and use global unicast address, it will be
// destroyed in Ip6RemoveAddr() function later. Then, the upper layer driver's Stop() function will be
// called, which may break the upper layer network stacks. So, the driver should take the responsibility
// for the recovery by using ConnectController() after Ip6RemoveAddr().
//
// If any IPv6 children (Instance) in configured state and use global unicast address, it will be
// destroyed in Ip6RemoveAddr() function later. Then, the upper layer driver's Stop() function will be
// called, which may break the upper layer network stacks. So, the driver should take the responsibility
// for the recovery by using ConnectController() after Ip6RemoveAddr().
// Here, just check whether need to recover the upper layer network stacks later.
//
NET_LIST_FOR_EACH (Entry, &IpSb->DefaultInterface->AddressList) {
NET_LIST_FOR_EACH (Entry, &IpSb->DefaultInterface->AddressList) {
AddrInfo = NET_LIST_USER_STRUCT_S (Entry, IP6_ADDRESS_INFO, Link, IP6_ADDR_INFO_SIGNATURE);
if (!IsListEmpty (&IpSb->Children)) {
NET_LIST_FOR_EACH (Entry2, &IpSb->Children) {
@@ -105,7 +105,7 @@ Ip6ConfigOnPolicyChanged (
}
}
}
//
// All IPv6 children that use global unicast address as it's source address
// should be destroyed now. The survivers are those use the link-local address
@@ -118,7 +118,7 @@ Ip6ConfigOnPolicyChanged (
NULL,
0
);
if (IpSb->Controller != NULL && Recovery) {
//
// ConnectController() to recover the upper layer network stacks.
@@ -726,7 +726,7 @@ Ip6ConfigSetPolicy (
DataItem->DataSize = 0;
DataItem->Status = EFI_NOT_FOUND;
NetMapIterate (&DataItem->EventMap, Ip6ConfigSignalEvent, NULL);
if (NewPolicy == Ip6ConfigPolicyManual) {
//
// The policy is changed from automatic to manual. Stop the DHCPv6 process
@@ -1546,7 +1546,7 @@ Ip6ConfigSetDnsServer (
}
} else {
//
// DataSize is 0 and Data is NULL, clean up the DnsServer address.
// DataSize is 0 and Data is NULL, clean up the DnsServer address.
//
if (Item->Data.Ptr != NULL) {
FreePool (Item->Data.Ptr);
@@ -1965,7 +1965,7 @@ Ip6ConfigOnDhcp6SbInstalled (
network stack was set successfully.
@retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
- This is NULL.
- One or more fields in Data and DataSizedo not match the
- One or more fields in Data and DataSizedo not match the
requirement of the data type indicated by DataType.
@retval EFI_WRITE_PROTECTED The specified configuration data is read-only or the specified
configuration data cannot be set under the current policy.

View File

@@ -1,7 +1,7 @@
/** @file
Definitions for EFI IPv6 Configuartion Protocol implementation.
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -70,7 +70,7 @@ typedef struct _IP6_CONFIG_INSTANCE IP6_CONFIG_INSTANCE;
8 bytes.
@retval EFI_SUCCESS The specified configuration data for the EFI IPv6
network stack was set successfully.
**/
typedef
EFI_STATUS
@@ -87,14 +87,14 @@ EFI_STATUS
@param[in, out] DataSize On input, in bytes, the size of Data. On output, in
bytes, the size of buffer required to store the specified
configuration data.
@param[in] Data The data buffer in which the configuration data is returned.
@param[in] Data The data buffer in which the configuration data is returned.
Ignored if DataSize is ZERO.
@retval EFI_BUFFER_TOO_SMALL The size of Data is too small for the specified
configuration data, and the required size is
configuration data, and the required size is
returned in DataSize.
@retval EFI_SUCCESS The specified configuration data was obtained successfully.
@retval EFI_SUCCESS The specified configuration data was obtained successfully.
**/
typedef
EFI_STATUS
@@ -162,9 +162,9 @@ typedef struct {
} IP6_ADDRESS_INFO_ENTRY;
typedef struct {
EFI_IP6_CONFIG_POLICY Policy; ///< manual or automatic
EFI_IP6_CONFIG_POLICY Policy; ///< manual or automatic
EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS DadTransmitCount; ///< dad transmits count
EFI_IP6_CONFIG_INTERFACE_ID InterfaceId; ///< alternative interface id
EFI_IP6_CONFIG_INTERFACE_ID InterfaceId; ///< alternative interface id
LIST_ENTRY ManualAddress; ///< IP addresses
UINT32 ManualAddressCount; ///< IP addresses count
LIST_ENTRY GatewayAddress; ///< Gateway address
@@ -236,13 +236,13 @@ Ip6ConfigReadConfigData (
/**
The event process routine when the DHCPv6 server is answered with a reply packet
for an information request.
@param[in] This Points to the EFI_DHCP6_PROTOCOL.
@param[in] Context The pointer to the IP6 configuration instance data.
@param[in] Packet The DHCPv6 reply packet.
@retval EFI_SUCCESS The DNS server address was retrieved from the reply packet.
@retval EFI_NOT_READY The reply packet does not contain the DNS server option, or
@retval EFI_NOT_READY The reply packet does not contain the DNS server option, or
the DNS server address is not valid.
**/
@@ -256,7 +256,7 @@ Ip6ConfigOnDhcp6Reply (
/**
The work function to trigger the DHCPv6 process to perform a stateful autoconfiguration.
@param[in] Instance Pointer to the IP6 config instance data.
@param[in] OtherInfoOnly If FALSE, get stateful address and other information
via DHCPv6. Otherwise, only get the other information.
@@ -275,10 +275,10 @@ Ip6ConfigStartStatefulAutoConfig (
Initialize an IP6_CONFIG_INSTANCE.
@param[out] Instance The buffer of IP6_CONFIG_INSTANCE to be initialized.
@retval EFI_OUT_OF_RESOURCES Failed to allocate resources to complete the operation.
@retval EFI_SUCCESS The IP6_CONFIG_INSTANCE initialized successfully.
**/
EFI_STATUS
Ip6ConfigInitInstance (
@@ -289,7 +289,7 @@ Ip6ConfigInitInstance (
Release an IP6_CONFIG_INSTANCE.
@param[in, out] Instance The buffer of IP6_CONFIG_INSTANCE to be freed.
**/
VOID
Ip6ConfigCleanInstance (
@@ -303,7 +303,7 @@ Ip6ConfigCleanInstance (
@retval EFI_SUCCESS The child was successfully destroyed.
@retval Others Failed to destroy the child.
**/
EFI_STATUS
Ip6ConfigDestroyDhcp6 (

View File

@@ -1,7 +1,7 @@
/** @file
Helper functions for configuring or obtaining the parameters relating to IP6.
Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -994,7 +994,7 @@ Exit:
/**
Convert IFR data into IP6 configuration data. The policy, alternative interface
ID, and DAD transmit counts, and will be saved.
ID, and DAD transmit counts, and will be saved.
@param[in] IfrNvData The IFR NV data.
@param[in, out] Instance The IP6 config instance data.
@@ -1541,7 +1541,7 @@ Ip6GetCurrentSetting (
EFI_STATUS Status;
CHAR16 PortString[ADDRESS_STR_MAX_SIZE];
EFI_IP6_CONFIG_INTERFACE_INFO *IfInfo;
Ip6Config = &Instance->Ip6Config;
HiiHandle = Instance->CallbackInfo.RegisteredHandle;
@@ -1794,7 +1794,7 @@ Ip6FormCallback (
}
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
break;
case KEY_INTERFACE_ID:
Status = Ip6ParseInterfaceIdFromString (IfrNvData->InterfaceId, &Ip6NvData->InterfaceId);
if (EFI_ERROR (Status)) {
@@ -1805,9 +1805,9 @@ Ip6FormCallback (
NULL
);
}
break;
case KEY_MANUAL_ADDRESS:
Status = Ip6ParseAddressListFromString (
IfrNvData->ManualAddress,
@@ -1822,9 +1822,9 @@ Ip6FormCallback (
NULL
);
}
break;
case KEY_GATEWAY_ADDRESS:
Status = Ip6ParseAddressListFromString (
IfrNvData->GatewayAddress,
@@ -1839,9 +1839,9 @@ Ip6FormCallback (
NULL
);
}
break;
case KEY_DNS_ADDRESS:
Status = Ip6ParseAddressListFromString (
IfrNvData->DnsAddress,
@@ -1856,7 +1856,7 @@ Ip6FormCallback (
NULL
);
}
break;
default:

View File

@@ -1,7 +1,7 @@
/** @file
The driver binding and service binding protocol for IP6 driver.
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
This program and the accompanying materials
@@ -182,7 +182,7 @@ Ip6CleanService (
Status = Ip6LeaveGroup (IpSb, &AllNodes);
if (EFI_ERROR (Status)) {
return Status;
}
}
}
if (IpSb->DefaultInterface != NULL) {
@@ -568,14 +568,14 @@ Ip6DriverBindingStart (
}
//
// Read the config data from NV variable again.
// Read the config data from NV variable again.
// The default data can be changed by other drivers.
//
Status = Ip6ConfigReadConfigData (IpSb->MacString, &IpSb->Ip6ConfigInstance);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
//
// If there is any default manual address, set it.
//
@@ -638,7 +638,7 @@ Ip6DriverBindingStart (
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
}
//
// Initialize the IP6 ID
@@ -655,7 +655,7 @@ ON_ERROR:
/**
Callback function which provided by user to remove one node in NetDestroyLinkList process.
@param[in] Entry The entry to be removed.
@param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
@@ -786,7 +786,7 @@ Ip6DriverBindingStop (
FreePool (IpSb);
Status = EFI_SUCCESS;
}
Exit:
return Status;
}

View File

@@ -1,13 +1,13 @@
## @file
# Basic IPv6 packet I/O Service.
#
# This module provides basic network IPv6 packet I/O services which includes support for
# Neighbor Discovery Protocol (ND), Multicast Listener Discovery Protocol (MLD),
# and a subset of the Internet Control Message Protocol (ICMPv6). This driver
#
# This module provides basic network IPv6 packet I/O services which includes support for
# Neighbor Discovery Protocol (ND), Multicast Listener Discovery Protocol (MLD),
# and a subset of the Internet Control Message Protocol (ICMPv6). This driver
# also provides the mechanism to set and get various types of configurations for
# the EFI IPv6 network stack.
#
# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License

View File

@@ -7,13 +7,13 @@
// also provides the mechanism to set and get various types of configurations for
// the EFI IPv6 network stack.
//
// Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
//
// 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.
//

Some files were not shown because too many files have changed in this diff Show More