]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/PxeBaseCodeCallBack.h
Use doxygen comment style for document entity such as struct, enum, variable that...
[mirror_edk2.git] / MdePkg / Include / Protocol / PxeBaseCodeCallBack.h
1 /** @file
2 EFI PXE Base Code CallBack Protocol is as defined in UEFI specification.
3 It is invoked when the PXE Base Code Protocol is about to transmit, has received,
4 or is waiting to receive a packet.
5
6 Copyright (c) 2006 - 2008, Intel Corporation
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16
17 #ifndef _PXE_BASE_CODE_CALLBACK_H_
18 #define _PXE_BASE_CODE_CALLBACK_H_
19
20 ///
21 /// Call Back Definitions
22 ///
23 #define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_GUID \
24 { \
25 0x245dca21, 0xfb7b, 0x11d3, {0x8f, 0x01, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
26 }
27
28 //
29 // Revision Number
30 //
31 #define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION 0x00010000
32 #define EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION \
33 EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION
34
35 ///
36 /// Protocol definition
37 ///
38 typedef struct _EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL;
39
40 ///
41 /// Protocol defined in EFI1.1.
42 ///
43 typedef EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL EFI_PXE_BASE_CODE_CALLBACK;
44
45 typedef enum {
46 EFI_PXE_BASE_CODE_FUNCTION_FIRST,
47 EFI_PXE_BASE_CODE_FUNCTION_DHCP,
48 EFI_PXE_BASE_CODE_FUNCTION_DISCOVER,
49 EFI_PXE_BASE_CODE_FUNCTION_MTFTP,
50 EFI_PXE_BASE_CODE_FUNCTION_UDP_WRITE,
51 EFI_PXE_BASE_CODE_FUNCTION_UDP_READ,
52 EFI_PXE_BASE_CODE_FUNCTION_ARP,
53 EFI_PXE_BASE_CODE_FUNCTION_IGMP,
54 EFI_PXE_BASE_CODE_PXE_FUNCTION_LAST
55 } EFI_PXE_BASE_CODE_FUNCTION;
56
57 typedef enum {
58 EFI_PXE_BASE_CODE_CALLBACK_STATUS_FIRST,
59 EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,
60 EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT,
61 EFI_PXE_BASE_CODE_CALLBACK_STATUS_LAST
62 } EFI_PXE_BASE_CODE_CALLBACK_STATUS;
63
64 /**
65 Callback function that is invoked when the PXE Base Code Protocol is about to transmit, has
66 received, or is waiting to receive a packet.
67
68 @param This Pointer to the EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL instance.
69 @param Function The PXE Base Code Protocol function that is waiting for an event.
70 @param Received TRUE if the callback is being invoked due to a receive event. FALSE if
71 the callback is being invoked due to a transmit event.
72 @param PacketLen The length, in bytes, of Packet. This field will have a value of zero if
73 this is a wait for receive event.
74 @param Packet If Received is TRUE, a pointer to the packet that was just received;
75 otherwise a pointer to the packet that is about to be transmitted.
76
77 @retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE if Function specifies a continue operation
78 @retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT if Function specifies an abort operation
79
80 **/
81 typedef
82 EFI_PXE_BASE_CODE_CALLBACK_STATUS
83 (EFIAPI *EFI_PXE_CALLBACK)(
84 IN EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *This,
85 IN EFI_PXE_BASE_CODE_FUNCTION Function,
86 IN BOOLEAN Received,
87 IN UINT32 PacketLen,
88 IN EFI_PXE_BASE_CODE_PACKET *Packet OPTIONAL
89 );
90
91 /**
92 @par Protocol Description:
93 Protocol that is invoked when the PXE Base Code Protocol is about
94 to transmit, has received, or is waiting to receive a packet.
95
96 @param Revision
97 The revision of the EFI_PXE_BASE_CODE_PROTOCOL. All future revisions must
98 be backwards compatible. If a future version is not backwards compatible
99 it is not the same GUID.
100
101 @param Callback
102 Callback routine used by the PXE Base Code Dhcp(), Discover(), Mtftp(),
103 UdpWrite(), and Arp() functions.
104
105 **/
106 struct _EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL {
107 UINT64 Revision;
108 EFI_PXE_CALLBACK Callback;
109 };
110
111 extern EFI_GUID gEfiPxeBaseCodeCallbackProtocolGuid;
112
113 #endif
114