]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Protocol/PxeBaseCodeCallBack.h
MdePkg: Add definition for new warning code EFI_WARN_FILE_SYSTEM.
[mirror_edk2.git] / MdePkg / Include / Protocol / PxeBaseCodeCallBack.h
... / ...
CommitLineData
1/** @file\r
2 It is invoked when the PXE Base Code Protocol is about to transmit, has received, \r
3 or is waiting to receive a packet.\r
4\r
5Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
6This program and the accompanying materials are licensed and made available under \r
7the terms and conditions of the BSD License that accompanies this distribution. \r
8The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php. \r
10 \r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
13\r
14 @par Revision Reference: \r
15 This Protocol is introduced in EFI Specification 1.10\r
16\r
17**/\r
18\r
19#ifndef _PXE_BASE_CODE_CALLBACK_H_\r
20#define _PXE_BASE_CODE_CALLBACK_H_\r
21\r
22///\r
23/// Call Back Definitions.\r
24///\r
25#define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_GUID \\r
26 { \\r
27 0x245dca21, 0xfb7b, 0x11d3, {0x8f, 0x01, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
28 }\r
29\r
30///\r
31/// UEFI Revision Number Definition.\r
32///\r
33#define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION 0x00010000\r
34\r
35///\r
36/// EFI 1.1 Revision Number defintion.\r
37///\r
38#define EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION \\r
39 EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION\r
40\r
41///\r
42/// UEFI Protocol name.\r
43///\r
44typedef struct _EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL;\r
45\r
46///\r
47/// EFI1.1 Protocol name.\r
48/// \r
49typedef EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL EFI_PXE_BASE_CODE_CALLBACK;\r
50\r
51///\r
52/// Event type list for PXE Base Code Protocol function.\r
53///\r
54typedef enum {\r
55 EFI_PXE_BASE_CODE_FUNCTION_FIRST,\r
56 EFI_PXE_BASE_CODE_FUNCTION_DHCP,\r
57 EFI_PXE_BASE_CODE_FUNCTION_DISCOVER,\r
58 EFI_PXE_BASE_CODE_FUNCTION_MTFTP,\r
59 EFI_PXE_BASE_CODE_FUNCTION_UDP_WRITE,\r
60 EFI_PXE_BASE_CODE_FUNCTION_UDP_READ,\r
61 EFI_PXE_BASE_CODE_FUNCTION_ARP,\r
62 EFI_PXE_BASE_CODE_FUNCTION_IGMP,\r
63 EFI_PXE_BASE_CODE_PXE_FUNCTION_LAST\r
64} EFI_PXE_BASE_CODE_FUNCTION;\r
65\r
66///\r
67/// Callback status type.\r
68///\r
69typedef enum {\r
70 EFI_PXE_BASE_CODE_CALLBACK_STATUS_FIRST,\r
71 EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,\r
72 EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT,\r
73 EFI_PXE_BASE_CODE_CALLBACK_STATUS_LAST\r
74} EFI_PXE_BASE_CODE_CALLBACK_STATUS;\r
75\r
76/** \r
77 Callback function that is invoked when the PXE Base Code Protocol is about to transmit, has\r
78 received, or is waiting to receive a packet. \r
79 \r
80 This function is invoked when the PXE Base Code Protocol is about to transmit, has received,\r
81 or is waiting to receive a packet. Parameters Function and Received specify the type of event.\r
82 Parameters PacketLen and Packet specify the packet that generated the event. If these fields\r
83 are zero and NULL respectively, then this is a status update callback. If the operation specified\r
84 by Function is to continue, then CALLBACK_STATUS_CONTINUE should be returned. If the operation\r
85 specified by Function should be aborted, then CALLBACK_STATUS_ABORT should be returned. Due to\r
86 the polling nature of UEFI device drivers, a callback function should not execute for more than 5 ms.\r
87 The SetParameters() function must be called after a Callback Protocol is installed to enable the\r
88 use of callbacks.\r
89 \r
90 @param This The pointer to the EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL instance.\r
91 @param Function The PXE Base Code Protocol function that is waiting for an event. \r
92 @param Received TRUE if the callback is being invoked due to a receive event. FALSE if\r
93 the callback is being invoked due to a transmit event. \r
94 @param PacketLen The length, in bytes, of Packet. This field will have a value of zero if\r
95 this is a wait for receive event. \r
96 @param Packet If Received is TRUE, a pointer to the packet that was just received;\r
97 otherwise a pointer to the packet that is about to be transmitted. \r
98 \r
99 @retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE if Function specifies a continue operation \r
100 @retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT if Function specifies an abort operation\r
101 \r
102**/\r
103typedef \r
104EFI_PXE_BASE_CODE_CALLBACK_STATUS \r
105(EFIAPI *EFI_PXE_CALLBACK)(\r
106 IN EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *This,\r
107 IN EFI_PXE_BASE_CODE_FUNCTION Function,\r
108 IN BOOLEAN Received,\r
109 IN UINT32 PacketLen,\r
110 IN EFI_PXE_BASE_CODE_PACKET *Packet OPTIONAL\r
111 );\r
112\r
113///\r
114/// Protocol that is invoked when the PXE Base Code Protocol is about \r
115/// to transmit, has received, or is waiting to receive a packet.\r
116///\r
117struct _EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL {\r
118 ///\r
119 /// The revision of the EFI_PXE_BASE_CODE_PROTOCOL. All future revisions must \r
120 /// be backwards compatible. If a future version is not backwards compatible \r
121 /// it is not the same GUID.\r
122 ///\r
123 UINT64 Revision;\r
124 EFI_PXE_CALLBACK Callback;\r
125};\r
126\r
127extern EFI_GUID gEfiPxeBaseCodeCallbackProtocolGuid;\r
128\r
129#endif \r
130\r