]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
2 | EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.\r | |
3 | EFI_MANAGED_NETWORK_PROTOCOL as defined in UEFI 2.0.\r | |
4 | \r | |
1a09f6f6 | 5 | Copyright (c) 2006 - 2008, Intel Corporation\r |
f6203b71 | 6 | All rights reserved. This program and the accompanying materials\r |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
d1f95000 | 10 | \r |
f6203b71 | 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 |
d1f95000 | 14 | **/\r |
15 | \r | |
19bee90c LG |
16 | #ifndef __EFI_MANAGED_NETWORK_PROTOCOL_H__\r |
17 | #define __EFI_MANAGED_NETWORK_PROTOCOL_H__\r | |
d1f95000 | 18 | \r |
19 | #include <Protocol/SimpleNetwork.h>\r | |
20 | \r | |
21 | #define EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID \\r | |
22 | { \\r | |
23 | 0xf36ff770, 0xa7e1, 0x42cf, {0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c } \\r | |
24 | }\r | |
25 | \r | |
26 | #define EFI_MANAGED_NETWORK_PROTOCOL_GUID \\r | |
27 | { \\r | |
f6203b71 | 28 | 0x7ab33a91, 0xace5, 0x4326, { 0xb5, 0x72, 0xe7, 0xee, 0x33, 0xd3, 0x9f, 0x16 } \\r |
d1f95000 | 29 | }\r |
30 | \r | |
31 | typedef struct _EFI_MANAGED_NETWORK_PROTOCOL EFI_MANAGED_NETWORK_PROTOCOL;\r | |
32 | \r | |
33 | typedef struct {\r | |
34 | UINT32 ReceivedQueueTimeoutValue;\r | |
35 | UINT32 TransmitQueueTimeoutValue;\r | |
36 | UINT16 ProtocolTypeFilter;\r | |
37 | BOOLEAN EnableUnicastReceive;\r | |
38 | BOOLEAN EnableMulticastReceive;\r | |
39 | BOOLEAN EnableBroadcastReceive;\r | |
40 | BOOLEAN EnablePromiscuousReceive;\r | |
41 | BOOLEAN FlushQueuesOnReset;\r | |
42 | BOOLEAN EnableReceiveTimestamps;\r | |
43 | BOOLEAN DisableBackgroundPolling;\r | |
44 | } EFI_MANAGED_NETWORK_CONFIG_DATA;\r | |
45 | \r | |
46 | typedef struct {\r | |
47 | EFI_TIME Timestamp;\r | |
48 | EFI_EVENT RecycleEvent;\r | |
49 | UINT32 PacketLength;\r | |
50 | UINT32 HeaderLength;\r | |
51 | UINT32 AddressLength;\r | |
52 | UINT32 DataLength;\r | |
53 | BOOLEAN BroadcastFlag;\r | |
54 | BOOLEAN MulticastFlag;\r | |
55 | BOOLEAN PromiscuousFlag;\r | |
56 | UINT16 ProtocolType;\r | |
57 | VOID *DestinationAddress;\r | |
58 | VOID *SourceAddress;\r | |
59 | VOID *MediaHeader;\r | |
60 | VOID *PacketData;\r | |
61 | } EFI_MANAGED_NETWORK_RECEIVE_DATA;\r | |
62 | \r | |
63 | typedef struct {\r | |
64 | UINT32 FragmentLength;\r | |
65 | VOID *FragmentBuffer;\r | |
66 | } EFI_MANAGED_NETWORK_FRAGMENT_DATA;\r | |
67 | \r | |
68 | typedef struct {\r | |
69 | EFI_MAC_ADDRESS *DestinationAddress; //OPTIONAL\r | |
70 | EFI_MAC_ADDRESS *SourceAddress; //OPTIONAL\r | |
71 | UINT16 ProtocolType; //OPTIONAL\r | |
72 | UINT32 DataLength;\r | |
73 | UINT16 HeaderLength; //OPTIONAL\r | |
74 | UINT16 FragmentCount;\r | |
75 | EFI_MANAGED_NETWORK_FRAGMENT_DATA FragmentTable[1];\r | |
76 | } EFI_MANAGED_NETWORK_TRANSMIT_DATA;\r | |
77 | \r | |
78 | \r | |
79 | typedef struct {\r | |
80 | EFI_EVENT Event;\r | |
81 | EFI_STATUS Status;\r | |
82 | union {\r | |
83 | EFI_MANAGED_NETWORK_RECEIVE_DATA *RxData;\r | |
84 | EFI_MANAGED_NETWORK_TRANSMIT_DATA *TxData;\r | |
85 | } Packet;\r | |
86 | } EFI_MANAGED_NETWORK_COMPLETION_TOKEN;\r | |
87 | \r | |
88 | /**\r | |
89 | Returns the operational parameters for the current MNP child driver.\r | |
90 | \r | |
91 | @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r | |
92 | @param MnpConfigData Pointer to storage for MNP operational parameters.\r | |
93 | @param SnpModeData Pointer to storage for SNP operational parameters.\r | |
94 | \r | |
95 | @retval EFI_SUCCESS The operation completed successfully.\r | |
96 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
97 | @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.\r | |
98 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured. The default\r | |
99 | values are returned in MnpConfigData if it is not NULL.\r | |
100 | @retval Other The mode data could not be read.\r | |
101 | \r | |
102 | **/\r | |
103 | typedef\r | |
104 | EFI_STATUS\r | |
8b13229b | 105 | (EFIAPI *EFI_MANAGED_NETWORK_GET_MODE_DATA)(\r |
d1f95000 | 106 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
107 | OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,\r | |
f6203b71 | 108 | OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL\r |
ed66e1bc | 109 | );\r |
d1f95000 | 110 | \r |
111 | /**\r | |
112 | Sets or clears the operational parameters for the MNP child driver.\r | |
113 | \r | |
114 | @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r | |
115 | @param MnpConfigData Pointer to configuration data that will be assigned to the MNP\r | |
116 | child driver instance. If NULL, the MNP child driver instance is\r | |
117 | reset to startup defaults and all pending transmit and receive\r | |
118 | requests are flushed.\r | |
119 | \r | |
120 | @retval EFI_SUCCESS The operation completed successfully.\r | |
121 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r | |
122 | @retval EFI_OUT_OF_RESOURCES Required system resources (usually memory) could not be\r | |
123 | allocated.\r | |
124 | @retval EFI_UNSUPPORTED The requested feature is unsupported in this [MNP]\r | |
125 | implementation.\r | |
126 | @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r | |
127 | @retval Other The MNP child driver instance has been reset to startup defaults.\r | |
128 | \r | |
129 | **/\r | |
130 | typedef\r | |
131 | EFI_STATUS\r | |
8b13229b | 132 | (EFIAPI *EFI_MANAGED_NETWORK_CONFIGURE)(\r |
d1f95000 | 133 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
f6203b71 | 134 | IN EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL\r |
ed66e1bc | 135 | );\r |
f6203b71 | 136 | \r |
d1f95000 | 137 | /**\r |
138 | Translates an IP multicast address to a hardware (MAC) multicast address.\r | |
139 | \r | |
140 | @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r | |
141 | @param Ipv6Flag Set to TRUE to if IpAddress is an IPv6 multicast address.\r | |
142 | Set to FALSE if IpAddress is an IPv4 multicast address.\r | |
143 | @param IpAddress Pointer to the multicast IP address (in network byte order) to convert.\r | |
144 | @param MacAddress Pointer to the resulting multicast MAC address.\r | |
145 | \r | |
146 | @retval EFI_SUCCESS The operation completed successfully.\r | |
147 | @retval EFI_INVALID_PARAMETER One of the following conditions is TRUE:\r | |
148 | - This is NULL.\r | |
149 | - IpAddress is NULL.\r | |
150 | - *IpAddress is not a valid multicast IP address.\r | |
151 | - MacAddress is NULL.\r | |
152 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
153 | @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.\r | |
154 | @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r | |
155 | @retval Other The address could not be converted.\r | |
156 | \r | |
157 | **/\r | |
158 | typedef\r | |
159 | EFI_STATUS\r | |
8b13229b | 160 | (EFIAPI *EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC)(\r |
d1f95000 | 161 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
162 | IN BOOLEAN Ipv6Flag,\r | |
163 | IN EFI_IP_ADDRESS *IpAddress,\r | |
f6203b71 | 164 | OUT EFI_MAC_ADDRESS *MacAddress\r |
ed66e1bc | 165 | );\r |
d1f95000 | 166 | \r |
167 | /**\r | |
168 | Enables and disables receive filters for multicast address.\r | |
169 | \r | |
170 | @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r | |
171 | @param JoinFlag Set to TRUE to join this multicast group.\r | |
172 | Set to FALSE to leave this multicast group.\r | |
173 | @param MacAddress Pointer to the multicast MAC group (address) to join or leave.\r | |
174 | \r | |
175 | @retval EFI_SUCCESS The requested operation completed successfully.\r | |
176 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
177 | - This is NULL.\r | |
178 | - JoinFlag is TRUE and MacAddress is NULL.\r | |
179 | - *MacAddress is not a valid multicast MAC address.\r | |
180 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
181 | @retval EFI_ALREADY_STARTED The supplied multicast group is already joined.\r | |
182 | @retval EFI_NOT_FOUND The supplied multicast group is not joined.\r | |
f6203b71 | 183 | @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r |
d1f95000 | 184 | @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.\r |
185 | @retval Other The requested operation could not be completed.\r | |
186 | \r | |
187 | **/\r | |
188 | typedef\r | |
189 | EFI_STATUS\r | |
8b13229b | 190 | (EFIAPI *EFI_MANAGED_NETWORK_GROUPS)(\r |
d1f95000 | 191 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
192 | IN BOOLEAN JoinFlag,\r | |
f6203b71 | 193 | IN EFI_MAC_ADDRESS *MacAddress OPTIONAL\r |
ed66e1bc | 194 | );\r |
f6203b71 | 195 | \r |
d1f95000 | 196 | /**\r |
197 | Places asynchronous outgoing data packets into the transmit queue.\r | |
198 | \r | |
199 | @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r | |
200 | @param Token Pointer to a token associated with the transmit data descriptor.\r | |
201 | \r | |
202 | @retval EFI_SUCCESS The transmit completion token was cached.\r | |
203 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
204 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r | |
205 | @retval EFI_ACCESS_DENIED The transmit completion token is already in the transmit queue.\r | |
206 | @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources\r | |
207 | (usually memory).\r | |
208 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
209 | @retval EFI_NOT_READY The transmit request could not be queued because the transmit queue is full.\r | |
210 | \r | |
211 | **/\r | |
212 | typedef\r | |
213 | EFI_STATUS\r | |
8b13229b | 214 | (EFIAPI *EFI_MANAGED_NETWORK_TRANSMIT)(\r |
d1f95000 | 215 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
f6203b71 | 216 | IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token\r |
ed66e1bc | 217 | );\r |
f6203b71 | 218 | \r |
d1f95000 | 219 | /**\r |
220 | Places an asynchronous receiving request into the receiving queue.\r | |
221 | \r | |
222 | @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r | |
223 | @param Token Pointer to a token associated with the receive data descriptor.\r | |
224 | \r | |
225 | @retval EFI_SUCCESS The receive completion token was cached.\r | |
226 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
227 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
228 | - This is NULL.\r | |
229 | - Token is NULL.\r | |
230 | - Token.Event is NULL\r | |
231 | @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources\r | |
232 | (usually memory).\r | |
233 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
234 | @retval EFI_ACCESS_DENIED The receive completion token was already in the receive queue.\r | |
235 | @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.\r | |
236 | \r | |
237 | **/\r | |
238 | typedef\r | |
239 | EFI_STATUS\r | |
8b13229b | 240 | (EFIAPI *EFI_MANAGED_NETWORK_RECEIVE)(\r |
d1f95000 | 241 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
f6203b71 | 242 | IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token\r |
ed66e1bc | 243 | );\r |
f6203b71 | 244 | \r |
d1f95000 | 245 | \r |
246 | /**\r | |
247 | Aborts an asynchronous transmit or receive request.\r | |
248 | \r | |
249 | @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r | |
250 | @param Token Pointer to a token that has been issued by\r | |
251 | EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or\r | |
252 | EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If\r | |
253 | NULL, all pending tokens are aborted.\r | |
254 | \r | |
255 | @retval EFI_SUCCESS The asynchronous I/O request was aborted and Token.Event\r | |
256 | was signaled. When Token is NULL, all pending requests were\r | |
257 | aborted and their events were signaled.\r | |
258 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
259 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
260 | @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was\r | |
261 | not found in the transmit or receive queue. It has either completed\r | |
262 | or was not issued by Transmit() and Receive().\r | |
263 | \r | |
264 | **/\r | |
265 | typedef\r | |
266 | EFI_STATUS\r | |
8b13229b | 267 | (EFIAPI *EFI_MANAGED_NETWORK_CANCEL)(\r |
d1f95000 | 268 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
f6203b71 | 269 | IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token OPTIONAL\r |
ed66e1bc | 270 | );\r |
d1f95000 | 271 | \r |
272 | /**\r | |
273 | Polls for incoming data packets and processes outgoing data packets.\r | |
274 | \r | |
275 | @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r | |
276 | \r | |
277 | @retval EFI_SUCCESS Incoming or outgoing data was processed.\r | |
278 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
279 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
280 | @retval EFI_NOT_READY No incoming or outgoing data was processed. Consider increasing\r | |
281 | the polling rate.\r | |
282 | @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.\r | |
283 | Consider increasing the polling rate.\r | |
284 | \r | |
285 | **/\r | |
286 | typedef\r | |
287 | EFI_STATUS\r | |
8b13229b | 288 | (EFIAPI *EFI_MANAGED_NETWORK_POLL)(\r |
f6203b71 | 289 | IN EFI_MANAGED_NETWORK_PROTOCOL *This\r |
ed66e1bc | 290 | );\r |
d1f95000 | 291 | \r |
4ca9b6c4 LG |
292 | /** \r |
293 | @par Protocol Description:\r | |
294 | The MNP is used by network applications (and drivers) to \r | |
295 | perform raw (unformatted) asynchronous network packet I/O.\r | |
296 | \r | |
297 | @param GetModeData\r | |
298 | Returns the current MNP child driver operational parameters. \r | |
299 | May also support returning underlying Simple Network Protocol (SNP) driver mode data. \r | |
300 | \r | |
301 | @param Configure\r | |
302 | Sets and clears operational parameters for an MNP child driver. \r | |
303 | \r | |
304 | @param McastIpToMac\r | |
305 | Translates a software (IP) multicast address to a hardware (MAC) multicast address. \r | |
306 | This function may be unsupported in some MNP implementations. \r | |
307 | \r | |
308 | @param Groups\r | |
309 | Enables and disables receive filters for multicast addresses. \r | |
310 | This function may be unsupported in some MNP implementations. \r | |
311 | \r | |
312 | @param Transmit\r | |
313 | Places asynchronous outgoing data packets into the transmit queue. \r | |
314 | \r | |
315 | @param Receive\r | |
316 | Places an asynchronous receiving request into the receiving queue. \r | |
317 | \r | |
318 | @param Cancel\r | |
319 | Aborts a pending transmit or receive request. \r | |
320 | \r | |
321 | @param Poll\r | |
322 | Polls for incoming data packets and processes outgoing data packets. \r | |
323 | \r | |
324 | **/\r | |
d1f95000 | 325 | struct _EFI_MANAGED_NETWORK_PROTOCOL {\r |
326 | EFI_MANAGED_NETWORK_GET_MODE_DATA GetModeData;\r | |
327 | EFI_MANAGED_NETWORK_CONFIGURE Configure;\r | |
328 | EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC McastIpToMac;\r | |
329 | EFI_MANAGED_NETWORK_GROUPS Groups;\r | |
330 | EFI_MANAGED_NETWORK_TRANSMIT Transmit;\r | |
331 | EFI_MANAGED_NETWORK_RECEIVE Receive;\r | |
332 | EFI_MANAGED_NETWORK_CANCEL Cancel;\r | |
333 | EFI_MANAGED_NETWORK_POLL Poll;\r | |
334 | };\r | |
335 | \r | |
336 | extern EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid;\r | |
337 | extern EFI_GUID gEfiManagedNetworkProtocolGuid;\r | |
338 | \r | |
339 | #endif\r |