]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/PxeBaseCodeCallBack.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Include / Protocol / PxeBaseCodeCallBack.h
CommitLineData
d1f95000 1/** @file\r
9095d37b 2 It is invoked when the PXE Base Code Protocol is about to transmit, has received,\r
4ca9b6c4 3 or is waiting to receive a packet.\r
d1f95000 4\r
9095d37b 5Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 6SPDX-License-Identifier: BSD-2-Clause-Patent\r
9095d37b
LG
7\r
8 @par Revision Reference:\r
5899caf0 9 This Protocol is introduced in EFI Specification 1.10\r
10\r
d1f95000 11**/\r
12\r
13#ifndef _PXE_BASE_CODE_CALLBACK_H_\r
14#define _PXE_BASE_CODE_CALLBACK_H_\r
15\r
99e8ed21 16///\r
af2dc6a7 17/// Call Back Definitions.\r
99e8ed21 18///\r
d1f95000 19#define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_GUID \\r
20 { \\r
21 0x245dca21, 0xfb7b, 0x11d3, {0x8f, 0x01, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
22 }\r
23\r
992f22b9 24///\r
af2dc6a7 25/// UEFI Revision Number Definition.\r
992f22b9 26///\r
2f88bd3a 27#define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION 0x00010000\r
f1004231 28\r
992f22b9 29///\r
af2dc6a7 30/// EFI 1.1 Revision Number defintion.\r
992f22b9 31///\r
a6508c05 32#define EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION \\r
33 EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION\r
d1f95000 34\r
99e8ed21 35///\r
af2dc6a7 36/// UEFI Protocol name.\r
99e8ed21 37///\r
2f88bd3a 38typedef struct _EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL;\r
d1f95000 39\r
99e8ed21 40///\r
af2dc6a7 41/// EFI1.1 Protocol name.\r
9095d37b 42///\r
2f88bd3a 43typedef EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL EFI_PXE_BASE_CODE_CALLBACK;\r
a6508c05 44\r
9319d2c2 45///\r
af2dc6a7 46/// Event type list for PXE Base Code Protocol function.\r
9319d2c2 47///\r
d1f95000 48typedef enum {\r
49 EFI_PXE_BASE_CODE_FUNCTION_FIRST,\r
50 EFI_PXE_BASE_CODE_FUNCTION_DHCP,\r
51 EFI_PXE_BASE_CODE_FUNCTION_DISCOVER,\r
52 EFI_PXE_BASE_CODE_FUNCTION_MTFTP,\r
53 EFI_PXE_BASE_CODE_FUNCTION_UDP_WRITE,\r
54 EFI_PXE_BASE_CODE_FUNCTION_UDP_READ,\r
55 EFI_PXE_BASE_CODE_FUNCTION_ARP,\r
56 EFI_PXE_BASE_CODE_FUNCTION_IGMP,\r
57 EFI_PXE_BASE_CODE_PXE_FUNCTION_LAST\r
58} EFI_PXE_BASE_CODE_FUNCTION;\r
59\r
9319d2c2 60///\r
af2dc6a7 61/// Callback status type.\r
9319d2c2 62///\r
d1f95000 63typedef enum {\r
64 EFI_PXE_BASE_CODE_CALLBACK_STATUS_FIRST,\r
65 EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,\r
66 EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT,\r
67 EFI_PXE_BASE_CODE_CALLBACK_STATUS_LAST\r
68} EFI_PXE_BASE_CODE_CALLBACK_STATUS;\r
69\r
9095d37b 70/**\r
d1f95000 71 Callback function that is invoked when the PXE Base Code Protocol is about to transmit, has\r
9095d37b
LG
72 received, or is waiting to receive a packet.\r
73\r
f737cfb9 74 This function is invoked when the PXE Base Code Protocol is about to transmit, has received,\r
75 or is waiting to receive a packet. Parameters Function and Received specify the type of event.\r
76 Parameters PacketLen and Packet specify the packet that generated the event. If these fields\r
77 are zero and NULL respectively, then this is a status update callback. If the operation specified\r
78 by Function is to continue, then CALLBACK_STATUS_CONTINUE should be returned. If the operation\r
79 specified by Function should be aborted, then CALLBACK_STATUS_ABORT should be returned. Due to\r
80 the polling nature of UEFI device drivers, a callback function should not execute for more than 5 ms.\r
81 The SetParameters() function must be called after a Callback Protocol is installed to enable the\r
82 use of callbacks.\r
9095d37b 83\r
af2dc6a7 84 @param This The pointer to the EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL instance.\r
9095d37b 85 @param Function The PXE Base Code Protocol function that is waiting for an event.\r
d1f95000 86 @param Received TRUE if the callback is being invoked due to a receive event. FALSE if\r
9095d37b 87 the callback is being invoked due to a transmit event.\r
d1f95000 88 @param PacketLen The length, in bytes, of Packet. This field will have a value of zero if\r
9095d37b 89 this is a wait for receive event.\r
d1f95000 90 @param Packet If Received is TRUE, a pointer to the packet that was just received;\r
9095d37b
LG
91 otherwise a pointer to the packet that is about to be transmitted.\r
92\r
93 @retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE if Function specifies a continue operation\r
d1f95000 94 @retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT if Function specifies an abort operation\r
9095d37b 95\r
d1f95000 96**/\r
9095d37b
LG
97typedef\r
98EFI_PXE_BASE_CODE_CALLBACK_STATUS\r
d1f95000 99(EFIAPI *EFI_PXE_CALLBACK)(\r
100 IN EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *This,\r
101 IN EFI_PXE_BASE_CODE_FUNCTION Function,\r
102 IN BOOLEAN Received,\r
103 IN UINT32 PacketLen,\r
104 IN EFI_PXE_BASE_CODE_PACKET *Packet OPTIONAL\r
105 );\r
106\r
44717a39 107///\r
9095d37b 108/// Protocol that is invoked when the PXE Base Code Protocol is about\r
44717a39 109/// to transmit, has received, or is waiting to receive a packet.\r
110///\r
d1f95000 111struct _EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL {\r
1f08a159 112 ///\r
9095d37b
LG
113 /// The revision of the EFI_PXE_BASE_CODE_PROTOCOL. All future revisions must\r
114 /// be backwards compatible. If a future version is not backwards compatible\r
1f08a159 115 /// it is not the same GUID.\r
116 ///\r
2f88bd3a
MK
117 UINT64 Revision;\r
118 EFI_PXE_CALLBACK Callback;\r
d1f95000 119};\r
120\r
2f88bd3a 121extern EFI_GUID gEfiPxeBaseCodeCallbackProtocolGuid;\r
d1f95000 122\r
9095d37b 123#endif\r