2007-06-19 12:12:02 +02:00
|
|
|
/** @file
|
|
|
|
EFI Multicast Trivial File Tranfer Protocol Definition
|
|
|
|
|
2010-04-23 17:46:20 +02:00
|
|
|
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
2010-03-12 23:19:12 +01:00
|
|
|
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.
|
2009-09-03 11:22:38 +02:00
|
|
|
|
2010-03-01 09:00:28 +01:00
|
|
|
@par Revision Reference:
|
2009-09-03 11:22:38 +02:00
|
|
|
This Protocol is introduced in UEFI Specification 2.0
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef __EFI_MTFTP4_PROTOCOL_H__
|
|
|
|
#define __EFI_MTFTP4_PROTOCOL_H__
|
|
|
|
|
|
|
|
#define EFI_MTFTP4_SERVICE_BINDING_PROTOCOL_GUID \
|
|
|
|
{ \
|
|
|
|
0x2FE800BE, 0x8F01, 0x4aa6, {0x94, 0x6B, 0xD7, 0x13, 0x88, 0xE1, 0x83, 0x3F } \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define EFI_MTFTP4_PROTOCOL_GUID \
|
|
|
|
{ \
|
|
|
|
0x78247c57, 0x63db, 0x4708, {0x99, 0xc2, 0xa8, 0xb4, 0xa9, 0xa6, 0x1f, 0x6b } \
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct _EFI_MTFTP4_PROTOCOL EFI_MTFTP4_PROTOCOL;
|
|
|
|
typedef struct _EFI_MTFTP4_TOKEN EFI_MTFTP4_TOKEN;
|
|
|
|
|
|
|
|
//
|
|
|
|
//MTFTP4 packet opcode definition
|
|
|
|
//
|
|
|
|
#define EFI_MTFTP4_OPCODE_RRQ 1
|
|
|
|
#define EFI_MTFTP4_OPCODE_WRQ 2
|
|
|
|
#define EFI_MTFTP4_OPCODE_DATA 3
|
|
|
|
#define EFI_MTFTP4_OPCODE_ACK 4
|
|
|
|
#define EFI_MTFTP4_OPCODE_ERROR 5
|
|
|
|
#define EFI_MTFTP4_OPCODE_OACK 6
|
|
|
|
#define EFI_MTFTP4_OPCODE_DIR 7
|
|
|
|
#define EFI_MTFTP4_OPCODE_DATA8 8
|
|
|
|
#define EFI_MTFTP4_OPCODE_ACK8 9
|
|
|
|
|
|
|
|
//
|
|
|
|
// MTFTP4 error code definition
|
|
|
|
//
|
|
|
|
#define EFI_MTFTP4_ERRORCODE_NOT_DEFINED 0
|
|
|
|
#define EFI_MTFTP4_ERRORCODE_FILE_NOT_FOUND 1
|
|
|
|
#define EFI_MTFTP4_ERRORCODE_ACCESS_VIOLATION 2
|
|
|
|
#define EFI_MTFTP4_ERRORCODE_DISK_FULL 3
|
|
|
|
#define EFI_MTFTP4_ERRORCODE_ILLEGAL_OPERATION 4
|
|
|
|
#define EFI_MTFTP4_ERRORCODE_UNKNOWN_TRANSFER_ID 5
|
|
|
|
#define EFI_MTFTP4_ERRORCODE_FILE_ALREADY_EXISTS 6
|
|
|
|
#define EFI_MTFTP4_ERRORCODE_NO_SUCH_USER 7
|
|
|
|
#define EFI_MTFTP4_ERRORCODE_REQUEST_DENIED 8
|
|
|
|
|
|
|
|
//
|
|
|
|
// MTFTP4 pacekt definitions
|
|
|
|
//
|
|
|
|
#pragma pack(1)
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
UINT16 OpCode;
|
|
|
|
UINT8 Filename[1];
|
|
|
|
} EFI_MTFTP4_REQ_HEADER;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
UINT16 OpCode;
|
|
|
|
UINT8 Data[1];
|
|
|
|
} EFI_MTFTP4_OACK_HEADER;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
UINT16 OpCode;
|
|
|
|
UINT16 Block;
|
|
|
|
UINT8 Data[1];
|
|
|
|
} EFI_MTFTP4_DATA_HEADER;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
UINT16 OpCode;
|
|
|
|
UINT16 Block[1];
|
|
|
|
} EFI_MTFTP4_ACK_HEADER;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
UINT16 OpCode;
|
|
|
|
UINT64 Block;
|
|
|
|
UINT8 Data[1];
|
|
|
|
} EFI_MTFTP4_DATA8_HEADER;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
UINT16 OpCode;
|
|
|
|
UINT64 Block[1];
|
|
|
|
} EFI_MTFTP4_ACK8_HEADER;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
UINT16 OpCode;
|
|
|
|
UINT16 ErrorCode;
|
|
|
|
UINT8 ErrorMessage[1];
|
|
|
|
} EFI_MTFTP4_ERROR_HEADER;
|
|
|
|
|
|
|
|
typedef union {
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
|
|
|
/// Type of packets as defined by the MTFTPv4 packet opcodes.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
UINT16 OpCode;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
|
|
|
/// Read request packet header.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_MTFTP4_REQ_HEADER Rrq;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
|
|
|
/// Write request packet header.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_MTFTP4_REQ_HEADER Wrq;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
|
|
|
/// Option acknowledge packet header.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_MTFTP4_OACK_HEADER Oack;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
|
|
|
/// Data packet header.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_MTFTP4_DATA_HEADER Data;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
|
|
|
/// Acknowledgement packet header.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_MTFTP4_ACK_HEADER Ack;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
|
|
|
/// Data packet header with big block number.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_MTFTP4_DATA8_HEADER Data8;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
|
|
|
/// Acknowledgement header with big block num.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_MTFTP4_ACK8_HEADER Ack8;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
|
|
|
/// Error packet header.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_MTFTP4_ERROR_HEADER Error;
|
|
|
|
} EFI_MTFTP4_PACKET;
|
|
|
|
|
|
|
|
#pragma pack()
|
|
|
|
|
2008-08-14 06:29:48 +02:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// MTFTP4 option definition.
|
2008-08-14 06:29:48 +02:00
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
typedef struct {
|
|
|
|
UINT8 *OptionStr;
|
|
|
|
UINT8 *ValueStr;
|
|
|
|
} EFI_MTFTP4_OPTION;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
BOOLEAN UseDefaultSetting;
|
|
|
|
EFI_IPv4_ADDRESS StationIp;
|
|
|
|
EFI_IPv4_ADDRESS SubnetMask;
|
|
|
|
UINT16 LocalPort;
|
|
|
|
EFI_IPv4_ADDRESS GatewayIp;
|
|
|
|
EFI_IPv4_ADDRESS ServerIp;
|
|
|
|
UINT16 InitialServerPort;
|
|
|
|
UINT16 TryCount;
|
|
|
|
UINT16 TimeoutValue;
|
|
|
|
} EFI_MTFTP4_CONFIG_DATA;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
EFI_MTFTP4_CONFIG_DATA ConfigData;
|
2010-03-01 09:00:28 +01:00
|
|
|
UINT8 SupportedOptionCount;
|
2007-06-19 12:12:02 +02:00
|
|
|
UINT8 **SupportedOptoins;
|
2010-03-01 09:00:28 +01:00
|
|
|
UINT8 UnsupportedOptionCount;
|
2007-06-19 12:12:02 +02:00
|
|
|
UINT8 **UnsupportedOptoins;
|
|
|
|
} EFI_MTFTP4_MODE_DATA;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
EFI_IPv4_ADDRESS GatewayIp;
|
|
|
|
EFI_IPv4_ADDRESS ServerIp;
|
|
|
|
UINT16 ServerPort;
|
|
|
|
UINT16 TryCount;
|
|
|
|
UINT16 TimeoutValue;
|
|
|
|
} EFI_MTFTP4_OVERRIDE_DATA;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Protocol interfaces definition
|
|
|
|
//
|
|
|
|
|
|
|
|
/**
|
2010-03-01 09:00:28 +01:00
|
|
|
A callback function that is provided by the caller to intercept
|
2007-06-19 12:12:02 +02:00
|
|
|
the EFI_MTFTP4_OPCODE_DATA or EFI_MTFTP4_OPCODE_DATA8 packets processed in the
|
2010-03-01 09:00:28 +01:00
|
|
|
EFI_MTFTP4_PROTOCOL.ReadFile() function, and alternatively to intercept
|
|
|
|
EFI_MTFTP4_OPCODE_OACK or EFI_MTFTP4_OPCODE_ERROR packets during a call to
|
|
|
|
EFI_MTFTP4_PROTOCOL.ReadFile(), WriteFile() or ReadDirectory().
|
2007-06-19 12:12:02 +02:00
|
|
|
|
2010-03-12 23:19:12 +01:00
|
|
|
@param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
|
2007-06-19 12:12:02 +02:00
|
|
|
@param Token The token that the caller provided in the
|
|
|
|
EFI_MTFTP4_PROTOCOL.ReadFile(), WriteFile()
|
|
|
|
or ReadDirectory() function.
|
|
|
|
@param PacketLen Indicates the length of the packet.
|
2010-03-12 23:19:12 +01:00
|
|
|
@param Packet The pointer to an MTFTPv4 packet.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
2010-03-12 23:19:12 +01:00
|
|
|
@retval EFI_SUCCESS The operation was successful.
|
|
|
|
@retval Others Aborts the transfer process.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
**/
|
2010-03-01 09:00:28 +01:00
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_MTFTP4_CHECK_PACKET)(
|
2007-06-19 12:12:02 +02:00
|
|
|
IN EFI_MTFTP4_PROTOCOL *This,
|
|
|
|
IN EFI_MTFTP4_TOKEN *Token,
|
|
|
|
IN UINT16 PacketLen,
|
|
|
|
IN EFI_MTFTP4_PACKET *Paket
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
/**
|
2010-03-01 09:00:28 +01:00
|
|
|
Timeout callback funtion.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
2010-03-12 23:19:12 +01:00
|
|
|
@param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
|
2007-06-19 12:12:02 +02:00
|
|
|
@param Token The token that is provided in the
|
|
|
|
EFI_MTFTP4_PROTOCOL.ReadFile() or
|
|
|
|
EFI_MTFTP4_PROTOCOL.WriteFile() or
|
|
|
|
EFI_MTFTP4_PROTOCOL.ReadDirectory() functions
|
|
|
|
by the caller.
|
2010-03-01 09:00:28 +01:00
|
|
|
|
2010-03-12 23:19:12 +01:00
|
|
|
@retval EFI_SUCCESS The operation was successful.
|
2007-06-19 12:12:02 +02:00
|
|
|
@retval Others Aborts download process.
|
|
|
|
|
|
|
|
**/
|
2010-03-01 09:00:28 +01:00
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_MTFTP4_TIMEOUT_CALLBACK)(
|
2007-06-19 12:12:02 +02:00
|
|
|
IN EFI_MTFTP4_PROTOCOL *This,
|
|
|
|
IN EFI_MTFTP4_TOKEN *Token
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
/**
|
2009-06-04 07:49:29 +02:00
|
|
|
A callback function that the caller provides to feed data to the
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_MTFTP4_PROTOCOL.WriteFile() function.
|
|
|
|
|
2010-03-12 23:19:12 +01:00
|
|
|
@param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
|
2007-06-19 12:12:02 +02:00
|
|
|
@param Token The token provided in the
|
|
|
|
EFI_MTFTP4_PROTOCOL.WriteFile() by the caller.
|
|
|
|
@param Length Indicates the length of the raw data wanted on input, and the
|
|
|
|
length the data available on output.
|
2010-03-12 23:19:12 +01:00
|
|
|
@param Buffer The pointer to the buffer where the data is stored.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
2010-03-12 23:19:12 +01:00
|
|
|
@retval EFI_SUCCESS The operation was successful.
|
2007-06-19 12:12:02 +02:00
|
|
|
@retval Others Aborts session.
|
|
|
|
|
|
|
|
**/
|
2010-03-01 09:00:28 +01:00
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_MTFTP4_PACKET_NEEDED)(
|
2007-06-19 12:12:02 +02:00
|
|
|
IN EFI_MTFTP4_PROTOCOL *This,
|
|
|
|
IN EFI_MTFTP4_TOKEN *Token,
|
|
|
|
IN OUT UINT16 *Length,
|
|
|
|
OUT VOID **Buffer
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.
|
|
|
|
|
2010-03-12 23:19:12 +01:00
|
|
|
@param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
|
|
|
|
@param ModeData The pointer to storage for the EFI MTFTPv4 Protocol driver mode data.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS The configuration data was successfully returned.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES The required mode data could not be allocated.
|
|
|
|
@retval EFI_INVALID_PARAMETER This is NULL or ModeData is NULL.
|
|
|
|
|
|
|
|
**/
|
2010-03-01 09:00:28 +01:00
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2007-06-19 12:12:02 +02:00
|
|
|
(EFIAPI *EFI_MTFTP4_GET_MODE_DATA)(
|
|
|
|
IN EFI_MTFTP4_PROTOCOL *This,
|
|
|
|
OUT EFI_MTFTP4_MODE_DATA *ModeData
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2010-03-01 09:00:28 +01:00
|
|
|
Initializes, changes, or resets the default operational setting for this
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI MTFTPv4 Protocol driver instance.
|
|
|
|
|
2010-03-12 23:19:12 +01:00
|
|
|
@param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
|
|
|
|
@param MtftpConfigData The pointer to the configuration data structure.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS The EFI MTFTPv4 Protocol driver was configured successfully.
|
|
|
|
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
|
|
|
|
@retval EFI_ACCESS_DENIED The EFI configuration could not be changed at this time because
|
|
|
|
there is one MTFTP background operation in progress.
|
|
|
|
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
|
|
|
|
RARP, etc.) has not finished yet.
|
|
|
|
@retval EFI_UNSUPPORTED A configuration protocol (DHCP, BOOTP, RARP, etc.) could not
|
|
|
|
be located when clients choose to use the default address
|
|
|
|
settings.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES The EFI MTFTPv4 Protocol driver instance data could not be
|
|
|
|
allocated.
|
|
|
|
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI
|
|
|
|
MTFTPv4 Protocol driver instance is not configured.
|
|
|
|
|
|
|
|
**/
|
2010-03-01 09:00:28 +01:00
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2007-06-19 12:12:02 +02:00
|
|
|
(EFIAPI *EFI_MTFTP4_CONFIGURE)(
|
|
|
|
IN EFI_MTFTP4_PROTOCOL *This,
|
|
|
|
IN EFI_MTFTP4_CONFIG_DATA *MtftpConfigData OPTIONAL
|
2010-03-01 09:00:28 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
|
2007-06-19 12:12:02 +02:00
|
|
|
/**
|
|
|
|
Gets information about a file from an MTFTPv4 server.
|
|
|
|
|
2010-03-12 23:19:12 +01:00
|
|
|
@param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
|
2007-06-19 12:12:02 +02:00
|
|
|
@param OverrideData Data that is used to override the existing parameters. If NULL,
|
|
|
|
the default parameters that were set in the
|
|
|
|
EFI_MTFTP4_PROTOCOL.Configure() function are used.
|
2010-03-12 23:19:12 +01:00
|
|
|
@param Filename The pointer to ASCIIZ file name string.
|
|
|
|
@param ModeStr The pointer to ASCIIZ mode string. If NULL, "octet" will be used.
|
2007-06-19 12:12:02 +02:00
|
|
|
@param OptionCount Number of option/value string pairs in OptionList.
|
2010-03-12 23:19:12 +01:00
|
|
|
@param OptionList The pointer to array of option/value string pairs. Ignored if
|
2007-06-19 12:12:02 +02:00
|
|
|
OptionCount is zero.
|
|
|
|
@param PacketLength The number of bytes in the returned packet.
|
|
|
|
@param Packet The pointer to the received packet. This buffer must be freed by
|
|
|
|
the caller.
|
|
|
|
|
2009-09-17 04:37:58 +02:00
|
|
|
@retval EFI_SUCCESS An MTFTPv4 OACK packet was received and is in the Packet.
|
|
|
|
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
|
|
|
|
- This is NULL.
|
|
|
|
- Filename is NULL.
|
|
|
|
- OptionCount is not zero and OptionList is NULL.
|
|
|
|
- One or more options in OptionList have wrong format.
|
|
|
|
- PacketLength is NULL.
|
|
|
|
- One or more IPv4 addresses in OverrideData are not valid
|
|
|
|
unicast IPv4 addresses if OverrideData is not NULL.
|
|
|
|
@retval EFI_UNSUPPORTED One or more options in the OptionList are in the
|
|
|
|
unsupported list of structure EFI_MTFTP4_MODE_DATA.
|
|
|
|
@retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started.
|
|
|
|
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
|
|
|
|
RARP, etc.) has not finished yet.
|
|
|
|
@retval EFI_ACCESS_DENIED The previous operation has not completed yet.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
|
|
|
|
@retval EFI_TFTP_ERROR An MTFTPv4 ERROR packet was received and is in the Packet.
|
|
|
|
@retval EFI_NETWORK_UNREACHABLE An ICMP network unreachable error packet was received and the Packet is set to NULL.
|
|
|
|
@retval EFI_HOST_UNREACHABLE An ICMP host unreachable error packet was received and the Packet is set to NULL.
|
|
|
|
@retval EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received and the Packet is set to NULL.
|
|
|
|
@retval EFI_PORT_UNREACHABLE An ICMP port unreachable error packet was received and the Packet is set to NULL.
|
|
|
|
@retval EFI_ICMP_ERROR Some other ICMP ERROR packet was received and is in the Buffer.
|
|
|
|
@retval EFI_PROTOCOL_ERROR An unexpected MTFTPv4 packet was received and is in the Packet.
|
|
|
|
@retval EFI_TIMEOUT No responses were received from the MTFTPv4 server.
|
|
|
|
@retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
|
2010-02-03 05:37:11 +01:00
|
|
|
@retval EFI_NO_MEDIA There was a media error.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
**/
|
2010-03-01 09:00:28 +01:00
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2007-06-19 12:12:02 +02:00
|
|
|
(EFIAPI *EFI_MTFTP4_GET_INFO)(
|
|
|
|
IN EFI_MTFTP4_PROTOCOL *This,
|
|
|
|
IN EFI_MTFTP4_OVERRIDE_DATA *OverrideData OPTIONAL,
|
|
|
|
IN UINT8 *Filename,
|
|
|
|
IN UINT8 *ModeStr OPTIONAL,
|
|
|
|
IN UINT8 OptionCount,
|
|
|
|
IN EFI_MTFTP4_OPTION *OptionList,
|
|
|
|
OUT UINT32 *PacketLength,
|
|
|
|
OUT EFI_MTFTP4_PACKET **Packet OPTIONAL
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Parses the options in an MTFTPv4 OACK packet.
|
|
|
|
|
2010-03-12 23:19:12 +01:00
|
|
|
@param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
|
2007-06-19 12:12:02 +02:00
|
|
|
@param PacketLen Length of the OACK packet to be parsed.
|
2010-03-12 23:19:12 +01:00
|
|
|
@param Packet The pointer to the OACK packet to be parsed.
|
|
|
|
@param OptionCount The pointer to the number of options in following OptionList.
|
|
|
|
@param OptionList The pointer to EFI_MTFTP4_OPTION storage. Call the EFI Boot
|
2009-07-24 19:36:07 +02:00
|
|
|
Service FreePool() to release the OptionList if the options
|
|
|
|
in this OptionList are not needed any more.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS The OACK packet was valid and the OptionCount and
|
|
|
|
OptionList parameters have been updated.
|
|
|
|
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
|
|
|
|
- PacketLen is 0.
|
|
|
|
- Packet is NULL or Packet is not a valid MTFTPv4 packet.
|
|
|
|
- OptionCount is NULL.
|
|
|
|
@retval EFI_NOT_FOUND No options were found in the OACK packet.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Storage for the OptionList array cannot be allocated.
|
|
|
|
@retval EFI_PROTOCOL_ERROR One or more of the option fields is invalid.
|
|
|
|
|
|
|
|
**/
|
2010-03-01 09:00:28 +01:00
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2007-06-19 12:12:02 +02:00
|
|
|
(EFIAPI *EFI_MTFTP4_PARSE_OPTIONS)(
|
|
|
|
IN EFI_MTFTP4_PROTOCOL *This,
|
|
|
|
IN UINT32 PacketLen,
|
|
|
|
IN EFI_MTFTP4_PACKET *Packet,
|
|
|
|
OUT UINT32 *OptionCount,
|
|
|
|
OUT EFI_MTFTP4_OPTION **OptionList OPTIONAL
|
2010-03-01 09:00:28 +01:00
|
|
|
);
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Downloads a file from an MTFTPv4 server.
|
|
|
|
|
2010-03-12 23:19:12 +01:00
|
|
|
@param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
|
|
|
|
@param Token The pointer to the token structure to provide the parameters that are
|
2007-06-19 12:12:02 +02:00
|
|
|
used in this operation.
|
|
|
|
|
2009-09-17 04:37:58 +02:00
|
|
|
@retval EFI_SUCCESS The data file has been transferred successfully.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
|
|
|
|
@retval EFI_BUFFER_TOO_SMALL BufferSize is not zero but not large enough to hold the
|
|
|
|
downloaded data in downloading process.
|
|
|
|
@retval EFI_ABORTED Current operation is aborted by user.
|
|
|
|
@retval EFI_NETWORK_UNREACHABLE An ICMP network unreachable error packet was received.
|
|
|
|
@retval EFI_HOST_UNREACHABLE An ICMP host unreachable error packet was received.
|
|
|
|
@retval EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received.
|
|
|
|
@retval EFI_PORT_UNREACHABLE An ICMP port unreachable error packet was received.
|
|
|
|
@retval EFI_ICMP_ERROR Some other ICMP ERROR packet was received.
|
|
|
|
@retval EFI_TIMEOUT No responses were received from the MTFTPv4 server.
|
|
|
|
@retval EFI_TFTP_ERROR An MTFTPv4 ERROR packet was received.
|
|
|
|
@retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
|
2010-02-03 05:37:11 +01:00
|
|
|
@retval EFI_NO_MEDIA There was a media error.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
**/
|
2010-03-01 09:00:28 +01:00
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2007-06-19 12:12:02 +02:00
|
|
|
(EFIAPI *EFI_MTFTP4_READ_FILE)(
|
|
|
|
IN EFI_MTFTP4_PROTOCOL *This,
|
|
|
|
IN EFI_MTFTP4_TOKEN *Token
|
2010-03-01 09:00:28 +01:00
|
|
|
);
|
|
|
|
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sends a file to an MTFTPv4 server.
|
|
|
|
|
2010-03-12 23:19:12 +01:00
|
|
|
@param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
|
|
|
|
@param Token The pointer to the token structure to provide the parameters that are
|
2007-06-19 12:12:02 +02:00
|
|
|
used in this operation.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The upload session has started.
|
|
|
|
@retval EFI_UNSUPPORTED The operation is not supported by this implementation.
|
|
|
|
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
|
|
|
|
@retval EFI_UNSUPPORTED One or more options in the Token.OptionList are in
|
|
|
|
the unsupported list of structure EFI_MTFTP4_MODE_DATA.
|
|
|
|
@retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started.
|
|
|
|
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
|
|
|
|
RARP, etc.) is not finished yet.
|
|
|
|
@retval EFI_ALREADY_STARTED This Token is already being used in another MTFTPv4 session.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
|
|
|
|
@retval EFI_ACCESS_DENIED The previous operation has not completed yet.
|
|
|
|
@retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
|
|
|
|
|
|
|
|
**/
|
2010-03-01 09:00:28 +01:00
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2007-06-19 12:12:02 +02:00
|
|
|
(EFIAPI *EFI_MTFTP4_WRITE_FILE)(
|
|
|
|
IN EFI_MTFTP4_PROTOCOL *This,
|
|
|
|
IN EFI_MTFTP4_TOKEN *Token
|
2010-03-01 09:00:28 +01:00
|
|
|
);
|
|
|
|
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Downloads a data file "directory" from an MTFTPv4 server. May be unsupported in some EFI
|
2010-03-01 09:00:28 +01:00
|
|
|
implementations.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
2010-03-12 23:19:12 +01:00
|
|
|
@param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
|
|
|
|
@param Token The pointer to the token structure to provide the parameters that are
|
2007-06-19 12:12:02 +02:00
|
|
|
used in this operation.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The MTFTPv4 related file "directory" has been downloaded.
|
|
|
|
@retval EFI_UNSUPPORTED The operation is not supported by this implementation.
|
|
|
|
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
|
|
|
|
@retval EFI_UNSUPPORTED One or more options in the Token.OptionList are in
|
|
|
|
the unsupported list of structure EFI_MTFTP4_MODE_DATA.
|
|
|
|
@retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started.
|
|
|
|
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
|
|
|
|
RARP, etc.) is not finished yet.
|
|
|
|
@retval EFI_ALREADY_STARTED This Token is already being used in another MTFTPv4 session.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
|
|
|
|
@retval EFI_ACCESS_DENIED The previous operation has not completed yet.
|
|
|
|
@retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
|
|
|
|
|
|
|
|
**/
|
2010-03-01 09:00:28 +01:00
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2007-06-19 12:12:02 +02:00
|
|
|
(EFIAPI *EFI_MTFTP4_READ_DIRECTORY)(
|
|
|
|
IN EFI_MTFTP4_PROTOCOL *This,
|
|
|
|
IN EFI_MTFTP4_TOKEN *Token
|
2010-03-01 09:00:28 +01:00
|
|
|
);
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Polls for incoming data packets and processes outgoing data packets.
|
|
|
|
|
2010-03-12 23:19:12 +01:00
|
|
|
@param This The pointer to the EFI_MTFTP4_PROTOCOL instance.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS Incoming or outgoing data was processed.
|
|
|
|
@retval EFI_NOT_STARTED This EFI MTFTPv4 Protocol instance has not been started.
|
|
|
|
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
|
|
|
|
RARP, etc.) is not finished yet.
|
|
|
|
@retval EFI_INVALID_PARAMETER This is NULL.
|
|
|
|
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
|
|
|
|
@retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
|
|
|
|
Consider increasing the polling rate.
|
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-06-24 09:14:18 +02:00
|
|
|
(EFIAPI *EFI_MTFTP4_POLL)(
|
2007-06-19 12:12:02 +02:00
|
|
|
IN EFI_MTFTP4_PROTOCOL *This
|
2010-03-01 09:00:28 +01:00
|
|
|
);
|
|
|
|
|
2008-10-13 04:54:29 +02:00
|
|
|
///
|
2010-03-01 09:00:28 +01:00
|
|
|
/// The EFI_MTFTP4_PROTOCOL is designed to be used by UEFI drivers and applications
|
|
|
|
/// to transmit and receive data files. The EFI MTFTPv4 Protocol driver uses
|
2008-10-13 04:54:29 +02:00
|
|
|
/// the underlying EFI UDPv4 Protocol driver and EFI IPv4 Protocol driver.
|
2010-03-01 09:00:28 +01:00
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
struct _EFI_MTFTP4_PROTOCOL {
|
|
|
|
EFI_MTFTP4_GET_MODE_DATA GetModeData;
|
|
|
|
EFI_MTFTP4_CONFIGURE Configure;
|
|
|
|
EFI_MTFTP4_GET_INFO GetInfo;
|
|
|
|
EFI_MTFTP4_PARSE_OPTIONS ParseOptions;
|
|
|
|
EFI_MTFTP4_READ_FILE ReadFile;
|
|
|
|
EFI_MTFTP4_WRITE_FILE WriteFile;
|
|
|
|
EFI_MTFTP4_READ_DIRECTORY ReadDirectory;
|
|
|
|
EFI_MTFTP4_POLL Poll;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _EFI_MTFTP4_TOKEN {
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
|
|
|
/// The status that is returned to the caller at the end of the operation
|
|
|
|
/// to indicate whether this operation completed successfully.
|
|
|
|
///
|
2008-08-21 05:08:04 +02:00
|
|
|
EFI_STATUS Status;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
|
|
|
/// The event that will be signaled when the operation completes. If
|
|
|
|
/// set to NULL, the corresponding function will wait until the read or
|
|
|
|
/// write operation finishes. The type of Event must be
|
|
|
|
/// EVT_NOTIFY_SIGNAL. The Task Priority Level (TPL) of
|
|
|
|
/// Event must be lower than or equal to TPL_CALLBACK.
|
|
|
|
///
|
2008-08-21 05:08:04 +02:00
|
|
|
EFI_EVENT Event;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
|
|
|
/// If not NULL, the data that will be used to override the existing configure data.
|
|
|
|
///
|
2008-08-21 05:08:04 +02:00
|
|
|
EFI_MTFTP4_OVERRIDE_DATA *OverrideData;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The pointer to the ASCIIZ file name string.
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
2008-08-21 05:08:04 +02:00
|
|
|
UINT8 *Filename;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The pointer to the ASCIIZ mode string. If NULL, "octet" is used.
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
2008-08-21 05:08:04 +02:00
|
|
|
UINT8 *ModeStr;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
|
|
|
/// Number of option/value string pairs.
|
|
|
|
///
|
2008-08-21 05:08:04 +02:00
|
|
|
UINT32 OptionCount;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The pointer to an array of option/value string pairs. Ignored if OptionCount is zero.
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
2008-08-21 05:08:04 +02:00
|
|
|
EFI_MTFTP4_OPTION *OptionList;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The size of the data buffer.
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
2009-07-24 19:36:07 +02:00
|
|
|
UINT64 BufferSize;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The pointer to the data buffer. Data that is downloaded from the
|
2008-12-09 15:04:41 +01:00
|
|
|
/// MTFTPv4 server is stored here. Data that is uploaded to the
|
|
|
|
/// MTFTPv4 server is read from here. Ignored if BufferSize is zero.
|
|
|
|
///
|
2009-07-24 19:36:07 +02:00
|
|
|
VOID *Buffer;
|
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The pointer to the context that will be used by CheckPacket,
|
2009-07-24 19:36:07 +02:00
|
|
|
/// TimeoutCallback and PacketNeeded.
|
|
|
|
///
|
|
|
|
VOID *Context;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The pointer to the callback function to check the contents of the received packet.
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
2008-08-21 05:08:04 +02:00
|
|
|
EFI_MTFTP4_CHECK_PACKET CheckPacket;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The pointer to the function to be called when a timeout occurs.
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
2008-08-21 05:08:04 +02:00
|
|
|
EFI_MTFTP4_TIMEOUT_CALLBACK TimeoutCallback;
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The pointer to the function to provide the needed packet contents.
|
2008-12-09 15:04:41 +01:00
|
|
|
///
|
2008-08-21 05:08:04 +02:00
|
|
|
EFI_MTFTP4_PACKET_NEEDED PacketNeeded;
|
2007-06-19 12:12:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
extern EFI_GUID gEfiMtftp4ServiceBindingProtocolGuid;
|
2010-03-01 09:00:28 +01:00
|
|
|
extern EFI_GUID gEfiMtftp4ProtocolGuid;
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|