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