3 Copyright (c) 1999 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions
7 of the BSD License which accompanies this distribution. The
8 full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef _BIOS_SNP_16_H_
17 #define _BIOS_SNP_16_H_
21 #include <Protocol/LegacyBios.h>
22 #include <Protocol/SimpleNetwork.h>
23 #include <Protocol/PciIo.h>
24 #include <Protocol/NetworkInterfaceIdentifier.h>
25 #include <Protocol/DevicePath.h>
27 #include <Library/UefiDriverEntryPoint.h>
28 #include <Library/DebugLib.h>
29 #include <Library/BaseMemoryLib.h>
30 #include <Library/UefiBootServicesTableLib.h>
31 #include <Library/UefiLib.h>
32 #include <Library/BaseLib.h>
33 #include <Library/DevicePathLib.h>
34 #include <Library/MemoryAllocationLib.h>
36 #include <Guid/EventGroup.h>
38 #include <IndustryStandard/Pci.h>
43 // BIOS Simple Network Protocol Device Structure
45 #define EFI_SIMPLE_NETWORK_DEV_SIGNATURE SIGNATURE_32 ('s', 'n', '1', '6')
47 #define INIT_PXE_STATUS 0xabcd
49 #define EFI_SIMPLE_NETWORK_MAX_TX_FIFO_SIZE 64
54 VOID
* Data
[EFI_SIMPLE_NETWORK_MAX_TX_FIFO_SIZE
];
55 } EFI_SIMPLE_NETWORK_DEV_FIFO
;
60 EFI_SIMPLE_NETWORK_PROTOCOL SimpleNetwork
;
61 EFI_SIMPLE_NETWORK_MODE SimpleNetworkMode
;
62 EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL Nii
;
63 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
64 EFI_PCI_IO_PROTOCOL
*PciIo
;
65 EFI_LEGACY_BIOS_PROTOCOL
*LegacyBios
;
68 // Local Data for Simple Network Protocol interface goes here
71 EFI_EVENT EfiBootEvent
;
72 EFI_EVENT LegacyBootEvent
;
73 UINT16 PxeEntrySegment
;
74 UINT16 PxeEntryOffset
;
75 EFI_SIMPLE_NETWORK_DEV_FIFO TxBufferFifo
;
76 EFI_DEVICE_PATH_PROTOCOL
*BaseDevicePath
;
77 PXE_T
*Pxe
; ///< Pointer to !PXE structure
78 PXENV_UNDI_GET_INFORMATION_T GetInformation
; ///< Data from GET INFORMATION
79 PXENV_UNDI_GET_NIC_TYPE_T GetNicType
; ///< Data from GET NIC TYPE
80 PXENV_UNDI_GET_NDIS_INFO_T GetNdisInfo
; ///< Data from GET NDIS INFO
81 BOOLEAN IsrValid
; ///< TRUE if Isr contains valid data
82 PXENV_UNDI_ISR_T Isr
; ///< Data from ISR
83 PXENV_UNDI_TBD_T
*Xmit
; //
84 VOID
*TxRealModeMediaHeader
; ///< < 1 MB Size = 0x100
85 VOID
*TxRealModeDataBuffer
; ///< < 1 MB Size = GetInformation.MaxTranUnit
86 VOID
*TxDestAddr
; ///< < 1 MB Size = 16
87 UINT8 InterruptStatus
; ///< returned/cleared by GetStatus, set in ISR
88 UINTN UndiLoaderTablePages
;
89 UINTN DestinationDataSegmentPages
;
90 UINTN DestinationStackSegmentPages
;
91 UINTN DestinationCodeSegmentPages
;
92 VOID
*UndiLoaderTable
;
93 VOID
*DestinationDataSegment
;
94 VOID
*DestinationStackSegment
;
95 VOID
*DestinationCodeSegment
;
96 } EFI_SIMPLE_NETWORK_DEV
;
98 #define EFI_SIMPLE_NETWORK_DEV_FROM_THIS(a) \
100 EFI_SIMPLE_NETWORK_DEV, \
102 EFI_SIMPLE_NETWORK_DEV_SIGNATURE \
108 extern EFI_DRIVER_BINDING_PROTOCOL gBiosSnp16DriverBinding
;
109 extern EFI_COMPONENT_NAME_PROTOCOL gBiosSnp16ComponentName
;
110 extern EFI_COMPONENT_NAME2_PROTOCOL gBiosSnp16ComponentName2
;
114 // Driver Binding Protocol functions
117 Tests to see if this driver supports a given controller.
119 @param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
120 @param Controller The handle of the controller to test.
121 @param RemainingDevicePath A pointer to the remaining portion of a device path.
123 @retval EFI_SUCCESS The driver supports given controller.
124 @retval EFI_UNSUPPORT The driver doesn't support given controller.
125 @retval Other Other errors prevent driver finishing to test
126 if the driver supports given controller.
130 BiosSnp16DriverBindingSupported (
131 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
132 IN EFI_HANDLE Controller
,
133 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
138 Starts the Snp device controller
140 @param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
141 @param Controller The handle of the controller to test.
142 @param RemainingDevicePath A pointer to the remaining portion of a device path.
144 @retval EFI_SUCCESS - The device was started.
145 @retval EFI_DEVICE_ERROR - The device could not be started due to a device error.
146 @retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.
150 BiosSnp16DriverBindingStart (
151 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
152 IN EFI_HANDLE Controller
,
153 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
158 Stops the device by given device controller.
160 @param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
161 @param Controller The handle of the controller to test.
162 @param NumberOfChildren The number of child device handles in ChildHandleBuffer.
163 @param ChildHandleBuffer An array of child handles to be freed. May be NULL if
164 NumberOfChildren is 0.
166 @retval EFI_SUCCESS - The device was stopped.
167 @retval EFI_DEVICE_ERROR - The device could not be stopped due to a device error.
171 BiosSnp16DriverBindingStop (
172 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
173 IN EFI_HANDLE Controller
,
174 IN UINTN NumberOfChildren
,
175 IN EFI_HANDLE
*ChildHandleBuffer
180 // Simple Network Protocol functions
183 Call 16 bit UNDI ROM to start the network interface
185 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
187 @retval EFI_DEVICE_ERROR Network interface has not be initialized.
188 @retval EFI_DEVICE_ERROR Fail to execute 16 bit ROM call.
189 @retval EFI_SUCESS Success operation.
193 Undi16SimpleNetworkStart (
194 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
199 Call 16 bit UNDI ROM to stop the network interface
201 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
203 @retval EFI_DEVICE_ERROR Network interface has not be initialized.
204 @retval EFI_DEVICE_ERROR Fail to execute 16 bit ROM call.
205 @retval EFI_SUCESS Success operation.
209 Undi16SimpleNetworkStop (
210 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
215 Initialize network interface
217 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
218 @param ExtraRxBufferSize The size of extra request receive buffer.
219 @param ExtraTxBufferSize The size of extra request transmit buffer.
221 @retval EFI_DEVICE_ERROR Fail to execute 16 bit ROM call.
222 @retval EFI_SUCESS Success operation.
226 Undi16SimpleNetworkInitialize (
227 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
,
228 IN UINTN ExtraRxBufferSize OPTIONAL
,
229 IN UINTN ExtraTxBufferSize OPTIONAL
234 Reset network interface.
236 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
237 @param ExtendedVerification Need extended verfication.
239 @retval EFI_INVALID_PARAMETER Invalid This paramter.
240 @retval EFI_DEVICE_ERROR Network device has not been initialized.
241 @retval EFI_NOT_STARTED Network device has been stopped.
242 @retval EFI_DEVICE_ERROR Invalid status for network device
243 @retval EFI_SUCCESS Success operation.
247 Undi16SimpleNetworkReset (
248 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
,
249 IN BOOLEAN ExtendedVerification
254 Shutdown network interface.
256 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
258 @retval EFI_INVALID_PARAMETER Invalid This paramter.
259 @retval EFI_DEVICE_ERROR Network device has not been initialized.
260 @retval EFI_NOT_STARTED Network device has been stopped.
261 @retval EFI_DEVICE_ERROR Invalid status for network device
262 @retval EFI_SUCCESS Success operation.
266 Undi16SimpleNetworkShutdown (
267 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
272 Reset network interface.
274 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
275 @param Enable Enable mask value
276 @param Disable Disable mask value
277 @param ResetMCastFilter Whether reset multi cast filter or not
278 @param MCastFilterCnt Count of mutli cast filter for different MAC address
279 @param MCastFilter Buffer for mustli cast filter for different MAC address.
281 @retval EFI_INVALID_PARAMETER Invalid This paramter.
282 @retval EFI_DEVICE_ERROR Network device has not been initialized.
283 @retval EFI_NOT_STARTED Network device has been stopped.
284 @retval EFI_DEVICE_ERROR Invalid status for network device
285 @retval EFI_SUCCESS Success operation.
289 Undi16SimpleNetworkReceiveFilters (
290 IN EFI_SIMPLE_NETWORK_PROTOCOL
* This
,
293 IN BOOLEAN ResetMCastFilter
,
294 IN UINTN MCastFilterCnt OPTIONAL
,
295 IN EFI_MAC_ADDRESS
* MCastFilter OPTIONAL
302 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
303 @param Reset Whether reset station MAC address to permenent address
304 @param New A pointer to New address
306 @retval EFI_INVALID_PARAMETER Invalid This paramter.
307 @retval EFI_DEVICE_ERROR Network device has not been initialized.
308 @retval EFI_NOT_STARTED Network device has been stopped.
309 @retval EFI_DEVICE_ERROR Invalid status for network device
310 @retval EFI_SUCCESS Success operation.
314 Undi16SimpleNetworkStationAddress (
315 IN EFI_SIMPLE_NETWORK_PROTOCOL
* This
,
317 IN EFI_MAC_ADDRESS
* New OPTIONAL
324 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
325 @param Reset Whether cleanup old statistics data.
326 @param StatisticsSize The buffer of statistics table.
327 @param StatisticsTable A pointer to statistics buffer.
329 @retval EFI_INVALID_PARAMETER Invalid This paramter.
330 @retval EFI_DEVICE_ERROR Network device has not been initialized.
331 @retval EFI_NOT_STARTED Network device has been stopped.
332 @retval EFI_DEVICE_ERROR Invalid status for network device
333 @retval EFI_SUCCESS Success operation.
337 Undi16SimpleNetworkStatistics (
338 IN EFI_SIMPLE_NETWORK_PROTOCOL
* This
,
340 IN OUT UINTN
*StatisticsSize OPTIONAL
,
341 OUT EFI_NETWORK_STATISTICS
* StatisticsTable OPTIONAL
346 Translate IP address to MAC address.
348 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
349 @param IPv6 IPv6 or IPv4
350 @param IP A pointer to given Ip address.
351 @param MAC On return, translated MAC address.
353 @retval EFI_INVALID_PARAMETER Invalid This paramter.
354 @retval EFI_INVALID_PARAMETER Invalid IP address.
355 @retval EFI_INVALID_PARAMETER Invalid return buffer for holding MAC address.
356 @retval EFI_UNSUPPORTED Do not support IPv6
357 @retval EFI_DEVICE_ERROR Network device has not been initialized.
358 @retval EFI_NOT_STARTED Network device has been stopped.
359 @retval EFI_DEVICE_ERROR Invalid status for network device
360 @retval EFI_SUCCESS Success operation.
364 Undi16SimpleNetworkMCastIpToMac (
365 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
,
367 IN EFI_IP_ADDRESS
*IP
,
368 OUT EFI_MAC_ADDRESS
*MAC
373 Performs read and write operations on the NVRAM device attached to a
376 @param This The protocol instance pointer.
377 @param ReadWrite TRUE for read operations, FALSE for write operations.
378 @param Offset Byte offset in the NVRAM device at which to start the read or
379 write operation. This must be a multiple of NvRamAccessSize and
381 @param BufferSize The number of bytes to read or write from the NVRAM device.
382 This must also be a multiple of NvramAccessSize.
383 @param Buffer A pointer to the data buffer.
385 @retval EFI_SUCCESS The NVRAM access was performed.
386 @retval EFI_NOT_STARTED The network interface has not been started.
387 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
388 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
389 @retval EFI_UNSUPPORTED This function is not supported by the network interface.
394 Undi16SimpleNetworkNvData (
395 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
,
404 Reads the current interrupt status and recycled transmit buffer status from
407 @param This The protocol instance pointer.
408 @param InterruptStatus A pointer to the bit mask of the currently active interrupts
409 If this is NULL, the interrupt status will not be read from
410 the device. If this is not NULL, the interrupt status will
411 be read from the device. When the interrupt status is read,
412 it will also be cleared. Clearing the transmit interrupt
413 does not empty the recycled transmit buffer array.
414 @param TxBuf Recycled transmit buffer address. The network interface will
415 not transmit if its internal recycled transmit buffer array
416 is full. Reading the transmit buffer does not clear the
417 transmit interrupt. If this is NULL, then the transmit buffer
418 status will not be read. If there are no transmit buffers to
419 recycle and TxBuf is not NULL, * TxBuf will be set to NULL.
421 @retval EFI_SUCCESS The status of the network interface was retrieved.
422 @retval EFI_NOT_STARTED The network interface has not been started.
423 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
424 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
425 @retval EFI_UNSUPPORTED This function is not supported by the network interface.
430 Undi16SimpleNetworkGetStatus (
431 IN EFI_SIMPLE_NETWORK_PROTOCOL
* This
,
432 OUT UINT32
*InterruptStatus OPTIONAL
,
433 OUT VOID
**TxBuf OPTIONAL
438 Places a packet in the transmit queue of a network interface.
440 @param This The protocol instance pointer.
441 @param HeaderSize The size, in bytes, of the media header to be filled in by
442 the Transmit() function. If HeaderSize is non-zero, then it
443 must be equal to This->Mode->MediaHeaderSize and the DestAddr
444 and Protocol parameters must not be NULL.
445 @param BufferSize The size, in bytes, of the entire packet (media header and
446 data) to be transmitted through the network interface.
447 @param Buffer A pointer to the packet (media header followed by data) to be
448 transmitted. This parameter cannot be NULL. If HeaderSize is zero,
449 then the media header in Buffer must already be filled in by the
450 caller. If HeaderSize is non-zero, then the media header will be
451 filled in by the Transmit() function.
452 @param SrcAddr The source HW MAC address. If HeaderSize is zero, then this parameter
453 is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then
454 This->Mode->CurrentAddress is used for the source HW MAC address.
455 @param DestAddr The destination HW MAC address. If HeaderSize is zero, then this
456 parameter is ignored.
457 @param Protocol The type of header to build. If HeaderSize is zero, then this
458 parameter is ignored. See RFC 1700, section "Ether Types", for
461 @retval EFI_SUCCESS The packet was placed on the transmit queue.
462 @retval EFI_NOT_STARTED The network interface has not been started.
463 @retval EFI_NOT_READY The network interface is too busy to accept this transmit request.
464 @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.
465 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
466 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
467 @retval EFI_UNSUPPORTED This function is not supported by the network interface.
472 Undi16SimpleNetworkTransmit (
473 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
,
477 IN EFI_MAC_ADDRESS
*SrcAddr OPTIONAL
,
478 IN EFI_MAC_ADDRESS
*DestAddr OPTIONAL
,
479 IN UINT16
*Protocol OPTIONAL
484 Receives a packet from a network interface.
486 @param This The protocol instance pointer.
487 @param HeaderSize The size, in bytes, of the media header received on the network
488 interface. If this parameter is NULL, then the media header size
489 will not be returned.
490 @param BufferSize On entry, the size, in bytes, of Buffer. On exit, the size, in
491 bytes, of the packet that was received on the network interface.
492 @param Buffer A pointer to the data buffer to receive both the media header and
494 @param SrcAddr The source HW MAC address. If this parameter is NULL, the
495 HW MAC source address will not be extracted from the media
497 @param DestAddr The destination HW MAC address. If this parameter is NULL,
498 the HW MAC destination address will not be extracted from the
500 @param Protocol The media header type. If this parameter is NULL, then the
501 protocol will not be extracted from the media header. See
502 RFC 1700 section "Ether Types" for examples.
504 @retval EFI_SUCCESS The received data was stored in Buffer, and BufferSize has
505 been updated to the number of bytes received.
506 @retval EFI_NOT_STARTED The network interface has not been started.
507 @retval EFI_NOT_READY The network interface is too busy to accept this transmit
509 @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.
510 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
511 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
512 @retval EFI_UNSUPPORTED This function is not supported by the network interface.
517 Undi16SimpleNetworkReceive (
518 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
,
519 OUT UINTN
*HeaderSize OPTIONAL
,
520 IN OUT UINTN
*BufferSize
,
522 OUT EFI_MAC_ADDRESS
*SrcAddr OPTIONAL
,
523 OUT EFI_MAC_ADDRESS
*DestAddr OPTIONAL
,
524 OUT UINT16
*Protocol OPTIONAL
529 wait for a packet to be received.
531 @param Event Event used with WaitForEvent() to wait for a packet to be received.
532 @param Context Event Context
537 Undi16SimpleNetworkWaitForPacket (
544 Check whether packet is ready for receive.
546 @param This The protocol instance pointer.
548 @retval EFI_SUCCESS Receive data is ready.
549 @retval EFI_NOT_STARTED The network interface has not been started.
550 @retval EFI_NOT_READY The network interface is too busy to accept this transmit
552 @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.
553 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
554 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
555 @retval EFI_UNSUPPORTED This function is not supported by the network interface.
558 Undi16SimpleNetworkCheckForPacket (
559 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
564 Cache Interrupt verctor address converted from IVT number.
566 @param VectorNumber IVT number
568 @retval EFI_SUCCESS Success to operation.
577 Get interrupt vector address according to IVT number.
579 @param VectorNumber Given IVT number
581 @return cached interrupt vector address.
584 RestoreCachedVectorAddress (
590 If available, launch the BaseCode from a NIC option ROM.
591 This should install the !PXE and PXENV+ structures in memory for
595 @param SimpleNetworkDevice Simple network device instance
596 @param RomAddress The ROM base address for NIC rom.
598 @retval EFI_NOT_FOUND The check sum does not match
599 @retval EFI_NOT_FOUND Rom ID offset is wrong
600 @retval EFI_NOT_FOUND No Rom ID structure is found
604 EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
612 Op-Code: PXENV_START_UNDI (0000h)
613 Input: Far pointer to a PXENV_START_UNDI_T parameter structure that has been initialized by the caller.
614 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
615 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
617 Description: This service is used to pass the BIOS parameter registers to the UNDI driver. The UNDI driver is
618 responsible for saving the information it needs to communicate with the hardware.
619 This service is also responsible for hooking the Int 1Ah service routine
620 Note: This API service must be called only once during UNDI Option ROM boot.
621 The UNDI driver is responsible for saving this information and using it every time
622 PXENV_UNDI_STARTUP is called.
623 Service cannot be used in protected mode.
631 } PXENV_START_UNDI_T;
632 Set before calling API service
633 AX, BX, DX, DI, ES: BIOS initialization parameter registers. These
634 fields should contain the same information passed to the option ROM
635 initialization routine by the Host System BIOS. Information about the
636 contents of these registers can be found in the [PnP], [PCI] and
637 [BBS] specifications.
638 Returned from API service
639 Status: See the PXENV_STATUS_xxx constants.
641 @param SimpleNetworkDevice Device instance
642 @param PxeUndiTable Point to structure which hold paramter and return value
645 @return Return value of PXE option ROM far call.
649 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
650 IN OUT PXENV_START_UNDI_T
*PxeUndiTable
657 Op-Code: PXENV_UNDI_STARTUP (0001h)
658 Input: Far pointer to a PXENV_UNDI_STARTUP_T parameter structure that has been initialized by the
660 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
661 the parameter structure must be set to one of the values represented by the
662 PXENV_STATUS_xxx constants.
663 Description: This API is responsible for initializing the contents of the UNDI code & data segment for proper
664 operation. Information from the !PXE structure and the first PXENV_START_UNDI API call is used
665 to complete this initialization. The rest of the UNDI APIs will not be available until this call has
667 Note: PXENV_UNDI_STARTUP must not be called again without first calling
669 PXENV_UNDI_STARTUP and PXENV_UNDI_SHUTDOWN are no longer responsible for
670 chaining interrupt 1Ah. This must be done by the PXENV_START_UNDI and
671 PXENV_STOP_UNDI API calls.
672 This service cannot be used in protected mode.
676 } PXENV_UNDI_STARTUP_T;
677 Set before calling API service
679 Returned from API service
680 Status: See the PXENV_STATUS_xxx constants.
682 @param SimpleNetworkDevice Device instance
683 @param PxeUndiTable Point to structure which hold paramter and return value
686 @return Return value of PXE option ROM far call.
690 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
691 IN OUT PXENV_UNDI_STARTUP_T
*PxeUndiTable
698 Op-Code: PXENV_UNDI_CLEANUP (0002h)
699 Input: Far pointer to a PXENV_UNDI_CLEANUP_T parameter structure.
700 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field
701 in the parameter structure must be set to one of the values represented by the
702 PXENV_STATUS_xxx constants.
703 Description: This call will prepare the network adapter driver to be unloaded from memory. This call must be
704 made just before unloading the Universal NIC Driver. The rest of the API will not be available
705 after this call executes.
706 This service cannot be used in protected mode.
709 } PXENV_UNDI_CLEANUP_T;
710 Set before calling API service
712 Returned from API service
713 Status: See the PXENV_STATUS_xxx constants.
715 @param SimpleNetworkDevice Device instance
716 @param PxeUndiTable Point to structure which hold paramter and return value
719 @return Return value of PXE option ROM far call.
723 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
724 IN OUT PXENV_UNDI_CLEANUP_T
*PxeUndiTable
731 Op-Code: PXENV_UNDI_INITIALIZE (0003h)
732 Input: Far pointer to a PXENV_UNDI_INITIALIZE_T parameter structure that has been initialized by the
734 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
735 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
737 Description: This call resets the adapter and programs it with default parameters. The default parameters used
738 are those supplied to the most recent UNDI_STARTUP call. This routine does not enable the
739 receive and transmit units of the network adapter to readily receive or transmit packets. The
740 application must call PXENV_UNDI_OPEN to logically connect the network adapter to the network.
741 This call must be made by an application to establish an interface to the network adapter driver.
742 Note: When the PXE code makes this call to initialize the network adapter, it passes a NULL pointer for
743 the Protocol field in the parameter structure.
748 } PXENV_UNDI_INITIALIZE_T;
749 Set before calling API service
750 ProtocolIni: Physical address of a memory copy of the driver
751 module from the protocol.ini file obtained from the protocol manager
752 driver (refer to the NDIS 2.0 specification). This parameter is
753 supported for the universal NDIS driver to pass the information
754 contained in the protocol.ini file to the NIC driver for any specific
755 configuration of the NIC. (Note that the module identification in the
756 protocol.ini file was done by NDIS.) This value can be NULL for any
757 other application interfacing to the universal NIC driver
758 Returned from API service
759 Status: See the PXENV_STATUS_xxx constants.
761 @param SimpleNetworkDevice Device instance.
762 @param PxeUndiTable Point to structure which hold paramter and return value
765 @return Return value of PXE option ROM far call.
769 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
770 IN OUT PXENV_UNDI_INITIALIZE_T
*PxeUndiTable
775 Wrapper routine for reset adapter.
779 Op-Code: PXENV_UNDI_RESET_ADAPTER (0004h)
780 Input: Far pointer to a PXENV_UNDI_RESET_ADAPTER_t parameter structure that has been initialized
782 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
783 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
785 Description: This call resets and reinitializes the network adapter with the same set of parameters supplied to
786 Initialize Routine. Unlike Initialize, this call opens the adapter that is, it connects logically to the
787 network. This routine cannot be used to replace Initialize or Shutdown calls.
790 PXENV_UNDI_MCAST_ADDRESS_t R_Mcast_Buf;
791 } PXENV_UNDI_RESET_T;
793 #define MAXNUM_MCADDR 8
796 UINT16 MCastAddrCount;
797 MAC_ADDR McastAddr[MAXNUM_MCADDR];
798 } PXENV_UNDI_MCAST_ADDRESS_t;
800 Set before calling API service
801 R_Mcast_Buf: This is a structure of MCastAddrCount and
803 MCastAddrCount: Number of multicast MAC addresses in the
805 McastAddr: List of up to MAXNUM_MCADDR multicast MAC
807 Returned from API service
808 Status: See the PXENV_STATUS_xxx constants.
810 @param SimpleNetworkDevice Device instance.
811 @param PxeUndiTable Point to structure which hold paramter and return value
813 @param RxFilter Filter setting mask value for PXE recive .
815 @return Return value of PXE option ROM far call.
819 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
820 IN OUT PXENV_UNDI_RESET_T
*PxeUndiTable
,
828 Op-Code: PXENV_UNDI_SHUTDOWN (0005h)
829 Input: Far pointer to a PXENV_UNDI_SHUTDOWN_T parameter.
830 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
831 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
833 Description: This call resets the network adapter and leaves it in a safe state for another driver to program it.
834 Note: The contents of the PXENV_UNDI_STARTUP parameter structure need to be saved by the
835 Universal NIC Driver in case PXENV_UNDI_INITIALIZE is called again.
839 } PXENV_UNDI_SHUTDOWN_T;
840 Set before calling API service
842 Returned from API service
843 Status: See the PXENV_STATUS_xxx constants.
845 @param SimpleNetworkDevice Device instance
846 @param PxeUndiTable Point to structure which hold paramter and return value
849 @return Return value of PXE option ROM far call.
853 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
854 IN OUT PXENV_UNDI_SHUTDOWN_T
*PxeUndiTable
861 Op-Code: PXENV_UNDI_OPEN (0006h)
862 Input: Far pointer to a PXENV_UNDI_OPEN_T parameter structure that has been initialized by the caller.
863 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
864 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
866 Description: This call activates the adapter network connection and sets the adapter ready to accept packets
867 for transmit and receive.
872 #define FLTR_DIRECTED 0x0001
873 #define FLTR_BRDCST 0x0002
874 #define FLTR_PRMSCS 0x0004
875 #define FLTR_SRC_RTG 0x0008
876 PXENV_UNDI_MCAST_ADDRESS_t R_Mcast_Buf;
878 Set before calling API service
879 OpenFlag: This is an adapter specific input parameter. This is
880 supported for the universal NDIS 2.0 driver to pass in the open flags
881 provided by the protocol driver. (See the NDIS 2.0 specification.)
883 PktFilter: Filter for receiving packets. This can be one, or more, of
884 the FLTR_xxx constants. Multiple values are arithmetically or-ed
886 directed packets are packets that may come to your MAC address
887 or the multicast MAC address.
888 R_Mcast_Buf: See definition in UNDI RESET ADAPTER (0004h).
889 Returned from API service
890 Status: See the PXENV_STATUS_xxx constants.
892 @param SimpleNetworkDevice Device instance
893 @param PxeUndiTable Point to structure which hold paramter and return value
896 @return Return value of PXE option ROM far call.
900 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
901 IN OUT PXENV_UNDI_OPEN_T
*PxeUndiTable
908 Op-Code: PXENV_UNDI_CLOSE (0007h)
909 Input: Far pointer to a PXENV_UNDI_CLOSE_T parameter.
910 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
911 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
913 Description: This call disconnects the network adapter from the network. Packets cannot be transmitted or
914 received until the network adapter is open again.
917 } PXENV_UNDI_CLOSE_T;
918 Set before calling API service
920 Returned from API service
921 Status: See the PXENV_STATUS_xxx constants.
923 @param SimpleNetworkDevice Device instance
924 @param PxeUndiTable Point to structure which hold paramter and return value
927 @return Return value of PXE option ROM far call.
931 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
932 IN OUT PXENV_UNDI_CLOSE_T
*PxeUndiTable
939 Op-Code: PXENV_UNDI_TRANSMIT (0008h)
940 Input: Far pointer to a PXENV_UNDI_TRANSMIT_T parameter structure that
941 has been initialized by the caller.
942 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX.
943 The status code must be set to one of the values represented by the
944 PXENV_STATUS_xxx constants.
945 Description: This call transmits a buffer to the network. The media header
946 for the packet can be filled by the calling protocol, but it might not be.
947 The network adapter driver will fill it if required by the values in the
948 parameter block. The packet is buffered for transmission provided there is
949 an available buffer, and the function returns PXENV_EXIT_SUCCESS. If no
950 buffer is available the function returns PXENV_EXIT_FAILURE with a status
951 code of PXE_UNDI_STATUS__OUT OF_RESOURCE. The number of buffers is
952 implementation-dependent. An interrupt is generated on completion of the
953 transmission of one or more packets. A call to PXENV_UNDI_TRANSMIT is
954 permitted in the context of a transmit complete interrupt.
964 #define XMT_DESTADDR 0x0000
965 #define XMT_BROADCAST 0x0001
969 } t_PXENV_UNDI_TRANSMIT;
971 #define MAX_DATA_BLKS 8
982 } DataBlock[MAX_DATA_BLKS];
985 Set before calling API service
986 Protocol: This is the protocol of the upper layer that is calling UNDI
987 TRANSMIT call. If the upper layer has filled the media header, this
988 field must be P_UNKNOWN.
989 XmitFlag: If this flag is XMT_DESTADDR, the NIC driver expects a
990 pointer to the destination media address in the field DestAddr. If
991 XMT_BROADCAST, the NIC driver fills the broadcast address for the
993 TBD: Segment:Offset address of the transmit buffer descriptor.
994 ImmedLength: Length of the immediate transmit buffer: Xmit.
995 Xmit: Segment:Offset of the immediate transmit buffer.
996 DataBlkCount: Number of blocks in this transmit buffer.
998 0 => 32-bit physical address in TDDataPtr (not supported in this
1000 1 => segment:offset in TDDataPtr which can be a real mode or 16-bit
1001 protected mode pointer
1002 TDRsvdByte: Reserved must be zero.
1003 TDDatalen: Data block length in bytes.
1004 TDDataPtr: Segment:Offset of the transmit block.
1005 DataBlock: Array of transmit data blocks.
1006 Returned from API service
1007 Status: See the PXENV_STATUS_xxx constants
1009 @param SimpleNetworkDevice Device instance
1010 @param PxeUndiTable Point to structure which hold paramter and return value
1011 for option ROM call.
1013 @return Return value of PXE option ROM far call.
1017 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1018 IN OUT PXENV_UNDI_TRANSMIT_T
*PxeUndiTable
1024 UNDI SET MULTICAST ADDRESS
1025 Op-Code: PXENV_UNDI_SET_MCAST_ADDRESS (0009h)
1026 Input: Far pointer to a PXENV_TFTP_SET_MCAST_ADDRESS_t parameter structure that has been
1027 initialized by the caller.
1028 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1029 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1031 Description: This call changes the current list of multicast addresses to the input list and resets the network
1032 adapter to accept it. If the number of multicast addresses is zero, multicast is disabled.
1034 PXENV_STATUS Status;
1035 PXENV_UNDI_MCAST_ADDRESS_t R_Mcast_Buf;
1036 } PXENV_UNDI_SET_MCAST_ADDR_T;
1037 Set before calling API service
1038 R_Mcast_Buf: See description in the UNDI RESET ADAPTER
1040 Returned from API service
1041 Status: See the PXENV_STATUS_xxx constants
1043 @param SimpleNetworkDevice Device instance
1044 @param PxeUndiTable Point to structure which hold paramter and return value
1045 for option ROM call.
1047 @return Return value of PXE option ROM far call.
1050 PxeUndiSetMcastAddr (
1051 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1052 IN OUT PXENV_UNDI_SET_MCAST_ADDR_T
*PxeUndiTable
1058 UNDI SET STATION ADDRESS
1059 Op-Code: PXENV_UNDI_SET_STATION_ADDRESS (000Ah)
1060 Input: Far pointer to a PXENV_UNDI_SET_STATION_ADDRESS_t parameter structure that has been
1061 initialized by the caller.
1062 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1063 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1065 Description: This call sets the MAC address to be the input value and is called before opening the network
1066 adapter. Later, the open call uses this variable as a temporary MAC address to program the
1067 adapter individual address registers.
1069 PXENV_STATUS Status;
1070 MAC_ADDR StationAddress;
1071 } PXENV_UNDI_SET_STATION_ADDR_T;
1072 Set before calling API service
1073 StationAddress: Temporary MAC address to be used for
1074 transmit and receive.
1075 Returned from API service
1076 Status: See the PXENV_STATUS_xxx constants.
1078 @param SimpleNetworkDevice Device instance
1079 @param PxeUndiTable Point to structure which hold paramter and return value
1080 for option ROM call.
1082 @return Return value of PXE option ROM far call.
1085 PxeUndiSetStationAddr (
1086 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1087 IN OUT PXENV_UNDI_SET_STATION_ADDR_T
*PxeUndiTable
1093 UNDI SET PACKET FILTER
1094 Op-Code: PXENV_UNDI_SET_PACKET_FILTER (000Bh)
1095 Input: Far pointer to a PXENV_UNDI_SET_PACKET_FILTER_T parameter structure that has been
1096 initialized by the caller.
1097 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1098 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1100 Description: This call resets the adapter's receive unit to accept a new filter, different from the one provided with
1103 PXENV_STATUS Status;
1105 } PXENV_UNDI_SET_PACKET_FILTER_T;
1106 Set before calling API service
1107 Filter: See the receive filter values in the UNDI OPEN
1108 (0006h) API description.
1109 Returned from API service
1110 Status: See the PXENV_STATUS_xxx constants.
1112 @param SimpleNetworkDevice Device instance
1113 @param PxeUndiTable Point to structure which hold paramter and return value
1114 for option ROM call.
1116 @return Return value of PXE option ROM far call.
1119 PxeUndiSetPacketFilter (
1120 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1121 IN OUT PXENV_UNDI_SET_PACKET_FILTER_T
*PxeUndiTable
1127 UNDI GET INFORMATION
1128 Op-Code: PXENV_UNDI_GET_INFORMATION (000Ch)
1129 Input: Far pointer to a PXENV_UNDI_GET_INFORMATION_T parameter structure that has been
1130 initialized by the caller.
1131 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1132 the parameter structure must be set to one of the values represented by the
1133 PXENV_STATUS_xxx constants.
1134 Description: This call copies the network adapter variables, including the MAC address, into the input buffer.
1135 Note: The PermNodeAddress field must be valid after PXENV_START_UNDI and
1136 PXENV_UNDI_STARTUP have been issued. All other fields must be valid after
1137 PXENV_START_UNDI, PXENV_UNDI_STARTUP and PXENV_UNDI_INITIALIZE have been
1140 PXENV_STATUS Status;
1145 #define ETHER_TYPE 1
1146 #define EXP_ETHER_TYPE 2
1148 #define ARCNET_TYPE 7
1150 MAC_ADDR CurrentNodeAddress;
1151 MAC_ADDR PermNodeAddress;
1155 } PXENV_UNDI_GET_INFORMATION_T;
1156 Set before calling API service
1158 Returned from API service
1159 Status: See the PXENV_STATUS_xxx constants.
1160 BaseIO: Adapter base I/O address.
1161 IntNumber: Adapter IRQ number.
1162 MaxTranUnit: Adapter maximum transmit unit.
1163 HWType: Type of protocol at the hardware level.
1164 HWAddrLen: Length of the hardware address.
1165 CurrentNodeAddress: Current hardware address.
1166 PermNodeAddress: Permanent hardware address.
1167 ROMAddress: Real mode ROM segment address.
1168 RxBufCnt: Receive queue length.
1169 TxBufCnt: Transmit queue length.
1171 @param SimpleNetworkDevice Device instance
1172 @param PxeUndiTable Point to structure which hold paramter and return value
1173 for option ROM call.
1175 @return Return value of PXE option ROM far call.
1178 PxeUndiGetInformation (
1179 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1180 IN OUT PXENV_UNDI_GET_INFORMATION_T
*PxeUndiTable
1187 Op-Code: PXENV_UNDI_GET_STATISTICS (000Dh)
1188 Input: Far pointer to a PXENV_UNDI_GET_STATISTICS_T parameter structure that has been initialized
1190 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1191 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1193 Description: This call reads statistical information from the network adapter, and returns.
1195 PXENV_STATUS Status;
1196 UINT32 XmtGoodFrames;
1197 UINT32 RcvGoodFrames;
1198 UINT32 RcvCRCErrors;
1199 UINT32 RcvResourceErrors;
1200 } PXENV_UNDI_GET_STATISTICS_T;
1201 Set before calling API service
1203 Returned from API service
1204 Status: See the PXENV_STATUS_xxx constants.
1205 XmtGoodFrames: Number of successful transmissions.
1206 RcvGoodFrames: Number of good frames received.
1207 RcvCRCErrors: Number of frames received with CRC
1209 RcvResourceErrors: Number of frames discarded
1210 because receive queue was full.
1212 @param SimpleNetworkDevice Device instance
1213 @param PxeUndiTable Point to structure which hold paramter and return value
1214 for option ROM call.
1216 @return Return value of PXE option ROM far call.
1219 PxeUndiGetStatistics (
1220 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1221 IN OUT PXENV_UNDI_GET_STATISTICS_T
*PxeUndiTable
1227 UNDI CLEAR STATISTICS
1228 Op-Code: PXENV_UNDI_CLEAR_STATISTICS (000Eh)
1229 Input: Far pointer to a PXENV_UNDI_CLEAR_STATISTICS_T parameter.
1230 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1231 the parameter structure must be set to one of the values represented by the
1232 PXENV_STATUS_xxx constants.
1233 Description: This call clears the statistical information from the network adapter.
1235 PXENV_STATUS Status;
1236 } PXENV_UNDI_CLEAR_STATISTICS_T;
1237 Set before calling API service
1239 Returned from API service
1240 Status: See the PXENV_STATUS_xxx constants.
1242 @param SimpleNetworkDevice Device instance
1243 @param PxeUndiTable Point to structure which hold paramter and return value
1244 for option ROM call.
1246 @return Return value of PXE option ROM far call.
1249 PxeUndiClearStatistics (
1250 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1251 IN OUT PXENV_UNDI_CLEAR_STATISTICS_T
*PxeUndiTable
1258 Op-Code: PXENV_UNDI_INITIATE_DIAGS (000Fh)
1259 Input: Far pointer to a PXENV_UNDI_INITIATE_DIAGS_T parameter.
1260 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1261 the parameter structure must be set to one of the values represented by the
1262 PXENV_STATUS_xxx constants.
1263 Description: This call can be used to initiate the run-time diagnostics. It causes the network adapter to run
1264 hardware diagnostics and to update its status information.
1266 PXENV_STATUS Status;
1267 } PXENV_UNDI_INITIATE_DIAGS_T;
1268 Set before calling API service
1270 Returned from API service
1271 Status: See the PXENV_STATUS_xxx constants.
1273 @param SimpleNetworkDevice Device instance
1274 @param PxeUndiTable Point to structure which hold paramter and return value
1275 for option ROM call.
1277 @return Return value of PXE option ROM far call.
1280 PxeUndiInitiateDiags (
1281 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1282 IN OUT PXENV_UNDI_INITIATE_DIAGS_T
*PxeUndiTable
1288 UNDI FORCE INTERRUPT
1289 Op-Code: PXENV_UNDI_FORCE_INTERRUPT (0010h)
1290 Input: Far pointer to a PXENV_UNDI_FORCE_INTERRUPT_T parameter structure that has been
1291 initialized by the caller.
1292 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1293 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1295 Description: This call forces the network adapter to generate an interrupt. When a receive interrupt occurs, the
1296 network adapter driver usually queues the packet and calls the application's callback receive
1297 routine with a pointer to the packet received. Then, the callback routine either can copy the packet
1298 to its buffer or can decide to delay the copy to a later time. If the packet is not immediately copied,
1299 the network adapter driver does not remove it from the input queue. When the application wants to
1300 copy the packet, it can call the PXENV_UNDI_FORCE_INTERRUPT routine to simulate the receive
1303 PXENV_STATUS Status;
1304 } PXENV_UNDI_FORCE_INTERRUPT_T;
1305 Set before calling API service
1307 Returned from API service
1308 Status: See the PXENV_STATUS_xxx constants.
1310 @param SimpleNetworkDevice Device instance
1311 @param PxeUndiTable Point to structure which hold paramter and return value
1312 for option ROM call.
1314 @return Return value of PXE option ROM far call.
1317 PxeUndiForceInterrupt (
1318 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1319 IN OUT PXENV_UNDI_FORCE_INTERRUPT_T
*PxeUndiTable
1325 UNDI GET MULTICAST ADDRESS
1326 Op-Code: PXENV_UNDI_GET_MCAST_ADDRESS (0011h)
1327 Input: Far pointer to a PXENV_GET_MCAST_ADDRESS_t parameter structure that has been initialized
1329 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1330 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1332 Description: This call converts the given IP multicast address to a hardware multicast address.
1334 PXENV_STATUS Status;
1337 } PXENV_UNDI_GET_MCAST_ADDR_T;
1338 Set before calling API service
1339 InetAddr: IP multicast address.
1340 Returned from API service
1341 Status: See the PXENV_STATUS_xxx constants.
1342 MediaAddr: MAC multicast address.
1344 @param SimpleNetworkDevice Device instance
1345 @param PxeUndiTable Point to structure which hold paramter and return value
1346 for option ROM call.
1348 @return Return value of PXE option ROM far call.
1351 PxeUndiGetMcastAddr (
1352 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1353 IN OUT PXENV_UNDI_GET_MCAST_ADDR_T
*PxeUndiTable
1360 Op-Code: PXENV_UNDI_GET_NIC_TYPE (0012h)
1361 Input: Far pointer to a PXENV_UNDI_GET_NIC_TYPE_T parameter structure that has been initialized by
1363 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1364 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1365 constants. If the PXENV_EXIT_SUCCESS is returned the parameter structure must contain the
1367 Description: This call, if successful, provides the NIC-specific information necessary to identify the network
1368 adapter that is used to boot the system.
1369 Note: The application first gets the DHCPDISCOVER packet using GET_CACHED_INFO and checks if
1370 the UNDI is supported before making this call. If the UNDI is not supported, the NIC-specific
1371 information can be obtained from the DHCPDISCOVER packet itself.
1372 PXENV_START_UNDI, PXENV_UNDI_STARTUP and PXENV_UNDI_INITIALIZE must be called
1373 before the information provided is valid.
1375 PXENV_STATUS Status;
1379 #define CardBus_NIC 4
1389 UINT16 SubVendor_ID;
1390 UINT16 SubDevice_ID;
1400 } PXENV_UNDI_GET_NIC_TYPE_T;
1401 Set before calling API service
1403 Returned from API service
1404 Status: See the PXENV_STATUS_xxx constants.
1405 NICType: Type of NIC information stored in the parameter
1407 Info: Information about the fields in this union can be found
1408 in the [PnP] and [PCI] specifications
1410 @param SimpleNetworkDevice Device instance
1411 @param PxeUndiTable Point to structure which hold paramter and return value
1412 for option ROM call.
1414 @return Return value of PXE option ROM far call.
1418 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1419 IN OUT PXENV_UNDI_GET_NIC_TYPE_T
*PxeUndiTable
1426 Op-Code: PXENV_UNDI_GET_IFACE_INFO (0013h)
1427 Input: Far pointer to a PXENV_UNDI_GET_IFACE_INFO_t parameter structure that has been initialized
1429 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1430 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1431 constants. If the PXENV_EXIT_SUCCESS is returned, the parameter structure must contain the
1432 interface specific information.
1433 Description: This call, if successful, provides the network interface specific information such as the interface
1434 type at the link layer (Ethernet, Tokenring) and the link speed. This information can be used in the
1435 universal drivers such as NDIS or Miniport to communicate to the upper protocol modules.
1436 Note: UNDI follows the NDIS2 specification in giving this information. It is the responsibility of the
1437 universal driver to translate/convert this information into a format that is required in its specification
1438 or to suit the expectation of the upper level protocol modules.
1439 PXENV_START_UNDI, PXENV_UNDI_STARTUP and PXENV_UNDI_INITIALIZE must be called
1440 before the information provided is valid.
1443 UINT8 IfaceType[16];
1445 UINT32 ServiceFlags;
1447 } PXENV_UNDI_GET_NDIS_INFO_T;
1448 Set before calling API service
1450 Returned from API service
1451 Status: See the PXENV_STATUS_xxx constants.
1452 IfaceType: Name of MAC type in ASCIIZ format. This is
1453 used by the universal NDIS driver to specify its driver type
1454 to the protocol driver.
1455 LinkSpeed: Defined in the NDIS 2.0 specification.
1456 ServiceFlags: Defined in the NDIS 2.0 specification.
1457 Reserved: Must be zero.
1459 @param SimpleNetworkDevice Device instance
1460 @param PxeUndiTable Point to structure which hold paramter and return value
1461 for option ROM call.
1463 @return Return value of PXE option ROM far call.
1466 PxeUndiGetNdisInfo (
1467 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1468 IN OUT PXENV_UNDI_GET_NDIS_INFO_T
*PxeUndiTable
1475 Op-Code: PXENV_UNDI_ISR (0014h)
1476 Input: Far pointer to a PXENV_UNDI_ISR_T parameter structure that has been initialized by the caller.
1477 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1478 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1480 Description: This API function will be called at different levels of processing the interrupt. The FuncFlag field in
1481 the parameter block indicates the operation to be performed for the call. This field is filled with the
1482 status of that operation on return.
1483 Note: Interrupt Service Routine Operation:
1484 In this design the UNDI does not hook the interrupt for the Network Interface. Instead, the
1485 application or the protocol driver hooks the interrupt and calls UNDI with the PXENV_UNDI_ISR
1486 API call for interrupt verification (PXENV_UNDI_ISR_IN_START) and processing
1487 (PXENV_UNDI_ISR_IN_PROCESS and PXENV_UNDI_ISR_GET_NEXT).
1488 When the Network Interface HW generates an interrupt the protocol driver interrupt service
1489 routine (ISR) gets control and takes care of the interrupt processing at the PIC level. The ISR then
1490 calls the UNDI using the PXENV_UNDI_ISR API with the value PXENV_UNDI_ISR_IN_START for
1491 the FuncFlag parameter. At this time UNDI must disable the interrupts at the Network Interface
1492 level and read any status values required to further process the interrupt. UNDI must return as
1493 quickly as possible with one of the two values, PXENV_UNDI_ISR_OUT_OURS or
1494 PXENV_UNDI_ISR_OUT_NOT_OURS, for the parameter FuncFlag depending on whether the
1495 interrupt was generated by this particular Network Interface or not.
1496 If the value returned in FuncFlag is PXENV_UNDI_ISR_OUT_NOT_OURS, then the interrupt was
1497 not generated by our NIC, and interrupt processing is complete.
1498 If the value returned in FuncFlag is PXENV_UNDI_ISR_OUT_OURS, the protocol driver must start
1499 a handler thread and send an end-of-interrupt (EOI) command to the PIC. Interrupt processing is
1501 The protocol driver strategy routine will call UNDI using this same API with FuncFlag equal to
1502 PXENV_UNDI_ISR_IN_PROCESS. At this time UNDI must find the cause of this interrupt and
1503 return the status in the FuncFlag. It first checks if there is a frame received and if so it returns the
1504 first buffer pointer of that frame in the parameter block.
1505 The protocol driver calls UNDI repeatedly with the FuncFlag equal to
1506 PXENV_UNDI_ISR_IN_GET_NEXT to get all the buffers in a frame and also all the received
1507 frames in the queue. On this call, UNDI must remember the previous buffer given to the protoco,l
1508 remove it from the receive queue and recycle it. In case of a multi-buffered frame, if the previous
1509 buffer is not the last buffer in the frame it must return the next buffer in the frame in the parameter
1510 block. Otherwise it must return the first buffer in the next frame.
1511 If there is no received frame pending to be processed, UNDI processes the transmit completes and
1512 if there is no other interrupt status to be processed, UNDI re-enables the interrupt at the
1513 NETWORK INTERFACE level and returns PXENV_UNDI_ISR_OUT_DONE in the FuncFlag.
1514 IMPORTANT: It is possible for the protocol driver to be interrupted again while in the
1515 strategy routine when the UNDI re-enables interrupts.
1517 @param SimpleNetworkDevice Device instance
1518 @param PxeUndiTable Point to structure which hold paramter and return value
1519 for option ROM call.
1521 @return Return value of PXE option ROM far call.
1525 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1526 IN OUT PXENV_UNDI_ISR_T
*PxeUndiTable
1533 Op-Code: PXENV_STOP_UNDI (0015h)
1534 Input: Far pointer to a PXENV_STOP_UNDI_T parameter structure that has been initialized by the caller.
1535 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1536 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1538 Description: This routine is responsible for unhooking the Int 1Ah service routine.
1539 Note: This API service must be called only once at the end of UNDI Option ROM boot. One of the valid
1540 status codes is PXENV_STATUS_KEEP. If this status is returned, UNDI must not be removed from
1541 base memory. Also, UNDI must not be removed from base memory if BC is not removed from base
1543 Service cannot be used in protected mode.
1545 PXENV_STATUS Status;
1546 } PXENV_STOP_UNDI_T;
1547 Set before calling API service
1549 Returned from API service
1550 Status: See the PXENV_STATUS_xxx constants.
1552 @param SimpleNetworkDevice Device instance
1553 @param PxeUndiTable Point to structure which hold paramter and return value
1554 for option ROM call.
1556 @return Return value of PXE option ROM far call.
1560 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1561 IN OUT PXENV_STOP_UNDI_T
*PxeUndiTable
1568 Op-Code: PXENV_UNDI_GET_STATE (0015h)
1569 Input: Far pointer to a PXENV_UNDI_GET_STATE_T parameter.
1570 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1571 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1572 constants. The UNDI_STATE field in the parameter structure must be set to one of the valid state
1574 Description: This call can be used to obtain state of the UNDI engine in order to avoid issuing adverse call
1577 #define PXE_UNDI_GET_STATE_STARTED 1
1578 #define PXE_UNDI_GET_STATE_INITIALIZED 2
1579 #define PXE_UNDI_GET_STATE_OPENED 3
1580 PXENV_STATUS Status;
1582 } PXENV_UNDI_GET_STATE_T;
1583 Set before calling API service
1585 Returned from API service
1586 Status: See the PXENV_STATUS_xxx constants.
1587 State: See definitions of the state constants.
1588 Note. UNDI implementation is responsible for maintaining
1589 internal state machine.
1591 Op-Code: PXENV_UNDI_ISR (0014h)
1592 Input: Far pointer to a t_PXENV_UNDI_ISR parameter structure that has been initialized by the caller.
1593 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1594 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1596 Description: This API function will be called at different levels of processing the interrupt. The FuncFlag field in
1597 the parameter block indicates the operation to be performed for the call. This field is filled with the
1598 status of that operation on return.
1600 @param SimpleNetworkDevice Device instance
1601 @param PxeUndiTable Point to structure which hold paramter and return value
1602 for option ROM call.
1604 @return Return value of PXE option ROM far call.
1608 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1609 IN OUT PXENV_UNDI_GET_STATE_T
*PxeUndiTable
1614 Effect the Far Call into the PXE Layer
1616 Note: When using a 32-bit stack segment do not push 32-bit words onto the stack. The PXE API
1617 services will not work, unless there are three 16-bit parameters pushed onto the stack.
1618 push DS ;Far pointer to parameter structure
1619 push offset pxe_data_call_struct ;is pushed onto stack.
1620 push Index ;UINT16 is pushed onto stack.
1621 call dword ptr (s_PXE ptr es:[di]).EntryPointSP
1622 add sp, 6 ;Caller cleans up stack.
1624 @param SimpleNetworkDevice Device instance for simple network
1625 @param Table Point to parameter/retun value table for legacy far call
1626 @param TableSize The size of paramter/return value table
1627 @param CallIndex The index of legacy call.
1633 EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1641 Allocate buffer below 1M for real mode.
1643 @param NumPages The number pages want to be allocated.
1644 @param Buffer On return, allocated buffer.
1646 @return Status of allocating pages.
1649 BiosSnp16AllocatePagesBelowOneMb (