]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/PxeBaseCodeCallBack.h
code scrub for UefiPxeBcDxe.
[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 /// UEFI Revision Number Definition
30 ///
31 #define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION 0x00010000
32
33 ///
34 /// EFI 1.1 Revision Number defintion
35 ///
36 #define EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION \
37 EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION
38
39 ///
40 /// UEFI Protocol name
41 ///
42 typedef struct _EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL;
43
44 ///
45 /// EFI1.1 Protocol name
46 ///
47 typedef EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL EFI_PXE_BASE_CODE_CALLBACK;
48
49 ///
50 /// Event type list for PXE Base Code Protocol function
51 ///
52 typedef enum {
53 EFI_PXE_BASE_CODE_FUNCTION_FIRST,
54 EFI_PXE_BASE_CODE_FUNCTION_DHCP,
55 EFI_PXE_BASE_CODE_FUNCTION_DISCOVER,
56 EFI_PXE_BASE_CODE_FUNCTION_MTFTP,
57 EFI_PXE_BASE_CODE_FUNCTION_UDP_WRITE,
58 EFI_PXE_BASE_CODE_FUNCTION_UDP_READ,
59 EFI_PXE_BASE_CODE_FUNCTION_ARP,
60 EFI_PXE_BASE_CODE_FUNCTION_IGMP,
61 EFI_PXE_BASE_CODE_PXE_FUNCTION_LAST
62 } EFI_PXE_BASE_CODE_FUNCTION;
63
64 ///
65 /// Callback status type
66 ///
67 typedef enum {
68 EFI_PXE_BASE_CODE_CALLBACK_STATUS_FIRST,
69 EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,
70 EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT,
71 EFI_PXE_BASE_CODE_CALLBACK_STATUS_LAST
72 } EFI_PXE_BASE_CODE_CALLBACK_STATUS;
73
74 /**
75 Callback function that is invoked when the PXE Base Code Protocol is about to transmit, has
76 received, or is waiting to receive a packet.
77
78 This function is invoked when the PXE Base Code Protocol is about to transmit, has received,
79 or is waiting to receive a packet. Parameters Function and Received specify the type of event.
80 Parameters PacketLen and Packet specify the packet that generated the event. If these fields
81 are zero and NULL respectively, then this is a status update callback. If the operation specified
82 by Function is to continue, then CALLBACK_STATUS_CONTINUE should be returned. If the operation
83 specified by Function should be aborted, then CALLBACK_STATUS_ABORT should be returned. Due to
84 the polling nature of UEFI device drivers, a callback function should not execute for more than 5 ms.
85 The SetParameters() function must be called after a Callback Protocol is installed to enable the
86 use of callbacks.
87
88 @param This Pointer to the EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL instance.
89 @param Function The PXE Base Code Protocol function that is waiting for an event.
90 @param Received TRUE if the callback is being invoked due to a receive event. FALSE if
91 the callback is being invoked due to a transmit event.
92 @param PacketLen The length, in bytes, of Packet. This field will have a value of zero if
93 this is a wait for receive event.
94 @param Packet If Received is TRUE, a pointer to the packet that was just received;
95 otherwise a pointer to the packet that is about to be transmitted.
96
97 @retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE if Function specifies a continue operation
98 @retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT if Function specifies an abort operation
99
100 **/
101 typedef
102 EFI_PXE_BASE_CODE_CALLBACK_STATUS
103 (EFIAPI *EFI_PXE_CALLBACK)(
104 IN EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *This,
105 IN EFI_PXE_BASE_CODE_FUNCTION Function,
106 IN BOOLEAN Received,
107 IN UINT32 PacketLen,
108 IN EFI_PXE_BASE_CODE_PACKET *Packet OPTIONAL
109 );
110
111 ///
112 /// Protocol that is invoked when the PXE Base Code Protocol is about
113 /// to transmit, has received, or is waiting to receive a packet.
114 ///
115 struct _EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL {
116 ///
117 /// The revision of the EFI_PXE_BASE_CODE_PROTOCOL. All future revisions must
118 /// be backwards compatible. If a future version is not backwards compatible
119 /// it is not the same GUID.
120 ///
121 UINT64 Revision;
122 EFI_PXE_CALLBACK Callback;
123 };
124
125 extern EFI_GUID gEfiPxeBaseCodeCallbackProtocolGuid;
126
127 #endif
128