/** @file
Copyright (c) 1999 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
of the BSD License which accompanies this distribution. The
full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "BiosSnp16.h"
///
/// EFI Driver Binding Protocol Instance
///
0x3,
NULL,
};
///
/// This boolean is used to determine if we should release the cached vector during an error condition.
///
//
// Private worker functions;
//
/**
Start the UNDI interface.
@param SimpleNetworkDevice A pointer to EFI_SIMPLE_NETWORK_DEV data structure.
@param Ax PCI address of Undi device.
@retval EFI_DEVICE_ERROR Fail to start 16 bit UNDI ROM.
@retval Others Status of start 16 bit UNDI ROM.
**/
);
/**
Start the UNDI interface
@param SimpleNetworkDevice A pointer to EFI_SIMPLE_NETWORK_DEV data structure.
@retval EFI_DEVICE_ERROR Fail to start 16 bit UNDI ROM.
@retval Others Status of start 16 bit UNDI ROM.
**/
);
/**
Stop the UNDI interface
@param SimpleNetworkDevice A pointer to EFI_SIMPLE_NETWORK_DEV data structure.
@retval EFI_DEVICE_ERROR Fail to stop 16 bit UNDI ROM.
@retval Others Status of stop 16 bit UNDI ROM.
**/
);
/**
Get runtime information for Undi network interface
@param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
@retval EFI_SUCCESS Sucess operation.
@retval Others Fail to get runtime information for Undi network interface.
**/
);
/**
Get NIC type
@param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
@retval EFI_SUCCESS Sucess operation.
@retval Others Fail to get NIC type.
**/
);
/**
Get NDIS information
@param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
@retval EFI_SUCCESS Sucess operation.
@retval Others Fail to get NDIS information.
**/
);
/**
Signal handlers for ExitBootServices event.
Clean up any Real-mode UNDI residue from the system
@param Event ExitBootServices event
@param Context
**/
);
/**
Loads the undi driver.
@param SimpleNetworkDevice A pointer to EFI_SIMPLE_NETWORK_DEV data structure.
@retval EFI_SUCCESS - Successfully loads undi driver.
@retval EFI_NOT_FOUND - Doesn't find undi driver or undi driver load failure.
**/
);
/**
Unload 16 bit UNDI Option ROM from memory
@param SimpleNetworkDevice A pointer to EFI_SIMPLE_NETWORK_DEV data structure.
@return EFI_STATUS
**/
);
/**
Entry point for EFI drivers.
@param ImageHandle Handle that identifies the loaded image.
@param SystemTable System Table for this image.
@return EFI_STATUS Return status from EfiLibInstallAllDriverProtocols.
**/
)
{
);
}
//
// EFI Driver Binding Protocol Functions
//
/**
Tests to see if this driver supports a given controller.
@param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param Controller The handle of the controller to test.
@param RemainingDevicePath A pointer to the remaining portion of a device path.
@retval EFI_SUCCESS The driver supports given controller.
@retval EFI_UNSUPPORT The driver doesn't support given controller.
@retval Other Other errors prevent driver finishing to test
if the driver supports given controller.
**/
)
{
//
// See if the Legacy BIOS Protocol is available
//
return Status;
}
//
// Open the IO Abstraction(s) needed to perform the supported test
//
(VOID **) &DevicePath,
);
return Status;
}
gBS->CloseProtocol (
);
//
// Open the IO Abstraction(s) needed to perform the supported test
//
);
return Status;
}
//
// See if this is a PCI Network Controller by looking at the Command register and
// Class Code Register
//
goto Done;
}
}
Done:
gBS->CloseProtocol (
);
return Status;
}
/**
Starts the Snp device controller
@param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param Controller The handle of the controller to test.
@param RemainingDevicePath A pointer to the remaining portion of a device path.
@retval EFI_SUCCESS - The device was started.
@retval EFI_DEVICE_ERROR - The device could not be started due to a device error.
@retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.
**/
)
{
//
// See if the Legacy BIOS Protocol is available
//
return Status;
}
//
// Open the IO Abstraction(s) needed
//
(VOID **) &DevicePath,
);
goto Done;
}
);
goto Done;
}
0,
);
);
}
goto Done;
}
//
// Check to see if there is a legacy option ROM image associated with this PCI device
//
NULL,
NULL,
);
goto Done;
}
//
// Post the legacy option ROM if it is available.
//
NULL,
&Flags,
NULL,
NULL,
NULL,
);
goto Done;
}
//
// Allocate memory for this SimpleNetwork device instance
//
sizeof (EFI_SIMPLE_NETWORK_DEV),
(VOID **) &SimpleNetworkDevice
);
goto Done;
}
//
// Initialize the SimpleNetwork device instance
//
//
// Initialize the Nii Protocol
//
//
// Load 16 bit UNDI Option ROM into Memory
//
goto Done;
}
//
// Call PXENV_START_UNDI - Initilizes the UNID interface for use.
//
);
goto Done;
}
//
// Initialize the Simple Network Protocol
//
);
goto Done;
}
//
// Create an event to be signalled when ExitBootServices occurs in order
// to clean up nicely
//
NULL,
);
goto Done;
}
//
// Create an event to be signalled when Legacy Boot occurs to clean up the IVT
//
NULL,
);
goto Done;
}
//
// Initialize the SimpleNetwork Mode Information
//
//
// Initialize the SimpleNetwork Private Information
//
);
goto Done;
}
1,
);
goto Done;
}
1,
);
goto Done;
}
1,
);
goto Done;
}
SimpleNetworkDevice->Xmit->XmitOffset = (UINT16) (((UINT32)(UINTN) SimpleNetworkDevice->TxRealModeMediaHeader) & 0x000f);
SimpleNetworkDevice->Xmit->XmitSegment = (UINT16) (((UINT32)(UINTN) SimpleNetworkDevice->TxRealModeMediaHeader) >> 4);
SimpleNetworkDevice->Xmit->DataBlock[0].TDDataPtrOffset = (UINT16) (((UINT32)(UINTN) SimpleNetworkDevice->TxRealModeDataBuffer) & 0x000f);
SimpleNetworkDevice->Xmit->DataBlock[0].TDDataPtrSegment = (UINT16) (((UINT32)(UINTN) SimpleNetworkDevice->TxRealModeDataBuffer) >> 4);
//
// Start() the SimpleNetwork device
//
goto Done;
}
//
// GetInformation() the SimpleNetwork device
//
goto Done;
}
//
// Build the device path for the child device
//
CopyMem (
sizeof (EFI_MAC_ADDRESS)
);
);
//
// GetNicType() the SimpleNetwork device
//
goto Done;
}
//
// GetNdisInfo() the SimpleNetwork device
//
goto Done;
}
//
// Stop() the SimpleNetwork device
//
goto Done;
}
//
// Print Mode information
//
DEBUG ((DEBUG_NET, "Mode->HwAddressSize = %d\n", SimpleNetworkDevice->SimpleNetworkMode.HwAddressSize));
DEBUG ((DEBUG_NET, "Mode->MacAddressChangeable = %d\n", SimpleNetworkDevice->SimpleNetworkMode.MacAddressChangeable));
DEBUG ((DEBUG_NET, "Mode->MultiplTxSupported = %d\n", SimpleNetworkDevice->SimpleNetworkMode.MultipleTxSupported));
DEBUG ((DEBUG_NET, "Mode->NvRamAccessSize = %d\n", SimpleNetworkDevice->SimpleNetworkMode.NvRamAccessSize));
DEBUG ((DEBUG_NET, "Mode->ReceiveFilterSetting = %d\n", SimpleNetworkDevice->SimpleNetworkMode.ReceiveFilterSetting));
DEBUG ((DEBUG_NET, "Mode->MCastFilterCount = %d\n", SimpleNetworkDevice->SimpleNetworkMode.MCastFilterCount));
DEBUG ((DEBUG_NET, "%02x ", SimpleNetworkDevice->SimpleNetworkMode.MCastFilter[Index].Addr[Index2]));
}
}
}
}
}
//
// The network device was started, information collected, and stopped.
// Install protocol interfaces for the SimpleNetwork device.
//
);
goto Done;
}
//
// Open PCI I/O from the newly created child handle
//
);
Done:
if (SimpleNetworkDevice != NULL) {
//
// CLOSE + SHUTDOWN
//
//
// CLEANUP
//
//
// STOP
//
if (SimpleNetworkDevice->UndiLoaded) {
}
}
}
}
);
}
}
}
}
//
// Only restore the vector if it was cached.
//
if (mCachedInt1A) {
RestoreCachedVectorAddress (0x1A);
}
}
0,
);
);
}
}
gBS->CloseProtocol (
);
gBS->CloseProtocol (
);
if (Status != EFI_OUT_OF_RESOURCES) {
}
}
return Status;
}
/**
Stops the device by given device controller.
@param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param Controller The handle of the controller to test.
@param NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param ChildHandleBuffer An array of child handles to be freed. May be NULL if
NumberOfChildren is 0.
@retval EFI_SUCCESS - The device was stopped.
@retval EFI_DEVICE_ERROR - The device could not be stopped due to a device error.
**/
)
{
//
// Complete all outstanding transactions to Controller.
// Don't allow any new transaction to Controller to be started.
//
if (NumberOfChildren == 0) {
//
// Close the bus driver
//
);
0,
);
);
}
}
);
);
}
return Status;
}
(VOID **) &SimpleNetwork,
);
);
);
gBS->OpenProtocol (
);
} else {
//
// CLOSE + SHUTDOWN
//
//
// CLEANUP
//
//
// STOP
//
if (SimpleNetworkDevice->UndiLoaded) {
}
}
}
}
);
}
}
}
}
}
}
}
}
if (!AllChildrenStopped) {
return EFI_DEVICE_ERROR;
}
return EFI_SUCCESS;
}
//
// FIFO Support Functions
//
/**
Judge whether transmit FIFO is full.
@param Fifo Point to trasmit FIFO structure.
@return BOOLEAN whether transmit FIFO is full.
**/
)
{
return TRUE;
}
return FALSE;
}
/**
Judge whether transmit FIFO is empty.
@param Fifo Point to trasmit FIFO structure.
@return BOOLEAN whether transmit FIFO is empty.
**/
)
{
return TRUE;
}
return FALSE;
}
/**
Add data into transmit buffer.
@param Fifo Point to trasmit FIFO structure.
@param Data The data point want to be added.
@retval EFI_OUT_OF_RESOURCES FIFO is full
@retval EFI_SUCCESS Success operation.
**/
)
{
if (SimpleNetworkTransmitFifoFull (Fifo)) {
return EFI_OUT_OF_RESOURCES;
}
return EFI_SUCCESS;
}
/**
Get a data and remove it from network transmit FIFO.
@param Fifo Point to trasmit FIFO structure.
@param Data On return, point to the data point want to be got and removed.
@retval EFI_OUT_OF_RESOURCES network transmit buffer is empty.
@retval EFI_SUCCESS Success operation.
**/
)
{
if (SimpleNetworkTransmitFifoEmpty (Fifo)) {
return EFI_OUT_OF_RESOURCES;
}
return EFI_SUCCESS;
}
/**
Get recive filter setting according to EFI mask value.
@param ReceiveFilterSetting filter setting EFI mask value.
@return UINT16 Undi filter setting value.
**/
)
{
PktFilter = 0;
if ((ReceiveFilterSetting & EFI_SIMPLE_NETWORK_RECEIVE_UNICAST) != 0) {
}
if ((ReceiveFilterSetting & EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST) != 0) {
}
if ((ReceiveFilterSetting & EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST) != 0) {
PktFilter |= FLTR_BRDCST;
}
if ((ReceiveFilterSetting & EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS) != 0) {
PktFilter |= FLTR_PRMSCS;
}
if ((ReceiveFilterSetting & EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST) != 0) {
PktFilter |= FLTR_PRMSCS;
//
// @bug : Do not know if this is right????
//
}
//
// @bug : What is FLTR_SRC_RTG?
//
return PktFilter;
}
/**
Get filter setting from multi cast buffer .
@param Mode Point to mode structure.
@param McastBuffer The multi cast buffer
@param HwAddressSize Size of filter value.
**/
)
{
//
// @bug : What if Mode->MCastFilterCount > MAXNUM_MCADDR?
//
} else {
}
}
}
//
// Load 16 bit UNDI Option ROM into memory
//
/**
Loads the undi driver.
@param SimpleNetworkDevice A pointer to EFI_SIMPLE_NETWORK_DEV data structure.
@retval EFI_SUCCESS - Successfully loads undi driver.
@retval EFI_NOT_FOUND - Doesn't find undi driver or undi driver load failure.
**/
)
{
if (!mCachedInt1A) {
mCachedInt1A = TRUE;
}
}
0,
&Pci
);
continue;
}
//
// If the pointer to the PCI Data Structure is invalid, no further images can be located.
// The PCI Data Structure must be DWORD aligned.
//
if (PciExpansionRomHeader->PcirOffset == 0 ||
break;
}
continue;
}
if (PciDataStructure->VendorId != Pci.Hdr.VendorId || PciDataStructure->DeviceId != Pci.Hdr.DeviceId) {
continue;
}
DEBUG (
"PCI device with matchinng VendorId and DeviceId (%d,%d)\n",
);
return EFI_SUCCESS;
}
}
return EFI_NOT_FOUND;
}
/**
Unload 16 bit UNDI Option ROM from memory
@param SimpleNetworkDevice A pointer to EFI_SIMPLE_NETWORK_DEV data structure.
@return EFI_STATUS
**/
)
{
ZeroMem (SimpleNetworkDevice->UndiLoaderTable, SimpleNetworkDevice->UndiLoaderTablePages << EFI_PAGE_SHIFT);
);
}
ZeroMem (
);
);
}
ZeroMem (
);
);
}
ZeroMem (
);
);
}
return EFI_SUCCESS;
}
/**
Start the UNDI interface.
@param SimpleNetworkDevice A pointer to EFI_SIMPLE_NETWORK_DEV data structure.
@param Ax PCI address of Undi device.
@retval EFI_DEVICE_ERROR Fail to start 16 bit UNDI ROM.
@retval Others Status of start 16 bit UNDI ROM.
**/
)
{
//
// Call 16 bit UNDI ROM to start the network interface
//
//
// @bug : What is this state supposed to be???
//
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
return Status;
}
/**
Stop the UNDI interface
@param SimpleNetworkDevice A pointer to EFI_SIMPLE_NETWORK_DEV data structure.
@retval EFI_DEVICE_ERROR Fail to stop 16 bit UNDI ROM.
@retval Others Status of stop 16 bit UNDI ROM.
**/
)
{
//
// Call 16 bit UNDI ROM to start the network interface
//
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
return Status;
}
/**
Cleanup Unid network interface
@param SimpleNetworkDevice A pointer to EFI_SIMPLE_NETWORK_DEV data structure.
@retval EFI_DEVICE_ERROR Fail to cleanup 16 bit UNDI ROM.
@retval Others Status of cleanup 16 bit UNDI ROM.
**/
)
{
//
// Call 16 bit UNDI ROM to cleanup the network interface
//
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
return Status;
}
/**
Get runtime information for Undi network interface
@param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
@retval EFI_SUCCESS Sucess operation.
@retval Others Fail to get runtime information for Undi network interface.
**/
)
{
return EFI_INVALID_PARAMETER;
}
if (SimpleNetworkDevice == NULL) {
return EFI_DEVICE_ERROR;
}
//
// Verify that the current state of the adapter is valid for this call.
//
case EfiSimpleNetworkStarted:
break;
case EfiSimpleNetworkStopped:
return EFI_NOT_STARTED;
default:
return EFI_DEVICE_ERROR;
}
//
// Call 16 bit UNDI ROM to start the network interface
//
return Status;
}
DEBUG ((DEBUG_NET, " GetInformation.IntNumber = %d\n", SimpleNetworkDevice->GetInformation.IntNumber));
DEBUG ((DEBUG_NET, " GetInformation.MaxTranUnit = %d\n", SimpleNetworkDevice->GetInformation.MaxTranUnit));
DEBUG ((DEBUG_NET, " GetInformation.HwAddrLen = %d\n", SimpleNetworkDevice->GetInformation.HwAddrLen));
DEBUG ((DEBUG_NET, " GetInformation.ROMAddress = %d\n", SimpleNetworkDevice->GetInformation.ROMAddress));
}
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
//
// The information has been retrieved. Fill in Mode data.
//
SimpleNetworkDevice->SimpleNetworkMode.HwAddressSize = SimpleNetworkDevice->GetInformation.HwAddrLen;
SimpleNetworkDevice->SimpleNetworkMode.MaxPacketSize = SimpleNetworkDevice->GetInformation.MaxTranUnit;
ZeroMem (
);
CopyMem (
);
ZeroMem (
);
CopyMem (
);
//
// hard code broadcast address - not avail in PXE2.1
//
ZeroMem (
);
SetMem (
0xff
);
return Status;
}
/**
Get NIC type
@param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
@retval EFI_SUCCESS Sucess operation.
@retval Others Fail to get NIC type.
**/
)
{
return EFI_INVALID_PARAMETER;
}
if (SimpleNetworkDevice == NULL) {
return EFI_DEVICE_ERROR;
}
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
//
// The information has been retrieved. Fill in Mode data.
//
return Status;
}
/**
Get NDIS information
@param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
@retval EFI_SUCCESS Sucess operation.
@retval Others Fail to get NDIS information.
**/
)
{
return EFI_INVALID_PARAMETER;
}
if (SimpleNetworkDevice == NULL) {
return EFI_DEVICE_ERROR;
}
return Status;
}
DEBUG ((DEBUG_NET, " GetNdisInfo.ServiceFlags = %08x\n", SimpleNetworkDevice->GetNdisInfo.ServiceFlags));
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
//
// The information has been retrieved. Fill in Mode data.
//
return Status;
}
/**
Call Undi ROM 16bit ISR() to check interrupt cause.
@param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
@param FrameLength The length of frame buffer.
@param FrameHeaderLength The length of frame buffer's header if has.
@param Frame The frame buffer to process network interrupt.
@param ProtType The type network transmit protocol
@param PktType The type of package.
@retval EFI_DEVICE_ERROR Fail to execute 16 bit ROM's ISR, or status is invalid.
@retval EFI_SUCCESS Success operation.
**/
)
{
return EFI_INVALID_PARAMETER;
}
if (SimpleNetworkDevice == NULL) {
return EFI_DEVICE_ERROR;
}
//
// Verify that the current state of the adapter is valid for this call.
//
break;
case EfiSimpleNetworkStopped:
return EFI_NOT_STARTED;
case EfiSimpleNetworkStarted:
default:
return EFI_DEVICE_ERROR;
}
if (!SimpleNetworkDevice->IsrValid) {
//
// Call 16 bit UNDI ROM to open the network interface
//
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
//
// There have been no events on this UNDI interface, so return EFI_NOT_READY
//
return EFI_SUCCESS;
}
//
// There is data to process, so call until all events processed.
//
return Status;
}
}
//
// Call UNDI GET_NEXT until DONE
//
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
//
// UNDI is busy. Caller will have to call again.
// This should never happen with a polled mode driver.
//
return EFI_SUCCESS;
}
//
// Check for invalud UNDI FuncFlag
//
) {
DEBUG ((DEBUG_NET, " Invalid SimpleNetworkDevice->Isr.FuncFlag value %d\n", SimpleNetworkDevice->Isr.FuncFlag));
return EFI_DEVICE_ERROR;
}
//
// Check for Transmit Event
//
}
//
// Check for Receive Event
//
//
// note - this code will hang on a receive interrupt in a GetStatus loop
//
DEBUG ((DEBUG_NET, "SimpleNetworkDevice->Isr.BufferLength = %d\n", SimpleNetworkDevice->Isr.BufferLength));
DEBUG ((DEBUG_NET, "SimpleNetworkDevice->Isr.FrameLength = %d\n", SimpleNetworkDevice->Isr.FrameLength));
DEBUG ((DEBUG_NET, "SimpleNetworkDevice->Isr.FrameHeaderLength = %d\n", SimpleNetworkDevice->Isr.FrameHeaderLength));
DEBUG (
(
)
);
DEBUG ((DEBUG_NET, "SimpleNetworkDevice->Isr.ProtType = 0x%02x\n", SimpleNetworkDevice->Isr.BufferLength));
DEBUG ((DEBUG_NET, "SimpleNetworkDevice->Isr.PktType = 0x%02x\n", SimpleNetworkDevice->Isr.BufferLength));
if (FrameReceived) {
return EFI_SUCCESS;
}
return EFI_BUFFER_TOO_SMALL;
}
if (FrameHeaderLength != NULL) {
}
}
}
CopyMem (
(VOID *)(UINTN) ((SimpleNetworkDevice->Isr.FrameSegSel << 4) + SimpleNetworkDevice->Isr.FrameOffset),
);
}
}
//
// There is data to process, so call until all events processed.
//
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
// if (SimpleNetworkDevice->Isr.Status != PXENV_STATUS_SUCCESS) {
// return EFI_DEVICE_ERROR;
// }
//
}
return EFI_SUCCESS;
}
//
// ///////////////////////////////////////////////////////////////////////////////////////
// Simple Network Protocol Interface Functions using 16 bit UNDI Option ROMs
/////////////////////////////////////////////////////////////////////////////////////////
//
// Start()
//
/**
Call 16 bit UNDI ROM to start the network interface
@param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
@retval EFI_DEVICE_ERROR Network interface has not be initialized.
@retval EFI_DEVICE_ERROR Fail to execute 16 bit ROM call.
@retval EFI_SUCESS Success operation.
**/
)
{
return EFI_INVALID_PARAMETER;
}
if (SimpleNetworkDevice == NULL) {
return EFI_DEVICE_ERROR;
}
//
// Verify that the current state of the adapter is valid for this call.
//
case EfiSimpleNetworkStopped:
break;
case EfiSimpleNetworkStarted:
return EFI_ALREADY_STARTED;
default:
return EFI_DEVICE_ERROR;
}
//
// Call 16 bit UNDI ROM to start the network interface
//
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
//
// The UNDI interface has been started, so update the State.
//
//
//
//
return Status;
}
//
// Stop()
//
/**
Call 16 bit UNDI ROM to stop the network interface
@param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
@retval EFI_DEVICE_ERROR Network interface has not be initialized.
@retval EFI_DEVICE_ERROR Fail to execute 16 bit ROM call.
@retval EFI_SUCESS Success operation.
**/
)
{
return EFI_INVALID_PARAMETER;
}
if (SimpleNetworkDevice == NULL) {
return EFI_DEVICE_ERROR;
}
//
// Verify that the current state of the adapter is valid for this call.
//
case EfiSimpleNetworkStarted:
break;
case EfiSimpleNetworkStopped:
return EFI_NOT_STARTED;
default:
return EFI_DEVICE_ERROR;
}
return Status;
}
//
// Initialize()
//
/**
Initialize network interface
@param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
@param ExtraRxBufferSize The size of extra request receive buffer.
@param ExtraTxBufferSize The size of extra request transmit buffer.
@retval EFI_DEVICE_ERROR Fail to execute 16 bit ROM call.
@retval EFI_SUCESS Success operation.
**/
)
{
return EFI_INVALID_PARAMETER;
}
if (SimpleNetworkDevice == NULL) {
return EFI_DEVICE_ERROR;
}
//
// Verify that the current state of the adapter is valid for this call.
//
case EfiSimpleNetworkStopped:
return EFI_NOT_STARTED;
case EfiSimpleNetworkStarted:
break;
default:
return EFI_DEVICE_ERROR;
}
//
// Call 16 bit UNDI ROM to start the network interface
//
Initialize.ProtocolIni = 0;
}
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
DEBUG ((DEBUG_ERROR, "ERROR : PxeUndiInitialize() - Initialize.Status = %04x\n", Initialize.Status));
return EFI_DEVICE_ERROR;
}
//
// Call 16 bit UNDI ROM to open the network interface
//
Open.PktFilter = Undi16GetPacketFilterSetting (SimpleNetworkDevice->SimpleNetworkMode.ReceiveFilterSetting);
);
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
//
// The UNDI interface has been initialized, so update the State.
//
//
// If initialize succeeds, then assume that media is present.
//
//
// Reset the recycled transmit buffer FIFO
//
return Status;
}
//
// Reset()
//
/**
Reset network interface.
@param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
@param ExtendedVerification Need extended verfication.
@retval EFI_INVALID_PARAMETER Invalid This paramter.
@retval EFI_DEVICE_ERROR Network device has not been initialized.
@retval EFI_NOT_STARTED Network device has been stopped.
@retval EFI_DEVICE_ERROR Invalid status for network device
@retval EFI_SUCCESS Success operation.
**/
)
{
return EFI_INVALID_PARAMETER;
}
if (SimpleNetworkDevice == NULL) {
return EFI_DEVICE_ERROR;
}
//
// Verify that the current state of the adapter is valid for this call.
//
case EfiSimpleNetworkStopped:
return EFI_NOT_STARTED;
break;
case EfiSimpleNetworkStarted:
default:
return EFI_DEVICE_ERROR;
}
Rx_filter = Undi16GetPacketFilterSetting (SimpleNetworkDevice->SimpleNetworkMode.ReceiveFilterSetting);
);
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
//
// Reset the recycled transmit buffer FIFO
//
return Status;
}
//
// Shutdown()
//
/**
Shutdown network interface.
@param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
@retval EFI_INVALID_PARAMETER Invalid This paramter.
@retval EFI_DEVICE_ERROR Network device has not been initialized.
@retval EFI_NOT_STARTED Network device has been stopped.
@retval EFI_DEVICE_ERROR Invalid status for network device
@retval EFI_SUCCESS Success operation.
**/
)
{
return EFI_INVALID_PARAMETER;
}
if (SimpleNetworkDevice == NULL) {
return EFI_DEVICE_ERROR;
}
//
// Verify that the current state of the adapter is valid for this call.
//
case EfiSimpleNetworkStopped:
return EFI_NOT_STARTED;
break;
case EfiSimpleNetworkStarted:
default:
return EFI_DEVICE_ERROR;
}
//
// Call 16 bit UNDI ROM to start the network interface
//
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
//
// Call 16 bit UNDI ROM to open the network interface
//
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
//
// The UNDI interface has been initialized, so update the State.
//
//
// If shutdown succeeds, then assume that media is not present.
//
//
// Reset the recycled transmit buffer FIFO
//
//
// A short delay. Without this an initialize immediately following
// a shutdown will cause some versions of UNDI-16 to stop operating.
//
return Status;
}
//
// ReceiveFilters()
//
/**
Reset network interface.
@param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
@param Enable Enable mask value
@param Disable Disable mask value
@param ResetMCastFilter Whether reset multi cast filter or not
@param MCastFilterCnt Count of mutli cast filter for different MAC address
@param MCastFilter Buffer for mustli cast filter for different MAC address.
@retval EFI_INVALID_PARAMETER Invalid This paramter.
@retval EFI_DEVICE_ERROR Network device has not been initialized.
@retval EFI_NOT_STARTED Network device has been stopped.
@retval EFI_DEVICE_ERROR Invalid status for network device
@retval EFI_SUCCESS Success operation.
**/
)
{
return EFI_INVALID_PARAMETER;
}
if (SimpleNetworkDevice == NULL) {
return EFI_DEVICE_ERROR;
}
//
// Verify that the current state of the adapter is valid for this call.
//
case EfiSimpleNetworkStopped:
return EFI_NOT_STARTED;
break;
case EfiSimpleNetworkStarted:
default:
return EFI_DEVICE_ERROR;
}
//
// First deal with possible filter setting changes
//
return EFI_SUCCESS;
}
if ((NewFilter & EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST) != 0) {
if ((MCastFilterCnt == 0) || (MCastFilter == 0) || MCastFilterCnt > SimpleNetworkDevice->SimpleNetworkMode.MaxMCastFilterCount) {
return EFI_INVALID_PARAMETER;
}
}
//
// Call 16 bit UNDI ROM to close the network interface
//
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
//
// Call 16 bit UNDI ROM to open the network interface
//
//
// Reset the recycled transmit buffer FIFO
//
//
// Call 16 bit UNDI ROM to open the network interface
//
if ((NewFilter & EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST) != 0) {
//
// Copy the MAC addresses into the UNDI open parameter structure
//
CopyMem (
&MCastFilter[Index],
);
}
} else if (!ResetMCastFilter) {
CopyMem (
);
}
}
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
if ((NewFilter & EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST) != 0) {
CopyMem (
&MCastFilter[Index],
sizeof (EFI_MAC_ADDRESS)
);
}
}
//
// Read back multicast addresses.
//
return EFI_SUCCESS;
}
//
// StationAddress()
//
/**
Set new MAC address.
@param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
@param Reset Whether reset station MAC address to permenent address
@param New A pointer to New address
@retval EFI_INVALID_PARAMETER Invalid This paramter.
@retval EFI_DEVICE_ERROR Network device has not been initialized.
@retval EFI_NOT_STARTED Network device has been stopped.
@retval EFI_DEVICE_ERROR Invalid status for network device
@retval EFI_SUCCESS Success operation.
**/
)
{
//
// EFI_DEVICE_PATH_PROTOCOL *OldDevicePath;
//
return EFI_INVALID_PARAMETER;
}
if (SimpleNetworkDevice == NULL) {
return EFI_DEVICE_ERROR;
}
//
// Verify that the current state of the adapter is valid for this call.
//
break;
case EfiSimpleNetworkStopped:
return EFI_NOT_STARTED;
case EfiSimpleNetworkStarted:
default:
return EFI_DEVICE_ERROR;
}
//
// Call 16 bit UNDI ROM to open the network interface
//
if (Reset) {
//
// If we are reseting the Station Address to the permanent address, and the
// Station Address is not programmable, then just return EFI_SUCCESS.
//
return EFI_SUCCESS;
}
//
// If the address is already the permanent address, then just return success.
//
if (CompareMem (
) == 0) {
return EFI_SUCCESS;
}
//
// Copy the adapters permanent address to the new station address
//
CopyMem (
);
} else {
//
// If we are setting the Station Address, and the
// Station Address is not programmable, return invalid parameter.
//
return EFI_INVALID_PARAMETER;
}
//
// If the address is already the new address, then just return success.
//
if (CompareMem (
New,
) == 0) {
return EFI_SUCCESS;
}
//
// Copy New to the new station address
//
CopyMem (
New,
);
}
//
// Call 16 bit UNDI ROM to stop the network interface
//
//
// Call 16-bit UNDI ROM to set the station address
//
//
// Call 16-bit UNDI ROM to start the network interface
//
Open.PktFilter = Undi16GetPacketFilterSetting (SimpleNetworkDevice->SimpleNetworkMode.ReceiveFilterSetting);
);
//
// Check status from station address change
//
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
CopyMem (
);
#if 0 /* The device path is based on the permanent address not the current address. */
//
// The station address was changed, so update the device path with the new MAC address.
//
);
);
DEBUG ((DEBUG_ERROR, "Failed to reinstall the DevicePath protocol for the Simple Network Device\n"));
}
#endif /* 0 */
return Status;
}
//
// Statistics()
//
/**
Resets or collects the statistics on a network interface.
@param This Protocol instance pointer.
@param Reset Set to TRUE to reset the statistics for the network interface.
@param StatisticsSize On input the size, in bytes, of StatisticsTable. On
output the size, in bytes, of the resulting table of
statistics.
@param StatisticsTable A pointer to the EFI_NETWORK_STATISTICS structure that
contains the statistics.
@retval EFI_SUCCESS The statistics were collected from the network interface.
@retval EFI_NOT_STARTED The network interface has not been started.
@retval EFI_BUFFER_TOO_SMALL The Statistics buffer was too small. The current buffer
size needed to hold the statistics is returned in
StatisticsSize.
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval EFI_UNSUPPORTED This function is not supported by the network interface.
**/
)
{
return EFI_INVALID_PARAMETER;
}
if (SimpleNetworkDevice == NULL) {
return EFI_DEVICE_ERROR;
}
//
// Verify that the current state of the adapter is valid for this call.
//
break;
case EfiSimpleNetworkStopped:
return EFI_NOT_STARTED;
case EfiSimpleNetworkStarted:
default:
return EFI_DEVICE_ERROR;
}
return EFI_INVALID_PARAMETER;
}
//
// If Reset is TRUE, then clear all the statistics.
//
if (Reset) {
//
// Call 16 bit UNDI ROM to open the network interface
//
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
}
if (StatisticsSize != NULL) {
//
// If the size if valid, then see if the table is valid
//
if (StatisticsTable == NULL) {
return EFI_INVALID_PARAMETER;
}
//
// Call 16 bit UNDI ROM to open the network interface
//
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
//
// Fill in the Statistics Table with the collected values.
//
DEBUG (
" Statistics Collected : Size=%d Buf=%08x\n",
);
if (*StatisticsSize < sizeof LocalStatisticsTable) {
}
*StatisticsSize = sizeof LocalStatisticsTable;
return Status;
}
return EFI_SUCCESS;
}
//
// MCastIpToMac()
//
/**
Translate IP address to MAC address.
@param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
@param IPv6 IPv6 or IPv4
@param IP A pointer to given Ip address.
@param MAC On return, translated MAC address.
@retval EFI_INVALID_PARAMETER Invalid This paramter.
@retval EFI_INVALID_PARAMETER Invalid IP address.
@retval EFI_INVALID_PARAMETER Invalid return buffer for holding MAC address.
@retval EFI_UNSUPPORTED Do not support IPv6
@retval EFI_DEVICE_ERROR Network device has not been initialized.
@retval EFI_NOT_STARTED Network device has been stopped.
@retval EFI_DEVICE_ERROR Invalid status for network device
@retval EFI_SUCCESS Success operation.
**/
)
{
return EFI_INVALID_PARAMETER;
}
if (SimpleNetworkDevice == NULL) {
return EFI_DEVICE_ERROR;
}
//
// Verify that the current state of the adapter is valid for this call.
//
case EfiSimpleNetworkStopped:
return EFI_NOT_STARTED;
break;
case EfiSimpleNetworkStarted:
default:
return EFI_DEVICE_ERROR;
}
//
// 16 bit UNDI Option ROMS do not support IPv6. Check for IPv6 usage.
//
if (IPv6) {
return EFI_UNSUPPORTED;
}
//
// Call 16 bit UNDI ROM to open the network interface
//
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_DEVICE_ERROR;
}
//
// Copy the MAC address from the returned data structure.
//
CopyMem (
MAC,
);
return Status;
}
//
// NvData()
//
/**
Performs read and write operations on the NVRAM device attached to a
network interface.
@param This The protocol instance pointer.
@param ReadWrite TRUE for read operations, FALSE for write operations.
@param Offset Byte offset in the NVRAM device at which to start the read or
write operation. This must be a multiple of NvRamAccessSize and
less than NvRamSize.
@param BufferSize The number of bytes to read or write from the NVRAM device.
This must also be a multiple of NvramAccessSize.
@param Buffer A pointer to the data buffer.
@retval EFI_SUCCESS The NVRAM access was performed.
@retval EFI_NOT_STARTED The network interface has not been started.
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval EFI_UNSUPPORTED This function is not supported by the network interface.
**/
)
{
return EFI_UNSUPPORTED;
}
//
// GetStatus()
//
/**
Reads the current interrupt status and recycled transmit buffer status from
a network interface.
@param This The protocol instance pointer.
@param InterruptStatus A pointer to the bit mask of the currently active interrupts
If this is NULL, the interrupt status will not be read from
the device. If this is not NULL, the interrupt status will
be read from the device. When the interrupt status is read,
it will also be cleared. Clearing the transmit interrupt
does not empty the recycled transmit buffer array.
@param TxBuf Recycled transmit buffer address. The network interface will
not transmit if its internal recycled transmit buffer array
is full. Reading the transmit buffer does not clear the
transmit interrupt. If this is NULL, then the transmit buffer
status will not be read. If there are no transmit buffers to
recycle and TxBuf is not NULL, * TxBuf will be set to NULL.
@retval EFI_SUCCESS The status of the network interface was retrieved.
@retval EFI_NOT_STARTED The network interface has not been started.
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval EFI_UNSUPPORTED This function is not supported by the network interface.
**/
)
{
return EFI_INVALID_PARAMETER;
}
if (SimpleNetworkDevice == NULL) {
return EFI_DEVICE_ERROR;
}
//
// Verify that the current state of the adapter is valid for this call.
//
break;
case EfiSimpleNetworkStopped:
return EFI_NOT_STARTED;
case EfiSimpleNetworkStarted:
default:
return EFI_DEVICE_ERROR;
}
return EFI_INVALID_PARAMETER;
}
FrameLength = 0;
if (Status != EFI_BUFFER_TOO_SMALL) {
return Status;
}
}
//
// See if the caller wants interrupt info.
//
if (InterruptStatus != NULL) {
}
//
// See if the caller wants transmit buffer status info.
//
*TxBuf = 0;
}
return EFI_SUCCESS;
}
/**
Places a packet in the transmit queue of a network interface.
@param This The protocol instance pointer.
@param HeaderSize The size, in bytes, of the media header to be filled in by
the Transmit() function. If HeaderSize is non-zero, then it
must be equal to This->Mode->MediaHeaderSize and the DestAddr
and Protocol parameters must not be NULL.
@param BufferSize The size, in bytes, of the entire packet (media header and
data) to be transmitted through the network interface.
@param Buffer A pointer to the packet (media header followed by data) to be
transmitted. This parameter cannot be NULL. If HeaderSize is zero,
then the media header in Buffer must already be filled in by the
caller. If HeaderSize is non-zero, then the media header will be
filled in by the Transmit() function.
@param SrcAddr The source HW MAC address. If HeaderSize is zero, then this parameter
is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then
This->Mode->CurrentAddress is used for the source HW MAC address.
@param DestAddr The destination HW MAC address. If HeaderSize is zero, then this
parameter is ignored.
@param Protocol The type of header to build. If HeaderSize is zero, then this
parameter is ignored. See RFC 1700, section "Ether Types", for
examples.
@retval EFI_SUCCESS The packet was placed on the transmit queue.
@retval EFI_NOT_STARTED The network interface has not been started.
@retval EFI_NOT_READY The network interface is too busy to accept this transmit request.
@retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval EFI_UNSUPPORTED This function is not supported by the network interface.
**/
)
{
return EFI_INVALID_PARAMETER;
}
if (SimpleNetworkDevice == NULL) {
return EFI_DEVICE_ERROR;
}
//
// Verify that the current state of the adapter is valid for this call.
//
break;
case EfiSimpleNetworkStopped:
return EFI_NOT_STARTED;
case EfiSimpleNetworkStarted:
default:
return EFI_DEVICE_ERROR;
}
return EFI_INVALID_PARAMETER;
}
return EFI_BUFFER_TOO_SMALL;
}
if (HeaderSize != 0) {
return EFI_INVALID_PARAMETER;
}
return EFI_INVALID_PARAMETER;
}
CopyMem (
);
}
}
CopyMem (
);
*(UINT16 *) ((UINT8 *) Buffer + 2 * SimpleNetworkDevice->SimpleNetworkMode.HwAddressSize) = (UINT16) (((*Protocol & 0xFF) << 8) | ((*Protocol >> 8) & 0xFF));
}
}
//
// See if the recycled transmit buffer FIFO is full.
// If it is full, then we can not transmit until the caller calls GetStatus() to pull
// off recycled transmit buffers.
//
return EFI_NOT_READY;
}
//
// Output debug trace message.
//
//
// Initialize UNDI WRITE parameter structure.
//
CopyMem (
);
CopyMem (
);
SimpleNetworkDevice->Xmit->ImmedLength = (UINT16) SimpleNetworkDevice->SimpleNetworkMode.MediaHeaderSize;
SimpleNetworkDevice->Xmit->DataBlock[0].TDDataLen = (UINT16) (BufferSize - SimpleNetworkDevice->Xmit->ImmedLength);
CopyMem (
);
//
// Make API call to UNDI TRANSMIT
//
return Status;
}
//
// Check the status code from the 16 bit UNDI ROM
//
return EFI_NOT_READY;
case PXENV_STATUS_SUCCESS:
break;
default:
return EFI_DEVICE_ERROR;
}
//
// Add address of Buffer to the recycled transmit buffer FIFO
//
return EFI_SUCCESS;
}
/**
Receives a packet from a network interface.
@param This The protocol instance pointer.
@param HeaderSize The size, in bytes, of the media header received on the network
interface. If this parameter is NULL, then the media header size
will not be returned.
@param BufferSize On entry, the size, in bytes, of Buffer. On exit, the size, in
bytes, of the packet that was received on the network interface.
@param Buffer A pointer to the data buffer to receive both the media header and
the data.
@param SrcAddr The source HW MAC address. If this parameter is NULL, the
HW MAC source address will not be extracted from the media
header.
@param DestAddr The destination HW MAC address. If this parameter is NULL,
the HW MAC destination address will not be extracted from the
media header.
@param Protocol The media header type. If this parameter is NULL, then the
protocol will not be extracted from the media header. See
RFC 1700 section "Ether Types" for examples.
@retval EFI_SUCCESS The received data was stored in Buffer, and BufferSize has
been updated to the number of bytes received.
@retval EFI_NOT_STARTED The network interface has not been started.
@retval EFI_NOT_READY The network interface is too busy to accept this transmit
request.
@retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval EFI_UNSUPPORTED This function is not supported by the network interface.
**/
)
{
return EFI_INVALID_PARAMETER;
}
if (SimpleNetworkDevice == NULL) {
return EFI_DEVICE_ERROR;
}
//
// Verify that the current state of the adapter is valid for this call.
//
break;
case EfiSimpleNetworkStopped:
return EFI_NOT_STARTED;
case EfiSimpleNetworkStarted:
default:
return EFI_DEVICE_ERROR;
}
This,
&ProtType,
);
return Status;
}
return EFI_NOT_READY;
}
}
}
}
return Status;
}
//
// WaitForPacket()
//
/**
wait for a packet to be received.
@param Event Event used with WaitForEvent() to wait for a packet to be received.
@param Context Event Context
**/
)
{
//
// Someone is waiting on the receive packet event, if there's
// a packet pending, signal the event
//
}
}
//
// CheckForPacket()
//
/**
Check whether packet is ready for receive.
@param This The protocol instance pointer.
@retval EFI_SUCCESS Receive data is ready.
@retval EFI_NOT_STARTED The network interface has not been started.
@retval EFI_NOT_READY The network interface is too busy to accept this transmit
request.
@retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval EFI_UNSUPPORTED This function is not supported by the network interface.
**/
)
{
return EFI_INVALID_PARAMETER;
}
if (SimpleNetworkDevice == NULL) {
return EFI_DEVICE_ERROR;
}
//
// Verify that the current state of the adapter is valid for this call.
//
break;
case EfiSimpleNetworkStopped:
return EFI_NOT_STARTED;
case EfiSimpleNetworkStarted:
default:
return EFI_DEVICE_ERROR;
}
FrameLength = 0;
This,
NULL,
NULL,
NULL,
);
if (Status != EFI_BUFFER_TOO_SMALL) {
return Status;
}
}
return ((SimpleNetworkDevice->InterruptStatus & EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT) != 0) ? EFI_SUCCESS : EFI_NOT_READY;
}
/**
Signal handlers for ExitBootServices event.
Clean up any Real-mode UNDI residue from the system
@param Event ExitBootServices event
@param Context
**/
)
{
//
// NOTE: This is not the only way to effect this cleanup. The prescribed mechanism
// would be to perform an UNDI STOP command. This strategam has been attempted
// but results in problems making some of the EFI core services from TPL_CALLBACK.
// This issue needs to be resolved, but the other alternative has been to perform
// the unchain logic explicitly, as done below.
//
RestoreCachedVectorAddress (0x1A);
}
/**
Allocate buffer below 1M for real mode.
@param NumPages The number pages want to be allocated.
@param Buffer On return, allocated buffer.
@return Status of allocating pages.
**/
)
{
PhysicalAddress = 0x000fffff;
);
return Status;
}
return EFI_SUCCESS;
}