]>
Commit | Line | Data |
---|---|---|
959ccb23 | 1 | /** @file\r |
2 | This header file contains all of the PXE type definitions,\r | |
3 | structure prototypes, global variables and constants that\r | |
4 | are needed for porting PXE to EFI.\r | |
5 | \r | |
3ed785e9 | 6 | Copyright (c) 2006 - 2008, Intel Corporation \r |
959ccb23 | 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 | |
959ccb23 | 15 | @par Revision Reference:\r |
16 | 32/64-bit PXE specification:\r | |
17 | alpha-4, 99-Dec-17\r | |
18 | \r | |
19 | **/\r | |
20 | \r | |
21 | #ifndef __EFI_PXE_H__\r | |
22 | #define __EFI_PXE_H__\r | |
23 | \r | |
24 | #pragma pack(1)\r | |
25 | \r | |
959ccb23 | 26 | #define PXE_BUSTYPE(a, b, c, d) \\r |
27 | ( \\r | |
28 | (((PXE_UINT32) (d) & 0xFF) << 24) | (((PXE_UINT32) (c) & 0xFF) << 16) | (((PXE_UINT32) (b) & 0xFF) << 8) | \\r | |
29 | ((PXE_UINT32) (a) & 0xFF) \\r | |
30 | )\r | |
31 | \r | |
8b13229b | 32 | ///\r |
33 | /// UNDI ROM ID and devive ID signature\r | |
34 | ///\r | |
959ccb23 | 35 | #define PXE_BUSTYPE_PXE PXE_BUSTYPE ('!', 'P', 'X', 'E')\r |
36 | \r | |
8b13229b | 37 | ///\r |
38 | /// BUS ROM ID signatures\r | |
39 | ///\r | |
959ccb23 | 40 | #define PXE_BUSTYPE_PCI PXE_BUSTYPE ('P', 'C', 'I', 'R')\r |
41 | #define PXE_BUSTYPE_PC_CARD PXE_BUSTYPE ('P', 'C', 'C', 'R')\r | |
42 | #define PXE_BUSTYPE_USB PXE_BUSTYPE ('U', 'S', 'B', 'R')\r | |
43 | #define PXE_BUSTYPE_1394 PXE_BUSTYPE ('1', '3', '9', '4')\r | |
44 | \r | |
45 | #define PXE_SWAP_UINT16(n) ((((PXE_UINT16) (n) & 0x00FF) << 8) | (((PXE_UINT16) (n) & 0xFF00) >> 8))\r | |
46 | \r | |
47 | #define PXE_SWAP_UINT32(n) \\r | |
48 | ((((PXE_UINT32)(n) & 0x000000FF) << 24) | \\r | |
49 | (((PXE_UINT32)(n) & 0x0000FF00) << 8) | \\r | |
50 | (((PXE_UINT32)(n) & 0x00FF0000) >> 8) | \\r | |
51 | (((PXE_UINT32)(n) & 0xFF000000) >> 24))\r | |
52 | \r | |
53 | #define PXE_SWAP_UINT64(n) \\r | |
54 | ((((PXE_UINT64)(n) & 0x00000000000000FFULL) << 56) | \\r | |
55 | (((PXE_UINT64)(n) & 0x000000000000FF00ULL) << 40) | \\r | |
56 | (((PXE_UINT64)(n) & 0x0000000000FF0000ULL) << 24) | \\r | |
57 | (((PXE_UINT64)(n) & 0x00000000FF000000ULL) << 8) | \\r | |
58 | (((PXE_UINT64)(n) & 0x000000FF00000000ULL) >> 8) | \\r | |
59 | (((PXE_UINT64)(n) & 0x0000FF0000000000ULL) >> 24) | \\r | |
60 | (((PXE_UINT64)(n) & 0x00FF000000000000ULL) >> 40) | \\r | |
61 | (((PXE_UINT64)(n) & 0xFF00000000000000ULL) >> 56))\r | |
62 | \r | |
63 | \r | |
3ed785e9 | 64 | #define PXE_CPBSIZE_NOT_USED 0 ///< zero\r |
65 | #define PXE_DBSIZE_NOT_USED 0 ///< zero\r | |
66 | #define PXE_CPBADDR_NOT_USED (PXE_UINT64) 0 ///< zero\r | |
67 | #define PXE_DBADDR_NOT_USED (PXE_UINT64) 0 ///< zero\r | |
68 | #define PXE_CONST CONST\r | |
959ccb23 | 69 | \r |
70 | #define PXE_VOLATILE volatile\r | |
71 | \r | |
72 | typedef VOID PXE_VOID;\r | |
73 | typedef UINT8 PXE_UINT8;\r | |
74 | typedef UINT16 PXE_UINT16;\r | |
75 | typedef UINT32 PXE_UINT32;\r | |
76 | typedef UINTN PXE_UINTN;\r | |
77 | \r | |
8b13229b | 78 | ///\r |
79 | /// typedef unsigned long PXE_UINT64;\r | |
80 | ///\r | |
959ccb23 | 81 | typedef UINT64 PXE_UINT64;\r |
82 | \r | |
83 | typedef PXE_UINT8 PXE_BOOL;\r | |
3ed785e9 | 84 | #define PXE_FALSE 0 ///< zero\r |
959ccb23 | 85 | #define PXE_TRUE (!PXE_FALSE)\r |
86 | \r | |
87 | typedef PXE_UINT16 PXE_OPCODE;\r | |
88 | \r | |
8b13229b | 89 | ///\r |
90 | /// Return UNDI operational state.\r | |
91 | ///\r | |
959ccb23 | 92 | #define PXE_OPCODE_GET_STATE 0x0000\r |
93 | \r | |
8b13229b | 94 | ///\r |
95 | /// Change UNDI operational state from Stopped to Started.\r | |
96 | ///\r | |
959ccb23 | 97 | #define PXE_OPCODE_START 0x0001\r |
98 | \r | |
8b13229b | 99 | ///\r |
100 | /// Change UNDI operational state from Started to Stopped.\r | |
101 | ///\r | |
959ccb23 | 102 | #define PXE_OPCODE_STOP 0x0002\r |
103 | \r | |
8b13229b | 104 | ///\r |
105 | /// Get UNDI initialization information.\r | |
106 | ///\r | |
959ccb23 | 107 | #define PXE_OPCODE_GET_INIT_INFO 0x0003\r |
108 | \r | |
8b13229b | 109 | ///\r |
110 | /// Get NIC configuration information.\r | |
111 | ///\r | |
959ccb23 | 112 | #define PXE_OPCODE_GET_CONFIG_INFO 0x0004\r |
113 | \r | |
8b13229b | 114 | ///\r |
115 | /// Changed UNDI operational state from Started to Initialized.\r | |
116 | ///\r | |
959ccb23 | 117 | #define PXE_OPCODE_INITIALIZE 0x0005\r |
118 | \r | |
8b13229b | 119 | ///\r |
120 | /// Re-initialize the NIC H/W.\r | |
121 | ///\r | |
959ccb23 | 122 | #define PXE_OPCODE_RESET 0x0006\r |
123 | \r | |
8b13229b | 124 | ///\r |
125 | /// Change the UNDI operational state from Initialized to Started.\r | |
126 | ///\r | |
959ccb23 | 127 | #define PXE_OPCODE_SHUTDOWN 0x0007\r |
128 | \r | |
8b13229b | 129 | ///\r |
130 | /// Read & change state of external interrupt enables.\r | |
131 | ///\r | |
959ccb23 | 132 | #define PXE_OPCODE_INTERRUPT_ENABLES 0x0008\r |
133 | \r | |
8b13229b | 134 | ///\r |
135 | /// Read & change state of packet receive filters.\r | |
136 | ///\r | |
959ccb23 | 137 | #define PXE_OPCODE_RECEIVE_FILTERS 0x0009\r |
138 | \r | |
8b13229b | 139 | ///\r |
140 | /// Read & change station MAC address.\r | |
141 | ///\r | |
959ccb23 | 142 | #define PXE_OPCODE_STATION_ADDRESS 0x000A\r |
143 | \r | |
8b13229b | 144 | ///\r |
145 | /// Read traffic statistics.\r | |
146 | ///\r | |
959ccb23 | 147 | #define PXE_OPCODE_STATISTICS 0x000B\r |
148 | \r | |
8b13229b | 149 | ///\r |
150 | /// Convert multicast IP address to multicast MAC address.\r | |
151 | ///\r | |
959ccb23 | 152 | #define PXE_OPCODE_MCAST_IP_TO_MAC 0x000C\r |
153 | \r | |
8b13229b | 154 | ///\r |
155 | /// Read or change non-volatile storage on the NIC.\r | |
156 | ///\r | |
959ccb23 | 157 | #define PXE_OPCODE_NVDATA 0x000D\r |
158 | \r | |
8b13229b | 159 | ///\r |
160 | /// Get & clear interrupt status.\r | |
161 | ///\r | |
959ccb23 | 162 | #define PXE_OPCODE_GET_STATUS 0x000E\r |
163 | \r | |
8b13229b | 164 | ///\r |
165 | /// Fill media header in packet for transmit.\r | |
166 | ///\r | |
959ccb23 | 167 | #define PXE_OPCODE_FILL_HEADER 0x000F\r |
168 | \r | |
8b13229b | 169 | ///\r |
170 | /// Transmit packet(s).\r | |
171 | ///\r | |
959ccb23 | 172 | #define PXE_OPCODE_TRANSMIT 0x0010\r |
173 | \r | |
8b13229b | 174 | ///\r |
175 | /// Receive packet.\r | |
176 | ///\r | |
959ccb23 | 177 | #define PXE_OPCODE_RECEIVE 0x0011\r |
178 | \r | |
8b13229b | 179 | ///\r |
180 | /// Last valid PXE UNDI OpCode number.\r | |
181 | ///\r | |
959ccb23 | 182 | #define PXE_OPCODE_LAST_VALID 0x0011\r |
183 | \r | |
184 | typedef PXE_UINT16 PXE_OPFLAGS;\r | |
185 | \r | |
186 | #define PXE_OPFLAGS_NOT_USED 0x0000\r | |
187 | \r | |
188 | //\r | |
189 | // //////////////////////////////////////\r | |
190 | // UNDI Get State\r | |
191 | //\r | |
192 | // No OpFlags\r | |
193 | \r | |
194 | ////////////////////////////////////////\r | |
195 | // UNDI Start\r | |
196 | //\r | |
197 | // No OpFlags\r | |
198 | \r | |
199 | ////////////////////////////////////////\r | |
200 | // UNDI Stop\r | |
201 | //\r | |
202 | // No OpFlags\r | |
203 | \r | |
204 | ////////////////////////////////////////\r | |
205 | // UNDI Get Init Info\r | |
206 | //\r | |
207 | // No Opflags\r | |
208 | \r | |
209 | ////////////////////////////////////////\r | |
210 | // UNDI Get Config Info\r | |
211 | //\r | |
212 | // No Opflags\r | |
213 | \r | |
3ed785e9 | 214 | ///\r |
215 | /// UNDI Initialize\r | |
216 | ///\r | |
959ccb23 | 217 | #define PXE_OPFLAGS_INITIALIZE_CABLE_DETECT_MASK 0x0001\r |
218 | #define PXE_OPFLAGS_INITIALIZE_DETECT_CABLE 0x0000\r | |
219 | #define PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE 0x0001\r | |
220 | \r | |
3ed785e9 | 221 | ///\r |
222 | ///\r | |
223 | /// UNDI Reset\r | |
224 | ///\r | |
959ccb23 | 225 | #define PXE_OPFLAGS_RESET_DISABLE_INTERRUPTS 0x0001\r |
226 | #define PXE_OPFLAGS_RESET_DISABLE_FILTERS 0x0002\r | |
227 | \r | |
3ed785e9 | 228 | ///\r |
229 | /// UNDI Shutdown\r | |
230 | ///\r | |
231 | /// No OpFlags\r | |
959ccb23 | 232 | \r |
3ed785e9 | 233 | ///\r |
234 | /// UNDI Interrupt Enables\r | |
235 | ///\r | |
236 | ///\r | |
237 | /// Select whether to enable or disable external interrupt signals.\r | |
238 | /// Setting both enable and disable will return PXE_STATCODE_INVALID_OPFLAGS.\r | |
239 | ///\r | |
959ccb23 | 240 | #define PXE_OPFLAGS_INTERRUPT_OPMASK 0xC000\r |
241 | #define PXE_OPFLAGS_INTERRUPT_ENABLE 0x8000\r | |
242 | #define PXE_OPFLAGS_INTERRUPT_DISABLE 0x4000\r | |
243 | #define PXE_OPFLAGS_INTERRUPT_READ 0x0000\r | |
244 | \r | |
8b13229b | 245 | ///\r |
246 | /// Enable receive interrupts. An external interrupt will be generated\r | |
247 | /// after a complete non-error packet has been received.\r | |
248 | ///\r | |
959ccb23 | 249 | #define PXE_OPFLAGS_INTERRUPT_RECEIVE 0x0001\r |
250 | \r | |
8b13229b | 251 | ///\r |
252 | /// Enable transmit interrupts. An external interrupt will be generated\r | |
253 | /// after a complete non-error packet has been transmitted.\r | |
254 | ///\r | |
959ccb23 | 255 | #define PXE_OPFLAGS_INTERRUPT_TRANSMIT 0x0002\r |
256 | \r | |
8b13229b | 257 | ///\r |
258 | /// Enable command interrupts. An external interrupt will be generated\r | |
259 | /// when command execution stops.\r | |
260 | ///\r | |
959ccb23 | 261 | #define PXE_OPFLAGS_INTERRUPT_COMMAND 0x0004\r |
262 | \r | |
8b13229b | 263 | ///\r |
264 | /// Generate software interrupt. Setting this bit generates an external\r | |
265 | /// interrupt, if it is supported by the hardware.\r | |
266 | ///\r | |
959ccb23 | 267 | #define PXE_OPFLAGS_INTERRUPT_SOFTWARE 0x0008\r |
268 | \r | |
3ed785e9 | 269 | /// \r |
270 | /// UNDI Receive Filters\r | |
271 | ///\r | |
272 | ///\r | |
273 | /// Select whether to enable or disable receive filters.\r | |
274 | /// Setting both enable and disable will return PXE_STATCODE_INVALID_OPCODE.\r | |
275 | ///\r | |
959ccb23 | 276 | #define PXE_OPFLAGS_RECEIVE_FILTER_OPMASK 0xC000\r |
277 | #define PXE_OPFLAGS_RECEIVE_FILTER_ENABLE 0x8000\r | |
278 | #define PXE_OPFLAGS_RECEIVE_FILTER_DISABLE 0x4000\r | |
279 | #define PXE_OPFLAGS_RECEIVE_FILTER_READ 0x0000\r | |
280 | \r | |
8b13229b | 281 | ///\r |
282 | /// To reset the contents of the multicast MAC address filter list,\r | |
283 | /// set this OpFlag:\r | |
284 | ///\r | |
959ccb23 | 285 | #define PXE_OPFLAGS_RECEIVE_FILTER_RESET_MCAST_LIST 0x2000\r |
286 | \r | |
8b13229b | 287 | ///\r |
288 | /// Enable unicast packet receiving. Packets sent to the current station\r | |
289 | /// MAC address will be received.\r | |
290 | ///\r | |
959ccb23 | 291 | #define PXE_OPFLAGS_RECEIVE_FILTER_UNICAST 0x0001\r |
292 | \r | |
8b13229b | 293 | ///\r |
294 | /// Enable broadcast packet receiving. Packets sent to the broadcast\r | |
295 | /// MAC address will be received.\r | |
296 | ///\r | |
959ccb23 | 297 | #define PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST 0x0002\r |
298 | \r | |
8b13229b | 299 | ///\r |
300 | /// Enable filtered multicast packet receiving. Packets sent to any\r | |
301 | /// of the multicast MAC addresses in the multicast MAC address filter\r | |
302 | /// list will be received. If the filter list is empty, no multicast\r | |
303 | ///\r | |
959ccb23 | 304 | #define PXE_OPFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST 0x0004\r |
305 | \r | |
8b13229b | 306 | ///\r |
307 | /// Enable promiscuous packet receiving. All packets will be received.\r | |
308 | ///\r | |
959ccb23 | 309 | #define PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS 0x0008\r |
310 | \r | |
8b13229b | 311 | ///\r |
312 | /// Enable promiscuous multicast packet receiving. All multicast\r | |
313 | /// packets will be received.\r | |
314 | ///\r | |
959ccb23 | 315 | #define PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST 0x0010\r |
316 | \r | |
3ed785e9 | 317 | /// \r |
318 | /// UNDI Station Address\r | |
319 | ///\r | |
959ccb23 | 320 | #define PXE_OPFLAGS_STATION_ADDRESS_READ 0x0000\r |
321 | #define PXE_OPFLAGS_STATION_ADDRESS_WRITE 0x0000\r | |
322 | #define PXE_OPFLAGS_STATION_ADDRESS_RESET 0x0001\r | |
323 | \r | |
3ed785e9 | 324 | ///\r |
325 | /// UNDI Statistics\r | |
326 | ///\r | |
959ccb23 | 327 | #define PXE_OPFLAGS_STATISTICS_READ 0x0000\r |
328 | #define PXE_OPFLAGS_STATISTICS_RESET 0x0001\r | |
329 | \r | |
3ed785e9 | 330 | ///\r |
331 | /// UNDI MCast IP to MAC\r | |
332 | ///\r | |
333 | ///\r | |
334 | /// Identify the type of IP address in the CPB.\r | |
335 | ///\r | |
959ccb23 | 336 | #define PXE_OPFLAGS_MCAST_IP_TO_MAC_OPMASK 0x0003\r |
337 | #define PXE_OPFLAGS_MCAST_IPV4_TO_MAC 0x0000\r | |
338 | #define PXE_OPFLAGS_MCAST_IPV6_TO_MAC 0x0001\r | |
339 | \r | |
3ed785e9 | 340 | ///\r |
341 | /// UNDI NvData\r | |
342 | ///\r | |
343 | ///\r | |
344 | /// Select the type of non-volatile data operation.\r | |
345 | ///\r | |
959ccb23 | 346 | #define PXE_OPFLAGS_NVDATA_OPMASK 0x0001\r |
347 | #define PXE_OPFLAGS_NVDATA_READ 0x0000\r | |
348 | #define PXE_OPFLAGS_NVDATA_WRITE 0x0001\r | |
349 | \r | |
3ed785e9 | 350 | ///\r |
351 | /// UNDI Get Status\r | |
352 | ///\r | |
353 | ///\r | |
354 | /// Return current interrupt status. This will also clear any interrupts\r | |
355 | /// that are currently set. This can be used in a polling routine. The\r | |
356 | /// interrupt flags are still set and cleared even when the interrupts\r | |
357 | /// are disabled.\r | |
358 | ///\r | |
959ccb23 | 359 | #define PXE_OPFLAGS_GET_INTERRUPT_STATUS 0x0001\r |
360 | \r | |
3ed785e9 | 361 | ///\r |
362 | /// Return list of transmitted buffers for recycling. Transmit buffers\r | |
363 | /// must not be changed or unallocated until they have recycled. After\r | |
364 | /// issuing a transmit command, wait for a transmit complete interrupt.\r | |
365 | /// When a transmit complete interrupt is received, read the transmitted\r | |
366 | /// buffers. Do not plan on getting one buffer per interrupt. Some\r | |
367 | /// NICs and UNDIs may transmit multiple buffers per interrupt.\r | |
368 | ///\r | |
959ccb23 | 369 | #define PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS 0x0002\r |
370 | \r | |
3ed785e9 | 371 | ///\r |
372 | /// UNDI Fill Header\r | |
373 | ///\r | |
959ccb23 | 374 | #define PXE_OPFLAGS_FILL_HEADER_OPMASK 0x0001\r |
375 | #define PXE_OPFLAGS_FILL_HEADER_FRAGMENTED 0x0001\r | |
376 | #define PXE_OPFLAGS_FILL_HEADER_WHOLE 0x0000\r | |
377 | \r | |
3ed785e9 | 378 | ///\r |
379 | /// UNDI Transmit\r | |
380 | ///\r | |
381 | ///\r | |
382 | /// S/W UNDI only. Return after the packet has been transmitted. A\r | |
383 | /// transmit complete interrupt will still be generated and the transmit\r | |
384 | /// buffer will have to be recycled.\r | |
385 | ///\r | |
959ccb23 | 386 | #define PXE_OPFLAGS_SWUNDI_TRANSMIT_OPMASK 0x0001\r |
387 | #define PXE_OPFLAGS_TRANSMIT_BLOCK 0x0001\r | |
388 | #define PXE_OPFLAGS_TRANSMIT_DONT_BLOCK 0x0000\r | |
389 | \r | |
959ccb23 | 390 | #define PXE_OPFLAGS_TRANSMIT_OPMASK 0x0002\r |
391 | #define PXE_OPFLAGS_TRANSMIT_FRAGMENTED 0x0002\r | |
392 | #define PXE_OPFLAGS_TRANSMIT_WHOLE 0x0000\r | |
393 | \r | |
3ed785e9 | 394 | /// \r |
395 | /// UNDI Receive\r | |
396 | ///\r | |
397 | /// No OpFlags\r | |
398 | ///\r | |
399 | \r | |
400 | ///\r | |
401 | /// PXE STATFLAGS\r | |
402 | ///\r | |
959ccb23 | 403 | typedef PXE_UINT16 PXE_STATFLAGS;\r |
404 | \r | |
405 | #define PXE_STATFLAGS_INITIALIZE 0x0000\r | |
406 | \r | |
3ed785e9 | 407 | ///\r |
408 | /// Common StatFlags that can be returned by all commands.\r | |
409 | ///\r | |
410 | ///\r | |
411 | /// The COMMAND_COMPLETE and COMMAND_FAILED status flags must be\r | |
412 | /// implemented by all UNDIs. COMMAND_QUEUED is only needed by UNDIs\r | |
413 | /// that support command queuing.\r | |
414 | ///\r | |
959ccb23 | 415 | #define PXE_STATFLAGS_STATUS_MASK 0xC000\r |
416 | #define PXE_STATFLAGS_COMMAND_COMPLETE 0xC000\r | |
417 | #define PXE_STATFLAGS_COMMAND_FAILED 0x8000\r | |
418 | #define PXE_STATFLAGS_COMMAND_QUEUED 0x4000\r | |
419 | \r | |
3ed785e9 | 420 | ///\r |
421 | /// UNDI Get State\r | |
422 | ///\r | |
959ccb23 | 423 | #define PXE_STATFLAGS_GET_STATE_MASK 0x0003\r |
424 | #define PXE_STATFLAGS_GET_STATE_INITIALIZED 0x0002\r | |
425 | #define PXE_STATFLAGS_GET_STATE_STARTED 0x0001\r | |
426 | #define PXE_STATFLAGS_GET_STATE_STOPPED 0x0000\r | |
427 | \r | |
3ed785e9 | 428 | ///\r |
429 | /// UNDI Start\r | |
430 | ///\r | |
431 | /// No additional StatFlags\r | |
432 | ///\r | |
959ccb23 | 433 | \r |
3ed785e9 | 434 | ///\r |
435 | /// UNDI Get Init Info\r | |
436 | ///\r | |
959ccb23 | 437 | #define PXE_STATFLAGS_CABLE_DETECT_MASK 0x0001\r |
438 | #define PXE_STATFLAGS_CABLE_DETECT_NOT_SUPPORTED 0x0000\r | |
439 | #define PXE_STATFLAGS_CABLE_DETECT_SUPPORTED 0x0001\r | |
440 | \r | |
3ed785e9 | 441 | ///\r |
442 | /// UNDI Initialize\r | |
443 | ///\r | |
959ccb23 | 444 | #define PXE_STATFLAGS_INITIALIZED_NO_MEDIA 0x0001\r |
445 | \r | |
3ed785e9 | 446 | ///\r |
447 | /// UNDI Reset\r | |
448 | ///\r | |
959ccb23 | 449 | #define PXE_STATFLAGS_RESET_NO_MEDIA 0x0001\r |
450 | \r | |
3ed785e9 | 451 | ///\r |
452 | /// UNDI Shutdown\r | |
453 | ///\r | |
454 | /// No additional StatFlags\r | |
959ccb23 | 455 | \r |
3ed785e9 | 456 | ///\r |
457 | /// UNDI Interrupt Enables\r | |
458 | ///\r | |
459 | ///\r | |
460 | /// If set, receive interrupts are enabled.\r | |
461 | ///\r | |
959ccb23 | 462 | #define PXE_STATFLAGS_INTERRUPT_RECEIVE 0x0001\r |
463 | \r | |
3ed785e9 | 464 | ///\r |
465 | /// If set, transmit interrupts are enabled.\r | |
466 | ///\r | |
959ccb23 | 467 | #define PXE_STATFLAGS_INTERRUPT_TRANSMIT 0x0002\r |
468 | \r | |
3ed785e9 | 469 | ///\r |
470 | /// If set, command interrupts are enabled.\r | |
471 | ///\r | |
959ccb23 | 472 | #define PXE_STATFLAGS_INTERRUPT_COMMAND 0x0004\r |
473 | \r | |
3ed785e9 | 474 | ///\r |
475 | /// UNDI Receive Filters\r | |
476 | ///\r | |
477 | \r | |
478 | ///\r | |
479 | /// If set, unicast packets will be received.\r | |
480 | ///\r | |
959ccb23 | 481 | #define PXE_STATFLAGS_RECEIVE_FILTER_UNICAST 0x0001\r |
482 | \r | |
3ed785e9 | 483 | ///\r |
484 | /// If set, broadcast packets will be received.\r | |
485 | ///\r | |
959ccb23 | 486 | #define PXE_STATFLAGS_RECEIVE_FILTER_BROADCAST 0x0002\r |
487 | \r | |
3ed785e9 | 488 | ///\r |
489 | /// If set, multicast packets that match up with the multicast address\r | |
490 | /// filter list will be received.\r | |
491 | ///\r | |
959ccb23 | 492 | #define PXE_STATFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST 0x0004\r |
493 | \r | |
3ed785e9 | 494 | ///\r |
495 | /// If set, all packets will be received.\r | |
496 | ///\r | |
959ccb23 | 497 | #define PXE_STATFLAGS_RECEIVE_FILTER_PROMISCUOUS 0x0008\r |
498 | \r | |
3ed785e9 | 499 | ///\r |
500 | /// If set, all multicast packets will be received.\r | |
501 | ///\r | |
959ccb23 | 502 | #define PXE_STATFLAGS_RECEIVE_FILTER_ALL_MULTICAST 0x0010\r |
503 | \r | |
3ed785e9 | 504 | ///\r |
505 | /// UNDI Station Address\r | |
506 | ///\r | |
507 | /// No additional StatFlags\r | |
508 | ///\r | |
959ccb23 | 509 | \r |
3ed785e9 | 510 | ///\r |
511 | /// UNDI Statistics\r | |
512 | ///\r | |
513 | /// No additional StatFlags\r | |
514 | ///\r | |
959ccb23 | 515 | \r |
3ed785e9 | 516 | ///\r |
517 | //// UNDI MCast IP to MAC\r | |
518 | ////\r | |
519 | //// No additional StatFlags\r | |
959ccb23 | 520 | \r |
3ed785e9 | 521 | ///\r |
522 | /// UNDI NvData\r | |
523 | ///\r | |
524 | /// No additional StatFlags\r | |
525 | ///\r | |
959ccb23 | 526 | \r |
3ed785e9 | 527 | ///\r |
528 | /// UNDI Get Status\r | |
529 | ///\r | |
959ccb23 | 530 | \r |
3ed785e9 | 531 | ///\r |
532 | /// Use to determine if an interrupt has occurred.\r | |
533 | ///\r | |
959ccb23 | 534 | #define PXE_STATFLAGS_GET_STATUS_INTERRUPT_MASK 0x000F\r |
535 | #define PXE_STATFLAGS_GET_STATUS_NO_INTERRUPTS 0x0000\r | |
536 | \r | |
3ed785e9 | 537 | ///\r |
538 | /// If set, at least one receive interrupt occurred.\r | |
539 | ///\r | |
959ccb23 | 540 | #define PXE_STATFLAGS_GET_STATUS_RECEIVE 0x0001\r |
541 | \r | |
3ed785e9 | 542 | ///\r |
543 | /// If set, at least one transmit interrupt occurred.\r | |
544 | ///\r | |
959ccb23 | 545 | #define PXE_STATFLAGS_GET_STATUS_TRANSMIT 0x0002\r |
546 | \r | |
3ed785e9 | 547 | ///\r |
548 | /// If set, at least one command interrupt occurred.\r | |
549 | ///\r | |
959ccb23 | 550 | #define PXE_STATFLAGS_GET_STATUS_COMMAND 0x0004\r |
551 | \r | |
3ed785e9 | 552 | ///\r |
553 | /// If set, at least one software interrupt occurred.\r | |
554 | ///\r | |
959ccb23 | 555 | #define PXE_STATFLAGS_GET_STATUS_SOFTWARE 0x0008\r |
556 | \r | |
3ed785e9 | 557 | ///\r |
558 | /// This flag is set if the transmitted buffer queue is empty. This flag\r | |
559 | /// will be set if all transmitted buffer addresses get written into the DB.\r | |
560 | ///\r | |
959ccb23 | 561 | #define PXE_STATFLAGS_GET_STATUS_TXBUF_QUEUE_EMPTY 0x0010\r |
562 | \r | |
3ed785e9 | 563 | ///\r |
564 | /// This flag is set if no transmitted buffer addresses were written\r | |
565 | /// into the DB. (This could be because DBsize was too small.)\r | |
566 | ///\r | |
959ccb23 | 567 | #define PXE_STATFLAGS_GET_STATUS_NO_TXBUFS_WRITTEN 0x0020\r |
568 | \r | |
3ed785e9 | 569 | ///\r |
570 | /// UNDI Fill Header\r | |
571 | ///\r | |
572 | /// No additional StatFlags\r | |
573 | ///\r | |
959ccb23 | 574 | \r |
3ed785e9 | 575 | ///\r |
576 | /// UNDI Transmit\r | |
577 | ///\r | |
578 | /// No additional StatFlags.\r | |
959ccb23 | 579 | \r |
3ed785e9 | 580 | ///\r |
581 | /// UNDI Receive\r | |
582 | ///\r | |
583 | \r | |
584 | ///\r | |
585 | /// No additional StatFlags.\r | |
586 | ///\r | |
959ccb23 | 587 | typedef PXE_UINT16 PXE_STATCODE;\r |
588 | \r | |
589 | #define PXE_STATCODE_INITIALIZE 0x0000\r | |
590 | \r | |
3ed785e9 | 591 | ///\r |
592 | /// Common StatCodes returned by all UNDI commands, UNDI protocol functions\r | |
593 | /// and BC protocol functions.\r | |
594 | ///\r | |
959ccb23 | 595 | #define PXE_STATCODE_SUCCESS 0x0000\r |
596 | \r | |
597 | #define PXE_STATCODE_INVALID_CDB 0x0001\r | |
598 | #define PXE_STATCODE_INVALID_CPB 0x0002\r | |
599 | #define PXE_STATCODE_BUSY 0x0003\r | |
600 | #define PXE_STATCODE_QUEUE_FULL 0x0004\r | |
601 | #define PXE_STATCODE_ALREADY_STARTED 0x0005\r | |
602 | #define PXE_STATCODE_NOT_STARTED 0x0006\r | |
603 | #define PXE_STATCODE_NOT_SHUTDOWN 0x0007\r | |
604 | #define PXE_STATCODE_ALREADY_INITIALIZED 0x0008\r | |
605 | #define PXE_STATCODE_NOT_INITIALIZED 0x0009\r | |
606 | #define PXE_STATCODE_DEVICE_FAILURE 0x000A\r | |
607 | #define PXE_STATCODE_NVDATA_FAILURE 0x000B\r | |
608 | #define PXE_STATCODE_UNSUPPORTED 0x000C\r | |
609 | #define PXE_STATCODE_BUFFER_FULL 0x000D\r | |
610 | #define PXE_STATCODE_INVALID_PARAMETER 0x000E\r | |
611 | #define PXE_STATCODE_INVALID_UNDI 0x000F\r | |
612 | #define PXE_STATCODE_IPV4_NOT_SUPPORTED 0x0010\r | |
613 | #define PXE_STATCODE_IPV6_NOT_SUPPORTED 0x0011\r | |
614 | #define PXE_STATCODE_NOT_ENOUGH_MEMORY 0x0012\r | |
615 | #define PXE_STATCODE_NO_DATA 0x0013\r | |
616 | \r | |
617 | typedef PXE_UINT16 PXE_IFNUM;\r | |
618 | \r | |
3ed785e9 | 619 | ///\r |
620 | /// This interface number must be passed to the S/W UNDI Start command.\r | |
621 | ///\r | |
959ccb23 | 622 | #define PXE_IFNUM_START 0x0000\r |
623 | \r | |
3ed785e9 | 624 | ///\r |
625 | /// This interface number is returned by the S/W UNDI Get State and\r | |
626 | /// Start commands if information in the CDB, CPB or DB is invalid.\r | |
627 | ///\r | |
959ccb23 | 628 | #define PXE_IFNUM_INVALID 0x0000\r |
629 | \r | |
630 | typedef PXE_UINT16 PXE_CONTROL;\r | |
631 | \r | |
3ed785e9 | 632 | ///\r |
633 | /// Setting this flag directs the UNDI to queue this command for later\r | |
634 | /// execution if the UNDI is busy and it supports command queuing.\r | |
635 | /// If queuing is not supported, a PXE_STATCODE_INVALID_CONTROL error\r | |
636 | /// is returned. If the queue is full, a PXE_STATCODE_CDB_QUEUE_FULL\r | |
637 | /// error is returned.\r | |
638 | ///\r | |
959ccb23 | 639 | #define PXE_CONTROL_QUEUE_IF_BUSY 0x0002\r |
640 | \r | |
3ed785e9 | 641 | ///\r |
642 | /// These two bit values are used to determine if there are more UNDI\r | |
643 | /// CDB structures following this one. If the link bit is set, there\r | |
644 | /// must be a CDB structure following this one. Execution will start\r | |
645 | /// on the next CDB structure as soon as this one completes successfully.\r | |
646 | /// If an error is generated by this command, execution will stop.\r | |
647 | ///\r | |
959ccb23 | 648 | #define PXE_CONTROL_LINK 0x0001\r |
649 | #define PXE_CONTROL_LAST_CDB_IN_LIST 0x0000\r | |
650 | \r | |
651 | typedef PXE_UINT8 PXE_FRAME_TYPE;\r | |
652 | \r | |
653 | #define PXE_FRAME_TYPE_NONE 0x00\r | |
654 | #define PXE_FRAME_TYPE_UNICAST 0x01\r | |
655 | #define PXE_FRAME_TYPE_BROADCAST 0x02\r | |
656 | #define PXE_FRAME_TYPE_FILTERED_MULTICAST 0x03\r | |
657 | #define PXE_FRAME_TYPE_PROMISCUOUS 0x04\r | |
658 | #define PXE_FRAME_TYPE_PROMISCUOUS_MULTICAST 0x05\r | |
659 | \r | |
660 | #define PXE_FRAME_TYPE_MULTICAST PXE_FRAME_TYPE_FILTERED_MULTICAST \r | |
661 | \r | |
662 | typedef PXE_UINT32 PXE_IPV4;\r | |
663 | \r | |
664 | typedef PXE_UINT32 PXE_IPV6[4];\r | |
665 | #define PXE_MAC_LENGTH 32\r | |
666 | \r | |
667 | typedef PXE_UINT8 PXE_MAC_ADDR[PXE_MAC_LENGTH];\r | |
668 | \r | |
669 | typedef PXE_UINT8 PXE_IFTYPE;\r | |
670 | typedef UINT16 PXE_MEDIA_PROTOCOL;\r | |
671 | \r | |
3ed785e9 | 672 | ///\r |
673 | /// This information is from the ARP section of RFC 1700.\r | |
674 | ///\r | |
675 | /// 1 Ethernet (10Mb) [JBP]\r | |
676 | /// 2 Experimental Ethernet (3Mb) [JBP]\r | |
677 | /// 3 Amateur Radio AX.25 [PXK]\r | |
678 | /// 4 Proteon ProNET Token Ring [JBP]\r | |
679 | /// 5 Chaos [GXP]\r | |
680 | /// 6 IEEE 802 Networks [JBP]\r | |
681 | /// 7 ARCNET [JBP]\r | |
682 | /// 8 Hyperchannel [JBP]\r | |
683 | /// 9 Lanstar [TU]\r | |
684 | /// 10 Autonet Short Address [MXB1]\r | |
685 | /// 11 LocalTalk [JKR1]\r | |
686 | /// 12 LocalNet (IBM* PCNet or SYTEK* LocalNET) [JXM]\r | |
687 | /// 13 Ultra link [RXD2]\r | |
688 | /// 14 SMDS [GXC1]\r | |
689 | /// 15 Frame Relay [AGM]\r | |
690 | /// 16 Asynchronous Transmission Mode (ATM) [JXB2]\r | |
691 | /// 17 HDLC [JBP]\r | |
692 | /// 18 Fibre Channel [Yakov Rekhter]\r | |
693 | /// 19 Asynchronous Transmission Mode (ATM) [Mark Laubach]\r | |
694 | /// 20 Serial Line [JBP]\r | |
695 | /// 21 Asynchronous Transmission Mode (ATM) [MXB1]\r | |
696 | ///\r | |
697 | /// * Other names and brands may be claimed as the property of others.\r | |
698 | ///\r | |
959ccb23 | 699 | #define PXE_IFTYPE_ETHERNET 0x01\r |
700 | #define PXE_IFTYPE_TOKENRING 0x04\r | |
701 | #define PXE_IFTYPE_FIBRE_CHANNEL 0x12\r | |
702 | \r | |
703 | typedef struct s_pxe_hw_undi {\r | |
3ed785e9 | 704 | PXE_UINT32 Signature; ///< PXE_ROMID_SIGNATURE\r |
705 | PXE_UINT8 Len; ///< sizeof(PXE_HW_UNDI)\r | |
706 | PXE_UINT8 Fudge; ///< makes 8-bit cksum equal zero\r | |
707 | PXE_UINT8 Rev; ///< PXE_ROMID_REV\r | |
708 | PXE_UINT8 IFcnt; ///< physical connector count\r | |
709 | PXE_UINT8 MajorVer; ///< PXE_ROMID_MAJORVER\r | |
710 | PXE_UINT8 MinorVer; ///< PXE_ROMID_MINORVER\r | |
711 | PXE_UINT16 reserved; ///< zero, not used\r | |
712 | PXE_UINT32 Implementation; ///< implementation flags\r | |
713 | ///< reserved ///< vendor use\r | |
714 | ///< UINT32 Status; ///< status port\r | |
715 | ///< UINT32 Command; ///< command port\r | |
716 | ///< UINT64 CDBaddr; ///< CDB address port\r | |
717 | ///<\r | |
959ccb23 | 718 | } PXE_HW_UNDI;\r |
719 | \r | |
3ed785e9 | 720 | ///\r |
721 | /// Status port bit definitions\r | |
722 | ///\r | |
723 | \r | |
724 | ///\r | |
725 | /// UNDI operation state\r | |
726 | ///\r | |
959ccb23 | 727 | #define PXE_HWSTAT_STATE_MASK 0xC0000000\r |
728 | #define PXE_HWSTAT_BUSY 0xC0000000\r | |
729 | #define PXE_HWSTAT_INITIALIZED 0x80000000\r | |
730 | #define PXE_HWSTAT_STARTED 0x40000000\r | |
731 | #define PXE_HWSTAT_STOPPED 0x00000000\r | |
732 | \r | |
3ed785e9 | 733 | ///\r |
734 | /// If set, last command failed\r | |
735 | ///\r | |
959ccb23 | 736 | #define PXE_HWSTAT_COMMAND_FAILED 0x20000000\r |
737 | \r | |
3ed785e9 | 738 | ///\r |
739 | /// If set, identifies enabled receive filters\r | |
740 | ///\r | |
959ccb23 | 741 | #define PXE_HWSTAT_PROMISCUOUS_MULTICAST_RX_ENABLED 0x00001000\r |
742 | #define PXE_HWSTAT_PROMISCUOUS_RX_ENABLED 0x00000800\r | |
743 | #define PXE_HWSTAT_BROADCAST_RX_ENABLED 0x00000400\r | |
744 | #define PXE_HWSTAT_MULTICAST_RX_ENABLED 0x00000200\r | |
745 | #define PXE_HWSTAT_UNICAST_RX_ENABLED 0x00000100\r | |
746 | \r | |
3ed785e9 | 747 | ///\r |
748 | /// If set, identifies enabled external interrupts\r | |
749 | ///\r | |
959ccb23 | 750 | #define PXE_HWSTAT_SOFTWARE_INT_ENABLED 0x00000080\r |
751 | #define PXE_HWSTAT_TX_COMPLETE_INT_ENABLED 0x00000040\r | |
752 | #define PXE_HWSTAT_PACKET_RX_INT_ENABLED 0x00000020\r | |
753 | #define PXE_HWSTAT_CMD_COMPLETE_INT_ENABLED 0x00000010\r | |
754 | \r | |
3ed785e9 | 755 | ///\r |
756 | /// If set, identifies pending interrupts\r | |
757 | ///\r | |
959ccb23 | 758 | #define PXE_HWSTAT_SOFTWARE_INT_PENDING 0x00000008\r |
759 | #define PXE_HWSTAT_TX_COMPLETE_INT_PENDING 0x00000004\r | |
760 | #define PXE_HWSTAT_PACKET_RX_INT_PENDING 0x00000002\r | |
761 | #define PXE_HWSTAT_CMD_COMPLETE_INT_PENDING 0x00000001\r | |
762 | \r | |
3ed785e9 | 763 | ///\r |
764 | /// Command port definitions\r | |
765 | ///\r | |
766 | \r | |
767 | ///\r | |
768 | /// If set, CDB identified in CDBaddr port is given to UNDI.\r | |
769 | /// If not set, other bits in this word will be processed.\r | |
770 | ///\r | |
959ccb23 | 771 | #define PXE_HWCMD_ISSUE_COMMAND 0x80000000\r |
772 | #define PXE_HWCMD_INTS_AND_FILTS 0x00000000\r | |
773 | \r | |
3ed785e9 | 774 | ///\r |
775 | /// Use these to enable/disable receive filters.\r | |
776 | ///\r | |
959ccb23 | 777 | #define PXE_HWCMD_PROMISCUOUS_MULTICAST_RX_ENABLE 0x00001000\r |
778 | #define PXE_HWCMD_PROMISCUOUS_RX_ENABLE 0x00000800\r | |
779 | #define PXE_HWCMD_BROADCAST_RX_ENABLE 0x00000400\r | |
780 | #define PXE_HWCMD_MULTICAST_RX_ENABLE 0x00000200\r | |
781 | #define PXE_HWCMD_UNICAST_RX_ENABLE 0x00000100\r | |
782 | \r | |
3ed785e9 | 783 | ///\r |
784 | /// Use these to enable/disable external interrupts\r | |
785 | ///\r | |
959ccb23 | 786 | #define PXE_HWCMD_SOFTWARE_INT_ENABLE 0x00000080\r |
787 | #define PXE_HWCMD_TX_COMPLETE_INT_ENABLE 0x00000040\r | |
788 | #define PXE_HWCMD_PACKET_RX_INT_ENABLE 0x00000020\r | |
789 | #define PXE_HWCMD_CMD_COMPLETE_INT_ENABLE 0x00000010\r | |
790 | \r | |
3ed785e9 | 791 | ///\r |
792 | /// Use these to clear pending external interrupts\r | |
793 | ///\r | |
959ccb23 | 794 | #define PXE_HWCMD_CLEAR_SOFTWARE_INT 0x00000008\r |
795 | #define PXE_HWCMD_CLEAR_TX_COMPLETE_INT 0x00000004\r | |
796 | #define PXE_HWCMD_CLEAR_PACKET_RX_INT 0x00000002\r | |
797 | #define PXE_HWCMD_CLEAR_CMD_COMPLETE_INT 0x00000001\r | |
798 | \r | |
799 | typedef struct s_pxe_sw_undi {\r | |
3ed785e9 | 800 | PXE_UINT32 Signature; ///< PXE_ROMID_SIGNATURE\r |
801 | PXE_UINT8 Len; ///< sizeof(PXE_SW_UNDI)\r | |
802 | PXE_UINT8 Fudge; ///< makes 8-bit cksum zero\r | |
803 | PXE_UINT8 Rev; ///< PXE_ROMID_REV\r | |
804 | PXE_UINT8 IFcnt; ///< physical connector count\r | |
805 | PXE_UINT8 MajorVer; ///< PXE_ROMID_MAJORVER\r | |
806 | PXE_UINT8 MinorVer; ///< PXE_ROMID_MINORVER\r | |
807 | PXE_UINT16 reserved1; ///< zero, not used\r | |
808 | PXE_UINT32 Implementation; ///< Implementation flags\r | |
809 | PXE_UINT64 EntryPoint; ///< API entry point\r | |
810 | PXE_UINT8 reserved2[3]; ///< zero, not used\r | |
811 | PXE_UINT8 BusCnt; ///< number of bustypes supported\r | |
812 | PXE_UINT32 BusType[1]; ///< list of supported bustypes\r | |
959ccb23 | 813 | } PXE_SW_UNDI;\r |
814 | \r | |
815 | typedef union u_pxe_undi {\r | |
816 | PXE_HW_UNDI hw;\r | |
817 | PXE_SW_UNDI sw;\r | |
818 | } PXE_UNDI;\r | |
819 | \r | |
3ed785e9 | 820 | ///\r |
821 | /// Signature of !PXE structure\r | |
822 | ///\r | |
959ccb23 | 823 | #define PXE_ROMID_SIGNATURE PXE_BUSTYPE ('!', 'P', 'X', 'E')\r |
824 | \r | |
3ed785e9 | 825 | ///\r |
826 | /// !PXE structure format revision\r | |
827 | ///\r | |
959ccb23 | 828 | #define PXE_ROMID_REV 0x02\r |
829 | \r | |
3ed785e9 | 830 | ///\r |
831 | /// UNDI command interface revision. These are the values that get sent\r | |
832 | /// in option 94 (Client Network Interface Identifier) in the DHCP Discover\r | |
833 | /// and PXE Boot Server Request packets.\r | |
834 | ///\r | |
959ccb23 | 835 | #define PXE_ROMID_MAJORVER 0x03\r |
836 | #define PXE_ROMID_MINORVER 0x01\r | |
837 | \r | |
3ed785e9 | 838 | ///\r |
839 | /// Implementation flags\r | |
840 | ///\r | |
959ccb23 | 841 | #define PXE_ROMID_IMP_HW_UNDI 0x80000000\r |
842 | #define PXE_ROMID_IMP_SW_VIRT_ADDR 0x40000000\r | |
843 | #define PXE_ROMID_IMP_64BIT_DEVICE 0x00010000\r | |
844 | #define PXE_ROMID_IMP_FRAG_SUPPORTED 0x00008000\r | |
845 | #define PXE_ROMID_IMP_CMD_LINK_SUPPORTED 0x00004000\r | |
846 | #define PXE_ROMID_IMP_CMD_QUEUE_SUPPORTED 0x00002000\r | |
847 | #define PXE_ROMID_IMP_MULTI_FRAME_SUPPORTED 0x00001000\r | |
848 | #define PXE_ROMID_IMP_NVDATA_SUPPORT_MASK 0x00000C00\r | |
849 | #define PXE_ROMID_IMP_NVDATA_BULK_WRITABLE 0x00000C00\r | |
850 | #define PXE_ROMID_IMP_NVDATA_SPARSE_WRITABLE 0x00000800\r | |
851 | #define PXE_ROMID_IMP_NVDATA_READ_ONLY 0x00000400\r | |
852 | #define PXE_ROMID_IMP_NVDATA_NOT_AVAILABLE 0x00000000\r | |
853 | #define PXE_ROMID_IMP_STATISTICS_SUPPORTED 0x00000200\r | |
854 | #define PXE_ROMID_IMP_STATION_ADDR_SETTABLE 0x00000100\r | |
855 | #define PXE_ROMID_IMP_PROMISCUOUS_MULTICAST_RX_SUPPORTED 0x00000080\r | |
856 | #define PXE_ROMID_IMP_PROMISCUOUS_RX_SUPPORTED 0x00000040\r | |
857 | #define PXE_ROMID_IMP_BROADCAST_RX_SUPPORTED 0x00000020\r | |
858 | #define PXE_ROMID_IMP_FILTERED_MULTICAST_RX_SUPPORTED 0x00000010\r | |
859 | #define PXE_ROMID_IMP_SOFTWARE_INT_SUPPORTED 0x00000008\r | |
860 | #define PXE_ROMID_IMP_TX_COMPLETE_INT_SUPPORTED 0x00000004\r | |
861 | #define PXE_ROMID_IMP_PACKET_RX_INT_SUPPORTED 0x00000002\r | |
862 | #define PXE_ROMID_IMP_CMD_COMPLETE_INT_SUPPORTED 0x00000001\r | |
863 | \r | |
864 | typedef struct s_pxe_cdb {\r | |
865 | PXE_OPCODE OpCode;\r | |
866 | PXE_OPFLAGS OpFlags;\r | |
867 | PXE_UINT16 CPBsize;\r | |
868 | PXE_UINT16 DBsize;\r | |
869 | PXE_UINT64 CPBaddr;\r | |
870 | PXE_UINT64 DBaddr;\r | |
871 | PXE_STATCODE StatCode;\r | |
872 | PXE_STATFLAGS StatFlags;\r | |
873 | PXE_UINT16 IFnum;\r | |
874 | PXE_CONTROL Control;\r | |
875 | } PXE_CDB;\r | |
876 | \r | |
877 | typedef union u_pxe_ip_addr {\r | |
878 | PXE_IPV6 IPv6;\r | |
879 | PXE_IPV4 IPv4;\r | |
880 | } PXE_IP_ADDR;\r | |
881 | \r | |
882 | typedef union pxe_device {\r | |
3ed785e9 | 883 | ///\r |
884 | /// PCI and PC Card NICs are both identified using bus, device\r | |
885 | /// and function numbers. For PC Card, this may require PC\r | |
886 | /// Card services to be loaded in the BIOS or preboot\r | |
887 | /// environment.\r | |
888 | ///\r | |
959ccb23 | 889 | struct {\r |
3ed785e9 | 890 | ///\r |
891 | /// See S/W UNDI ROMID structure definition for PCI and\r | |
892 | /// PCC BusType definitions.\r | |
893 | ///\r | |
959ccb23 | 894 | PXE_UINT32 BusType;\r |
895 | \r | |
3ed785e9 | 896 | ///\r |
897 | /// Bus, device & function numbers that locate this device.\r | |
898 | ///\r | |
959ccb23 | 899 | PXE_UINT16 Bus;\r |
900 | PXE_UINT8 Device;\r | |
901 | PXE_UINT8 Function;\r | |
902 | }\r | |
903 | PCI, PCC;\r | |
904 | \r | |
959ccb23 | 905 | } PXE_DEVICE;\r |
906 | \r | |
3ed785e9 | 907 | ///\r |
908 | /// cpb and db definitions\r | |
909 | ///\r | |
910 | #define MAX_PCI_CONFIG_LEN 64 ///< # of dwords\r | |
911 | #define MAX_EEPROM_LEN 128 ///< # of dwords\r | |
912 | #define MAX_XMIT_BUFFERS 32 ///< recycling Q length for xmit_done\r | |
959ccb23 | 913 | #define MAX_MCAST_ADDRESS_CNT 8\r |
914 | \r | |
915 | typedef struct s_pxe_cpb_start_30 {\r | |
3ed785e9 | 916 | ///\r |
917 | /// PXE_VOID Delay(UINTN microseconds);\r | |
918 | ///\r | |
919 | /// UNDI will never request a delay smaller than 10 microseconds\r | |
920 | /// and will always request delays in increments of 10 microseconds.\r | |
921 | /// The Delay() CallBack routine must delay between n and n + 10\r | |
922 | /// microseconds before returning control to the UNDI.\r | |
923 | ///\r | |
924 | /// This field cannot be set to zero.\r | |
925 | ///\r | |
959ccb23 | 926 | UINT64 Delay;\r |
927 | \r | |
3ed785e9 | 928 | ///\r |
929 | /// PXE_VOID Block(UINT32 enable);\r | |
930 | ///\r | |
931 | /// UNDI may need to block multi-threaded/multi-processor access to\r | |
932 | /// critical code sections when programming or accessing the network\r | |
933 | /// device. To this end, a blocking service is needed by the UNDI.\r | |
934 | /// When UNDI needs a block, it will call Block() passing a non-zero\r | |
935 | /// value. When UNDI no longer needs a block, it will call Block()\r | |
936 | /// with a zero value. When called, if the Block() is already enabled,\r | |
937 | /// do not return control to the UNDI until the previous Block() is\r | |
938 | /// disabled.\r | |
939 | ///\r | |
940 | /// This field cannot be set to zero.\r | |
941 | ///\r | |
959ccb23 | 942 | UINT64 Block;\r |
943 | \r | |
3ed785e9 | 944 | ///\r |
945 | /// PXE_VOID Virt2Phys(UINT64 virtual, UINT64 physical_ptr);\r | |
946 | ///\r | |
947 | /// UNDI will pass the virtual address of a buffer and the virtual\r | |
948 | /// address of a 64-bit physical buffer. Convert the virtual address\r | |
949 | /// to a physical address and write the result to the physical address\r | |
950 | /// buffer. If virtual and physical addresses are the same, just\r | |
951 | /// copy the virtual address to the physical address buffer.\r | |
952 | ///\r | |
953 | /// This field can be set to zero if virtual and physical addresses\r | |
954 | /// are equal.\r | |
955 | ///\r | |
959ccb23 | 956 | UINT64 Virt2Phys;\r |
3ed785e9 | 957 | ///\r |
958 | /// PXE_VOID Mem_IO(UINT8 read_write, UINT8 len, UINT64 port,\r | |
959 | /// UINT64 buf_addr);\r | |
960 | ///\r | |
961 | /// UNDI will read or write the device io space using this call back\r | |
962 | /// function. It passes the number of bytes as the len parameter and it\r | |
963 | /// will be either 1,2,4 or 8.\r | |
964 | ///\r | |
965 | /// This field can not be set to zero.\r | |
966 | ///\r | |
959ccb23 | 967 | UINT64 Mem_IO;\r |
968 | } PXE_CPB_START_30;\r | |
969 | \r | |
970 | typedef struct s_pxe_cpb_start_31 {\r | |
3ed785e9 | 971 | ///\r |
972 | /// PXE_VOID Delay(UINT64 UnqId, UINTN microseconds);\r | |
973 | ///\r | |
974 | /// UNDI will never request a delay smaller than 10 microseconds\r | |
975 | /// and will always request delays in increments of 10 microseconds.\r | |
976 | /// The Delay() CallBack routine must delay between n and n + 10\r | |
977 | /// microseconds before returning control to the UNDI.\r | |
978 | ///\r | |
979 | /// This field cannot be set to zero.\r | |
980 | ///\r | |
959ccb23 | 981 | UINT64 Delay;\r |
982 | \r | |
3ed785e9 | 983 | ///\r |
984 | /// PXE_VOID Block(UINT64 unq_id, UINT32 enable);\r | |
985 | ///\r | |
986 | /// UNDI may need to block multi-threaded/multi-processor access to\r | |
987 | /// critical code sections when programming or accessing the network\r | |
988 | /// device. To this end, a blocking service is needed by the UNDI.\r | |
989 | /// When UNDI needs a block, it will call Block() passing a non-zero\r | |
990 | /// value. When UNDI no longer needs a block, it will call Block()\r | |
991 | /// with a zero value. When called, if the Block() is already enabled,\r | |
992 | /// do not return control to the UNDI until the previous Block() is\r | |
993 | /// disabled.\r | |
994 | ///\r | |
995 | /// This field cannot be set to zero.\r | |
996 | ///\r | |
959ccb23 | 997 | UINT64 Block;\r |
998 | \r | |
3ed785e9 | 999 | ///\r |
1000 | /// PXE_VOID Virt2Phys(UINT64 UnqId, UINT64 virtual, UINT64 physical_ptr);\r | |
1001 | ///\r | |
1002 | /// UNDI will pass the virtual address of a buffer and the virtual\r | |
1003 | /// address of a 64-bit physical buffer. Convert the virtual address\r | |
1004 | /// to a physical address and write the result to the physical address\r | |
1005 | /// buffer. If virtual and physical addresses are the same, just\r | |
1006 | /// copy the virtual address to the physical address buffer.\r | |
1007 | ///\r | |
1008 | /// This field can be set to zero if virtual and physical addresses\r | |
1009 | /// are equal.\r | |
1010 | ///\r | |
959ccb23 | 1011 | UINT64 Virt2Phys;\r |
3ed785e9 | 1012 | ///\r |
1013 | /// PXE_VOID Mem_IO(UINT64 UnqId, UINT8 read_write, UINT8 len, UINT64 port,\r | |
1014 | /// UINT64 buf_addr);\r | |
1015 | ///\r | |
1016 | /// UNDI will read or write the device io space using this call back\r | |
1017 | /// function. It passes the number of bytes as the len parameter and it\r | |
1018 | /// will be either 1,2,4 or 8.\r | |
1019 | ///\r | |
1020 | /// This field can not be set to zero.\r | |
1021 | ///\r | |
959ccb23 | 1022 | UINT64 Mem_IO;\r |
3ed785e9 | 1023 | ///\r |
1024 | /// PXE_VOID Map_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size,\r | |
1025 | /// UINT32 Direction, UINT64 mapped_addr);\r | |
1026 | ///\r | |
1027 | /// UNDI will pass the virtual address of a buffer, direction of the data\r | |
1028 | /// flow from/to the mapped buffer (the constants are defined below)\r | |
1029 | /// and a place holder (pointer) for the mapped address.\r | |
1030 | /// This call will Map the given address to a physical DMA address and write\r | |
1031 | /// the result to the mapped_addr pointer. If there is no need to\r | |
1032 | /// map the given address to a lower address (i.e. the given address is\r | |
1033 | /// associated with a physical address that is already compatible to be\r | |
1034 | /// used with the DMA, it converts the given virtual address to it's\r | |
1035 | /// physical address and write that in the mapped address pointer.\r | |
1036 | ///\r | |
1037 | /// This field can be set to zero if there is no mapping service available\r | |
1038 | ///\r | |
959ccb23 | 1039 | UINT64 Map_Mem;\r |
1040 | \r | |
3ed785e9 | 1041 | ///\r |
1042 | /// PXE_VOID UnMap_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size,\r | |
1043 | /// UINT32 Direction, UINT64 mapped_addr);\r | |
1044 | ///\r | |
1045 | /// UNDI will pass the virtual and mapped addresses of a buffer\r | |
1046 | /// This call will un map the given address\r | |
1047 | ///\r | |
1048 | /// This field can be set to zero if there is no unmapping service available\r | |
1049 | ///\r | |
959ccb23 | 1050 | UINT64 UnMap_Mem;\r |
1051 | \r | |
3ed785e9 | 1052 | ///\r |
1053 | /// PXE_VOID Sync_Mem(UINT64 unq_id, UINT64 virtual,\r | |
1054 | /// UINT32 size, UINT32 Direction, UINT64 mapped_addr);\r | |
1055 | ///\r | |
1056 | /// UNDI will pass the virtual and mapped addresses of a buffer\r | |
1057 | /// This call will synchronize the contents of both the virtual and mapped\r | |
1058 | /// buffers for the given Direction.\r | |
1059 | ///\r | |
1060 | /// This field can be set to zero if there is no service available\r | |
1061 | ///\r | |
959ccb23 | 1062 | UINT64 Sync_Mem;\r |
1063 | \r | |
3ed785e9 | 1064 | ///\r |
1065 | /// protocol driver can provide anything for this Unique_ID, UNDI remembers\r | |
1066 | /// that as just a 64bit value assocaited to the interface specified by\r | |
1067 | /// the ifnum and gives it back as a parameter to all the call-back routines\r | |
1068 | /// when calling for that interface!\r | |
1069 | ///\r | |
959ccb23 | 1070 | UINT64 Unique_ID;\r |
959ccb23 | 1071 | } PXE_CPB_START_31;\r |
1072 | \r | |
1073 | #define TO_AND_FROM_DEVICE 0\r | |
1074 | #define FROM_DEVICE 1\r | |
1075 | #define TO_DEVICE 2\r | |
1076 | \r | |
1077 | #define PXE_DELAY_MILLISECOND 1000\r | |
1078 | #define PXE_DELAY_SECOND 1000000\r | |
1079 | #define PXE_IO_READ 0\r | |
1080 | #define PXE_IO_WRITE 1\r | |
1081 | #define PXE_MEM_READ 2\r | |
1082 | #define PXE_MEM_WRITE 4\r | |
1083 | \r | |
1084 | typedef struct s_pxe_db_get_init_info {\r | |
3ed785e9 | 1085 | ///\r |
1086 | /// Minimum length of locked memory buffer that must be given to\r | |
1087 | /// the Initialize command. Giving UNDI more memory will generally\r | |
1088 | /// give better performance.\r | |
1089 | ///\r | |
1090 | /// If MemoryRequired is zero, the UNDI does not need and will not\r | |
1091 | /// use system memory to receive and transmit packets.\r | |
1092 | ///\r | |
959ccb23 | 1093 | PXE_UINT32 MemoryRequired;\r |
1094 | \r | |
3ed785e9 | 1095 | ///\r |
1096 | /// Maximum frame data length for Tx/Rx excluding the media header.\r | |
1097 | ///\r | |
959ccb23 | 1098 | PXE_UINT32 FrameDataLen;\r |
1099 | \r | |
3ed785e9 | 1100 | ///\r |
1101 | /// Supported link speeds are in units of mega bits. Common ethernet\r | |
1102 | /// values are 10, 100 and 1000. Unused LinkSpeeds[] entries are zero\r | |
1103 | /// filled.\r | |
1104 | ///\r | |
959ccb23 | 1105 | PXE_UINT32 LinkSpeeds[4];\r |
1106 | \r | |
3ed785e9 | 1107 | ///\r |
1108 | /// Number of non-volatile storage items.\r | |
1109 | ///\r | |
959ccb23 | 1110 | PXE_UINT32 NvCount;\r |
1111 | \r | |
3ed785e9 | 1112 | ///\r |
1113 | /// Width of non-volatile storage item in bytes. 0, 1, 2 or 4\r | |
1114 | ///\r | |
959ccb23 | 1115 | PXE_UINT16 NvWidth;\r |
1116 | \r | |
3ed785e9 | 1117 | ///\r |
1118 | /// Media header length. This is the typical media header length for\r | |
1119 | /// this UNDI. This information is needed when allocating receive\r | |
1120 | /// and transmit buffers.\r | |
1121 | ///\r | |
959ccb23 | 1122 | PXE_UINT16 MediaHeaderLen;\r |
1123 | \r | |
3ed785e9 | 1124 | ///\r |
1125 | /// Number of bytes in the NIC hardware (MAC) address.\r | |
1126 | ///\r | |
959ccb23 | 1127 | PXE_UINT16 HWaddrLen;\r |
1128 | \r | |
3ed785e9 | 1129 | ///\r |
1130 | /// Maximum number of multicast MAC addresses in the multicast\r | |
1131 | /// MAC address filter list.\r | |
1132 | ///\r | |
959ccb23 | 1133 | PXE_UINT16 MCastFilterCnt;\r |
1134 | \r | |
3ed785e9 | 1135 | ///\r |
1136 | /// Default number and size of transmit and receive buffers that will\r | |
1137 | /// be allocated by the UNDI. If MemoryRequired is non-zero, this\r | |
1138 | /// allocation will come out of the memory buffer given to the Initialize\r | |
1139 | /// command. If MemoryRequired is zero, this allocation will come out of\r | |
1140 | /// memory on the NIC.\r | |
1141 | ///\r | |
959ccb23 | 1142 | PXE_UINT16 TxBufCnt;\r |
1143 | PXE_UINT16 TxBufSize;\r | |
1144 | PXE_UINT16 RxBufCnt;\r | |
1145 | PXE_UINT16 RxBufSize;\r | |
1146 | \r | |
3ed785e9 | 1147 | ///\r |
1148 | /// Hardware interface types defined in the Assigned Numbers RFC\r | |
1149 | /// and used in DHCP and ARP packets.\r | |
1150 | /// See the PXE_IFTYPE typedef and PXE_IFTYPE_xxx macros.\r | |
1151 | ///\r | |
959ccb23 | 1152 | PXE_UINT8 IFtype;\r |
1153 | \r | |
3ed785e9 | 1154 | ///\r |
1155 | /// Supported duplex. See PXE_DUPLEX_xxxxx #defines below.\r | |
1156 | ///\r | |
959ccb23 | 1157 | PXE_UINT8 SupportedDuplexModes;\r |
1158 | \r | |
3ed785e9 | 1159 | ///\r |
1160 | /// Supported loopback options. See PXE_LOOPBACK_xxxxx #defines below.\r | |
1161 | ///\r | |
959ccb23 | 1162 | PXE_UINT8 SupportedLoopBackModes;\r |
1163 | } PXE_DB_GET_INIT_INFO;\r | |
1164 | \r | |
1165 | #define PXE_MAX_TXRX_UNIT_ETHER 1500\r | |
1166 | \r | |
1167 | #define PXE_HWADDR_LEN_ETHER 0x0006\r | |
1168 | #define PXE_MAC_HEADER_LEN_ETHER 0x000E\r | |
1169 | \r | |
1170 | #define PXE_DUPLEX_ENABLE_FULL_SUPPORTED 1\r | |
1171 | #define PXE_DUPLEX_FORCE_FULL_SUPPORTED 2\r | |
1172 | \r | |
1173 | #define PXE_LOOPBACK_INTERNAL_SUPPORTED 1\r | |
1174 | #define PXE_LOOPBACK_EXTERNAL_SUPPORTED 2\r | |
1175 | \r | |
1176 | typedef struct s_pxe_pci_config_info {\r | |
3ed785e9 | 1177 | ///\r |
1178 | /// This is the flag field for the PXE_DB_GET_CONFIG_INFO union.\r | |
1179 | /// For PCI bus devices, this field is set to PXE_BUSTYPE_PCI.\r | |
1180 | ///\r | |
959ccb23 | 1181 | UINT32 BusType;\r |
1182 | \r | |
3ed785e9 | 1183 | ///\r |
1184 | /// This identifies the PCI network device that this UNDI interface\r | |
1185 | /// is bound to.\r | |
1186 | ///\r | |
959ccb23 | 1187 | UINT16 Bus;\r |
1188 | UINT8 Device;\r | |
1189 | UINT8 Function;\r | |
1190 | \r | |
3ed785e9 | 1191 | ///\r |
1192 | /// This is a copy of the PCI configuration space for this\r | |
1193 | /// network device.\r | |
1194 | ///\r | |
959ccb23 | 1195 | union {\r |
1196 | UINT8 Byte[256];\r | |
1197 | UINT16 Word[128];\r | |
1198 | UINT32 Dword[64];\r | |
1199 | } Config;\r | |
1200 | } PXE_PCI_CONFIG_INFO;\r | |
1201 | \r | |
1202 | typedef struct s_pxe_pcc_config_info {\r | |
3ed785e9 | 1203 | ///\r |
1204 | /// This is the flag field for the PXE_DB_GET_CONFIG_INFO union.\r | |
1205 | /// For PCC bus devices, this field is set to PXE_BUSTYPE_PCC.\r | |
1206 | ///\r | |
959ccb23 | 1207 | PXE_UINT32 BusType;\r |
1208 | \r | |
3ed785e9 | 1209 | ///\r |
1210 | /// This identifies the PCC network device that this UNDI interface\r | |
1211 | /// is bound to.\r | |
1212 | ///\r | |
959ccb23 | 1213 | PXE_UINT16 Bus;\r |
1214 | PXE_UINT8 Device;\r | |
1215 | PXE_UINT8 Function;\r | |
1216 | \r | |
3ed785e9 | 1217 | ///\r |
1218 | /// This is a copy of the PCC configuration space for this\r | |
1219 | /// network device.\r | |
1220 | ///\r | |
959ccb23 | 1221 | union {\r |
1222 | PXE_UINT8 Byte[256];\r | |
1223 | PXE_UINT16 Word[128];\r | |
1224 | PXE_UINT32 Dword[64];\r | |
1225 | } Config;\r | |
1226 | } PXE_PCC_CONFIG_INFO;\r | |
1227 | \r | |
1228 | typedef union u_pxe_db_get_config_info {\r | |
1229 | PXE_PCI_CONFIG_INFO pci;\r | |
1230 | PXE_PCC_CONFIG_INFO pcc;\r | |
1231 | } PXE_DB_GET_CONFIG_INFO;\r | |
1232 | \r | |
1233 | typedef struct s_pxe_cpb_initialize {\r | |
3ed785e9 | 1234 | ///\r |
1235 | /// Address of first (lowest) byte of the memory buffer. This buffer must\r | |
1236 | /// be in contiguous physical memory and cannot be swapped out. The UNDI\r | |
1237 | /// will be using this for transmit and receive buffering.\r | |
1238 | ///\r | |
959ccb23 | 1239 | PXE_UINT64 MemoryAddr;\r |
1240 | \r | |
3ed785e9 | 1241 | ///\r |
1242 | /// MemoryLength must be greater than or equal to MemoryRequired\r | |
1243 | /// returned by the Get Init Info command.\r | |
1244 | ///\r | |
959ccb23 | 1245 | PXE_UINT32 MemoryLength;\r |
1246 | \r | |
3ed785e9 | 1247 | ///\r |
1248 | /// Desired link speed in Mbit/sec. Common ethernet values are 10, 100\r | |
1249 | /// and 1000. Setting a value of zero will auto-detect and/or use the\r | |
1250 | /// default link speed (operation depends on UNDI/NIC functionality).\r | |
1251 | ///\r | |
959ccb23 | 1252 | PXE_UINT32 LinkSpeed;\r |
1253 | \r | |
3ed785e9 | 1254 | ///\r |
1255 | /// Suggested number and size of receive and transmit buffers to\r | |
1256 | /// allocate. If MemoryAddr and MemoryLength are non-zero, this\r | |
1257 | /// allocation comes out of the supplied memory buffer. If MemoryAddr\r | |
1258 | /// and MemoryLength are zero, this allocation comes out of memory\r | |
1259 | /// on the NIC.\r | |
1260 | ///\r | |
1261 | /// If these fields are set to zero, the UNDI will allocate buffer\r | |
1262 | /// counts and sizes as it sees fit.\r | |
1263 | ///\r | |
959ccb23 | 1264 | PXE_UINT16 TxBufCnt;\r |
1265 | PXE_UINT16 TxBufSize;\r | |
1266 | PXE_UINT16 RxBufCnt;\r | |
1267 | PXE_UINT16 RxBufSize;\r | |
1268 | \r | |
3ed785e9 | 1269 | ///\r |
1270 | /// The following configuration parameters are optional and must be zero\r | |
1271 | /// to use the default values.\r | |
1272 | ///\r | |
959ccb23 | 1273 | PXE_UINT8 DuplexMode;\r |
1274 | \r | |
1275 | PXE_UINT8 LoopBackMode;\r | |
1276 | } PXE_CPB_INITIALIZE;\r | |
1277 | \r | |
1278 | #define PXE_DUPLEX_DEFAULT 0x00\r | |
1279 | #define PXE_FORCE_FULL_DUPLEX 0x01\r | |
1280 | #define PXE_ENABLE_FULL_DUPLEX 0x02\r | |
1281 | #define PXE_FORCE_HALF_DUPLEX 0x04\r | |
1282 | #define PXE_DISABLE_FULL_DUPLEX 0x08\r | |
1283 | \r | |
1284 | #define LOOPBACK_NORMAL 0\r | |
1285 | #define LOOPBACK_INTERNAL 1\r | |
1286 | #define LOOPBACK_EXTERNAL 2\r | |
1287 | \r | |
1288 | typedef struct s_pxe_db_initialize {\r | |
3ed785e9 | 1289 | ///\r |
1290 | /// Actual amount of memory used from the supplied memory buffer. This\r | |
1291 | /// may be less that the amount of memory suppllied and may be zero if\r | |
1292 | /// the UNDI and network device do not use external memory buffers.\r | |
1293 | ///\r | |
1294 | /// Memory used by the UNDI and network device is allocated from the\r | |
1295 | /// lowest memory buffer address.\r | |
1296 | ///\r | |
959ccb23 | 1297 | PXE_UINT32 MemoryUsed;\r |
1298 | \r | |
3ed785e9 | 1299 | ///\r |
1300 | /// Actual number and size of receive and transmit buffers that were\r | |
1301 | /// allocated.\r | |
1302 | ///\r | |
959ccb23 | 1303 | PXE_UINT16 TxBufCnt;\r |
1304 | PXE_UINT16 TxBufSize;\r | |
1305 | PXE_UINT16 RxBufCnt;\r | |
1306 | PXE_UINT16 RxBufSize;\r | |
1307 | } PXE_DB_INITIALIZE;\r | |
1308 | \r | |
1309 | typedef struct s_pxe_cpb_receive_filters {\r | |
3ed785e9 | 1310 | ///\r |
1311 | /// List of multicast MAC addresses. This list, if present, will\r | |
1312 | /// replace the existing multicast MAC address filter list.\r | |
1313 | ///\r | |
959ccb23 | 1314 | PXE_MAC_ADDR MCastList[MAX_MCAST_ADDRESS_CNT];\r |
1315 | } PXE_CPB_RECEIVE_FILTERS;\r | |
1316 | \r | |
1317 | typedef struct s_pxe_db_receive_filters {\r | |
3ed785e9 | 1318 | ///\r |
1319 | /// Filtered multicast MAC address list.\r | |
1320 | ///\r | |
959ccb23 | 1321 | PXE_MAC_ADDR MCastList[MAX_MCAST_ADDRESS_CNT];\r |
1322 | } PXE_DB_RECEIVE_FILTERS;\r | |
1323 | \r | |
1324 | typedef struct s_pxe_cpb_station_address {\r | |
3ed785e9 | 1325 | ///\r |
1326 | /// If supplied and supported, the current station MAC address\r | |
1327 | /// will be changed.\r | |
1328 | ///\r | |
959ccb23 | 1329 | PXE_MAC_ADDR StationAddr;\r |
1330 | } PXE_CPB_STATION_ADDRESS;\r | |
1331 | \r | |
1332 | typedef struct s_pxe_dpb_station_address {\r | |
3ed785e9 | 1333 | ///\r |
1334 | /// Current station MAC address.\r | |
1335 | ///\r | |
959ccb23 | 1336 | PXE_MAC_ADDR StationAddr;\r |
1337 | \r | |
3ed785e9 | 1338 | ///\r |
1339 | /// Station broadcast MAC address.\r | |
1340 | ///\r | |
959ccb23 | 1341 | PXE_MAC_ADDR BroadcastAddr;\r |
1342 | \r | |
3ed785e9 | 1343 | ///\r |
1344 | /// Permanent station MAC address.\r | |
1345 | ///\r | |
959ccb23 | 1346 | PXE_MAC_ADDR PermanentAddr;\r |
1347 | } PXE_DB_STATION_ADDRESS;\r | |
1348 | \r | |
1349 | typedef struct s_pxe_db_statistics {\r | |
3ed785e9 | 1350 | ///\r |
1351 | /// Bit field identifying what statistic data is collected by the\r | |
1352 | /// UNDI/NIC.\r | |
1353 | /// If bit 0x00 is set, Data[0x00] is collected.\r | |
1354 | /// If bit 0x01 is set, Data[0x01] is collected.\r | |
1355 | /// If bit 0x20 is set, Data[0x20] is collected.\r | |
1356 | /// If bit 0x21 is set, Data[0x21] is collected.\r | |
1357 | /// Etc.\r | |
1358 | ///\r | |
959ccb23 | 1359 | PXE_UINT64 Supported;\r |
1360 | \r | |
3ed785e9 | 1361 | ///\r |
1362 | /// Statistic data.\r | |
1363 | ///\r | |
959ccb23 | 1364 | PXE_UINT64 Data[64];\r |
1365 | } PXE_DB_STATISTICS;\r | |
1366 | \r | |
3ed785e9 | 1367 | ///\r |
1368 | /// Total number of frames received. Includes frames with errors and\r | |
1369 | /// dropped frames.\r | |
1370 | ///\r | |
959ccb23 | 1371 | #define PXE_STATISTICS_RX_TOTAL_FRAMES 0x00\r |
1372 | \r | |
3ed785e9 | 1373 | ///\r |
1374 | /// Number of valid frames received and copied into receive buffers.\r | |
1375 | ///\r | |
959ccb23 | 1376 | #define PXE_STATISTICS_RX_GOOD_FRAMES 0x01\r |
1377 | \r | |
3ed785e9 | 1378 | ///\r |
1379 | /// Number of frames below the minimum length for the media.\r | |
1380 | /// This would be <64 for ethernet.\r | |
1381 | ///\r | |
959ccb23 | 1382 | #define PXE_STATISTICS_RX_UNDERSIZE_FRAMES 0x02\r |
1383 | \r | |
3ed785e9 | 1384 | ///\r |
1385 | /// Number of frames longer than the maxminum length for the\r | |
1386 | /// media. This would be >1500 for ethernet.\r | |
1387 | ///\r | |
959ccb23 | 1388 | #define PXE_STATISTICS_RX_OVERSIZE_FRAMES 0x03\r |
1389 | \r | |
3ed785e9 | 1390 | ///\r |
1391 | /// Valid frames that were dropped because receive buffers were full.\r | |
1392 | ///\r | |
959ccb23 | 1393 | #define PXE_STATISTICS_RX_DROPPED_FRAMES 0x04\r |
1394 | \r | |
3ed785e9 | 1395 | ///\r |
1396 | /// Number of valid unicast frames received and not dropped.\r | |
1397 | ///\r | |
959ccb23 | 1398 | #define PXE_STATISTICS_RX_UNICAST_FRAMES 0x05\r |
1399 | \r | |
3ed785e9 | 1400 | ///\r |
1401 | /// Number of valid broadcast frames received and not dropped.\r | |
1402 | ///\r | |
959ccb23 | 1403 | #define PXE_STATISTICS_RX_BROADCAST_FRAMES 0x06\r |
1404 | \r | |
3ed785e9 | 1405 | ///\r |
1406 | /// Number of valid mutlicast frames received and not dropped.\r | |
1407 | ///\r | |
959ccb23 | 1408 | #define PXE_STATISTICS_RX_MULTICAST_FRAMES 0x07\r |
1409 | \r | |
3ed785e9 | 1410 | ///\r |
1411 | /// Number of frames w/ CRC or alignment errors.\r | |
1412 | ///\r | |
959ccb23 | 1413 | #define PXE_STATISTICS_RX_CRC_ERROR_FRAMES 0x08\r |
1414 | \r | |
3ed785e9 | 1415 | ///\r |
1416 | /// Total number of bytes received. Includes frames with errors\r | |
1417 | /// and dropped frames.\r | |
1418 | ///\r | |
959ccb23 | 1419 | #define PXE_STATISTICS_RX_TOTAL_BYTES 0x09\r |
1420 | \r | |
3ed785e9 | 1421 | ///\r |
1422 | /// Transmit statistics.\r | |
1423 | ///\r | |
959ccb23 | 1424 | #define PXE_STATISTICS_TX_TOTAL_FRAMES 0x0A\r |
1425 | #define PXE_STATISTICS_TX_GOOD_FRAMES 0x0B\r | |
1426 | #define PXE_STATISTICS_TX_UNDERSIZE_FRAMES 0x0C\r | |
1427 | #define PXE_STATISTICS_TX_OVERSIZE_FRAMES 0x0D\r | |
1428 | #define PXE_STATISTICS_TX_DROPPED_FRAMES 0x0E\r | |
1429 | #define PXE_STATISTICS_TX_UNICAST_FRAMES 0x0F\r | |
1430 | #define PXE_STATISTICS_TX_BROADCAST_FRAMES 0x10\r | |
1431 | #define PXE_STATISTICS_TX_MULTICAST_FRAMES 0x11\r | |
1432 | #define PXE_STATISTICS_TX_CRC_ERROR_FRAMES 0x12\r | |
1433 | #define PXE_STATISTICS_TX_TOTAL_BYTES 0x13\r | |
1434 | \r | |
3ed785e9 | 1435 | ///\r |
1436 | /// Number of collisions detection on this subnet.\r | |
1437 | ///\r | |
959ccb23 | 1438 | #define PXE_STATISTICS_COLLISIONS 0x14\r |
1439 | \r | |
3ed785e9 | 1440 | ///\r |
1441 | /// Number of frames destined for unsupported protocol.\r | |
1442 | ///\r | |
959ccb23 | 1443 | #define PXE_STATISTICS_UNSUPPORTED_PROTOCOL 0x15\r |
1444 | \r | |
1445 | typedef struct s_pxe_cpb_mcast_ip_to_mac {\r | |
3ed785e9 | 1446 | ///\r |
1447 | /// Multicast IP address to be converted to multicast MAC address.\r | |
1448 | ///\r | |
959ccb23 | 1449 | PXE_IP_ADDR IP;\r |
1450 | } PXE_CPB_MCAST_IP_TO_MAC;\r | |
1451 | \r | |
1452 | typedef struct s_pxe_db_mcast_ip_to_mac {\r | |
3ed785e9 | 1453 | ///\r |
1454 | /// Multicast MAC address.\r | |
1455 | ///\r | |
959ccb23 | 1456 | PXE_MAC_ADDR MAC;\r |
1457 | } PXE_DB_MCAST_IP_TO_MAC;\r | |
1458 | \r | |
1459 | typedef struct s_pxe_cpb_nvdata_sparse {\r | |
3ed785e9 | 1460 | ///\r |
1461 | /// NvData item list. Only items in this list will be updated.\r | |
1462 | ///\r | |
959ccb23 | 1463 | struct {\r |
3ed785e9 | 1464 | ///\r |
1465 | /// Non-volatile storage address to be changed.\r | |
1466 | ///\r | |
959ccb23 | 1467 | PXE_UINT32 Addr;\r |
1468 | \r | |
3ed785e9 | 1469 | ///\r |
1470 | /// Data item to write into above storage address.\r | |
1471 | ///\r | |
959ccb23 | 1472 | union {\r |
1473 | PXE_UINT8 Byte;\r | |
1474 | PXE_UINT16 Word;\r | |
1475 | PXE_UINT32 Dword;\r | |
1476 | } Data;\r | |
1477 | } Item[MAX_EEPROM_LEN];\r | |
3ed785e9 | 1478 | } PXE_CPB_NVDATA_SPARSE;\r |
959ccb23 | 1479 | \r |
3ed785e9 | 1480 | ///\r |
1481 | /// When using bulk update, the size of the CPB structure must be\r | |
1482 | /// the same size as the non-volatile NIC storage.\r | |
1483 | ///\r | |
959ccb23 | 1484 | typedef union u_pxe_cpb_nvdata_bulk {\r |
3ed785e9 | 1485 | ///\r |
1486 | /// Array of byte-wide data items.\r | |
1487 | ///\r | |
959ccb23 | 1488 | PXE_UINT8 Byte[MAX_EEPROM_LEN << 2];\r |
1489 | \r | |
3ed785e9 | 1490 | ///\r |
1491 | /// Array of word-wide data items.\r | |
1492 | ///\r | |
959ccb23 | 1493 | PXE_UINT16 Word[MAX_EEPROM_LEN << 1];\r |
1494 | \r | |
3ed785e9 | 1495 | ///\r |
1496 | /// Array of dword-wide data items.\r | |
1497 | ///\r | |
959ccb23 | 1498 | PXE_UINT32 Dword[MAX_EEPROM_LEN];\r |
1499 | } PXE_CPB_NVDATA_BULK;\r | |
1500 | \r | |
1501 | typedef struct s_pxe_db_nvdata {\r | |
3ed785e9 | 1502 | ///\r |
1503 | /// Arrays of data items from non-volatile storage.\r | |
1504 | ///\r | |
959ccb23 | 1505 | union {\r |
3ed785e9 | 1506 | ///\r |
1507 | /// Array of byte-wide data items.\r | |
1508 | ///\r | |
959ccb23 | 1509 | PXE_UINT8 Byte[MAX_EEPROM_LEN << 2];\r |
1510 | \r | |
3ed785e9 | 1511 | ///\r |
1512 | /// Array of word-wide data items.\r | |
1513 | ///\r | |
959ccb23 | 1514 | PXE_UINT16 Word[MAX_EEPROM_LEN << 1];\r |
1515 | \r | |
3ed785e9 | 1516 | ///\r |
1517 | /// Array of dword-wide data items.\r | |
1518 | ///\r | |
959ccb23 | 1519 | PXE_UINT32 Dword[MAX_EEPROM_LEN];\r |
1520 | } Data;\r | |
1521 | } PXE_DB_NVDATA;\r | |
1522 | \r | |
1523 | typedef struct s_pxe_db_get_status {\r | |
3ed785e9 | 1524 | ///\r |
1525 | /// Length of next receive frame (header + data). If this is zero,\r | |
1526 | /// there is no next receive frame available.\r | |
1527 | ///\r | |
959ccb23 | 1528 | PXE_UINT32 RxFrameLen;\r |
1529 | \r | |
3ed785e9 | 1530 | ///\r |
1531 | /// Reserved, set to zero.\r | |
1532 | ///\r | |
959ccb23 | 1533 | PXE_UINT32 reserved;\r |
1534 | \r | |
3ed785e9 | 1535 | ///\r |
1536 | /// Addresses of transmitted buffers that need to be recycled.\r | |
1537 | ///\r | |
959ccb23 | 1538 | PXE_UINT64 TxBuffer[MAX_XMIT_BUFFERS];\r |
1539 | } PXE_DB_GET_STATUS;\r | |
1540 | \r | |
1541 | typedef struct s_pxe_cpb_fill_header {\r | |
3ed785e9 | 1542 | ///\r |
1543 | /// Source and destination MAC addresses. These will be copied into\r | |
1544 | /// the media header without doing byte swapping.\r | |
1545 | ///\r | |
959ccb23 | 1546 | PXE_MAC_ADDR SrcAddr;\r |
1547 | PXE_MAC_ADDR DestAddr;\r | |
1548 | \r | |
3ed785e9 | 1549 | ///\r |
1550 | /// Address of first byte of media header. The first byte of packet data\r | |
1551 | /// follows the last byte of the media header.\r | |
1552 | ///\r | |
959ccb23 | 1553 | PXE_UINT64 MediaHeader;\r |
1554 | \r | |
3ed785e9 | 1555 | ///\r |
1556 | /// Length of packet data in bytes (not including the media header).\r | |
1557 | ///\r | |
959ccb23 | 1558 | PXE_UINT32 PacketLen;\r |
1559 | \r | |
3ed785e9 | 1560 | ///\r |
1561 | /// Protocol type. This will be copied into the media header without\r | |
1562 | /// doing byte swapping. Protocol type numbers can be obtained from\r | |
1563 | /// the Assigned Numbers RFC 1700.\r | |
1564 | ///\r | |
959ccb23 | 1565 | PXE_UINT16 Protocol;\r |
1566 | \r | |
3ed785e9 | 1567 | ///\r |
1568 | /// Length of the media header in bytes.\r | |
1569 | ///\r | |
959ccb23 | 1570 | PXE_UINT16 MediaHeaderLen;\r |
1571 | } PXE_CPB_FILL_HEADER;\r | |
1572 | \r | |
1573 | #define PXE_PROTOCOL_ETHERNET_IP 0x0800\r | |
1574 | #define PXE_PROTOCOL_ETHERNET_ARP 0x0806\r | |
1575 | #define MAX_XMIT_FRAGMENTS 16\r | |
1576 | \r | |
1577 | typedef struct s_pxe_cpb_fill_header_fragmented {\r | |
3ed785e9 | 1578 | ///\r |
1579 | /// Source and destination MAC addresses. These will be copied into\r | |
1580 | /// the media header without doing byte swapping.\r | |
1581 | ///\r | |
959ccb23 | 1582 | PXE_MAC_ADDR SrcAddr;\r |
1583 | PXE_MAC_ADDR DestAddr;\r | |
1584 | \r | |
3ed785e9 | 1585 | ///\r |
1586 | /// Length of packet data in bytes (not including the media header).\r | |
1587 | ///\r | |
959ccb23 | 1588 | PXE_UINT32 PacketLen;\r |
1589 | \r | |
3ed785e9 | 1590 | ///\r |
1591 | /// Protocol type. This will be copied into the media header without\r | |
1592 | /// doing byte swapping. Protocol type numbers can be obtained from\r | |
1593 | /// the Assigned Numbers RFC 1700.\r | |
1594 | ///\r | |
959ccb23 | 1595 | PXE_MEDIA_PROTOCOL Protocol;\r |
1596 | \r | |
3ed785e9 | 1597 | ///\r |
1598 | /// Length of the media header in bytes.\r | |
1599 | ///\r | |
959ccb23 | 1600 | PXE_UINT16 MediaHeaderLen;\r |
1601 | \r | |
3ed785e9 | 1602 | ///\r |
1603 | /// Number of packet fragment descriptors.\r | |
1604 | ///\r | |
959ccb23 | 1605 | PXE_UINT16 FragCnt;\r |
1606 | \r | |
3ed785e9 | 1607 | ///\r |
1608 | /// Reserved, must be set to zero.\r | |
1609 | ///\r | |
959ccb23 | 1610 | PXE_UINT16 reserved;\r |
1611 | \r | |
3ed785e9 | 1612 | ///\r |
1613 | /// Array of packet fragment descriptors. The first byte of the media\r | |
1614 | /// header is the first byte of the first fragment.\r | |
1615 | ///\r | |
959ccb23 | 1616 | struct {\r |
3ed785e9 | 1617 | ///\r |
1618 | /// Address of this packet fragment.\r | |
1619 | ///\r | |
959ccb23 | 1620 | PXE_UINT64 FragAddr;\r |
1621 | \r | |
3ed785e9 | 1622 | ///\r |
1623 | /// Length of this packet fragment.\r | |
1624 | ///\r | |
959ccb23 | 1625 | PXE_UINT32 FragLen;\r |
1626 | \r | |
3ed785e9 | 1627 | ///\r |
1628 | /// Reserved, must be set to zero.\r | |
1629 | ///\r | |
959ccb23 | 1630 | PXE_UINT32 reserved;\r |
1631 | } FragDesc[MAX_XMIT_FRAGMENTS];\r | |
1632 | }\r | |
1633 | PXE_CPB_FILL_HEADER_FRAGMENTED;\r | |
1634 | \r | |
1635 | typedef struct s_pxe_cpb_transmit {\r | |
3ed785e9 | 1636 | ///\r |
1637 | /// Address of first byte of frame buffer. This is also the first byte\r | |
1638 | /// of the media header.\r | |
1639 | ///\r | |
959ccb23 | 1640 | PXE_UINT64 FrameAddr;\r |
1641 | \r | |
3ed785e9 | 1642 | ///\r |
1643 | /// Length of the data portion of the frame buffer in bytes. Do not\r | |
1644 | /// include the length of the media header.\r | |
1645 | ///\r | |
959ccb23 | 1646 | PXE_UINT32 DataLen;\r |
1647 | \r | |
3ed785e9 | 1648 | ///\r |
1649 | /// Length of the media header in bytes.\r | |
1650 | ///\r | |
959ccb23 | 1651 | PXE_UINT16 MediaheaderLen;\r |
1652 | \r | |
3ed785e9 | 1653 | ///\r |
1654 | /// Reserved, must be zero.\r | |
1655 | ///\r | |
959ccb23 | 1656 | PXE_UINT16 reserved;\r |
1657 | } PXE_CPB_TRANSMIT;\r | |
1658 | \r | |
1659 | typedef struct s_pxe_cpb_transmit_fragments {\r | |
3ed785e9 | 1660 | ///\r |
1661 | /// Length of packet data in bytes (not including the media header).\r | |
1662 | ///\r | |
959ccb23 | 1663 | PXE_UINT32 FrameLen;\r |
1664 | \r | |
3ed785e9 | 1665 | ///\r |
1666 | /// Length of the media header in bytes.\r | |
1667 | ///\r | |
959ccb23 | 1668 | PXE_UINT16 MediaheaderLen;\r |
1669 | \r | |
3ed785e9 | 1670 | ///\r |
1671 | /// Number of packet fragment descriptors.\r | |
1672 | ///\r | |
959ccb23 | 1673 | PXE_UINT16 FragCnt;\r |
1674 | \r | |
3ed785e9 | 1675 | ///\r |
1676 | /// Array of frame fragment descriptors. The first byte of the first\r | |
1677 | /// fragment is also the first byte of the media header.\r | |
1678 | ///\r | |
959ccb23 | 1679 | struct {\r |
3ed785e9 | 1680 | ///\r |
1681 | /// Address of this frame fragment.\r | |
1682 | ///\r | |
959ccb23 | 1683 | PXE_UINT64 FragAddr;\r |
1684 | \r | |
3ed785e9 | 1685 | ///\r |
1686 | /// Length of this frame fragment.\r | |
1687 | ///\r | |
959ccb23 | 1688 | PXE_UINT32 FragLen;\r |
1689 | \r | |
3ed785e9 | 1690 | ///\r |
1691 | /// Reserved, must be set to zero.\r | |
1692 | ///\r | |
959ccb23 | 1693 | PXE_UINT32 reserved;\r |
1694 | } FragDesc[MAX_XMIT_FRAGMENTS];\r | |
1695 | }\r | |
1696 | PXE_CPB_TRANSMIT_FRAGMENTS;\r | |
1697 | \r | |
1698 | typedef struct s_pxe_cpb_receive {\r | |
3ed785e9 | 1699 | ///\r |
1700 | /// Address of first byte of receive buffer. This is also the first byte\r | |
1701 | /// of the frame header.\r | |
1702 | ///\r | |
959ccb23 | 1703 | PXE_UINT64 BufferAddr;\r |
1704 | \r | |
3ed785e9 | 1705 | ///\r |
1706 | /// Length of receive buffer. This must be large enough to hold the\r | |
1707 | /// received frame (media header + data). If the length of smaller than\r | |
1708 | /// the received frame, data will be lost.\r | |
1709 | ///\r | |
959ccb23 | 1710 | PXE_UINT32 BufferLen;\r |
1711 | \r | |
3ed785e9 | 1712 | ///\r |
1713 | /// Reserved, must be set to zero.\r | |
1714 | ///\r | |
959ccb23 | 1715 | PXE_UINT32 reserved;\r |
1716 | } PXE_CPB_RECEIVE;\r | |
1717 | \r | |
1718 | typedef struct s_pxe_db_receive {\r | |
3ed785e9 | 1719 | ///\r |
1720 | /// Source and destination MAC addresses from media header.\r | |
1721 | ///\r | |
959ccb23 | 1722 | PXE_MAC_ADDR SrcAddr;\r |
1723 | PXE_MAC_ADDR DestAddr;\r | |
1724 | \r | |
3ed785e9 | 1725 | ///\r |
1726 | /// Length of received frame. May be larger than receive buffer size.\r | |
1727 | /// The receive buffer will not be overwritten. This is how to tell\r | |
1728 | /// if data was lost because the receive buffer was too small.\r | |
1729 | ///\r | |
959ccb23 | 1730 | PXE_UINT32 FrameLen;\r |
1731 | \r | |
3ed785e9 | 1732 | ///\r |
1733 | /// Protocol type from media header.\r | |
1734 | ///\r | |
959ccb23 | 1735 | PXE_MEDIA_PROTOCOL Protocol;\r |
1736 | \r | |
3ed785e9 | 1737 | ///\r |
1738 | /// Length of media header in received frame.\r | |
1739 | ///\r | |
959ccb23 | 1740 | PXE_UINT16 MediaHeaderLen;\r |
1741 | \r | |
3ed785e9 | 1742 | ///\r |
1743 | /// Type of receive frame.\r | |
1744 | ///\r | |
959ccb23 | 1745 | PXE_FRAME_TYPE Type;\r |
1746 | \r | |
3ed785e9 | 1747 | ///\r |
1748 | /// Reserved, must be zero.\r | |
1749 | ///\r | |
959ccb23 | 1750 | PXE_UINT8 reserved[7];\r |
1751 | \r | |
1752 | } PXE_DB_RECEIVE;\r | |
1753 | \r | |
959ccb23 | 1754 | #pragma pack()\r |
1755 | \r | |
1756 | #endif\r |