Fix CRLF format

Signed-off-by: Tian, Hot <hot.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15155 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Tian, Hot
2014-01-22 08:38:50 +00:00
committed by hhtian
parent 4c8f6044a2
commit 4b738c76f5
10 changed files with 4723 additions and 4723 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,162 +1,162 @@
/** @file /** @file
This file is used to implement the EFI_DISK_INFO_PROTOCOL interface.. This file is used to implement the EFI_DISK_INFO_PROTOCOL interface..
Copyright (c) 2013, Intel Corporation. All rights reserved.<BR> Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php. http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
#include "NvmExpress.h" #include "NvmExpress.h"
EFI_DISK_INFO_PROTOCOL gNvmExpressDiskInfoProtocolTemplate = { EFI_DISK_INFO_PROTOCOL gNvmExpressDiskInfoProtocolTemplate = {
EFI_DISK_INFO_NVME_INTERFACE_GUID, EFI_DISK_INFO_NVME_INTERFACE_GUID,
NvmExpressDiskInfoInquiry, NvmExpressDiskInfoInquiry,
NvmExpressDiskInfoIdentify, NvmExpressDiskInfoIdentify,
NvmExpressDiskInfoSenseData, NvmExpressDiskInfoSenseData,
NvmExpressDiskInfoWhichIde NvmExpressDiskInfoWhichIde
}; };
/** /**
Initialize the installation of DiskInfo protocol. Initialize the installation of DiskInfo protocol.
This function prepares for the installation of DiskInfo protocol on the child handle. This function prepares for the installation of DiskInfo protocol on the child handle.
By default, it installs DiskInfo protocol with NVME interface GUID. By default, it installs DiskInfo protocol with NVME interface GUID.
@param[in] Device The pointer of NVME_DEVICE_PRIVATE_DATA. @param[in] Device The pointer of NVME_DEVICE_PRIVATE_DATA.
**/ **/
VOID VOID
InitializeDiskInfo ( InitializeDiskInfo (
IN NVME_DEVICE_PRIVATE_DATA *Device IN NVME_DEVICE_PRIVATE_DATA *Device
) )
{ {
CopyMem (&Device->DiskInfo, &gNvmExpressDiskInfoProtocolTemplate, sizeof (EFI_DISK_INFO_PROTOCOL)); CopyMem (&Device->DiskInfo, &gNvmExpressDiskInfoProtocolTemplate, sizeof (EFI_DISK_INFO_PROTOCOL));
} }
/** /**
Provides inquiry information for the controller type. Provides inquiry information for the controller type.
This function is used to get inquiry data. Data format This function is used to get inquiry data. Data format
of Identify data is defined by the Interface GUID. of Identify data is defined by the Interface GUID.
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance. @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
@param[in, out] InquiryData Pointer to a buffer for the inquiry data. @param[in, out] InquiryData Pointer to a buffer for the inquiry data.
@param[in, out] InquiryDataSize Pointer to the value for the inquiry data size. @param[in, out] InquiryDataSize Pointer to the value for the inquiry data size.
@retval EFI_SUCCESS The command was accepted without any errors. @retval EFI_SUCCESS The command was accepted without any errors.
@retval EFI_NOT_FOUND Device does not support this data class @retval EFI_NOT_FOUND Device does not support this data class
@retval EFI_DEVICE_ERROR Error reading InquiryData from device @retval EFI_DEVICE_ERROR Error reading InquiryData from device
@retval EFI_BUFFER_TOO_SMALL InquiryDataSize not big enough @retval EFI_BUFFER_TOO_SMALL InquiryDataSize not big enough
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
NvmExpressDiskInfoInquiry ( NvmExpressDiskInfoInquiry (
IN EFI_DISK_INFO_PROTOCOL *This, IN EFI_DISK_INFO_PROTOCOL *This,
IN OUT VOID *InquiryData, IN OUT VOID *InquiryData,
IN OUT UINT32 *InquiryDataSize IN OUT UINT32 *InquiryDataSize
) )
{ {
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
/** /**
Provides identify information for the controller type. Provides identify information for the controller type.
This function is used to get identify data. Data format This function is used to get identify data. Data format
of Identify data is defined by the Interface GUID. of Identify data is defined by the Interface GUID.
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL
instance. instance.
@param[in, out] IdentifyData Pointer to a buffer for the identify data. @param[in, out] IdentifyData Pointer to a buffer for the identify data.
@param[in, out] IdentifyDataSize Pointer to the value for the identify data @param[in, out] IdentifyDataSize Pointer to the value for the identify data
size. size.
@retval EFI_SUCCESS The command was accepted without any errors. @retval EFI_SUCCESS The command was accepted without any errors.
@retval EFI_NOT_FOUND Device does not support this data class @retval EFI_NOT_FOUND Device does not support this data class
@retval EFI_DEVICE_ERROR Error reading IdentifyData from device @retval EFI_DEVICE_ERROR Error reading IdentifyData from device
@retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough @retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
NvmExpressDiskInfoIdentify ( NvmExpressDiskInfoIdentify (
IN EFI_DISK_INFO_PROTOCOL *This, IN EFI_DISK_INFO_PROTOCOL *This,
IN OUT VOID *IdentifyData, IN OUT VOID *IdentifyData,
IN OUT UINT32 *IdentifyDataSize IN OUT UINT32 *IdentifyDataSize
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
NVME_DEVICE_PRIVATE_DATA *Device; NVME_DEVICE_PRIVATE_DATA *Device;
Device = NVME_DEVICE_PRIVATE_DATA_FROM_DISK_INFO (This); Device = NVME_DEVICE_PRIVATE_DATA_FROM_DISK_INFO (This);
Status = EFI_BUFFER_TOO_SMALL; Status = EFI_BUFFER_TOO_SMALL;
if (*IdentifyDataSize >= sizeof (Device->NamespaceData)) { if (*IdentifyDataSize >= sizeof (Device->NamespaceData)) {
Status = EFI_SUCCESS; Status = EFI_SUCCESS;
CopyMem (IdentifyData, &Device->NamespaceData, sizeof (Device->NamespaceData)); CopyMem (IdentifyData, &Device->NamespaceData, sizeof (Device->NamespaceData));
} }
*IdentifyDataSize = sizeof (Device->NamespaceData); *IdentifyDataSize = sizeof (Device->NamespaceData);
return Status; return Status;
} }
/** /**
Provides sense data information for the controller type. Provides sense data information for the controller type.
This function is used to get sense data. This function is used to get sense data.
Data format of Sense data is defined by the Interface GUID. Data format of Sense data is defined by the Interface GUID.
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance. @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
@param[in, out] SenseData Pointer to the SenseData. @param[in, out] SenseData Pointer to the SenseData.
@param[in, out] SenseDataSize Size of SenseData in bytes. @param[in, out] SenseDataSize Size of SenseData in bytes.
@param[out] SenseDataNumber Pointer to the value for the sense data size. @param[out] SenseDataNumber Pointer to the value for the sense data size.
@retval EFI_SUCCESS The command was accepted without any errors. @retval EFI_SUCCESS The command was accepted without any errors.
@retval EFI_NOT_FOUND Device does not support this data class. @retval EFI_NOT_FOUND Device does not support this data class.
@retval EFI_DEVICE_ERROR Error reading SenseData from device. @retval EFI_DEVICE_ERROR Error reading SenseData from device.
@retval EFI_BUFFER_TOO_SMALL SenseDataSize not big enough. @retval EFI_BUFFER_TOO_SMALL SenseDataSize not big enough.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
NvmExpressDiskInfoSenseData ( NvmExpressDiskInfoSenseData (
IN EFI_DISK_INFO_PROTOCOL *This, IN EFI_DISK_INFO_PROTOCOL *This,
IN OUT VOID *SenseData, IN OUT VOID *SenseData,
IN OUT UINT32 *SenseDataSize, IN OUT UINT32 *SenseDataSize,
OUT UINT8 *SenseDataNumber OUT UINT8 *SenseDataNumber
) )
{ {
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
/** /**
This function is used to get controller information. This function is used to get controller information.
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance. @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
@param[out] IdeChannel Pointer to the Ide Channel number. Primary or secondary. @param[out] IdeChannel Pointer to the Ide Channel number. Primary or secondary.
@param[out] IdeDevice Pointer to the Ide Device number. Master or slave. @param[out] IdeDevice Pointer to the Ide Device number. Master or slave.
@retval EFI_SUCCESS IdeChannel and IdeDevice are valid. @retval EFI_SUCCESS IdeChannel and IdeDevice are valid.
@retval EFI_UNSUPPORTED This is not an IDE device. @retval EFI_UNSUPPORTED This is not an IDE device.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
NvmExpressDiskInfoWhichIde ( NvmExpressDiskInfoWhichIde (
IN EFI_DISK_INFO_PROTOCOL *This, IN EFI_DISK_INFO_PROTOCOL *This,
OUT UINT32 *IdeChannel, OUT UINT32 *IdeChannel,
OUT UINT32 *IdeDevice OUT UINT32 *IdeDevice
) )
{ {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }

View File

@ -1,129 +1,129 @@
/** @file /** @file
Header file for EFI_DISK_INFO_PROTOCOL interface. Header file for EFI_DISK_INFO_PROTOCOL interface.
Copyright (c) 2013, Intel Corporation. All rights reserved.<BR> Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
#ifndef _NVME_DISKINFO_H_ #ifndef _NVME_DISKINFO_H_
#define _NVME_DISKINFO_H_ #define _NVME_DISKINFO_H_
/** /**
Initialize the installation of DiskInfo protocol. Initialize the installation of DiskInfo protocol.
This function prepares for the installation of DiskInfo protocol on the child handle. This function prepares for the installation of DiskInfo protocol on the child handle.
By default, it installs DiskInfo protocol with NVME interface GUID. By default, it installs DiskInfo protocol with NVME interface GUID.
@param[in] Device The pointer of NVME_DEVICE_PRIVATE_DATA. @param[in] Device The pointer of NVME_DEVICE_PRIVATE_DATA.
**/ **/
VOID VOID
InitializeDiskInfo ( InitializeDiskInfo (
IN NVME_DEVICE_PRIVATE_DATA *Device IN NVME_DEVICE_PRIVATE_DATA *Device
); );
/** /**
Provides inquiry information for the controller type. Provides inquiry information for the controller type.
This function is used to get inquiry data. Data format This function is used to get inquiry data. Data format
of Identify data is defined by the Interface GUID. of Identify data is defined by the Interface GUID.
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance. @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
@param[in, out] InquiryData Pointer to a buffer for the inquiry data. @param[in, out] InquiryData Pointer to a buffer for the inquiry data.
@param[in, out] InquiryDataSize Pointer to the value for the inquiry data size. @param[in, out] InquiryDataSize Pointer to the value for the inquiry data size.
@retval EFI_SUCCESS The command was accepted without any errors. @retval EFI_SUCCESS The command was accepted without any errors.
@retval EFI_NOT_FOUND Device does not support this data class @retval EFI_NOT_FOUND Device does not support this data class
@retval EFI_DEVICE_ERROR Error reading InquiryData from device @retval EFI_DEVICE_ERROR Error reading InquiryData from device
@retval EFI_BUFFER_TOO_SMALL InquiryDataSize not big enough @retval EFI_BUFFER_TOO_SMALL InquiryDataSize not big enough
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
NvmExpressDiskInfoInquiry ( NvmExpressDiskInfoInquiry (
IN EFI_DISK_INFO_PROTOCOL *This, IN EFI_DISK_INFO_PROTOCOL *This,
IN OUT VOID *InquiryData, IN OUT VOID *InquiryData,
IN OUT UINT32 *InquiryDataSize IN OUT UINT32 *InquiryDataSize
); );
/** /**
Provides identify information for the controller type. Provides identify information for the controller type.
This function is used to get identify data. Data format This function is used to get identify data. Data format
of Identify data is defined by the Interface GUID. of Identify data is defined by the Interface GUID.
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL
instance. instance.
@param[in, out] IdentifyData Pointer to a buffer for the identify data. @param[in, out] IdentifyData Pointer to a buffer for the identify data.
@param[in, out] IdentifyDataSize Pointer to the value for the identify data @param[in, out] IdentifyDataSize Pointer to the value for the identify data
size. size.
@retval EFI_SUCCESS The command was accepted without any errors. @retval EFI_SUCCESS The command was accepted without any errors.
@retval EFI_NOT_FOUND Device does not support this data class @retval EFI_NOT_FOUND Device does not support this data class
@retval EFI_DEVICE_ERROR Error reading IdentifyData from device @retval EFI_DEVICE_ERROR Error reading IdentifyData from device
@retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough @retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
NvmExpressDiskInfoIdentify ( NvmExpressDiskInfoIdentify (
IN EFI_DISK_INFO_PROTOCOL *This, IN EFI_DISK_INFO_PROTOCOL *This,
IN OUT VOID *IdentifyData, IN OUT VOID *IdentifyData,
IN OUT UINT32 *IdentifyDataSize IN OUT UINT32 *IdentifyDataSize
); );
/** /**
Provides sense data information for the controller type. Provides sense data information for the controller type.
This function is used to get sense data. This function is used to get sense data.
Data format of Sense data is defined by the Interface GUID. Data format of Sense data is defined by the Interface GUID.
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance. @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
@param[in, out] SenseData Pointer to the SenseData. @param[in, out] SenseData Pointer to the SenseData.
@param[in, out] SenseDataSize Size of SenseData in bytes. @param[in, out] SenseDataSize Size of SenseData in bytes.
@param[out] SenseDataNumber Pointer to the value for the sense data size. @param[out] SenseDataNumber Pointer to the value for the sense data size.
@retval EFI_SUCCESS The command was accepted without any errors. @retval EFI_SUCCESS The command was accepted without any errors.
@retval EFI_NOT_FOUND Device does not support this data class. @retval EFI_NOT_FOUND Device does not support this data class.
@retval EFI_DEVICE_ERROR Error reading SenseData from device. @retval EFI_DEVICE_ERROR Error reading SenseData from device.
@retval EFI_BUFFER_TOO_SMALL SenseDataSize not big enough. @retval EFI_BUFFER_TOO_SMALL SenseDataSize not big enough.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
NvmExpressDiskInfoSenseData ( NvmExpressDiskInfoSenseData (
IN EFI_DISK_INFO_PROTOCOL *This, IN EFI_DISK_INFO_PROTOCOL *This,
IN OUT VOID *SenseData, IN OUT VOID *SenseData,
IN OUT UINT32 *SenseDataSize, IN OUT UINT32 *SenseDataSize,
OUT UINT8 *SenseDataNumber OUT UINT8 *SenseDataNumber
); );
/** /**
This function is used to get controller information. This function is used to get controller information.
@param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance. @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
@param[out] IdeChannel Pointer to the Ide Channel number. Primary or secondary. @param[out] IdeChannel Pointer to the Ide Channel number. Primary or secondary.
@param[out] IdeDevice Pointer to the Ide Device number. Master or slave. @param[out] IdeDevice Pointer to the Ide Device number. Master or slave.
@retval EFI_SUCCESS IdeChannel and IdeDevice are valid. @retval EFI_SUCCESS IdeChannel and IdeDevice are valid.
@retval EFI_UNSUPPORTED This is not an IDE device. @retval EFI_UNSUPPORTED This is not an IDE device.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
NvmExpressDiskInfoWhichIde ( NvmExpressDiskInfoWhichIde (
IN EFI_DISK_INFO_PROTOCOL *This, IN EFI_DISK_INFO_PROTOCOL *This,
OUT UINT32 *IdeChannel, OUT UINT32 *IdeChannel,
OUT UINT32 *IdeDevice OUT UINT32 *IdeDevice
); );
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@ -11,23 +11,23 @@ http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
#ifndef _TCP_IO_H_ #ifndef _TCP_IO_H_
#define _TCP_IO_H_ #define _TCP_IO_H_
#include <Protocol/Tcp4.h> #include <Protocol/Tcp4.h>
#include <Protocol/Tcp6.h> #include <Protocol/Tcp6.h>
#include <Library/NetLib.h> #include <Library/NetLib.h>
#define TCP_VERSION_4 IP_VERSION_4 #define TCP_VERSION_4 IP_VERSION_4
#define TCP_VERSION_6 IP_VERSION_6 #define TCP_VERSION_6 IP_VERSION_6
/// ///
/// 10 seconds /// 10 seconds
/// ///
#define TCP_GET_MAPPING_TIMEOUT 100000000U #define TCP_GET_MAPPING_TIMEOUT 100000000U
@ -40,12 +40,12 @@ typedef struct {
EFI_IPv4_ADDRESS RemoteIp; EFI_IPv4_ADDRESS RemoteIp;
UINT16 RemotePort; UINT16 RemotePort;
BOOLEAN ActiveFlag; BOOLEAN ActiveFlag;
} TCP4_IO_CONFIG_DATA; } TCP4_IO_CONFIG_DATA;
typedef struct { typedef struct {
UINT16 StationPort; UINT16 StationPort;
EFI_IPv6_ADDRESS RemoteIp; EFI_IPv6_ADDRESS RemoteIp;
UINT16 RemotePort; UINT16 RemotePort;
BOOLEAN ActiveFlag; BOOLEAN ActiveFlag;
} TCP6_IO_CONFIG_DATA; } TCP6_IO_CONFIG_DATA;
@ -112,7 +112,7 @@ typedef struct {
@retval EFI_SUCCESS The TCP socket is created and configured. @retval EFI_SUCCESS The TCP socket is created and configured.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid. @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_UNSUPPORTED One or more of the control options are not @retval EFI_UNSUPPORTED One or more of the control options are not
supported in the implementation. supported in the implementation.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory. @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
@retval Others Failed to create the TCP socket or configure it. @retval Others Failed to create the TCP socket or configure it.
@ -120,26 +120,26 @@ typedef struct {
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
TcpIoCreateSocket ( TcpIoCreateSocket (
IN EFI_HANDLE Image, IN EFI_HANDLE Image,
IN EFI_HANDLE Controller, IN EFI_HANDLE Controller,
IN UINT8 TcpVersion, IN UINT8 TcpVersion,
IN TCP_IO_CONFIG_DATA *ConfigData, IN TCP_IO_CONFIG_DATA *ConfigData,
OUT TCP_IO *TcpIo OUT TCP_IO *TcpIo
); );
/** /**
Destroy the socket. Destroy the socket.
@param[in] TcpIo The TcpIo which wraps the socket to be destroyed. @param[in] TcpIo The TcpIo which wraps the socket to be destroyed.
**/ **/
VOID VOID
EFIAPI EFIAPI
TcpIoDestroySocket ( TcpIoDestroySocket (
IN TCP_IO *TcpIo IN TCP_IO *TcpIo
); );
/** /**
Connect to the other endpoint of the TCP socket. Connect to the other endpoint of the TCP socket.
@ -156,12 +156,12 @@ TcpIoDestroySocket (
@retval Others Other errors as indicated. @retval Others Other errors as indicated.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
TcpIoConnect ( TcpIoConnect (
IN OUT TCP_IO *TcpIo, IN OUT TCP_IO *TcpIo,
IN EFI_EVENT Timeout IN EFI_EVENT Timeout
); );
/** /**
Accept the incomding request from the other endpoint of the TCP socket. Accept the incomding request from the other endpoint of the TCP socket.
@ -187,19 +187,19 @@ TcpIoAccept (
IN OUT TCP_IO *TcpIo, IN OUT TCP_IO *TcpIo,
IN EFI_EVENT Timeout IN EFI_EVENT Timeout
); );
/** /**
Reset the socket. Reset the socket.
@param[in, out] TcpIo The TcpIo wrapping the TCP socket. @param[in, out] TcpIo The TcpIo wrapping the TCP socket.
**/ **/
VOID VOID
EFIAPI EFIAPI
TcpIoReset ( TcpIoReset (
IN OUT TCP_IO *TcpIo IN OUT TCP_IO *TcpIo
); );
/** /**
Transmit the Packet to the other endpoint of the socket. Transmit the Packet to the other endpoint of the socket.
@ -215,13 +215,13 @@ TcpIoReset (
@retval Others Other errors as indicated. @retval Others Other errors as indicated.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
TcpIoTransmit ( TcpIoTransmit (
IN TCP_IO *TcpIo, IN TCP_IO *TcpIo,
IN NET_BUF *Packet IN NET_BUF *Packet
); );
/** /**
Receive data from the socket. Receive data from the socket.
@ -240,14 +240,14 @@ TcpIoTransmit (
@retval Others Other errors as indicated. @retval Others Other errors as indicated.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
TcpIoReceive ( TcpIoReceive (
IN OUT TCP_IO *TcpIo, IN OUT TCP_IO *TcpIo,
IN NET_BUF *Packet, IN NET_BUF *Packet,
IN BOOLEAN AsyncMode, IN BOOLEAN AsyncMode,
IN EFI_EVENT Timeout IN EFI_EVENT Timeout
); );
#endif #endif

View File

@ -22,92 +22,92 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/MemoryAllocationLib.h> #include <Library/MemoryAllocationLib.h>
#include <Library/BaseMemoryLib.h> #include <Library/BaseMemoryLib.h>
/** /**
The common notify function associated with various TcpIo events. The common notify function associated with various TcpIo events.
@param[in] Event The event signaled. @param[in] Event The event signaled.
@param[in] Context The context. @param[in] Context The context.
**/ **/
VOID VOID
EFIAPI EFIAPI
TcpIoCommonNotify ( TcpIoCommonNotify (
IN EFI_EVENT Event, IN EFI_EVENT Event,
IN VOID *Context IN VOID *Context
) )
{ {
if ((Event == NULL) || (Context == NULL)) { if ((Event == NULL) || (Context == NULL)) {
return ; return ;
} }
*((BOOLEAN *) Context) = TRUE; *((BOOLEAN *) Context) = TRUE;
} }
/** /**
The internal function for delay configuring TCP6 when IP6 driver is still in DAD. The internal function for delay configuring TCP6 when IP6 driver is still in DAD.
@param[in] Tcp6 The EFI_TCP6_PROTOCOL protocol instance. @param[in] Tcp6 The EFI_TCP6_PROTOCOL protocol instance.
@param[in] Tcp6ConfigData The Tcp6 configuration data. @param[in] Tcp6ConfigData The Tcp6 configuration data.
@retval EFI_SUCCESS The operational settings successfully @retval EFI_SUCCESS The operational settings successfully
completed. completed.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid. @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval Others Failed to finish the operation. @retval Others Failed to finish the operation.
**/ **/
EFI_STATUS EFI_STATUS
TcpIoGetMapping ( TcpIoGetMapping (
IN EFI_TCP6_PROTOCOL *Tcp6, IN EFI_TCP6_PROTOCOL *Tcp6,
IN EFI_TCP6_CONFIG_DATA *Tcp6ConfigData IN EFI_TCP6_CONFIG_DATA *Tcp6ConfigData
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_EVENT Event; EFI_EVENT Event;
if ((Tcp6 == NULL) || (Tcp6ConfigData == NULL)) { if ((Tcp6 == NULL) || (Tcp6ConfigData == NULL)) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
Event = NULL; Event = NULL;
Status = gBS->CreateEvent ( Status = gBS->CreateEvent (
EVT_TIMER, EVT_TIMER,
TPL_CALLBACK, TPL_CALLBACK,
NULL, NULL,
NULL, NULL,
&Event &Event
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
goto ON_EXIT; goto ON_EXIT;
} }
Status = gBS->SetTimer ( Status = gBS->SetTimer (
Event, Event,
TimerRelative, TimerRelative,
TCP_GET_MAPPING_TIMEOUT TCP_GET_MAPPING_TIMEOUT
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
goto ON_EXIT; goto ON_EXIT;
} }
while (EFI_ERROR (gBS->CheckEvent (Event))) { while (EFI_ERROR (gBS->CheckEvent (Event))) {
Tcp6->Poll (Tcp6); Tcp6->Poll (Tcp6);
Status = Tcp6->Configure (Tcp6, Tcp6ConfigData); Status = Tcp6->Configure (Tcp6, Tcp6ConfigData);
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
break; break;
} }
} }
ON_EXIT: ON_EXIT:
if (Event != NULL) { if (Event != NULL) {
gBS->CloseEvent (Event); gBS->CloseEvent (Event);
} }
return Status; return Status;
} }
/** /**
@ -121,7 +121,7 @@ ON_EXIT:
@retval EFI_SUCCESS The TCP socket is created and configured. @retval EFI_SUCCESS The TCP socket is created and configured.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid. @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_UNSUPPORTED One or more of the control options are not @retval EFI_UNSUPPORTED One or more of the control options are not
supported in the implementation. supported in the implementation.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory. @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
@retval Others Failed to create the TCP socket or configure it. @retval Others Failed to create the TCP socket or configure it.
@ -177,26 +177,26 @@ TcpIoCreateSocket (
// //
// Create the TCP child instance and get the TCP protocol. // Create the TCP child instance and get the TCP protocol.
// //
Status = NetLibCreateServiceChild ( Status = NetLibCreateServiceChild (
Controller, Controller,
Image, Image,
ServiceBindingGuid, ServiceBindingGuid,
&TcpIo->Handle &TcpIo->Handle
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
return Status; return Status;
} }
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
TcpIo->Handle, TcpIo->Handle,
ProtocolGuid, ProtocolGuid,
Interface, Interface,
Image, Image,
Controller, Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER EFI_OPEN_PROTOCOL_BY_DRIVER
); );
if (EFI_ERROR (Status) || (*Interface == NULL)) { if (EFI_ERROR (Status) || (*Interface == NULL)) {
goto ON_ERROR; goto ON_ERROR;
} }
if (TcpVersion == TCP_VERSION_4) { if (TcpVersion == TCP_VERSION_4) {
@ -204,28 +204,28 @@ TcpIoCreateSocket (
} else { } else {
Tcp6 = TcpIo->Tcp.Tcp6; Tcp6 = TcpIo->Tcp.Tcp6;
} }
TcpIo->Image = Image; TcpIo->Image = Image;
TcpIo->Controller = Controller; TcpIo->Controller = Controller;
// //
// Set the configuration parameters. // Set the configuration parameters.
// //
ControlOption.ReceiveBufferSize = 0x200000; ControlOption.ReceiveBufferSize = 0x200000;
ControlOption.SendBufferSize = 0x200000; ControlOption.SendBufferSize = 0x200000;
ControlOption.MaxSynBackLog = 0; ControlOption.MaxSynBackLog = 0;
ControlOption.ConnectionTimeout = 0; ControlOption.ConnectionTimeout = 0;
ControlOption.DataRetries = 6; ControlOption.DataRetries = 6;
ControlOption.FinTimeout = 0; ControlOption.FinTimeout = 0;
ControlOption.TimeWaitTimeout = 0; ControlOption.TimeWaitTimeout = 0;
ControlOption.KeepAliveProbes = 4; ControlOption.KeepAliveProbes = 4;
ControlOption.KeepAliveTime = 0; ControlOption.KeepAliveTime = 0;
ControlOption.KeepAliveInterval = 0; ControlOption.KeepAliveInterval = 0;
ControlOption.EnableNagle = FALSE; ControlOption.EnableNagle = FALSE;
ControlOption.EnableTimeStamp = FALSE; ControlOption.EnableTimeStamp = FALSE;
ControlOption.EnableWindowScaling = TRUE; ControlOption.EnableWindowScaling = TRUE;
ControlOption.EnableSelectiveAck = FALSE; ControlOption.EnableSelectiveAck = FALSE;
ControlOption.EnablePathMtuDiscovery = FALSE; ControlOption.EnablePathMtuDiscovery = FALSE;
if (TcpVersion == TCP_VERSION_4) { if (TcpVersion == TCP_VERSION_4) {
Tcp4ConfigData.TypeOfService = 8; Tcp4ConfigData.TypeOfService = 8;
@ -309,59 +309,59 @@ TcpIoCreateSocket (
} }
} }
// //
// Create events for variuos asynchronous operations. // Create events for variuos asynchronous operations.
// //
Status = gBS->CreateEvent ( Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL, EVT_NOTIFY_SIGNAL,
TPL_NOTIFY, TPL_NOTIFY,
TcpIoCommonNotify, TcpIoCommonNotify,
&TcpIo->IsConnDone, &TcpIo->IsConnDone,
&Event &Event
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
goto ON_ERROR; goto ON_ERROR;
} }
TcpIo->ConnToken.Tcp4Token.CompletionToken.Event = Event; TcpIo->ConnToken.Tcp4Token.CompletionToken.Event = Event;
Status = gBS->CreateEvent ( Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL, EVT_NOTIFY_SIGNAL,
TPL_NOTIFY, TPL_NOTIFY,
TcpIoCommonNotify, TcpIoCommonNotify,
&TcpIo->IsListenDone, &TcpIo->IsListenDone,
&Event &Event
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
goto ON_ERROR; goto ON_ERROR;
} }
TcpIo->ListenToken.Tcp4Token.CompletionToken.Event = Event; TcpIo->ListenToken.Tcp4Token.CompletionToken.Event = Event;
Status = gBS->CreateEvent ( Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL, EVT_NOTIFY_SIGNAL,
TPL_NOTIFY, TPL_NOTIFY,
TcpIoCommonNotify, TcpIoCommonNotify,
&TcpIo->IsTxDone, &TcpIo->IsTxDone,
&Event &Event
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
goto ON_ERROR; goto ON_ERROR;
} }
TcpIo->TxToken.Tcp4Token.CompletionToken.Event = Event; TcpIo->TxToken.Tcp4Token.CompletionToken.Event = Event;
Status = gBS->CreateEvent ( Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL, EVT_NOTIFY_SIGNAL,
TPL_NOTIFY, TPL_NOTIFY,
TcpIoCommonNotify, TcpIoCommonNotify,
&TcpIo->IsRxDone, &TcpIo->IsRxDone,
&Event &Event
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
goto ON_ERROR; goto ON_ERROR;
} }
TcpIo->RxToken.Tcp4Token.CompletionToken.Event = Event; TcpIo->RxToken.Tcp4Token.CompletionToken.Event = Event;
@ -373,26 +373,26 @@ TcpIoCreateSocket (
TcpIo->RxToken.Tcp4Token.Packet.RxData = RxData; TcpIo->RxToken.Tcp4Token.Packet.RxData = RxData;
Status = gBS->CreateEvent ( Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL, EVT_NOTIFY_SIGNAL,
TPL_NOTIFY, TPL_NOTIFY,
TcpIoCommonNotify, TcpIoCommonNotify,
&TcpIo->IsCloseDone, &TcpIo->IsCloseDone,
&Event &Event
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
goto ON_ERROR; goto ON_ERROR;
} }
TcpIo->CloseToken.Tcp4Token.CompletionToken.Event = Event; TcpIo->CloseToken.Tcp4Token.CompletionToken.Event = Event;
return EFI_SUCCESS; return EFI_SUCCESS;
ON_ERROR: ON_ERROR:
TcpIoDestroySocket (TcpIo); TcpIoDestroySocket (TcpIo);
return Status; return Status;
} }
@ -482,7 +482,7 @@ TcpIoDestroySocket (
if ((Tcp4 != NULL) || (Tcp6 != NULL)) { if ((Tcp4 != NULL) || (Tcp6 != NULL)) {
gBS->CloseProtocol ( gBS->CloseProtocol (
TcpIo->Handle, TcpIo->Handle,
ProtocolGuid, ProtocolGuid,
TcpIo->Image, TcpIo->Image,
@ -518,7 +518,7 @@ TcpIoDestroySocket (
} }
} }
NetLibDestroyServiceChild ( NetLibDestroyServiceChild (
TcpIo->Controller, TcpIo->Controller,
TcpIo->Image, TcpIo->Image,
ServiceBindingGuid, ServiceBindingGuid,
@ -572,24 +572,24 @@ TcpIoConnect (
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
return Status; return Status;
} }
while (!TcpIo->IsConnDone && EFI_ERROR (gBS->CheckEvent (Timeout))) { while (!TcpIo->IsConnDone && EFI_ERROR (gBS->CheckEvent (Timeout))) {
if (TcpIo->TcpVersion == TCP_VERSION_4) { if (TcpIo->TcpVersion == TCP_VERSION_4) {
Tcp4->Poll (Tcp4); Tcp4->Poll (Tcp4);
} else { } else {
Tcp6->Poll (Tcp6); Tcp6->Poll (Tcp6);
} }
} }
if (!TcpIo->IsConnDone) { if (!TcpIo->IsConnDone) {
Status = EFI_TIMEOUT; Status = EFI_TIMEOUT;
} else { } else {
Status = TcpIo->ConnToken.Tcp4Token.CompletionToken.Status; Status = TcpIo->ConnToken.Tcp4Token.CompletionToken.Status;
} }
return Status; return Status;
} }
@ -642,8 +642,8 @@ TcpIoAccept (
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
return Status; return Status;
} }
while (!TcpIo->IsListenDone && EFI_ERROR (gBS->CheckEvent (Timeout))) { while (!TcpIo->IsListenDone && EFI_ERROR (gBS->CheckEvent (Timeout))) {
@ -652,18 +652,18 @@ TcpIoAccept (
} else { } else {
Tcp6->Poll (Tcp6); Tcp6->Poll (Tcp6);
} }
} }
if (!TcpIo->IsListenDone) { if (!TcpIo->IsListenDone) {
Status = EFI_TIMEOUT; Status = EFI_TIMEOUT;
} else { } else {
Status = TcpIo->ListenToken.Tcp4Token.CompletionToken.Status; Status = TcpIo->ListenToken.Tcp4Token.CompletionToken.Status;
} }
// //
// The new TCP instance handle created for the established connection is // The new TCP instance handle created for the established connection is
// in ListenToken. // in ListenToken.
// //
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
if (TcpIo->TcpVersion == TCP_VERSION_4) { if (TcpIo->TcpVersion == TCP_VERSION_4) {
ProtocolGuid = &gEfiTcp4ProtocolGuid; ProtocolGuid = &gEfiTcp4ProtocolGuid;
@ -671,16 +671,16 @@ TcpIoAccept (
ProtocolGuid = &gEfiTcp6ProtocolGuid; ProtocolGuid = &gEfiTcp6ProtocolGuid;
} }
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
TcpIo->ListenToken.Tcp4Token.NewChildHandle, TcpIo->ListenToken.Tcp4Token.NewChildHandle,
ProtocolGuid, ProtocolGuid,
(VOID **) (&TcpIo->NewTcp.Tcp4), (VOID **) (&TcpIo->NewTcp.Tcp4),
TcpIo->Image, TcpIo->Image,
TcpIo->Controller, TcpIo->Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER EFI_OPEN_PROTOCOL_BY_DRIVER
); );
} }
return Status; return Status;
} }
@ -721,10 +721,10 @@ TcpIoReset (
return ; return ;
} }
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
return ; return ;
} }
while (!TcpIo->IsCloseDone) { while (!TcpIo->IsCloseDone) {
if (TcpIo->TcpVersion == TCP_VERSION_4) { if (TcpIo->TcpVersion == TCP_VERSION_4) {
Tcp4->Poll (Tcp4); Tcp4->Poll (Tcp4);
@ -780,16 +780,16 @@ TcpIoTransmit (
Data = AllocatePool (Size); Data = AllocatePool (Size);
if (Data == NULL) { if (Data == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
((EFI_TCP4_TRANSMIT_DATA *) Data)->Push = TRUE; ((EFI_TCP4_TRANSMIT_DATA *) Data)->Push = TRUE;
((EFI_TCP4_TRANSMIT_DATA *) Data)->Urgent = FALSE; ((EFI_TCP4_TRANSMIT_DATA *) Data)->Urgent = FALSE;
((EFI_TCP4_TRANSMIT_DATA *) Data)->DataLength = Packet->TotalSize; ((EFI_TCP4_TRANSMIT_DATA *) Data)->DataLength = Packet->TotalSize;
// //
// Build the fragment table. // Build the fragment table.
// //
((EFI_TCP4_TRANSMIT_DATA *) Data)->FragmentCount = Packet->BlockOpNum; ((EFI_TCP4_TRANSMIT_DATA *) Data)->FragmentCount = Packet->BlockOpNum;
NetbufBuildExt ( NetbufBuildExt (
@ -802,8 +802,8 @@ TcpIoTransmit (
Tcp6 = NULL; Tcp6 = NULL;
Status = EFI_DEVICE_ERROR; Status = EFI_DEVICE_ERROR;
// //
// Trasnmit the packet. // Trasnmit the packet.
// //
if (TcpIo->TcpVersion == TCP_VERSION_4) { if (TcpIo->TcpVersion == TCP_VERSION_4) {
TcpIo->TxToken.Tcp4Token.Packet.TxData = (EFI_TCP4_TRANSMIT_DATA *) Data; TcpIo->TxToken.Tcp4Token.Packet.TxData = (EFI_TCP4_TRANSMIT_DATA *) Data;
@ -831,25 +831,25 @@ TcpIoTransmit (
Status = Tcp6->Transmit (Tcp6, &TcpIo->TxToken.Tcp6Token); Status = Tcp6->Transmit (Tcp6, &TcpIo->TxToken.Tcp6Token);
} }
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
goto ON_EXIT; goto ON_EXIT;
} }
while (!TcpIo->IsTxDone) { while (!TcpIo->IsTxDone) {
if (TcpIo->TcpVersion == TCP_VERSION_4) { if (TcpIo->TcpVersion == TCP_VERSION_4) {
Tcp4->Poll (Tcp4); Tcp4->Poll (Tcp4);
} else { } else {
Tcp6->Poll (Tcp6); Tcp6->Poll (Tcp6);
} }
} }
TcpIo->IsTxDone = FALSE; TcpIo->IsTxDone = FALSE;
Status = TcpIo->TxToken.Tcp4Token.CompletionToken.Status; Status = TcpIo->TxToken.Tcp4Token.CompletionToken.Status;
ON_EXIT: ON_EXIT:
FreePool (Data); FreePool (Data);
return Status; return Status;
} }
@ -926,22 +926,22 @@ TcpIoReceive (
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
FragmentCount = Packet->BlockOpNum; FragmentCount = Packet->BlockOpNum;
Fragment = AllocatePool (FragmentCount * sizeof (NET_FRAGMENT)); Fragment = AllocatePool (FragmentCount * sizeof (NET_FRAGMENT));
if (Fragment == NULL) { if (Fragment == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT; goto ON_EXIT;
} }
// //
// Build the fragment table. // Build the fragment table.
// //
NetbufBuildExt (Packet, Fragment, &FragmentCount); NetbufBuildExt (Packet, Fragment, &FragmentCount);
RxData->FragmentCount = 1; RxData->FragmentCount = 1;
CurrentFragment = 0; CurrentFragment = 0;
Status = EFI_SUCCESS; Status = EFI_SUCCESS;
while (CurrentFragment < FragmentCount) { while (CurrentFragment < FragmentCount) {
RxData->DataLength = Fragment[CurrentFragment].Len; RxData->DataLength = Fragment[CurrentFragment].Len;
RxData->FragmentTable[0].FragmentLength = Fragment[CurrentFragment].Len; RxData->FragmentTable[0].FragmentLength = Fragment[CurrentFragment].Len;
RxData->FragmentTable[0].FragmentBuffer = Fragment[CurrentFragment].Bulk; RxData->FragmentTable[0].FragmentBuffer = Fragment[CurrentFragment].Bulk;
@ -952,9 +952,9 @@ TcpIoReceive (
Status = Tcp6->Receive (Tcp6, &TcpIo->RxToken.Tcp6Token); Status = Tcp6->Receive (Tcp6, &TcpIo->RxToken.Tcp6Token);
} }
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
goto ON_EXIT; goto ON_EXIT;
} }
while (!TcpIo->IsRxDone && ((Timeout == NULL) || EFI_ERROR (gBS->CheckEvent (Timeout)))) { while (!TcpIo->IsRxDone && ((Timeout == NULL) || EFI_ERROR (gBS->CheckEvent (Timeout)))) {
// //
@ -966,42 +966,42 @@ TcpIoReceive (
Tcp6->Poll (Tcp6); Tcp6->Poll (Tcp6);
} }
} }
if (!TcpIo->IsRxDone) { if (!TcpIo->IsRxDone) {
// //
// Timeout occurs, cancel the receive request. // Timeout occurs, cancel the receive request.
// //
if (TcpIo->TcpVersion == TCP_VERSION_4) { if (TcpIo->TcpVersion == TCP_VERSION_4) {
Tcp4->Cancel (Tcp4, &TcpIo->RxToken.Tcp4Token.CompletionToken); Tcp4->Cancel (Tcp4, &TcpIo->RxToken.Tcp4Token.CompletionToken);
} else { } else {
Tcp6->Cancel (Tcp6, &TcpIo->RxToken.Tcp6Token.CompletionToken); Tcp6->Cancel (Tcp6, &TcpIo->RxToken.Tcp6Token.CompletionToken);
} }
Status = EFI_TIMEOUT; Status = EFI_TIMEOUT;
goto ON_EXIT; goto ON_EXIT;
} else { } else {
TcpIo->IsRxDone = FALSE; TcpIo->IsRxDone = FALSE;
} }
Status = TcpIo->RxToken.Tcp4Token.CompletionToken.Status; Status = TcpIo->RxToken.Tcp4Token.CompletionToken.Status;
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
goto ON_EXIT; goto ON_EXIT;
} }
Fragment[CurrentFragment].Len -= RxData->FragmentTable[0].FragmentLength; Fragment[CurrentFragment].Len -= RxData->FragmentTable[0].FragmentLength;
if (Fragment[CurrentFragment].Len == 0) { if (Fragment[CurrentFragment].Len == 0) {
CurrentFragment++; CurrentFragment++;
} else { } else {
Fragment[CurrentFragment].Bulk += RxData->FragmentTable[0].FragmentLength; Fragment[CurrentFragment].Bulk += RxData->FragmentTable[0].FragmentLength;
} }
} }
ON_EXIT: ON_EXIT:
if (Fragment != NULL) { if (Fragment != NULL) {
FreePool (Fragment); FreePool (Fragment);
} }
return Status; return Status;
} }

File diff suppressed because it is too large Load Diff

View File

@ -254,15 +254,15 @@ PxeBcDriverBindingStart (
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
goto ON_ERROR; goto ON_ERROR;
} }
// //
// Get max packet size from Ip4 to calculate block size for Tftp later. // Get max packet size from Ip4 to calculate block size for Tftp later.
// //
Status = Private->Ip4->GetModeData (Private->Ip4, &Ip4ModeData, NULL, NULL); Status = Private->Ip4->GetModeData (Private->Ip4, &Ip4ModeData, NULL, NULL);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
goto ON_ERROR; goto ON_ERROR;
} }
Private->Ip4MaxPacketSize = Ip4ModeData.MaxPacketSize; Private->Ip4MaxPacketSize = Ip4ModeData.MaxPacketSize;
Status = NetLibCreateServiceChild ( Status = NetLibCreateServiceChild (

View File

@ -50,7 +50,7 @@ typedef struct _PXEBC_PRIVATE_DATA PXEBC_PRIVATE_DATA;
#define PXEBC_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('P', 'X', 'E', 'P') #define PXEBC_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('P', 'X', 'E', 'P')
#define PXEBC_MTFTP_TIMEOUT 4 #define PXEBC_MTFTP_TIMEOUT 4
#define PXEBC_MTFTP_RETRIES 6 #define PXEBC_MTFTP_RETRIES 6
#define PXEBC_DEFAULT_UDP_OVERHEAD_SIZE 8 #define PXEBC_DEFAULT_UDP_OVERHEAD_SIZE 8
#define PXEBC_DEFAULT_TFTP_OVERHEAD_SIZE 4 #define PXEBC_DEFAULT_TFTP_OVERHEAD_SIZE 4
#define PXEBC_DEFAULT_PACKET_SIZE 1480 #define PXEBC_DEFAULT_PACKET_SIZE 1480
#define PXEBC_DEFAULT_LIFETIME 50000 // 50ms, unit is microsecond #define PXEBC_DEFAULT_LIFETIME 50000 // 50ms, unit is microsecond

View File

@ -1,97 +1,97 @@
## @file ## @file
# Component description file for SMM Variable module. # Component description file for SMM Variable module.
# #
# This module installs SMM variable protocol into SMM protocol database, # This module installs SMM variable protocol into SMM protocol database,
# which can be used by SMM driver, and installs SMM variable protocol # which can be used by SMM driver, and installs SMM variable protocol
# into BS protocol database, which can be used to notify the SMM Runtime # into BS protocol database, which can be used to notify the SMM Runtime
# Dxe driver that the SMM variable service is ready. # Dxe driver that the SMM variable service is ready.
# This module should be used with SMM Runtime DXE module together. The # This module should be used with SMM Runtime DXE module together. The
# SMM Runtime DXE module would install variable arch protocol and variable # SMM Runtime DXE module would install variable arch protocol and variable
# write arch protocol based on SMM variable module. # write arch protocol based on SMM variable module.
# #
# Caution: This module requires additional review when modified. # Caution: This module requires additional review when modified.
# This driver will have external input - variable data and communicate buffer in SMM mode. # This driver will have external input - variable data and communicate buffer in SMM mode.
# This external input must be validated carefully to avoid security issue like # This external input must be validated carefully to avoid security issue like
# buffer overflow, integer overflow. # buffer overflow, integer overflow.
# #
# Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
# #
## ##
[Defines] [Defines]
INF_VERSION = 0x00010005 INF_VERSION = 0x00010005
BASE_NAME = VariableSmm BASE_NAME = VariableSmm
FILE_GUID = 23A089B3-EED5-4ac5-B2AB-43E3298C2343 FILE_GUID = 23A089B3-EED5-4ac5-B2AB-43E3298C2343
MODULE_TYPE = DXE_SMM_DRIVER MODULE_TYPE = DXE_SMM_DRIVER
VERSION_STRING = 1.0 VERSION_STRING = 1.0
PI_SPECIFICATION_VERSION = 0x0001000A PI_SPECIFICATION_VERSION = 0x0001000A
ENTRY_POINT = VariableServiceInitialize ENTRY_POINT = VariableServiceInitialize
# #
# The following information is for reference only and not required by the build tools. # The following information is for reference only and not required by the build tools.
# #
# VALID_ARCHITECTURES = IA32 X64 # VALID_ARCHITECTURES = IA32 X64
# #
[Sources] [Sources]
Reclaim.c Reclaim.c
Variable.c Variable.c
VariableSmm.c VariableSmm.c
Variable.h Variable.h
[Packages] [Packages]
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec MdeModulePkg/MdeModulePkg.dec
[LibraryClasses] [LibraryClasses]
UefiDriverEntryPoint UefiDriverEntryPoint
MemoryAllocationLib MemoryAllocationLib
BaseLib BaseLib
SynchronizationLib SynchronizationLib
UefiLib UefiLib
SmmServicesTableLib SmmServicesTableLib
BaseMemoryLib BaseMemoryLib
DebugLib DebugLib
DxeServicesTableLib DxeServicesTableLib
HobLib HobLib
PcdLib PcdLib
[Protocols] [Protocols]
gEfiSmmFirmwareVolumeBlockProtocolGuid ## SOMETIMES_CONSUMES gEfiSmmFirmwareVolumeBlockProtocolGuid ## SOMETIMES_CONSUMES
gEfiSmmVariableProtocolGuid ## ALWAYS_PRODUCES gEfiSmmVariableProtocolGuid ## ALWAYS_PRODUCES
gEfiSmmFaultTolerantWriteProtocolGuid ## SOMETIMES_CONSUMES gEfiSmmFaultTolerantWriteProtocolGuid ## SOMETIMES_CONSUMES
gEfiSmmAccess2ProtocolGuid ## ALWAYS_CONSUMES gEfiSmmAccess2ProtocolGuid ## ALWAYS_CONSUMES
gEfiSmmEndOfDxeProtocolGuid ## ALWAYS_CONSUMES gEfiSmmEndOfDxeProtocolGuid ## ALWAYS_CONSUMES
[Guids] [Guids]
gEfiVariableGuid ## PRODUCES ## Configuration Table Guid gEfiVariableGuid ## PRODUCES ## Configuration Table Guid
gEfiGlobalVariableGuid ## PRODUCES ## Variable Guid gEfiGlobalVariableGuid ## PRODUCES ## Variable Guid
gSmmVariableWriteGuid ## PRODUCES ## SMM Variable Write Guid gSmmVariableWriteGuid ## PRODUCES ## SMM Variable Write Guid
gEfiSystemNvDataFvGuid ## CONSUMES gEfiSystemNvDataFvGuid ## CONSUMES
gEfiHardwareErrorVariableGuid ## SOMETIMES_CONSUMES gEfiHardwareErrorVariableGuid ## SOMETIMES_CONSUMES
gEdkiiFaultTolerantWriteGuid ## CONSUMES gEdkiiFaultTolerantWriteGuid ## CONSUMES
[Pcd] [Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize
gEfiMdeModulePkgTokenSpaceGuid.PcdHwErrStorageSize gEfiMdeModulePkgTokenSpaceGuid.PcdHwErrStorageSize
[FeaturePcd] [FeaturePcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics ## SOMETIME_CONSUMES (statistic the information of variable.) gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics ## SOMETIME_CONSUMES (statistic the information of variable.)
[Depex] [Depex]
TRUE TRUE