]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
4ca9b6c4 LG |
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 | |
d1f95000 | 4 | \r |
9df063a0 | 5 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r |
af2dc6a7 | 6 | This program and the accompanying materials are licensed and made available under \r |
7 | the terms and conditions of the BSD License that accompanies this distribution. \r | |
8 | The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php. \r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
d1f95000 | 13 | \r |
5899caf0 | 14 | @par Revision Reference: \r |
15 | This Protocol is introduced in EFI Specification 1.10\r | |
16 | \r | |
d1f95000 | 17 | **/\r |
18 | \r | |
19 | #ifndef _PXE_BASE_CODE_CALLBACK_H_\r | |
20 | #define _PXE_BASE_CODE_CALLBACK_H_\r | |
21 | \r | |
99e8ed21 | 22 | ///\r |
af2dc6a7 | 23 | /// Call Back Definitions.\r |
99e8ed21 | 24 | ///\r |
d1f95000 | 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 | |
992f22b9 | 30 | ///\r |
af2dc6a7 | 31 | /// UEFI Revision Number Definition.\r |
992f22b9 | 32 | ///\r |
a6508c05 | 33 | #define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION 0x00010000\r |
f1004231 | 34 | \r |
992f22b9 | 35 | ///\r |
af2dc6a7 | 36 | /// EFI 1.1 Revision Number defintion.\r |
992f22b9 | 37 | ///\r |
a6508c05 | 38 | #define EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION \\r |
39 | EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION\r | |
d1f95000 | 40 | \r |
99e8ed21 | 41 | ///\r |
af2dc6a7 | 42 | /// UEFI Protocol name.\r |
99e8ed21 | 43 | ///\r |
d1f95000 | 44 | typedef struct _EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL;\r |
45 | \r | |
99e8ed21 | 46 | ///\r |
af2dc6a7 | 47 | /// EFI1.1 Protocol name.\r |
99e8ed21 | 48 | /// \r |
a6508c05 | 49 | typedef EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL EFI_PXE_BASE_CODE_CALLBACK;\r |
50 | \r | |
9319d2c2 | 51 | ///\r |
af2dc6a7 | 52 | /// Event type list for PXE Base Code Protocol function.\r |
9319d2c2 | 53 | ///\r |
d1f95000 | 54 | typedef 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 | |
9319d2c2 | 66 | ///\r |
af2dc6a7 | 67 | /// Callback status type.\r |
9319d2c2 | 68 | ///\r |
d1f95000 | 69 | typedef 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 | |
f737cfb9 | 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 | |
af2dc6a7 | 90 | @param This The pointer to the EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL instance.\r |
d1f95000 | 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 | |
103 | typedef \r | |
104 | EFI_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 | |
44717a39 | 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 | |
d1f95000 | 117 | struct _EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL {\r |
1f08a159 | 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 | |
d1f95000 | 123 | UINT64 Revision;\r |
124 | EFI_PXE_CALLBACK Callback;\r | |
125 | };\r | |
126 | \r | |
127 | extern EFI_GUID gEfiPxeBaseCodeCallbackProtocolGuid;\r | |
128 | \r | |
129 | #endif \r | |
130 | \r |