Update to support to produce Component Name and & Component Name 2 protocol based on Feature flag PcdComponentNameDisable & PcdComponentName2Disable.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4006 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8
2007-09-30 03:08:02 +00:00
parent 5bca971e54
commit 83cbd279b6
68 changed files with 11129 additions and 9421 deletions

View File

@@ -2381,15 +2381,14 @@ InitializeBCDriver (
//
// Initialize EFI library
//
Status = EfiLibInstallAllDriverProtocols (
ImageHandle,
SystemTable,
&mPxeBcDriverBinding,
NULL,
&gPxeBcComponentName,
NULL,
NULL
);
Status = EfiLibInstallDriverBindingComponentName2 (
ImageHandle,
SystemTable,
&mPxeBcDriverBinding,
NULL,
&gPxeBcComponentName,
&gPxeBcComponentName2
);
InitArpHeader ();
OptionsStrucInit ();

File diff suppressed because it is too large Load Diff

View File

@@ -22,6 +22,45 @@ Abstract:
//
// EFI Component Name Functions
//
/**
Retrieves a Unicode string that is the user readable name of the driver.
This function retrieves the user readable name of a driver in the form of a
Unicode string. If the driver specified by This has a user readable name in
the language specified by Language, then a pointer to the driver name is
returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
by This does not support the language specified by Language,
then EFI_UNSUPPORTED is returned.
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param Language[in] A pointer to a Null-terminated ASCII string
array indicating the language. This is the
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 up
to the driver writer. Language is specified
in RFC 3066 or ISO 639-2 language code format.
@param DriverName[out] A pointer to the Unicode string to return.
This Unicode string is the name of the
driver specified by This in the language
specified by Language.
@retval EFI_SUCCESS The Unicode string for the Driver specified by
This and the language specified by Language was
returned in DriverName.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER DriverName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This does not support
the language specified by Language.
**/
EFI_STATUS
EFIAPI
PxeBcComponentNameGetDriverName (
@@ -30,6 +69,75 @@ PxeBcComponentNameGetDriverName (
OUT CHAR16 **DriverName
);
/**
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by a driver.
This function retrieves the user readable name of the controller specified by
ControllerHandle and ChildHandle in the form of a Unicode string. If the
driver specified by This has a user readable name in the language specified by
Language, then a pointer to the controller name is returned in ControllerName,
and EFI_SUCCESS is returned. If the driver specified by This is not currently
managing the controller specified by ControllerHandle and ChildHandle,
then EFI_UNSUPPORTED is returned. If the driver specified by This does not
support the language specified by Language, then EFI_UNSUPPORTED is returned.
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param ControllerHandle[in] The handle of a controller that the driver
specified by This is managing. This handle
specifies the controller whose name is to be
returned.
@param ChildHandle[in] The handle of the child controller to retrieve
the name of. This is an optional parameter that
may be NULL. It will be NULL for device
drivers. It will also be NULL for a bus drivers
that wish to retrieve the name of the bus
controller. It will not be NULL for a bus
driver that wishes to retrieve the name of a
child controller.
@param Language[in] A pointer to a Null-terminated ASCII string
array indicating the language. This is the
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 up
to the driver writer. Language is specified in
RFC 3066 or ISO 639-2 language code format.
@param ControllerName[out] A pointer to the Unicode string to return.
This Unicode string is the name of the
controller specified by ControllerHandle and
ChildHandle in the language specified by
Language from the point of view of the driver
specified by This.
@retval EFI_SUCCESS The Unicode string for the user readable name in
the language specified by Language for the
driver specified by This was returned in
DriverName.
@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
EFI_HANDLE.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER ControllerName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This is not currently
managing the controller specified by
ControllerHandle and ChildHandle.
@retval EFI_UNSUPPORTED The driver specified by This does not support
the language specified by Language.
**/
EFI_STATUS
EFIAPI
PxeBcComponentNameGetControllerName (
@@ -40,18 +148,29 @@ PxeBcComponentNameGetControllerName (
OUT CHAR16 **ControllerName
);
//
// EFI Component Name Protocol
//
EFI_COMPONENT_NAME_PROTOCOL gPxeBcComponentName = {
EFI_COMPONENT_NAME_PROTOCOL gPxeBcComponentName = {
PxeBcComponentNameGetDriverName,
PxeBcComponentNameGetControllerName,
"eng"
};
};
//
// EFI Component Name 2 Protocol
//
EFI_COMPONENT_NAME2_PROTOCOL gPxeBcComponentName2 = {
(EFI_COMPONENT_NAME2_GET_DRIVER_NAME) PxeBcComponentNameGetDriverName,
(EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) PxeBcComponentNameGetControllerName,
"en"
};
static EFI_UNICODE_STRING_TABLE mPxeBcDriverNameTable[] = {
{
"eng",
"eng;en",
L"PXE Base Code Driver"
},
{
@@ -60,6 +179,45 @@ static EFI_UNICODE_STRING_TABLE mPxeBcDriverNameTable[] = {
}
};
/**
Retrieves a Unicode string that is the user readable name of the driver.
This function retrieves the user readable name of a driver in the form of a
Unicode string. If the driver specified by This has a user readable name in
the language specified by Language, then a pointer to the driver name is
returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
by This does not support the language specified by Language,
then EFI_UNSUPPORTED is returned.
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param Language[in] A pointer to a Null-terminated ASCII string
array indicating the language. This is the
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 up
to the driver writer. Language is specified
in RFC 3066 or ISO 639-2 language code format.
@param DriverName[out] A pointer to the Unicode string to return.
This Unicode string is the name of the
driver specified by This in the language
specified by Language.
@retval EFI_SUCCESS The Unicode string for the Driver specified by
This and the language specified by Language was
returned in DriverName.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER DriverName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This does not support
the language specified by Language.
**/
EFI_STATUS
EFIAPI
PxeBcComponentNameGetDriverName (
@@ -67,41 +225,84 @@ PxeBcComponentNameGetDriverName (
IN CHAR8 *Language,
OUT CHAR16 **DriverName
)
/*++
Routine Description:
Retrieves a Unicode string that is the user readable name of the EFI Driver.
Arguments:
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
Language - A pointer to a three character ISO 639-2 language identifier.
This is the language of the driver name that 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 up to the driver writer.
DriverName - A pointer to the Unicode string to return. This Unicode string
is the name of the driver specified by This in the language
specified by Language.
Returns:
EFI_SUCCESS - The Unicode string for the Driver specified by This
and the language specified by Language was returned
in DriverName.
EFI_INVALID_PARAMETER - Language is NULL.
EFI_INVALID_PARAMETER - DriverName is NULL.
EFI_UNSUPPORTED - The driver specified by This does not support the
language specified by Language.
--*/
{
return LookupUnicodeString (
Language,
gPxeBcComponentName.SupportedLanguages,
mPxeBcDriverNameTable,
DriverName
);
return LookupUnicodeString2 (
Language,
This->SupportedLanguages,
mPxeBcDriverNameTable,
DriverName,
(BOOLEAN)(This == &gPxeBcComponentName)
);
}
/**
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by a driver.
This function retrieves the user readable name of the controller specified by
ControllerHandle and ChildHandle in the form of a Unicode string. If the
driver specified by This has a user readable name in the language specified by
Language, then a pointer to the controller name is returned in ControllerName,
and EFI_SUCCESS is returned. If the driver specified by This is not currently
managing the controller specified by ControllerHandle and ChildHandle,
then EFI_UNSUPPORTED is returned. If the driver specified by This does not
support the language specified by Language, then EFI_UNSUPPORTED is returned.
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param ControllerHandle[in] The handle of a controller that the driver
specified by This is managing. This handle
specifies the controller whose name is to be
returned.
@param ChildHandle[in] The handle of the child controller to retrieve
the name of. This is an optional parameter that
may be NULL. It will be NULL for device
drivers. It will also be NULL for a bus drivers
that wish to retrieve the name of the bus
controller. It will not be NULL for a bus
driver that wishes to retrieve the name of a
child controller.
@param Language[in] A pointer to a Null-terminated ASCII string
array indicating the language. This is the
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 up
to the driver writer. Language is specified in
RFC 3066 or ISO 639-2 language code format.
@param ControllerName[out] A pointer to the Unicode string to return.
This Unicode string is the name of the
controller specified by ControllerHandle and
ChildHandle in the language specified by
Language from the point of view of the driver
specified by This.
@retval EFI_SUCCESS The Unicode string for the user readable name in
the language specified by Language for the
driver specified by This was returned in
DriverName.
@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
EFI_HANDLE.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER ControllerName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This is not currently
managing the controller specified by
ControllerHandle and ChildHandle.
@retval EFI_UNSUPPORTED The driver specified by This does not support
the language specified by Language.
**/
EFI_STATUS
EFIAPI
PxeBcComponentNameGetControllerName (
@@ -111,50 +312,6 @@ PxeBcComponentNameGetControllerName (
IN CHAR8 *Language,
OUT CHAR16 **ControllerName
)
/*++
Routine Description:
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by an EFI Driver.
Arguments:
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
ControllerHandle - The handle of a controller that the driver specified by
This is managing. This handle specifies the controller
whose name is to be returned.
ChildHandle - The handle of the child controller to retrieve the name
of. This is an optional parameter that may be NULL. It
will be NULL for device drivers. It will also be NULL
for a bus drivers that wish to retrieve the name of the
bus controller. It will not be NULL for a bus driver
that wishes to retrieve the name of a child controller.
Language - A pointer to a three character ISO 639-2 language
identifier. This is the language of the controller name
that 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 up to the
driver writer.
ControllerName - A pointer to the Unicode string to return. This Unicode
string is the name of the controller specified by
ControllerHandle and ChildHandle in the language specified
by Language from the point of view of the driver specified
by This.
Returns:
EFI_SUCCESS - The Unicode string for the user readable name in the
language specified by Language for the driver
specified by This was returned in DriverName.
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETER - Language is NULL.
EFI_INVALID_PARAMETER - ControllerName is NULL.
EFI_UNSUPPORTED - The driver specified by This is not currently managing
the controller specified by ControllerHandle and
ChildHandle.
EFI_UNSUPPORTED - The driver specified by This does not support the
language specified by Language.
--*/
{
return EFI_UNSUPPORTED;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,36 +1,36 @@
/** @file
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PxeArch.h
Abstract:
Defines PXE Arch type
**/
#ifndef _EFI_PXE_ARCH_H_
#define _EFI_PXE_ARCH_H_
//
// warning #175: subscript out of range
//
#pragma warning (disable: 175)
#define SYS_ARCH GetSysArch()
UINT16
GetSysArch (
VOID
);
#endif
/** @file
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PxeArch.h
Abstract:
Defines PXE Arch type
**/
#ifndef _EFI_PXE_ARCH_H_
#define _EFI_PXE_ARCH_H_
//
// warning #175: subscript out of range
//
#pragma warning (disable: 175)
#define SYS_ARCH GetSysArch()
UINT16
GetSysArch (
VOID
);
#endif

View File

@@ -1,43 +1,43 @@
/** @file
Copyright (c) 2004, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module name:
hton.h
Abstract:
Byte swapping macros.
**/
#ifndef _HTON_H_
#define _HTON_H_
//
// Only Intel order functions are defined at this time.
//
#define HTONS(v) (UINT16) ((((v) << 8) & 0xff00) + (((v) >> 8) & 0x00ff))
#define HTONL(v) \
(UINT32) ((((v) << 24) & 0xff000000) + (((v) << 8) & 0x00ff0000) + (((v) >> 8) & 0x0000ff00) + (((v) >> 24) & 0x000000ff))
#define HTONLL(v) swap64 (v)
#define U8PTR(na) ((UINT8 *) &(na))
#define NTOHS(ns) ((UINT16) (((*U8PTR (ns)) << 8) +*(U8PTR (ns) + 1)))
#define NTOHL(ns) \
((UINT32) (((*U8PTR (ns)) << 24) + ((*(U8PTR (ns) + 1)) << 16) + ((*(U8PTR (ns) + 2)) << 8) +*(U8PTR (ns) + 3)))
#endif /* _HTON_H_ */
/* EOF - hton.h */
/** @file
Copyright (c) 2004, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module name:
hton.h
Abstract:
Byte swapping macros.
**/
#ifndef _HTON_H_
#define _HTON_H_
//
// Only Intel order functions are defined at this time.
//
#define HTONS(v) (UINT16) ((((v) << 8) & 0xff00) + (((v) >> 8) & 0x00ff))
#define HTONL(v) \
(UINT32) ((((v) << 24) & 0xff000000) + (((v) << 8) & 0x00ff0000) + (((v) >> 8) & 0x0000ff00) + (((v) >> 24) & 0x000000ff))
#define HTONLL(v) swap64 (v)
#define U8PTR(na) ((UINT8 *) &(na))
#define NTOHS(ns) ((UINT16) (((*U8PTR (ns)) << 8) +*(U8PTR (ns) + 1)))
#define NTOHL(ns) \
((UINT32) (((*U8PTR (ns)) << 24) + ((*(U8PTR (ns) + 1)) << 16) + ((*(U8PTR (ns) + 2)) << 8) +*(U8PTR (ns) + 3)))
#endif /* _HTON_H_ */
/* EOF - hton.h */

View File

@@ -1,26 +1,26 @@
/** @file
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PxeArch.h
Abstract:
Defines PXE Arch type
**/
#ifndef _EFI_PXE_ARCH_H_
#define _EFI_PXE_ARCH_H_
#define SYS_ARCH 0x6
#endif
/** @file
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PxeArch.h
Abstract:
Defines PXE Arch type
**/
#ifndef _EFI_PXE_ARCH_H_
#define _EFI_PXE_ARCH_H_
#define SYS_ARCH 0x6
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,26 +1,26 @@
/** @file
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PxeArch.h
Abstract:
Defines PXE Arch type
**/
#ifndef _EFI_PXE_ARCH_H_
#define _EFI_PXE_ARCH_H_
#define SYS_ARCH 0x2
#endif
/** @file
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PxeArch.h
Abstract:
Defines PXE Arch type
**/
#ifndef _EFI_PXE_ARCH_H_
#define _EFI_PXE_ARCH_H_
#define SYS_ARCH 0x2
#endif

View File

@@ -1,154 +1,154 @@
/** @file
Copyright (c) 2004, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
tftp.h
Abstract:
**/
#ifndef __TFTP_H__
#define __TFTP_H__
//
// Definitions for trivial file transfer protocol functionality with IP v4
// Per RFC 1350, July 1992 and RFC 2347, 8, and 9, May 1998
//
#pragma pack(1)
//
// max and min packet sizes
// (all data packets in transmission except last)
//
#define MAX_TFTP_PKT_SIZE (BUFFER_ALLOCATE_SIZE - 512)
#define MIN_TFTP_PKT_SIZE 512
//
// TFTPv4 OpCodes
//
#define TFTP_RRQ 1 // read request
#define TFTP_WRQ 2 // write request
#define TFTP_DATA 3 // data
#define TFTP_ACK 4 // acknowledgement
#define TFTP_ERROR 5 // error packet
#define TFTP_OACK 6 // option acknowledge
#define TFTP_DIR 7 // read directory request
#define TFTP_DATA8 8
#define TFTP_ACK8 9
//
// request packet (read or write)
// Fields shown (except file name) are not to be referenced directly,
// since their placement is variable within a request packet.
// All are null terminated case insensitive ascii strings.
//
struct Tftpv4Req {
UINT16 OpCode; // TFTP Op code
UINT8 FileName[2]; // file name
UINT8 Mode[2]; // "netascii" or "octet"
struct { // optionally, one or more option requests
UINT8 Option[2]; // option name
UINT8 Value[2]; // value requested
} OpReq[1];
};
//
// modes
//
#define MODE_ASCII "netascii"
#define MODE_BINARY "octet"
//
// option strings
//
#define OP_BLKSIZE "blksize" // block size option
#define OP_TIMEOUT "timeout" // time to wait before retransmitting
#define OP_TFRSIZE "tsize" // total transfer size option
#define OP_OVERWRITE "overwrite" // overwrite file option
#define OP_BIGBLKNUM "bigblk#" // big block number
// See RFC 2347, 8, and 9 for more information on TFTP options
// option acknowledge packet (optional)
// options not acknowledged are rejected
//
struct Tftpv4Oack {
UINT16 OpCode; // TFTP Op code
struct { // optionally, one or more option acknowledgements
UINT8 Option[2]; // option name (of those requested)
UINT8 Value[2]; // value acknowledged
} OpAck[1];
};
//
// acknowledge packet
//
struct Tftpv4Ack {
UINT16 OpCode; // TFTP Op code
UINT16 BlockNum;
};
//
// data packet
//
struct Tftpv4Data {
struct Tftpv4Ack Header;
UINT8 Data[512];
};
//
// big block number ack packet
//
struct Tftpv4Ack8 {
UINT16 OpCode;
UINT64 BlockNum;
};
//
// big block number data packet
//
struct Tftpv4Data8 {
struct Tftpv4Ack8 Header;
UINT8 Data[506];
};
//
// error packet
//
struct Tftpv4Error {
UINT16 OpCode; // TFTP Op code
UINT16 ErrCode; // error code
UINT8 ErrMsg[1]; // error message (nul terminated)
};
#pragma pack()
//
// error codes
//
#define TFTP_ERR_UNDEF 0 // Not defined, see error message (if any).
#define TFTP_ERR_NOT_FOUND 1 // File not found.
#define TFTP_ERR_ACCESS 2 // Access violation.
#define TFTP_ERR_FULL 3 // Disk full or allocation exceeded.
#define TFTP_ERR_ILLEGAL 4 // Illegal TFTP operation.
#define TFTP_ERR_BAD_ID 5 // Unknown transfer ID.
#define TFTP_ERR_EXISTS 6 // File already exists.
#define TFTP_ERR_NO_USER 7 // No such user.
#define TFTP_ERR_OPTION 8 // Option negotiation termination
//
// some defines
//
#define REQ_RESP_TIMEOUT 5 // Wait five seconds for request response.
#define ACK_TIMEOUT 4 // Wait four seconds for ack response.
#define NUM_ACK_RETRIES 3
#define NUM_MTFTP_OPEN_RETRIES 3
#endif /* __TFTP_H__ */
/* EOF - tftp.h */
/** @file
Copyright (c) 2004, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
tftp.h
Abstract:
**/
#ifndef __TFTP_H__
#define __TFTP_H__
//
// Definitions for trivial file transfer protocol functionality with IP v4
// Per RFC 1350, July 1992 and RFC 2347, 8, and 9, May 1998
//
#pragma pack(1)
//
// max and min packet sizes
// (all data packets in transmission except last)
//
#define MAX_TFTP_PKT_SIZE (BUFFER_ALLOCATE_SIZE - 512)
#define MIN_TFTP_PKT_SIZE 512
//
// TFTPv4 OpCodes
//
#define TFTP_RRQ 1 // read request
#define TFTP_WRQ 2 // write request
#define TFTP_DATA 3 // data
#define TFTP_ACK 4 // acknowledgement
#define TFTP_ERROR 5 // error packet
#define TFTP_OACK 6 // option acknowledge
#define TFTP_DIR 7 // read directory request
#define TFTP_DATA8 8
#define TFTP_ACK8 9
//
// request packet (read or write)
// Fields shown (except file name) are not to be referenced directly,
// since their placement is variable within a request packet.
// All are null terminated case insensitive ascii strings.
//
struct Tftpv4Req {
UINT16 OpCode; // TFTP Op code
UINT8 FileName[2]; // file name
UINT8 Mode[2]; // "netascii" or "octet"
struct { // optionally, one or more option requests
UINT8 Option[2]; // option name
UINT8 Value[2]; // value requested
} OpReq[1];
};
//
// modes
//
#define MODE_ASCII "netascii"
#define MODE_BINARY "octet"
//
// option strings
//
#define OP_BLKSIZE "blksize" // block size option
#define OP_TIMEOUT "timeout" // time to wait before retransmitting
#define OP_TFRSIZE "tsize" // total transfer size option
#define OP_OVERWRITE "overwrite" // overwrite file option
#define OP_BIGBLKNUM "bigblk#" // big block number
// See RFC 2347, 8, and 9 for more information on TFTP options
// option acknowledge packet (optional)
// options not acknowledged are rejected
//
struct Tftpv4Oack {
UINT16 OpCode; // TFTP Op code
struct { // optionally, one or more option acknowledgements
UINT8 Option[2]; // option name (of those requested)
UINT8 Value[2]; // value acknowledged
} OpAck[1];
};
//
// acknowledge packet
//
struct Tftpv4Ack {
UINT16 OpCode; // TFTP Op code
UINT16 BlockNum;
};
//
// data packet
//
struct Tftpv4Data {
struct Tftpv4Ack Header;
UINT8 Data[512];
};
//
// big block number ack packet
//
struct Tftpv4Ack8 {
UINT16 OpCode;
UINT64 BlockNum;
};
//
// big block number data packet
//
struct Tftpv4Data8 {
struct Tftpv4Ack8 Header;
UINT8 Data[506];
};
//
// error packet
//
struct Tftpv4Error {
UINT16 OpCode; // TFTP Op code
UINT16 ErrCode; // error code
UINT8 ErrMsg[1]; // error message (nul terminated)
};
#pragma pack()
//
// error codes
//
#define TFTP_ERR_UNDEF 0 // Not defined, see error message (if any).
#define TFTP_ERR_NOT_FOUND 1 // File not found.
#define TFTP_ERR_ACCESS 2 // Access violation.
#define TFTP_ERR_FULL 3 // Disk full or allocation exceeded.
#define TFTP_ERR_ILLEGAL 4 // Illegal TFTP operation.
#define TFTP_ERR_BAD_ID 5 // Unknown transfer ID.
#define TFTP_ERR_EXISTS 6 // File already exists.
#define TFTP_ERR_NO_USER 7 // No such user.
#define TFTP_ERR_OPTION 8 // Option negotiation termination
//
// some defines
//
#define REQ_RESP_TIMEOUT 5 // Wait five seconds for request response.
#define ACK_TIMEOUT 4 // Wait four seconds for ack response.
#define NUM_ACK_RETRIES 3
#define NUM_MTFTP_OPEN_RETRIES 3
#endif /* __TFTP_H__ */
/* EOF - tftp.h */

View File

@@ -1,26 +1,26 @@
/** @file
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PxeArch.h
Abstract:
Defines PXE Arch type
**/
#ifndef _EFI_PXE_ARCH_H_
#define _EFI_PXE_ARCH_H_
#define SYS_ARCH 0x7
#endif
/** @file
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PxeArch.h
Abstract:
Defines PXE Arch type
**/
#ifndef _EFI_PXE_ARCH_H_
#define _EFI_PXE_ARCH_H_
#define SYS_ARCH 0x7
#endif