Add NetworkPkg (P.UDK2010.UP3.Network.P1)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10986 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
28
NetworkPkg/Application/Ping6/Ia32/Tsc.c
Normal file
28
NetworkPkg/Application/Ping6/Ia32/Tsc.c
Normal file
@@ -0,0 +1,28 @@
|
||||
/** @file
|
||||
The implement to read TSC in IA32 platform.
|
||||
|
||||
Copyright (c) 2009 - 2010, 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.
|
||||
|
||||
**/
|
||||
|
||||
#include <Library/BaseLib.h>
|
||||
|
||||
/**
|
||||
Reads and returns the current value of the Time Stamp Counter (TSC).
|
||||
|
||||
@return The current value of TSC.
|
||||
|
||||
**/
|
||||
UINT64
|
||||
ReadTime ()
|
||||
{
|
||||
return AsmReadTsc ();
|
||||
}
|
28
NetworkPkg/Application/Ping6/Ipf/Itc.c
Normal file
28
NetworkPkg/Application/Ping6/Ipf/Itc.c
Normal file
@@ -0,0 +1,28 @@
|
||||
/** @file
|
||||
The implement to read ITC in IA64 platform.
|
||||
|
||||
Copyright (c) 2009 - 2010, 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.
|
||||
|
||||
**/
|
||||
|
||||
#include <Library/BaseLib.h>
|
||||
|
||||
/**
|
||||
Reads and returns the current value of the Interval Timer Counter Register (ITC).
|
||||
|
||||
@return The current value of ITC.
|
||||
|
||||
**/
|
||||
UINT64
|
||||
ReadTime ()
|
||||
{
|
||||
return AsmReadItc ();
|
||||
}
|
1179
NetworkPkg/Application/Ping6/Ping6.c
Normal file
1179
NetworkPkg/Application/Ping6/Ping6.c
Normal file
File diff suppressed because it is too large
Load Diff
92
NetworkPkg/Application/Ping6/Ping6.h
Normal file
92
NetworkPkg/Application/Ping6/Ping6.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/** @file
|
||||
The interface function declaration of shell application Ping6 (Ping for v6 series).
|
||||
|
||||
Copyright (c) 2009 - 2010, 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.
|
||||
|
||||
**/
|
||||
|
||||
#ifndef _PING6_H_
|
||||
#define _PING6_H_
|
||||
|
||||
#define EFI_PING6_GUID \
|
||||
{ \
|
||||
0x3f0b2478, 0x3619, 0x46c5, {0x81, 0x50, 0xa5, 0xab, 0xdd, 0xb6, 0x6b, 0xd9} \
|
||||
}
|
||||
|
||||
#define PING6_DEFAULT_TIMEOUT 5000
|
||||
#define PING6_MAX_SEND_NUMBER 10000
|
||||
#define PING6_MAX_BUFFER_SIZE 32768
|
||||
#define PING6_ONE_SECOND 10000000
|
||||
|
||||
//
|
||||
// A similar amount of time that passes in femtoseconds
|
||||
// for each increment of TimerValue. It is for NT32 only.
|
||||
//
|
||||
#define NTTIMERPERIOD 358049
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
typedef struct _ICMP6_ECHO_REQUEST_REPLY {
|
||||
UINT8 Type;
|
||||
UINT8 Code;
|
||||
UINT16 Checksum;
|
||||
UINT16 Identifier;
|
||||
UINT16 SequenceNum;
|
||||
UINT64 TimeStamp;
|
||||
UINT8 Data[1];
|
||||
} ICMP6_ECHO_REQUEST_REPLY;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
typedef struct _PING6_ICMP6_TX_INFO {
|
||||
LIST_ENTRY Link;
|
||||
UINT16 SequenceNum;
|
||||
UINT64 TimeStamp;
|
||||
EFI_IP6_COMPLETION_TOKEN *Token;
|
||||
} PING6_ICMP6_TX_INFO;
|
||||
|
||||
typedef struct _PING6_PRIVATE_DATA {
|
||||
EFI_HANDLE ImageHandle;
|
||||
EFI_HANDLE NicHandle;
|
||||
EFI_HANDLE Ip6ChildHandle;
|
||||
EFI_IP6_PROTOCOL *Ip6;
|
||||
EFI_EVENT Timer;
|
||||
|
||||
EFI_STATUS Status;
|
||||
LIST_ENTRY TxList;
|
||||
EFI_IP6_COMPLETION_TOKEN RxToken;
|
||||
UINT16 RxCount;
|
||||
UINT16 TxCount;
|
||||
UINT32 RttSum;
|
||||
UINT32 RttMin;
|
||||
UINT32 RttMax;
|
||||
UINT32 SequenceNum;
|
||||
|
||||
EFI_IPv6_ADDRESS SrcAddress;
|
||||
EFI_IPv6_ADDRESS DstAddress;
|
||||
UINT32 SendNum;
|
||||
UINT32 BufferSize;
|
||||
} PING6_PRIVATE_DATA;
|
||||
|
||||
/**
|
||||
Reads and returns the current value of register.
|
||||
In IA64, the register is the Interval Timer Vector (ITV).
|
||||
In X86(IA32/X64), the register is the Time Stamp Counter (TSC)
|
||||
|
||||
@return The current value of the register.
|
||||
|
||||
**/
|
||||
UINT64
|
||||
ReadTime (
|
||||
VOID
|
||||
);
|
||||
|
||||
#endif
|
64
NetworkPkg/Application/Ping6/Ping6.inf
Normal file
64
NetworkPkg/Application/Ping6/Ping6.inf
Normal file
@@ -0,0 +1,64 @@
|
||||
## @file
|
||||
# Component description file for Ping6 application.
|
||||
#
|
||||
# Copyright (c) 2009 - 2010, 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]
|
||||
INF_VERSION = 0x00010006
|
||||
BASE_NAME = Ping6
|
||||
FILE_GUID = F35F733F-5235-4d7b-83FA-97780CEBCB20
|
||||
MODULE_TYPE = UEFI_APPLICATION
|
||||
VERSION_STRING = 1.0
|
||||
ENTRY_POINT = InitializePing6
|
||||
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF
|
||||
#
|
||||
|
||||
[Sources]
|
||||
Ping6.c
|
||||
Ping6Strings.uni
|
||||
Ping6.h
|
||||
|
||||
[Sources.IA32]
|
||||
Ia32/Tsc.c
|
||||
|
||||
[Sources.X64]
|
||||
X64/Tsc.c
|
||||
|
||||
[Sources.IPF]
|
||||
Ipf/Itc.c
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
ShellPkg/ShellPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
BaseLib
|
||||
UefiBootServicesTableLib
|
||||
UefiApplicationEntryPoint
|
||||
BaseMemoryLib
|
||||
ShellLib
|
||||
MemoryAllocationLib
|
||||
DebugLib
|
||||
HiiLib
|
||||
NetLib
|
||||
|
||||
[Protocols]
|
||||
gEfiCpuArchProtocolGuid ## CONSUMS
|
||||
gEfiIp6ProtocolGuid ## CONSUMS
|
||||
gEfiIp6ServiceBindingProtocolGuid ## CONSUMS
|
||||
gEfiIp6ConfigProtocolGuid ## CONSUMS
|
BIN
NetworkPkg/Application/Ping6/Ping6Strings.uni
Normal file
BIN
NetworkPkg/Application/Ping6/Ping6Strings.uni
Normal file
Binary file not shown.
28
NetworkPkg/Application/Ping6/X64/Tsc.c
Normal file
28
NetworkPkg/Application/Ping6/X64/Tsc.c
Normal file
@@ -0,0 +1,28 @@
|
||||
/** @file
|
||||
The implement to read TSC in X64 platform.
|
||||
|
||||
Copyright (c) 2009 - 2010, 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.
|
||||
|
||||
**/
|
||||
|
||||
#include <Library/BaseLib.h>
|
||||
|
||||
/**
|
||||
Reads and returns the current value of Time Stamp Counter (TSC).
|
||||
|
||||
@return The current value of TSC
|
||||
|
||||
**/
|
||||
UINT64
|
||||
ReadTime ()
|
||||
{
|
||||
return AsmReadTsc ();
|
||||
}
|
Reference in New Issue
Block a user