6
Copyright (c) Intel 1999
11
32/64-bit PXE specification:
15
This header file contains all of the PXE type definitions,
16
structure prototypes, global variables and constants that
17
are needed for porting PXE to EFI.
22
#define PXE_INTEL_ORDER 1 // Intel order
23
//#define PXE_NETWORK_ORDER 1 // network order
25
#define PXE_UINT64_SUPPORT 1 // UINT64 supported
26
//#define PXE_NO_UINT64_SUPPORT 1 // UINT64 not supported
28
#define PXE_BUSTYPE(a,b,c,d) \
29
((((PXE_UINT32)(d) & 0xFF) << 24) | \
30
(((PXE_UINT32)(c) & 0xFF) << 16) | \
31
(((PXE_UINT32)(b) & 0xFF) << 8) | \
32
((PXE_UINT32)(a) & 0xFF))
35
// UNDI ROM ID and devive ID signature
37
#define PXE_BUSTYPE_PXE PXE_BUSTYPE('!', 'P', 'X', 'E')
40
// BUS ROM ID signatures
42
#define PXE_BUSTYPE_PCI PXE_BUSTYPE('P', 'C', 'I', 'R')
43
#define PXE_BUSTYPE_PC_CARD PXE_BUSTYPE('P', 'C', 'C', 'R')
44
#define PXE_BUSTYPE_USB PXE_BUSTYPE('U', 'S', 'B', 'R')
45
#define PXE_BUSTYPE_1394 PXE_BUSTYPE('1', '3', '9', '4')
47
#define PXE_SWAP_UINT16(n) \
48
((((PXE_UINT16)(n) & 0x00FF) << 8) | \
49
(((PXE_UINT16)(n) & 0xFF00) >> 8))
51
#define PXE_SWAP_UINT32(n) \
52
((((PXE_UINT32)(n) & 0x000000FF) << 24) | \
53
(((PXE_UINT32)(n) & 0x0000FF00) << 8) | \
54
(((PXE_UINT32)(n) & 0x00FF0000) >> 8) | \
55
(((PXE_UINT32)(n) & 0xFF000000) >> 24))
57
#if PXE_UINT64_SUPPORT != 0
58
#define PXE_SWAP_UINT64(n) \
59
((((PXE_UINT64)(n) & 0x00000000000000FF) << 56) | \
60
(((PXE_UINT64)(n) & 0x000000000000FF00) << 40) | \
61
(((PXE_UINT64)(n) & 0x0000000000FF0000) << 24) | \
62
(((PXE_UINT64)(n) & 0x00000000FF000000) << 8) | \
63
(((PXE_UINT64)(n) & 0x000000FF00000000) >> 8) | \
64
(((PXE_UINT64)(n) & 0x0000FF0000000000) >> 24) | \
65
(((PXE_UINT64)(n) & 0x00FF000000000000) >> 40) | \
66
(((PXE_UINT64)(n) & 0xFF00000000000000) >> 56))
67
#endif // PXE_UINT64_SUPPORT
69
#if PXE_NO_UINT64_SUPPORT != 0
70
#define PXE_SWAP_UINT64(n) \
72
PXE_UINT32 tmp = (PXE_UINT64)(n)[1]; \
73
(PXE_UINT64)(n)[1] = PXE_SWAP_UINT32((PXE_UINT64)(n)[0]); \
74
(PXE_UINT64)(n)[0] = tmp; \
76
#endif // PXE_NO_UINT64_SUPPORT
78
#define PXE_CPBSIZE_NOT_USED 0 // zero
79
#define PXE_DBSIZE_NOT_USED 0 // zero
80
#define PXE_CPBADDR_NOT_USED (PXE_UINT64)0 // zero
81
#define PXE_DBADDR_NOT_USED (PXE_UINT64)0 // zero
83
#define PXE_CONST const
85
#define PXE_VOLATILE volatile
87
typedef void PXE_VOID;
89
typedef unsigned char PXE_UINT8;
91
typedef unsigned short PXE_UINT16;
93
typedef unsigned PXE_UINT32;
95
#if PXE_UINT64_SUPPORT != 0
96
// typedef unsigned long PXE_UINT64;
97
typedef UINT64 PXE_UINT64;
98
#endif // PXE_UINT64_SUPPORT
100
#if PXE_NO_UINT64_SUPPORT != 0
101
typedef PXE_UINT32 PXE_UINT64[2];
102
#endif // PXE_NO_UINT64_SUPPORT
104
typedef unsigned PXE_UINTN;
106
typedef PXE_UINT8 PXE_BOOL;
108
#define PXE_FALSE 0 // zero
109
#define PXE_TRUE (!PXE_FALSE)
111
typedef PXE_UINT16 PXE_OPCODE;
114
// Return UNDI operational state.
116
#define PXE_OPCODE_GET_STATE 0x0000
119
// Change UNDI operational state from Stopped to Started.
121
#define PXE_OPCODE_START 0x0001
124
// Change UNDI operational state from Started to Stopped.
126
#define PXE_OPCODE_STOP 0x0002
129
// Get UNDI initialization information.
131
#define PXE_OPCODE_GET_INIT_INFO 0x0003
134
// Get NIC configuration information.
136
#define PXE_OPCODE_GET_CONFIG_INFO 0x0004
139
// Changed UNDI operational state from Started to Initialized.
141
#define PXE_OPCODE_INITIALIZE 0x0005
144
// Re-initialize the NIC H/W.
146
#define PXE_OPCODE_RESET 0x0006
149
// Change the UNDI operational state from Initialized to Started.
151
#define PXE_OPCODE_SHUTDOWN 0x0007
154
// Read & change state of external interrupt enables.
156
#define PXE_OPCODE_INTERRUPT_ENABLES 0x0008
159
// Read & change state of packet receive filters.
161
#define PXE_OPCODE_RECEIVE_FILTERS 0x0009
164
// Read & change station MAC address.
166
#define PXE_OPCODE_STATION_ADDRESS 0x000A
169
// Read traffic statistics.
171
#define PXE_OPCODE_STATISTICS 0x000B
174
// Convert multicast IP address to multicast MAC address.
176
#define PXE_OPCODE_MCAST_IP_TO_MAC 0x000C
179
// Read or change non-volatile storage on the NIC.
181
#define PXE_OPCODE_NVDATA 0x000D
184
// Get & clear interrupt status.
186
#define PXE_OPCODE_GET_STATUS 0x000E
189
// Fill media header in packet for transmit.
191
#define PXE_OPCODE_FILL_HEADER 0x000F
194
// Transmit packet(s).
196
#define PXE_OPCODE_TRANSMIT 0x0010
201
#define PXE_OPCODE_RECEIVE 0x0011
203
// last valid opcode:
204
#define PXE_OPCODE_VALID_MAX 0x0011
207
// Last valid PXE UNDI OpCode number.
209
#define PXE_OPCODE_LAST_VALID 0x0011
211
typedef PXE_UINT16 PXE_OPFLAGS;
213
#define PXE_OPFLAGS_NOT_USED 0x0000
215
////////////////////////////////////////
221
////////////////////////////////////////
227
////////////////////////////////////////
233
////////////////////////////////////////
234
// UNDI Get Init Info
239
////////////////////////////////////////
240
// UNDI Get Config Info
245
////////////////////////////////////////
249
#define PXE_OPFLAGS_INITIALIZE_CABLE_DETECT_MASK 0x0001
250
#define PXE_OPFLAGS_INITIALIZE_DETECT_CABLE 0x0000
251
#define PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE 0x0001
253
////////////////////////////////////////
257
#define PXE_OPFLAGS_RESET_DISABLE_INTERRUPTS 0x0001
258
#define PXE_OPFLAGS_RESET_DISABLE_FILTERS 0x0002
260
////////////////////////////////////////
266
////////////////////////////////////////
267
// UNDI Interrupt Enables
271
// Select whether to enable or disable external interrupt signals.
272
// Setting both enable and disable will return PXE_STATCODE_INVALID_OPFLAGS.
274
#define PXE_OPFLAGS_INTERRUPT_OPMASK 0xC000
275
#define PXE_OPFLAGS_INTERRUPT_ENABLE 0x8000
276
#define PXE_OPFLAGS_INTERRUPT_DISABLE 0x4000
277
#define PXE_OPFLAGS_INTERRUPT_READ 0x0000
280
// Enable receive interrupts. An external interrupt will be generated
281
// after a complete non-error packet has been received.
283
#define PXE_OPFLAGS_INTERRUPT_RECEIVE 0x0001
286
// Enable transmit interrupts. An external interrupt will be generated
287
// after a complete non-error packet has been transmitted.
289
#define PXE_OPFLAGS_INTERRUPT_TRANSMIT 0x0002
292
// Enable command interrupts. An external interrupt will be generated
293
// when command execution stops.
295
#define PXE_OPFLAGS_INTERRUPT_COMMAND 0x0004
298
// Generate software interrupt. Setting this bit generates an external
299
// interrupt, if it is supported by the hardware.
301
#define PXE_OPFLAGS_INTERRUPT_SOFTWARE 0x0008
303
////////////////////////////////////////
304
// UNDI Receive Filters
308
// Select whether to enable or disable receive filters.
309
// Setting both enable and disable will return PXE_STATCODE_INVALID_OPCODE.
311
#define PXE_OPFLAGS_RECEIVE_FILTER_OPMASK 0xC000
312
#define PXE_OPFLAGS_RECEIVE_FILTER_ENABLE 0x8000
313
#define PXE_OPFLAGS_RECEIVE_FILTER_DISABLE 0x4000
314
#define PXE_OPFLAGS_RECEIVE_FILTER_READ 0x0000
317
// To reset the contents of the multicast MAC address filter list,
320
#define PXE_OPFLAGS_RECEIVE_FILTER_RESET_MCAST_LIST 0x2000
323
// Enable unicast packet receiving. Packets sent to the current station
324
// MAC address will be received.
326
#define PXE_OPFLAGS_RECEIVE_FILTER_UNICAST 0x0001
329
// Enable broadcast packet receiving. Packets sent to the broadcast
330
// MAC address will be received.
332
#define PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST 0x0002
335
// Enable filtered multicast packet receiving. Packets sent to any
336
// of the multicast MAC addresses in the multicast MAC address filter
337
// list will be received. If the filter list is empty, no multicast
339
#define PXE_OPFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST 0x0004
342
// Enable promiscuous packet receiving. All packets will be received.
344
#define PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS 0x0008
347
// Enable promiscuous multicast packet receiving. All multicast
348
// packets will be received.
350
#define PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST 0x0010
352
////////////////////////////////////////
353
// UNDI Station Address
356
#define PXE_OPFLAGS_STATION_ADDRESS_READ 0x0000
357
#define PXE_OPFLAGS_STATION_ADDRESS_RESET 0x0001
359
////////////////////////////////////////
363
#define PXE_OPFLAGS_STATISTICS_READ 0x0000
364
#define PXE_OPFLAGS_STATISTICS_RESET 0x0001
366
////////////////////////////////////////
367
// UNDI MCast IP to MAC
371
// Identify the type of IP address in the CPB.
373
#define PXE_OPFLAGS_MCAST_IP_TO_MAC_OPMASK 0x0003
374
#define PXE_OPFLAGS_MCAST_IPV4_TO_MAC 0x0000
375
#define PXE_OPFLAGS_MCAST_IPV6_TO_MAC 0x0001
377
////////////////////////////////////////
382
// Select the type of non-volatile data operation.
384
#define PXE_OPFLAGS_NVDATA_OPMASK 0x0001
385
#define PXE_OPFLAGS_NVDATA_READ 0x0000
386
#define PXE_OPFLAGS_NVDATA_WRITE 0x0001
388
////////////////////////////////////////
393
// Return current interrupt status. This will also clear any interrupts
394
// that are currently set. This can be used in a polling routine. The
395
// interrupt flags are still set and cleared even when the interrupts
398
#define PXE_OPFLAGS_GET_INTERRUPT_STATUS 0x0001
401
// Return list of transmitted buffers for recycling. Transmit buffers
402
// must not be changed or unallocated until they have recycled. After
403
// issuing a transmit command, wait for a transmit complete interrupt.
404
// When a transmit complete interrupt is received, read the transmitted
405
// buffers. Do not plan on getting one buffer per interrupt. Some
406
// NICs and UNDIs may transmit multiple buffers per interrupt.
408
#define PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS 0x0002
410
////////////////////////////////////////
414
#define PXE_OPFLAGS_FILL_HEADER_OPMASK 0x0001
415
#define PXE_OPFLAGS_FILL_HEADER_FRAGMENTED 0x0001
416
#define PXE_OPFLAGS_FILL_HEADER_WHOLE 0x0000
418
////////////////////////////////////////
423
// S/W UNDI only. Return after the packet has been transmitted. A
424
// transmit complete interrupt will still be generated and the transmit
425
// buffer will have to be recycled.
427
#define PXE_OPFLAGS_SWUNDI_TRANSMIT_OPMASK 0x0001
428
#define PXE_OPFLAGS_TRANSMIT_BLOCK 0x0001
429
#define PXE_OPFLAGS_TRANSMIT_DONT_BLOCK 0x0000
434
#define PXE_OPFLAGS_TRANSMIT_OPMASK 0x0002
435
#define PXE_OPFLAGS_TRANSMIT_FRAGMENTED 0x0002
436
#define PXE_OPFLAGS_TRANSMIT_WHOLE 0x0000
438
////////////////////////////////////////
444
typedef PXE_UINT16 PXE_STATFLAGS;
446
#define PXE_STATFLAGS_INITIALIZE 0x0000
448
////////////////////////////////////////
449
// Common StatFlags that can be returned by all commands.
453
// The COMMAND_COMPLETE and COMMAND_FAILED status flags must be
454
// implemented by all UNDIs. COMMAND_QUEUED is only needed by UNDIs
455
// that support command queuing.
457
#define PXE_STATFLAGS_STATUS_MASK 0xC000
458
#define PXE_STATFLAGS_COMMAND_COMPLETE 0xC000
459
#define PXE_STATFLAGS_COMMAND_FAILED 0x8000
460
#define PXE_STATFLAGS_COMMAND_QUEUED 0x4000
461
//#define PXE_STATFLAGS_INITIALIZE 0x0000
463
#define PXE_STATFLAGS_DB_WRITE_TRUNCATED 0x2000
465
////////////////////////////////////////
469
#define PXE_STATFLAGS_GET_STATE_MASK 0x0003
470
#define PXE_STATFLAGS_GET_STATE_INITIALIZED 0x0002
471
#define PXE_STATFLAGS_GET_STATE_STARTED 0x0001
472
#define PXE_STATFLAGS_GET_STATE_STOPPED 0x0000
474
////////////////////////////////////////
478
// No additional StatFlags
480
////////////////////////////////////////
481
// UNDI Get Init Info
484
#define PXE_STATFLAGS_CABLE_DETECT_MASK 0x0001
485
#define PXE_STATFLAGS_CABLE_DETECT_NOT_SUPPORTED 0x0000
486
#define PXE_STATFLAGS_CABLE_DETECT_SUPPORTED 0x0001
489
////////////////////////////////////////
493
#define PXE_STATFLAGS_INITIALIZED_NO_MEDIA 0x0001
495
////////////////////////////////////////
499
#define PXE_STATFLAGS_RESET_NO_MEDIA 0x0001
501
////////////////////////////////////////
505
// No additional StatFlags
507
////////////////////////////////////////
508
// UNDI Interrupt Enables
512
// If set, receive interrupts are enabled.
514
#define PXE_STATFLAGS_INTERRUPT_RECEIVE 0x0001
517
// If set, transmit interrupts are enabled.
519
#define PXE_STATFLAGS_INTERRUPT_TRANSMIT 0x0002
522
// If set, command interrupts are enabled.
524
#define PXE_STATFLAGS_INTERRUPT_COMMAND 0x0004
527
////////////////////////////////////////
528
// UNDI Receive Filters
532
// If set, unicast packets will be received.
534
#define PXE_STATFLAGS_RECEIVE_FILTER_UNICAST 0x0001
537
// If set, broadcast packets will be received.
539
#define PXE_STATFLAGS_RECEIVE_FILTER_BROADCAST 0x0002
542
// If set, multicast packets that match up with the multicast address
543
// filter list will be received.
545
#define PXE_STATFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST 0x0004
548
// If set, all packets will be received.
550
#define PXE_STATFLAGS_RECEIVE_FILTER_PROMISCUOUS 0x0008
553
// If set, all multicast packets will be received.
555
#define PXE_STATFLAGS_RECEIVE_FILTER_ALL_MULTICAST 0x0010
557
////////////////////////////////////////
558
// UNDI Station Address
561
// No additional StatFlags
563
////////////////////////////////////////
567
// No additional StatFlags
569
////////////////////////////////////////
570
// UNDI MCast IP to MAC
573
// No additional StatFlags
575
////////////////////////////////////////
579
// No additional StatFlags
582
////////////////////////////////////////
587
// Use to determine if an interrupt has occurred.
589
#define PXE_STATFLAGS_GET_STATUS_INTERRUPT_MASK 0x000F
590
#define PXE_STATFLAGS_GET_STATUS_NO_INTERRUPTS 0x0000
593
// If set, at least one receive interrupt occurred.
595
#define PXE_STATFLAGS_GET_STATUS_RECEIVE 0x0001
598
// If set, at least one transmit interrupt occurred.
600
#define PXE_STATFLAGS_GET_STATUS_TRANSMIT 0x0002
603
// If set, at least one command interrupt occurred.
605
#define PXE_STATFLAGS_GET_STATUS_COMMAND 0x0004
608
// If set, at least one software interrupt occurred.
610
#define PXE_STATFLAGS_GET_STATUS_SOFTWARE 0x0008
613
// This flag is set if the transmitted buffer queue is empty. This flag
614
// will be set if all transmitted buffer addresses get written into the DB.
616
#define PXE_STATFLAGS_GET_STATUS_TXBUF_QUEUE_EMPTY 0x0010
619
// This flag is set if no transmitted buffer addresses were written
620
// into the DB. (This could be because DBsize was too small.)
622
#define PXE_STATFLAGS_GET_STATUS_NO_TXBUFS_WRITTEN 0x0020
624
////////////////////////////////////////
628
// No additional StatFlags
630
////////////////////////////////////////
634
// No additional StatFlags.
636
////////////////////////////////////////
640
// No additional StatFlags.
642
typedef PXE_UINT16 PXE_STATCODE;
644
#define PXE_STATCODE_INITIALIZE 0x0000
646
////////////////////////////////////////
647
// Common StatCodes returned by all UNDI commands, UNDI protocol functions
648
// and BC protocol functions.
651
#define PXE_STATCODE_SUCCESS 0x0000
653
#define PXE_STATCODE_INVALID_CDB 0x0001
654
#define PXE_STATCODE_INVALID_CPB 0x0002
655
#define PXE_STATCODE_BUSY 0x0003
656
#define PXE_STATCODE_QUEUE_FULL 0x0004
657
#define PXE_STATCODE_ALREADY_STARTED 0x0005
658
#define PXE_STATCODE_NOT_STARTED 0x0006
659
#define PXE_STATCODE_NOT_SHUTDOWN 0x0007
660
#define PXE_STATCODE_ALREADY_INITIALIZED 0x0008
661
#define PXE_STATCODE_NOT_INITIALIZED 0x0009
662
#define PXE_STATCODE_DEVICE_FAILURE 0x000A
663
#define PXE_STATCODE_NVDATA_FAILURE 0x000B
664
#define PXE_STATCODE_UNSUPPORTED 0x000C
665
#define PXE_STATCODE_BUFFER_FULL 0x000D
666
#define PXE_STATCODE_INVALID_PARAMETER 0x000E
667
#define PXE_STATCODE_INVALID_UNDI 0x000F
668
#define PXE_STATCODE_IPV4_NOT_SUPPORTED 0x0010
669
#define PXE_STATCODE_IPV6_NOT_SUPPORTED 0x0011
670
#define PXE_STATCODE_NOT_ENOUGH_MEMORY 0x0012
671
#define PXE_STATCODE_NO_DATA 0x0013
674
typedef PXE_UINT16 PXE_IFNUM;
677
// This interface number must be passed to the S/W UNDI Start command.
679
#define PXE_IFNUM_START 0x0000
682
// This interface number is returned by the S/W UNDI Get State and
683
// Start commands if information in the CDB, CPB or DB is invalid.
685
#define PXE_IFNUM_INVALID 0x0000
687
typedef PXE_UINT16 PXE_CONTROL;
690
// Setting this flag directs the UNDI to queue this command for later
691
// execution if the UNDI is busy and it supports command queuing.
692
// If queuing is not supported, a PXE_STATCODE_INVALID_CONTROL error
693
// is returned. If the queue is full, a PXE_STATCODE_CDB_QUEUE_FULL
694
// error is returned.
696
#define PXE_CONTROL_QUEUE_IF_BUSY 0x0002
699
// These two bit values are used to determine if there are more UNDI
700
// CDB structures following this one. If the link bit is set, there
701
// must be a CDB structure following this one. Execution will start
702
// on the next CDB structure as soon as this one completes successfully.
703
// If an error is generated by this command, execution will stop.
705
#define PXE_CONTROL_LINK 0x0001
706
#define PXE_CONTROL_LAST_CDB_IN_LIST 0x0000
708
typedef PXE_UINT8 PXE_FRAME_TYPE;
710
#define PXE_FRAME_TYPE_NONE 0x00
711
#define PXE_FRAME_TYPE_UNICAST 0x01
712
#define PXE_FRAME_TYPE_BROADCAST 0x02
713
#define PXE_FRAME_TYPE_MULTICAST 0x03
714
#define PXE_FRAME_TYPE_PROMISCUOUS 0x04
716
typedef PXE_UINT32 PXE_IPV4;
718
typedef PXE_UINT32 PXE_IPV6[4];
719
#define PXE_MAC_LENGTH 32
721
typedef PXE_UINT8 PXE_MAC_ADDR[PXE_MAC_LENGTH];
723
typedef PXE_UINT8 PXE_IFTYPE;
724
typedef PXE_UINT16 PXE_MEDIA_PROTOCOL;
727
// This information is from the ARP section of RFC 1700.
729
// 1 Ethernet (10Mb) [JBP]
730
// 2 Experimental Ethernet (3Mb) [JBP]
731
// 3 Amateur Radio AX.25 [PXK]
732
// 4 Proteon ProNET Token Ring [JBP]
734
// 6 IEEE 802 Networks [JBP]
736
// 8 Hyperchannel [JBP]
738
// 10 Autonet Short Address [MXB1]
739
// 11 LocalTalk [JKR1]
740
// 12 LocalNet (IBM PCNet or SYTEK LocalNET) [JXM]
741
// 13 Ultra link [RXD2]
743
// 15 Frame Relay [AGM]
744
// 16 Asynchronous Transmission Mode (ATM) [JXB2]
746
// 18 Fibre Channel [Yakov Rekhter]
747
// 19 Asynchronous Transmission Mode (ATM) [Mark Laubach]
748
// 20 Serial Line [JBP]
749
// 21 Asynchronous Transmission Mode (ATM) [MXB1]
752
#define PXE_IFTYPE_ETHERNET 0x01
753
#define PXE_IFTYPE_TOKENRING 0x04
754
#define PXE_IFTYPE_FIBRE_CHANNEL 0x12
756
typedef struct s_pxe_hw_undi {
757
PXE_UINT32 Signature; // PXE_ROMID_SIGNATURE
758
PXE_UINT8 Len; // sizeof(PXE_HW_UNDI)
759
PXE_UINT8 Fudge; // makes 8-bit cksum equal zero
760
PXE_UINT8 Rev; // PXE_ROMID_REV
761
PXE_UINT8 IFcnt; // physical connector count
762
PXE_UINT8 MajorVer; // PXE_ROMID_MAJORVER
763
PXE_UINT8 MinorVer; // PXE_ROMID_MINORVER
764
PXE_UINT16 reserved; // zero, not used
765
PXE_UINT32 Implementation; // implementation flags
766
// reserved // vendor use
767
// PXE_UINT32 Status; // status port
768
// PXE_UINT32 Command; // command port
769
// PXE_UINT64 CDBaddr; // CDB address port
773
// Status port bit definitions
777
// UNDI operation state
779
#define PXE_HWSTAT_STATE_MASK 0xC0000000
780
#define PXE_HWSTAT_BUSY 0xC0000000
781
#define PXE_HWSTAT_INITIALIZED 0x80000000
782
#define PXE_HWSTAT_STARTED 0x40000000
783
#define PXE_HWSTAT_STOPPED 0x00000000
786
// If set, last command failed
788
#define PXE_HWSTAT_COMMAND_FAILED 0x20000000
791
// If set, identifies enabled receive filters
793
#define PXE_HWSTAT_PROMISCUOUS_MULTICAST_RX_ENABLED 0x00001000
794
#define PXE_HWSTAT_PROMISCUOUS_RX_ENABLED 0x00000800
795
#define PXE_HWSTAT_BROADCAST_RX_ENABLED 0x00000400
796
#define PXE_HWSTAT_MULTICAST_RX_ENABLED 0x00000200
797
#define PXE_HWSTAT_UNICAST_RX_ENABLED 0x00000100
800
// If set, identifies enabled external interrupts
802
#define PXE_HWSTAT_SOFTWARE_INT_ENABLED 0x00000080
803
#define PXE_HWSTAT_TX_COMPLETE_INT_ENABLED 0x00000040
804
#define PXE_HWSTAT_PACKET_RX_INT_ENABLED 0x00000020
805
#define PXE_HWSTAT_CMD_COMPLETE_INT_ENABLED 0x00000010
808
// If set, identifies pending interrupts
810
#define PXE_HWSTAT_SOFTWARE_INT_PENDING 0x00000008
811
#define PXE_HWSTAT_TX_COMPLETE_INT_PENDING 0x00000004
812
#define PXE_HWSTAT_PACKET_RX_INT_PENDING 0x00000002
813
#define PXE_HWSTAT_CMD_COMPLETE_INT_PENDING 0x00000001
816
// Command port definitions
820
// If set, CDB identified in CDBaddr port is given to UNDI.
821
// If not set, other bits in this word will be processed.
823
#define PXE_HWCMD_ISSUE_COMMAND 0x80000000
824
#define PXE_HWCMD_INTS_AND_FILTS 0x00000000
827
// Use these to enable/disable receive filters.
829
#define PXE_HWCMD_PROMISCUOUS_MULTICAST_RX_ENABLE 0x00001000
830
#define PXE_HWCMD_PROMISCUOUS_RX_ENABLE 0x00000800
831
#define PXE_HWCMD_BROADCAST_RX_ENABLE 0x00000400
832
#define PXE_HWCMD_MULTICAST_RX_ENABLE 0x00000200
833
#define PXE_HWCMD_UNICAST_RX_ENABLE 0x00000100
836
// Use these to enable/disable external interrupts
838
#define PXE_HWCMD_SOFTWARE_INT_ENABLE 0x00000080
839
#define PXE_HWCMD_TX_COMPLETE_INT_ENABLE 0x00000040
840
#define PXE_HWCMD_PACKET_RX_INT_ENABLE 0x00000020
841
#define PXE_HWCMD_CMD_COMPLETE_INT_ENABLE 0x00000010
844
// Use these to clear pending external interrupts
846
#define PXE_HWCMD_CLEAR_SOFTWARE_INT 0x00000008
847
#define PXE_HWCMD_CLEAR_TX_COMPLETE_INT 0x00000004
848
#define PXE_HWCMD_CLEAR_PACKET_RX_INT 0x00000002
849
#define PXE_HWCMD_CLEAR_CMD_COMPLETE_INT 0x00000001
851
typedef struct s_pxe_sw_undi {
852
PXE_UINT32 Signature; // PXE_ROMID_SIGNATURE
853
PXE_UINT8 Len; // sizeof(PXE_SW_UNDI)
854
PXE_UINT8 Fudge; // makes 8-bit cksum zero
855
PXE_UINT8 Rev; // PXE_ROMID_REV
856
PXE_UINT8 IFcnt; // physical connector count
857
PXE_UINT8 MajorVer; // PXE_ROMID_MAJORVER
858
PXE_UINT8 MinorVer; // PXE_ROMID_MINORVER
859
PXE_UINT16 reserved1; // zero, not used
860
PXE_UINT32 Implementation; // Implementation flags
861
PXE_UINT64 EntryPoint; // API entry point
862
PXE_UINT8 reserved2[3]; // zero, not used
863
PXE_UINT8 BusCnt; // number of bustypes supported
864
PXE_UINT32 BusType[1]; // list of supported bustypes
867
typedef union u_pxe_undi {
873
// Signature of !PXE structure
875
#define PXE_ROMID_SIGNATURE PXE_BUSTYPE('!', 'P', 'X', 'E')
878
// !PXE structure format revision
880
#define PXE_ROMID_REV 0x02
883
// UNDI command interface revision. These are the values that get sent
884
// in option 94 (Client Network Interface Identifier) in the DHCP Discover
885
// and PXE Boot Server Request packets.
887
#define PXE_ROMID_MAJORVER 0x03
888
#define PXE_ROMID_MINORVER 0x00
891
// Implementation flags
893
#define PXE_ROMID_IMP_HW_UNDI 0x80000000
894
#define PXE_ROMID_IMP_SW_VIRT_ADDR 0x40000000
895
#define PXE_ROMID_IMP_64BIT_DEVICE 0x00010000
896
#define PXE_ROMID_IMP_FRAG_SUPPORTED 0x00008000
897
#define PXE_ROMID_IMP_CMD_LINK_SUPPORTED 0x00004000
898
#define PXE_ROMID_IMP_CMD_QUEUE_SUPPORTED 0x00002000
899
#define PXE_ROMID_IMP_MULTI_FRAME_SUPPORTED 0x00001000
900
#define PXE_ROMID_IMP_NVDATA_SUPPORT_MASK 0x00000C00
901
#define PXE_ROMID_IMP_NVDATA_BULK_WRITABLE 0x00000C00
902
#define PXE_ROMID_IMP_NVDATA_SPARSE_WRITABLE 0x00000800
903
#define PXE_ROMID_IMP_NVDATA_READ_ONLY 0x00000400
904
#define PXE_ROMID_IMP_NVDATA_NOT_AVAILABLE 0x00000000
905
#define PXE_ROMID_IMP_STATISTICS_SUPPORTED 0x00000200
906
#define PXE_ROMID_IMP_STATION_ADDR_SETTABLE 0x00000100
907
#define PXE_ROMID_IMP_PROMISCUOUS_MULTICAST_RX_SUPPORTED 0x00000080
908
#define PXE_ROMID_IMP_PROMISCUOUS_RX_SUPPORTED 0x00000040
909
#define PXE_ROMID_IMP_BROADCAST_RX_SUPPORTED 0x00000020
910
#define PXE_ROMID_IMP_FILTERED_MULTICAST_RX_SUPPORTED 0x00000010
911
#define PXE_ROMID_IMP_SOFTWARE_INT_SUPPORTED 0x00000008
912
#define PXE_ROMID_IMP_TX_COMPLETE_INT_SUPPORTED 0x00000004
913
#define PXE_ROMID_IMP_PACKET_RX_INT_SUPPORTED 0x00000002
914
#define PXE_ROMID_IMP_CMD_COMPLETE_INT_SUPPORTED 0x00000001
917
typedef struct s_pxe_cdb {
924
PXE_STATCODE StatCode;
925
PXE_STATFLAGS StatFlags;
931
typedef union u_pxe_ip_addr {
936
typedef union pxe_device {
938
// PCI and PC Card NICs are both identified using bus, device
939
// and function numbers. For PC Card, this may require PC
940
// Card services to be loaded in the BIOS or preboot
945
// See S/W UNDI ROMID structure definition for PCI and
946
// PCC BusType definitions.
951
// Bus, device & function numbers that locate this device.
959
// %%TBD - More information is needed about enumerating
960
// USB and 1394 devices.
968
// cpb and db definitions
970
#define MAX_PCI_CONFIG_LEN 64 // # of dwords
971
#define MAX_EEPROM_LEN 128 // #of dwords
972
#define MAX_XMIT_BUFFERS 32 // recycling Q length for xmit_done
973
#define MAX_MCAST_ADDRESS_CNT 8
975
typedef struct s_pxe_cpb_start {
977
// PXE_VOID Delay(PXE_UINT64 microseconds);
979
// UNDI will never request a delay smaller than 10 microseconds
980
// and will always request delays in increments of 10 microseconds.
981
// The Delay() CallBack routine must delay between n and n + 10
982
// microseconds before returning control to the UNDI.
984
// This field cannot be set to zero.
989
// PXE_VOID Block(PXE_UINT32 enable);
991
// UNDI may need to block multi-threaded/multi-processor access to
992
// critical code sections when programming or accessing the network
993
// device. To this end, a blocking service is needed by the UNDI.
994
// When UNDI needs a block, it will call Block() passing a non-zero
995
// value. When UNDI no longer needs a block, it will call Block()
996
// with a zero value. When called, if the Block() is already enabled,
997
// do not return control to the UNDI until the previous Block() is
1000
// This field cannot be set to zero.
1005
// PXE_VOID Virt2Phys(PXE_UINT64 virtual, PXE_UINT64 physical_ptr);
1007
// UNDI will pass the virtual address of a buffer and the virtual
1008
// address of a 64-bit physical buffer. Convert the virtual address
1009
// to a physical address and write the result to the physical address
1010
// buffer. If virtual and physical addresses are the same, just
1011
// copy the virtual address to the physical address buffer.
1013
// This field can be set to zero if virtual and physical addresses
1016
PXE_UINT64 Virt2Phys;
1018
// PXE_VOID Mem_IO(PXE_UINT8 read_write, PXE_UINT8 len, PXE_UINT64 port,
1019
// PXE_UINT64 buf_addr);
1021
// UNDI will read or write the device io space using this call back
1022
// function. It passes the number of bytes as the len parameter and it
1023
// will be either 1,2,4 or 8.
1025
// This field can not be set to zero.
1030
#define PXE_DELAY_MILLISECOND 1000
1031
#define PXE_DELAY_SECOND 1000000
1032
#define PXE_IO_READ 0
1033
#define PXE_IO_WRITE 1
1034
#define PXE_MEM_READ 2
1035
#define PXE_MEM_WRITE 4
1038
typedef struct s_pxe_db_get_init_info {
1040
// Minimum length of locked memory buffer that must be given to
1041
// the Initialize command. Giving UNDI more memory will generally
1042
// give better performance.
1044
// If MemoryRequired is zero, the UNDI does not need and will not
1045
// use system memory to receive and transmit packets.
1047
PXE_UINT32 MemoryRequired;
1050
// Maximum frame data length for Tx/Rx excluding the media header.
1052
PXE_UINT32 FrameDataLen;
1055
// Supported link speeds are in units of mega bits. Common ethernet
1056
// values are 10, 100 and 1000. Unused LinkSpeeds[] entries are zero
1059
PXE_UINT32 LinkSpeeds[4];
1062
// Number of non-volatile storage items.
1067
// Width of non-volatile storage item in bytes. 0, 1, 2 or 4
1072
// Media header length. This is the typical media header length for
1073
// this UNDI. This information is needed when allocating receive
1074
// and transmit buffers.
1076
PXE_UINT16 MediaHeaderLen;
1079
// Number of bytes in the NIC hardware (MAC) address.
1081
PXE_UINT16 HWaddrLen;
1084
// Maximum number of multicast MAC addresses in the multicast
1085
// MAC address filter list.
1087
PXE_UINT16 MCastFilterCnt;
1090
// Default number and size of transmit and receive buffers that will
1091
// be allocated by the UNDI. If MemoryRequired is non-zero, this
1092
// allocation will come out of the memory buffer given to the Initialize
1093
// command. If MemoryRequired is zero, this allocation will come out of
1094
// memory on the NIC.
1096
PXE_UINT16 TxBufCnt;
1097
PXE_UINT16 TxBufSize;
1098
PXE_UINT16 RxBufCnt;
1099
PXE_UINT16 RxBufSize;
1102
// Hardware interface types defined in the Assigned Numbers RFC
1103
// and used in DHCP and ARP packets.
1104
// See the PXE_IFTYPE typedef and PXE_IFTYPE_xxx macros.
1109
// Supported duplex. See PXE_DUPLEX_xxxxx #defines below.
1114
// Supported loopback options. See PXE_LOOPBACK_xxxxx #defines below.
1117
} PXE_DB_GET_INIT_INFO;
1119
#define PXE_MAX_TXRX_UNIT_ETHER 1500
1121
#define PXE_HWADDR_LEN_ETHER 0x0006
1122
#define PXE_MAC_HEADER_LEN_ETHER 0x000E
1124
#define PXE_DUPLEX_ENABLE_FULL_SUPPORTED 1
1125
#define PXE_DUPLEX_FORCE_FULL_SUPPORTED 2
1127
#define PXE_LOOPBACK_INTERNAL_SUPPORTED 1
1128
#define PXE_LOOPBACK_EXTERNAL_SUPPORTED 2
1131
typedef struct s_pxe_pci_config_info {
1133
// This is the flag field for the PXE_DB_GET_CONFIG_INFO union.
1134
// For PCI bus devices, this field is set to PXE_BUSTYPE_PCI.
1139
// This identifies the PCI network device that this UNDI interface
1147
// This is a copy of the PCI configuration space for this
1151
PXE_UINT8 Byte[256];
1152
PXE_UINT16 Word[128];
1153
PXE_UINT32 Dword[64];
1155
} PXE_PCI_CONFIG_INFO;
1158
typedef struct s_pxe_pcc_config_info {
1160
// This is the flag field for the PXE_DB_GET_CONFIG_INFO union.
1161
// For PCC bus devices, this field is set to PXE_BUSTYPE_PCC.
1166
// This identifies the PCC network device that this UNDI interface
1174
// This is a copy of the PCC configuration space for this
1178
PXE_UINT8 Byte[256];
1179
PXE_UINT16 Word[128];
1180
PXE_UINT32 Dword[64];
1182
} PXE_PCC_CONFIG_INFO;
1185
typedef struct s_pxe_usb_config_info {
1187
// %%TBD What should we return here...
1188
} PXE_USB_CONFIG_INFO;
1191
typedef struct s_pxe_1394_config_info {
1193
// %%TBD What should we return here...
1194
} PXE_1394_CONFIG_INFO;
1197
typedef union u_pxe_db_get_config_info {
1198
PXE_PCI_CONFIG_INFO pci;
1199
PXE_PCC_CONFIG_INFO pcc;
1200
PXE_USB_CONFIG_INFO usb;
1201
PXE_1394_CONFIG_INFO _1394;
1202
} PXE_DB_GET_CONFIG_INFO;
1205
typedef struct s_pxe_cpb_initialize {
1207
// Address of first (lowest) byte of the memory buffer. This buffer must
1208
// be in contiguous physical memory and cannot be swapped out. The UNDI
1209
// will be using this for transmit and receive buffering.
1211
PXE_UINT64 MemoryAddr;
1214
// MemoryLength must be greater than or equal to MemoryRequired
1215
// returned by the Get Init Info command.
1217
PXE_UINT32 MemoryLength;
1220
// Desired link speed in Mbit/sec. Common ethernet values are 10, 100
1221
// and 1000. Setting a value of zero will auto-detect and/or use the
1222
// default link speed (operation depends on UNDI/NIC functionality).
1224
PXE_UINT32 LinkSpeed;
1227
// Suggested number and size of receive and transmit buffers to
1228
// allocate. If MemoryAddr and MemoryLength are non-zero, this
1229
// allocation comes out of the supplied memory buffer. If MemoryAddr
1230
// and MemoryLength are zero, this allocation comes out of memory
1233
// If these fields are set to zero, the UNDI will allocate buffer
1234
// counts and sizes as it sees fit.
1236
PXE_UINT16 TxBufCnt;
1237
PXE_UINT16 TxBufSize;
1238
PXE_UINT16 RxBufCnt;
1239
PXE_UINT16 RxBufSize;
1242
// The following configuration parameters are optional and must be zero
1243
// to use the default values.
1248
} PXE_CPB_INITIALIZE;
1251
#define PXE_DUPLEX_DEFAULT 0x00
1252
#define PXE_FORCE_FULL_DUPLEX 0x01
1253
#define PXE_ENABLE_FULL_DUPLEX 0x02
1255
#define LOOPBACK_NORMAL 0
1256
#define LOOPBACK_INTERNAL 1
1257
#define LOOPBACK_EXTERNAL 2
1260
typedef struct s_pxe_db_initialize {
1262
// Actual amount of memory used from the supplied memory buffer. This
1263
// may be less that the amount of memory suppllied and may be zero if
1264
// the UNDI and network device do not use external memory buffers.
1266
// Memory used by the UNDI and network device is allocated from the
1267
// lowest memory buffer address.
1269
PXE_UINT32 MemoryUsed;
1272
// Actual number and size of receive and transmit buffers that were
1275
PXE_UINT16 TxBufCnt;
1276
PXE_UINT16 TxBufSize;
1277
PXE_UINT16 RxBufCnt;
1278
PXE_UINT16 RxBufSize;
1279
} PXE_DB_INITIALIZE;
1282
typedef struct s_pxe_cpb_receive_filters {
1284
// List of multicast MAC addresses. This list, if present, will
1285
// replace the existing multicast MAC address filter list.
1287
PXE_MAC_ADDR MCastList[MAX_MCAST_ADDRESS_CNT];
1288
} PXE_CPB_RECEIVE_FILTERS;
1291
typedef struct s_pxe_db_receive_filters {
1293
// Filtered multicast MAC address list.
1295
PXE_MAC_ADDR MCastList[MAX_MCAST_ADDRESS_CNT];
1296
} PXE_DB_RECEIVE_FILTERS;
1299
typedef struct s_pxe_cpb_station_address {
1301
// If supplied and supported, the current station MAC address
1304
PXE_MAC_ADDR StationAddr;
1305
} PXE_CPB_STATION_ADDRESS;
1308
typedef struct s_pxe_dpb_station_address {
1310
// Current station MAC address.
1312
PXE_MAC_ADDR StationAddr;
1315
// Station broadcast MAC address.
1317
PXE_MAC_ADDR BroadcastAddr;
1320
// Permanent station MAC address.
1322
PXE_MAC_ADDR PermanentAddr;
1323
} PXE_DB_STATION_ADDRESS;
1326
typedef struct s_pxe_db_statistics {
1328
// Bit field identifying what statistic data is collected by the
1330
// If bit 0x00 is set, Data[0x00] is collected.
1331
// If bit 0x01 is set, Data[0x01] is collected.
1332
// If bit 0x20 is set, Data[0x20] is collected.
1333
// If bit 0x21 is set, Data[0x21] is collected.
1336
PXE_UINT64 Supported;
1341
PXE_UINT64 Data[64];
1342
} PXE_DB_STATISTICS;
1345
// Total number of frames received. Includes frames with errors and
1348
#define PXE_STATISTICS_RX_TOTAL_FRAMES 0x00
1351
// Number of valid frames received and copied into receive buffers.
1353
#define PXE_STATISTICS_RX_GOOD_FRAMES 0x01
1356
// Number of frames below the minimum length for the media.
1357
// This would be <64 for ethernet.
1359
#define PXE_STATISTICS_RX_UNDERSIZE_FRAMES 0x02
1362
// Number of frames longer than the maxminum length for the
1363
// media. This would be >1500 for ethernet.
1365
#define PXE_STATISTICS_RX_OVERSIZE_FRAMES 0x03
1368
// Valid frames that were dropped because receive buffers were full.
1370
#define PXE_STATISTICS_RX_DROPPED_FRAMES 0x04
1373
// Number of valid unicast frames received and not dropped.
1375
#define PXE_STATISTICS_RX_UNICAST_FRAMES 0x05
1378
// Number of valid broadcast frames received and not dropped.
1380
#define PXE_STATISTICS_RX_BROADCAST_FRAMES 0x06
1383
// Number of valid mutlicast frames received and not dropped.
1385
#define PXE_STATISTICS_RX_MULTICAST_FRAMES 0x07
1388
// Number of frames w/ CRC or alignment errors.
1390
#define PXE_STATISTICS_RX_CRC_ERROR_FRAMES 0x08
1393
// Total number of bytes received. Includes frames with errors
1394
// and dropped frames.
1396
#define PXE_STATISTICS_RX_TOTAL_BYTES 0x09
1399
// Transmit statistics.
1401
#define PXE_STATISTICS_TX_TOTAL_FRAMES 0x0A
1402
#define PXE_STATISTICS_TX_GOOD_FRAMES 0x0B
1403
#define PXE_STATISTICS_TX_UNDERSIZE_FRAMES 0x0C
1404
#define PXE_STATISTICS_TX_OVERSIZE_FRAMES 0x0D
1405
#define PXE_STATISTICS_TX_DROPPED_FRAMES 0x0E
1406
#define PXE_STATISTICS_TX_UNICAST_FRAMES 0x0F
1407
#define PXE_STATISTICS_TX_BROADCAST_FRAMES 0x10
1408
#define PXE_STATISTICS_TX_MULTICAST_FRAMES 0x11
1409
#define PXE_STATISTICS_TX_CRC_ERROR_FRAMES 0x12
1410
#define PXE_STATISTICS_TX_TOTAL_BYTES 0x13
1413
// Number of collisions detection on this subnet.
1415
#define PXE_STATISTICS_COLLISIONS 0x14
1418
// Number of frames destined for unsupported protocol.
1420
#define PXE_STATISTICS_UNSUPPORTED_PROTOCOL 0x15
1423
typedef struct s_pxe_cpb_mcast_ip_to_mac {
1425
// Multicast IP address to be converted to multicast MAC address.
1428
} PXE_CPB_MCAST_IP_TO_MAC;
1431
typedef struct s_pxe_db_mcast_ip_to_mac {
1433
// Multicast MAC address.
1436
} PXE_DB_MCAST_IP_TO_MAC;
1439
typedef struct s_pxe_cpb_nvdata_sparse {
1441
// NvData item list. Only items in this list will be updated.
1444
// Non-volatile storage address to be changed.
1447
// Data item to write into above storage address.
1454
} Item[MAX_EEPROM_LEN];
1455
} PXE_CPB_NVDATA_SPARSE;
1459
// When using bulk update, the size of the CPB structure must be
1460
// the same size as the non-volatile NIC storage.
1462
typedef union u_pxe_cpb_nvdata_bulk {
1464
// Array of byte-wide data items.
1466
PXE_UINT8 Byte[MAX_EEPROM_LEN << 2];
1469
// Array of word-wide data items.
1471
PXE_UINT16 Word[MAX_EEPROM_LEN << 1];
1474
// Array of dword-wide data items.
1476
PXE_UINT32 Dword[MAX_EEPROM_LEN];
1477
} PXE_CPB_NVDATA_BULK;
1479
typedef struct s_pxe_db_nvdata {
1481
// Arrays of data items from non-volatile storage.
1485
// Array of byte-wide data items.
1487
PXE_UINT8 Byte[MAX_EEPROM_LEN << 2];
1490
// Array of word-wide data items.
1492
PXE_UINT16 Word[MAX_EEPROM_LEN << 1];
1494
// Array of dword-wide data items.
1496
PXE_UINT32 Dword[MAX_EEPROM_LEN];
1501
typedef struct s_pxe_db_get_status {
1503
// Length of next receive frame (header + data). If this is zero,
1504
// there is no next receive frame available.
1506
PXE_UINT32 RxFrameLen;
1509
// Reserved, set to zero.
1511
PXE_UINT32 reserved;
1514
// Addresses of transmitted buffers that need to be recycled.
1516
PXE_UINT64 TxBuffer[MAX_XMIT_BUFFERS];
1517
} PXE_DB_GET_STATUS;
1521
typedef struct s_pxe_cpb_fill_header {
1523
// Source and destination MAC addresses. These will be copied into
1524
// the media header without doing byte swapping.
1526
PXE_MAC_ADDR SrcAddr;
1527
PXE_MAC_ADDR DestAddr;
1530
// Address of first byte of media header. The first byte of packet data
1531
// follows the last byte of the media header.
1533
PXE_UINT64 MediaHeader;
1536
// Length of packet data in bytes (not including the media header).
1538
PXE_UINT32 PacketLen;
1541
// Protocol type. This will be copied into the media header without
1542
// doing byte swapping. Protocol type numbers can be obtained from
1543
// the Assigned Numbers RFC 1700.
1545
PXE_UINT16 Protocol;
1548
// Length of the media header in bytes.
1550
PXE_UINT16 MediaHeaderLen;
1551
} PXE_CPB_FILL_HEADER;
1554
#define PXE_PROTOCOL_ETHERNET_IP 0x0800
1555
#define PXE_PROTOCOL_ETHERNET_ARP 0x0806
1556
#define MAX_XMIT_FRAGMENTS 16
1558
typedef struct s_pxe_cpb_fill_header_fragmented {
1560
// Source and destination MAC addresses. These will be copied into
1561
// the media header without doing byte swapping.
1563
PXE_MAC_ADDR SrcAddr;
1564
PXE_MAC_ADDR DestAddr;
1567
// Length of packet data in bytes (not including the media header).
1569
PXE_UINT32 PacketLen;
1572
// Protocol type. This will be copied into the media header without
1573
// doing byte swapping. Protocol type numbers can be obtained from
1574
// the Assigned Numbers RFC 1700.
1576
PXE_MEDIA_PROTOCOL Protocol;
1579
// Length of the media header in bytes.
1581
PXE_UINT16 MediaHeaderLen;
1584
// Number of packet fragment descriptors.
1589
// Reserved, must be set to zero.
1591
PXE_UINT16 reserved;
1594
// Array of packet fragment descriptors. The first byte of the media
1595
// header is the first byte of the first fragment.
1599
// Address of this packet fragment.
1601
PXE_UINT64 FragAddr;
1604
// Length of this packet fragment.
1609
// Reserved, must be set to zero.
1611
PXE_UINT32 reserved;
1612
} FragDesc[MAX_XMIT_FRAGMENTS];
1613
} PXE_CPB_FILL_HEADER_FRAGMENTED;
1617
typedef struct s_pxe_cpb_transmit {
1619
// Address of first byte of frame buffer. This is also the first byte
1620
// of the media header.
1622
PXE_UINT64 FrameAddr;
1625
// Length of the data portion of the frame buffer in bytes. Do not
1626
// include the length of the media header.
1631
// Length of the media header in bytes.
1633
PXE_UINT16 MediaheaderLen;
1636
// Reserved, must be zero.
1638
PXE_UINT16 reserved;
1643
typedef struct s_pxe_cpb_transmit_fragments {
1645
// Length of packet data in bytes (not including the media header).
1647
PXE_UINT32 FrameLen;
1650
// Length of the media header in bytes.
1652
PXE_UINT16 MediaheaderLen;
1655
// Number of packet fragment descriptors.
1660
// Array of frame fragment descriptors. The first byte of the first
1661
// fragment is also the first byte of the media header.
1665
// Address of this frame fragment.
1667
PXE_UINT64 FragAddr;
1670
// Length of this frame fragment.
1675
// Reserved, must be set to zero.
1677
PXE_UINT32 reserved;
1678
} FragDesc[MAX_XMIT_FRAGMENTS];
1679
} PXE_CPB_TRANSMIT_FRAGMENTS;
1682
typedef struct s_pxe_cpb_receive {
1684
// Address of first byte of receive buffer. This is also the first byte
1685
// of the frame header.
1687
PXE_UINT64 BufferAddr;
1690
// Length of receive buffer. This must be large enough to hold the
1691
// received frame (media header + data). If the length of smaller than
1692
// the received frame, data will be lost.
1694
PXE_UINT32 BufferLen;
1697
// Reserved, must be set to zero.
1699
PXE_UINT32 reserved;
1703
typedef struct s_pxe_db_receive {
1705
// Source and destination MAC addresses from media header.
1707
PXE_MAC_ADDR SrcAddr;
1708
PXE_MAC_ADDR DestAddr;
1711
// Length of received frame. May be larger than receive buffer size.
1712
// The receive buffer will not be overwritten. This is how to tell
1713
// if data was lost because the receive buffer was too small.
1715
PXE_UINT32 FrameLen;
1718
// Protocol type from media header.
1720
PXE_MEDIA_PROTOCOL Protocol;
1723
// Length of media header in received frame.
1725
PXE_UINT16 MediaHeaderLen;
1728
// Type of receive frame.
1730
PXE_FRAME_TYPE Type;
1733
// Reserved, must be zero.
1735
PXE_UINT8 reserved[7];
1741
/* EOF - efi_pxe.h */
1742
#endif /* _EFI_PXE_H */