Remove gEfiNetworkInterfaceIdentifierProtocolGuid reference from code base. Only left its definition in MdePkg.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4295 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff
2007-11-13 09:08:17 +00:00
parent cfe9de5244
commit 41057d7787
13 changed files with 75 additions and 570 deletions

View File

@@ -42,7 +42,6 @@ pxe_getstatus (
{
PXE_DB_GET_STATUS *db;
UINT16 InterruptFlags;
UINT64 TempData;
db = snp->db;
snp->cdb.OpCode = PXE_OPCODE_GET_STATUS;
@@ -122,10 +121,6 @@ pxe_getstatus (
(snp->cdb.StatFlags & PXE_STATFLAGS_GET_STATUS_TXBUF_QUEUE_EMPTY)
) ? 0 : (VOID *) (UINTN) db->TxBuffer[0];
TempData = (UINT64) (UINTN) (*TransmitBufferListPtr);
if (snp->IsOldUndi && (TempData >= FOUR_GIGABYTES)) {
del_v2p ((VOID *) (UINTN) (db->TxBuffer[0]));
}
}
return EFI_SUCCESS;

View File

@@ -54,47 +54,13 @@ pxe_receive (
PXE_CPB_RECEIVE *cpb;
PXE_DB_RECEIVE *db;
UINTN buf_size;
UINT64 TempData;
cpb = snp->cpb;
db = snp->db;
buf_size = *BuffSizePtr;
//
// IMPORTANT NOTE:
// In case of the older 3.0 UNDI, if the input buffer address is beyond 4GB,
// DO NOT call the map function on the given buffer, instead use
// a global buffer. The reason is that UNDI3.0 has some unnecessary check of
// making sure that all the addresses (whether or not they will be given
// to the NIC ) supplied to it are below 4GB. It may or may not use
// the mapped address after all (like in case of CPB and DB)!
// Instead of using the global buffer whose address is allocated within the
// 2GB limit if I start mapping the given buffer we lose the data, here is
// why!!!
// if our address is > 4GB, the map call creates another buffer below 2GB and
// copies data to/from the original buffer to the mapped buffer either at
// map time or unmap time depending on the map direction.
// UNDI will not complain since we already mapped the buffer to be
// within the 2GB limit but will not use (I know undi) the mapped address
// since it does not give the user buffers to the NIC's receive unit,
// It just copies the received packet into the user buffer using the virtual
// (CPU) address rather than the mapped (device or physical) address.
// When the UNDI call returns, if we then unmap the buffer, we will lose
// the contents because unmap copies the contents of the mapped buffer into
// the original buffer (since the direction is FROM_DEVICE) !!!
//
// this is not a problem in Undi 3.1 because this undi uses it's map callback
// routine to map a cpu address to device address and it does it only if
// it is giving the address to the device and unmaps it before using the cpu
// address!
//
TempData = (UINT64) (UINTN) BufferPtr;
if (snp->IsOldUndi && (TempData >= FOUR_GIGABYTES)) {
cpb->BufferAddr = (UINT64)(UINTN) snp->receive_buf;
cpb->BufferLen = (UINT32) (snp->init_info.MediaHeaderLen + snp->init_info.FrameDataLen);
} else {
cpb->BufferAddr = (UINT64)(UINTN) BufferPtr;
cpb->BufferLen = (UINT32) *BuffSizePtr;
}
cpb->BufferAddr = (UINT64)(UINTN) BufferPtr;
cpb->BufferLen = (UINT32) *BuffSizePtr;
cpb->reserved = 0;
@@ -162,11 +128,6 @@ pxe_receive (
*ProtocolPtr = (UINT16) PXE_SWAP_UINT16 (db->Protocol); /* we need to do the byte swapping */
}
TempData = (UINT64) (UINTN) BufferPtr;
if (snp->IsOldUndi && (TempData >= FOUR_GIGABYTES)) {
CopyMem (BufferPtr, snp->receive_buf, snp->init_info.MediaHeaderLen + snp->init_info.FrameDataLen);
}
return (*BuffSizePtr <= buf_size) ? EFI_SUCCESS : EFI_BUFFER_TOO_SMALL;
}

View File

@@ -329,9 +329,7 @@ SimpleNetworkDriverSupported (
EFI_STATUS Status;
EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL *NiiProtocol;
PXE_UNDI *pxe;
BOOLEAN IsUndi31;
IsUndi31 = FALSE;
Status = gBS->OpenProtocol (
Controller,
&gEfiDevicePathProtocolGuid,
@@ -352,34 +350,16 @@ SimpleNetworkDriverSupported (
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (Status == EFI_ALREADY_STARTED)
{
DEBUG ((EFI_D_INFO, "Support(): Already Started. on handle %x\n", Controller));
return EFI_ALREADY_STARTED;
}
if (!EFI_ERROR (Status))
{
DEBUG ((EFI_D_INFO, "Support(): UNDI3.1 found on handle %x\n", Controller));
IsUndi31 = TRUE;
} else {
//
// try the older 3.0 driver
//
Status = gBS->OpenProtocol (
Controller,
&gEfiNetworkInterfaceIdentifierProtocolGuid,
(VOID **) &NiiProtocol,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
return Status;
if (EFI_ERROR (Status)) {
if (Status == EFI_ALREADY_STARTED) {
DEBUG ((EFI_D_INFO, "Support(): Already Started. on handle %x\n", Controller));
}
DEBUG ((EFI_D_INFO, "Support(): UNDI3.0 found on handle %x\n", Controller));
return Status;
}
DEBUG ((EFI_D_INFO, "Support(): UNDI3.1 found on handle %x\n", Controller));
//
// check the version, we don't want to connect to the undi16
//
@@ -445,22 +425,12 @@ SimpleNetworkDriverSupported (
DEBUG ((EFI_D_INFO, "Support(): supported on %x\n", Controller));
Done:
if (IsUndi31) {
gBS->CloseProtocol (
Controller,
&gEfiNetworkInterfaceIdentifierProtocolGuid_31,
This->DriverBindingHandle,
Controller
);
} else {
gBS->CloseProtocol (
Controller,
&gEfiNetworkInterfaceIdentifierProtocolGuid,
This->DriverBindingHandle,
Controller
);
}
gBS->CloseProtocol (
Controller,
&gEfiNetworkInterfaceIdentifierProtocolGuid_31,
This->DriverBindingHandle,
Controller
);
return Status;
}
@@ -491,11 +461,7 @@ SimpleNetworkDriverStart (
PXE_UNDI *pxe;
SNP_DRIVER *snp;
VOID *addr;
VOID *addrUnmap;
EFI_PHYSICAL_ADDRESS paddr;
EFI_HANDLE Handle;
UINTN Size;
BOOLEAN UndiNew;
PXE_PCI_CONFIG_INFO ConfigInfo;
PCI_TYPE00 *ConfigHeader;
UINT32 *TempBar;
@@ -539,8 +505,7 @@ SimpleNetworkDriverStart (
return Status;
}
//
// Get the NII interface. look for 3.1 undi first, if it is not there
// then look for 3.0, validate the interface.
// Get the NII interface.
//
Status = gBS->OpenProtocol (
Controller,
@@ -550,7 +515,7 @@ SimpleNetworkDriverStart (
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (Status == EFI_ALREADY_STARTED) {
if (EFI_ERROR (Status)) {
gBS->CloseProtocol (
Controller,
&gEfiDevicePathProtocolGuid,
@@ -560,36 +525,7 @@ SimpleNetworkDriverStart (
return Status;
}
if (!EFI_ERROR (Status)) {
//
// probably not a 3.1 UNDI
//
UndiNew = TRUE;
DEBUG ((EFI_D_INFO, "Start(): UNDI3.1 found\n"));
} else {
UndiNew = FALSE;
Status = gBS->OpenProtocol (
Controller,
&gEfiNetworkInterfaceIdentifierProtocolGuid,
(VOID **) &Nii,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
gBS->CloseProtocol (
Controller,
&gEfiDevicePathProtocolGuid,
This->DriverBindingHandle,
Controller
);
return Status;
}
DEBUG ((EFI_D_INFO, "Start(): UNDI3.0 found\n"));
}
DEBUG ((EFI_D_INFO, "Start(): UNDI3.1 found\n"));
pxe = (PXE_UNDI *) (UINTN) (Nii->ID);
@@ -632,30 +568,9 @@ SimpleNetworkDriverStart (
snp = (SNP_DRIVER *) (UINTN) addr;
if (!UndiNew) {
Size = SNP_MEM_PAGES (sizeof (SNP_DRIVER));
Status = mPciIoFncs->Map (
mPciIoFncs,
EfiPciIoOperationBusMasterCommonBuffer,
addr,
&Size,
&paddr,
&addrUnmap
);
ASSERT (paddr);
DEBUG ((EFI_D_NET, "\nSNP_DRIVER @ %Xh, sizeof(SNP_DRIVER) == %d", addr, sizeof (SNP_DRIVER)));
snp = (SNP_DRIVER *) (UINTN) paddr;
snp->SnpDriverUnmap = addrUnmap;
}
ZeroMem (snp, sizeof (SNP_DRIVER));
snp->IoFncs = mPciIoFncs;
snp->IsOldUndi = (BOOLEAN) (!UndiNew);
snp->Signature = SNP_DRIVER_SIGNATURE;
EfiInitializeLock (&snp->lock, TPL_NOTIFY);
@@ -725,26 +640,9 @@ SimpleNetworkDriverStart (
goto Error_DeleteSNP;
}
if (snp->IsOldUndi) {
Size = SNP_MEM_PAGES (4096);
snp->cpb = (VOID *) (UINTN) addr;
snp->db = (VOID *) ((UINTN) addr + 2048);
Status = mPciIoFncs->Map (
mPciIoFncs,
EfiPciIoOperationBusMasterCommonBuffer,
addr,
&Size,
&paddr,
&snp->CpbUnmap
);
ASSERT (paddr);
snp->cpb = (VOID *) (UINTN) paddr;
snp->db = (VOID *) ((UINTN) paddr + 2048);
} else {
snp->cpb = (VOID *) (UINTN) addr;
snp->db = (VOID *) ((UINTN) addr + 2048);
}
//
// pxe_start call is going to give the callback functions to UNDI, these callback
// functions use the BarIndex values from the snp structure, so these must be initialized
@@ -762,7 +660,7 @@ SimpleNetworkDriverStart (
Status = pxe_start (snp);
if (Status != EFI_SUCCESS) {
goto Error_DeleteCPBDB;
goto Error_DeleteSNP;
}
snp->cdb.OpCode = PXE_OPCODE_GET_INIT_INFO;
@@ -792,7 +690,7 @@ SimpleNetworkDriverStart (
if (snp->cdb.StatCode != PXE_STATCODE_SUCCESS) {
DEBUG ((EFI_D_NET, "\nsnp->undi.init_info() %xh:%xh\n", snp->cdb.StatFlags, snp->cdb.StatCode));
pxe_stop (snp);
goto Error_DeleteCPBDB;
goto Error_DeleteSNP;
}
snp->cdb.OpCode = PXE_OPCODE_GET_CONFIG_INFO;
@@ -817,7 +715,7 @@ SimpleNetworkDriverStart (
if (snp->cdb.StatCode != PXE_STATCODE_SUCCESS) {
DEBUG ((EFI_D_NET, "\nsnp->undi.config_info() %xh:%xh\n", snp->cdb.StatFlags, snp->cdb.StatCode));
pxe_stop (snp);
goto Error_DeleteCPBDB;
goto Error_DeleteSNP;
}
//
// Find the correct BAR to do IO.
@@ -846,79 +744,6 @@ SimpleNetworkDriverStart (
TempBar++;
}
//
// We allocate 2 more global buffers for undi 3.0 interface. We use these
// buffers to pass to undi when the user buffers are beyond 4GB.
// UNDI 3.0 wants all the addresses passed to it to be
// within 2GB limit, create them here and map them so that when undi calls
// v2p callback to check if the physical address is < 2gb, we will pass.
//
// For 3.1 and later UNDIs, we do not do this because undi is
// going to call the map() callback if and only if it wants to use the
// device address for any address it receives.
//
if (snp->IsOldUndi) {
//
// buffer for receive
//
Size = SNP_MEM_PAGES (snp->init_info.MediaHeaderLen + snp->init_info.FrameDataLen);
Status = mPciIoFncs->AllocateBuffer (
mPciIoFncs,
AllocateAnyPages,
EfiBootServicesData,
Size,
&addr,
0
);
if (Status != EFI_SUCCESS) {
DEBUG ((EFI_D_ERROR, "\nCould not allocate receive buffer.\n"));
goto Error_DeleteCPBDB;
}
Status = mPciIoFncs->Map (
mPciIoFncs,
EfiPciIoOperationBusMasterCommonBuffer,
addr,
&Size,
&paddr,
&snp->ReceiveBufUnmap
);
ASSERT (paddr);
snp->receive_buf = (UINT8 *) (UINTN) paddr;
//
// buffer for fill_header
//
Size = SNP_MEM_PAGES (snp->init_info.MediaHeaderLen);
Status = mPciIoFncs->AllocateBuffer (
mPciIoFncs,
AllocateAnyPages,
EfiBootServicesData,
Size,
&addr,
0
);
if (Status != EFI_SUCCESS) {
DEBUG ((EFI_D_ERROR, "\nCould not allocate fill_header buffer.\n"));
goto Error_DeleteRCVBuf;
}
Status = mPciIoFncs->Map (
mPciIoFncs,
EfiPciIoOperationBusMasterCommonBuffer,
addr,
&Size,
&paddr,
&snp->FillHdrBufUnmap
);
ASSERT (paddr);
snp->fill_hdr_buf = (UINT8 *) (UINTN) paddr;
}
//
// Initialize simple network protocol mode structure
//
@@ -992,7 +817,7 @@ SimpleNetworkDriverStart (
if (Status) {
pxe_stop (snp);
goto Error_DeleteHdrBuf;
goto Error_DeleteSNP;
}
Status = pxe_get_stn_addr (snp);
@@ -1001,7 +826,7 @@ SimpleNetworkDriverStart (
DEBUG ((EFI_D_ERROR, "\nsnp->undi.get_station_addr() failed.\n"));
pxe_shutdown (snp);
pxe_stop (snp);
goto Error_DeleteHdrBuf;
goto Error_DeleteSNP;
}
snp->mode.MediaPresent = FALSE;
@@ -1033,43 +858,6 @@ SimpleNetworkDriverStart (
return Status;
}
Error_DeleteHdrBuf:
if (snp->IsOldUndi) {
Status = mPciIoFncs->Unmap (
mPciIoFncs,
snp->FillHdrBufUnmap
);
Size = SNP_MEM_PAGES (snp->init_info.MediaHeaderLen);
mPciIoFncs->FreeBuffer (
mPciIoFncs,
Size,
snp->fill_hdr_buf
);
}
Error_DeleteRCVBuf:
if (snp->IsOldUndi) {
Status = mPciIoFncs->Unmap (
mPciIoFncs,
snp->ReceiveBufUnmap
);
Size = SNP_MEM_PAGES (snp->init_info.MediaHeaderLen + snp->init_info.FrameDataLen);
mPciIoFncs->FreeBuffer (
mPciIoFncs,
Size,
snp->receive_buf
);
}
Error_DeleteCPBDB:
if (snp->IsOldUndi) {
Status = mPciIoFncs->Unmap (
mPciIoFncs,
snp->CpbUnmap
);
}
Status = mPciIoFncs->FreeBuffer (
mPciIoFncs,
SNP_MEM_PAGES (4096),
@@ -1077,12 +865,6 @@ Error_DeleteCPBDB:
);
Error_DeleteSNP:
if (snp->IsOldUndi) {
Status = mPciIoFncs->Unmap (
mPciIoFncs,
snp->SnpDriverUnmap
);
}
mPciIoFncs->FreeBuffer (
mPciIoFncs,
@@ -1090,21 +872,12 @@ Error_DeleteSNP:
snp
);
NiiError:
if (!UndiNew) {
gBS->CloseProtocol (
Controller,
&gEfiNetworkInterfaceIdentifierProtocolGuid,
This->DriverBindingHandle,
Controller
);
} else {
gBS->CloseProtocol (
Controller,
&gEfiNetworkInterfaceIdentifierProtocolGuid_31,
This->DriverBindingHandle,
Controller
);
}
gBS->CloseProtocol (
Controller,
&gEfiNetworkInterfaceIdentifierProtocolGuid_31,
This->DriverBindingHandle,
Controller
);
gBS->CloseProtocol (
Controller,
@@ -1163,21 +936,12 @@ SimpleNetworkDriverStop (
return Status;
}
if (!Snp->IsOldUndi) {
Status = gBS->CloseProtocol (
Controller,
&gEfiNetworkInterfaceIdentifierProtocolGuid_31,
This->DriverBindingHandle,
Controller
);
} else {
Status = gBS->CloseProtocol (
Controller,
&gEfiNetworkInterfaceIdentifierProtocolGuid,
This->DriverBindingHandle,
Controller
);
}
Status = gBS->CloseProtocol (
Controller,
&gEfiNetworkInterfaceIdentifierProtocolGuid_31,
This->DriverBindingHandle,
Controller
);
Status = gBS->CloseProtocol (
Controller,
@@ -1189,38 +953,6 @@ SimpleNetworkDriverStop (
pxe_shutdown (Snp);
pxe_stop (Snp);
if (Snp->IsOldUndi) {
Status = mPciIoFncs->Unmap (
mPciIoFncs,
Snp->FillHdrBufUnmap
);
mPciIoFncs->FreeBuffer (
mPciIoFncs,
SNP_MEM_PAGES (Snp->init_info.MediaHeaderLen),
Snp->fill_hdr_buf
);
Status = mPciIoFncs->Unmap (
mPciIoFncs,
Snp->ReceiveBufUnmap
);
mPciIoFncs->FreeBuffer (
mPciIoFncs,
SNP_MEM_PAGES (Snp->init_info.MediaHeaderLen + Snp->init_info.FrameDataLen),
Snp->receive_buf
);
Status = mPciIoFncs->Unmap (
mPciIoFncs,
Snp->CpbUnmap
);
Status = mPciIoFncs->Unmap (
mPciIoFncs,
Snp->SnpDriverUnmap
);
}
mPciIoFncs->FreeBuffer (
mPciIoFncs,
SNP_MEM_PAGES (4096),

View File

@@ -95,7 +95,7 @@ typedef struct {
EFI_PCI_IO_PROTOCOL *IoFncs;
UINT8 IoBarIndex;
UINT8 MemoryBarIndex;
BOOLEAN IsOldUndi; // true for EFI1.0 UNDI (3.0) drivers
//
// Buffers for command descriptor block, command parameter block
// and data block.

View File

@@ -33,10 +33,8 @@ pxe_start (
SNP_DRIVER *snp
)
{
PXE_CPB_START_30 *cpb;
PXE_CPB_START_31 *cpb_31;
cpb = snp->cpb;
cpb_31 = snp->cpb;
//
// Initialize UNDI Start CDB for H/W UNDI
@@ -57,37 +55,23 @@ pxe_start (
// a S/W UNDI.
//
if (snp->is_swundi) {
if (snp->IsOldUndi) {
snp->cdb.CPBsize = sizeof (PXE_CPB_START_30);
snp->cdb.CPBaddr = (UINT64)(UINTN) cpb;
snp->cdb.CPBsize = sizeof (PXE_CPB_START_31);
snp->cdb.CPBaddr = (UINT64)(UINTN) cpb_31;
cpb->Delay = (UINT64)(UINTN) &snp_undi32_callback_delay_30;
cpb->Block = (UINT64)(UINTN) &snp_undi32_callback_block_30;
cpb_31->Delay = (UINT64)(UINTN) &snp_undi32_callback_delay;
cpb_31->Block = (UINT64)(UINTN) &snp_undi32_callback_block;
//
// Virtual == Physical. This can be set to zero.
//
cpb->Virt2Phys = (UINT64)(UINTN) &snp_undi32_callback_v2p_30;
cpb->Mem_IO = (UINT64)(UINTN) &snp_undi32_callback_memio_30;
} else {
snp->cdb.CPBsize = sizeof (PXE_CPB_START_31);
snp->cdb.CPBaddr = (UINT64)(UINTN) cpb_31;
//
// Virtual == Physical. This can be set to zero.
//
cpb_31->Virt2Phys = (UINT64)(UINTN) 0;
cpb_31->Mem_IO = (UINT64)(UINTN) &snp_undi32_callback_memio;
cpb_31->Delay = (UINT64)(UINTN) &snp_undi32_callback_delay;
cpb_31->Block = (UINT64)(UINTN) &snp_undi32_callback_block;
cpb_31->Map_Mem = (UINT64)(UINTN) &snp_undi32_callback_map;
cpb_31->UnMap_Mem = (UINT64)(UINTN) &snp_undi32_callback_unmap;
cpb_31->Sync_Mem = (UINT64)(UINTN) &snp_undi32_callback_sync;
//
// Virtual == Physical. This can be set to zero.
//
cpb_31->Virt2Phys = (UINT64)(UINTN) 0;
cpb_31->Mem_IO = (UINT64)(UINTN) &snp_undi32_callback_memio;
cpb_31->Map_Mem = (UINT64)(UINTN) &snp_undi32_callback_map;
cpb_31->UnMap_Mem = (UINT64)(UINTN) &snp_undi32_callback_unmap;
cpb_31->Sync_Mem = (UINT64)(UINTN) &snp_undi32_callback_sync;
cpb_31->Unique_ID = (UINT64)(UINTN) snp;
}
cpb_31->Unique_ID = (UINT64)(UINTN) snp;
}
//
// Issue UNDI command and check result.

View File

@@ -52,9 +52,6 @@ pxe_fillheader (
)
{
PXE_CPB_FILL_HEADER_FRAGMENTED *cpb;
EFI_STATUS Status;
struct s_v2p *pkt_v2p;
UINT64 TempData;
cpb = snp->cpb;
if (SourceAddrPtr) {
@@ -95,35 +92,6 @@ pxe_fillheader (
cpb->FragDesc[0].reserved = cpb->FragDesc[1].reserved = 0;
if (snp->IsOldUndi) {
TempData = (UINT64) (UINTN) MacHeaderPtr;
if (TempData >= FOUR_GIGABYTES) {
cpb->FragDesc[0].FragAddr = (UINT64) (UINTN) snp->fill_hdr_buf;
cpb->FragDesc[0].FragLen = (UINT32) snp->init_info.MediaHeaderLen;
}
TempData = (UINT64) (UINTN) (BufferPtr);
if (TempData >= FOUR_GIGABYTES) {
//
// Let the device just read this buffer
//
Status = add_v2p (
&pkt_v2p,
EfiPciIoOperationBusMasterRead,
BufferPtr,
BufferLength
);
if (Status != EFI_SUCCESS) {
return Status;
}
//
// give the virtual address to UNDI and it will call back on Virt2Phys
// to get the mapped address, if it needs it
//
cpb->FragDesc[1].FragLen = (UINT32) pkt_v2p->bsize;
}
}
snp->cdb.OpCode = PXE_OPCODE_FILL_HEADER;
snp->cdb.OpFlags = PXE_OPFLAGS_FILL_HEADER_FRAGMENTED;
@@ -145,24 +113,6 @@ pxe_fillheader (
(*snp->issue_undi32_command) ((UINT64) (UINTN) &snp->cdb);
if (snp->IsOldUndi) {
TempData = (UINT64) (UINTN) (BufferPtr);
if (TempData >= FOUR_GIGABYTES) {
del_v2p (BufferPtr);
}
//
// if we used the global buffer for header, copy the contents
//
TempData = (UINT64) (UINTN) MacHeaderPtr;
if (TempData >= FOUR_GIGABYTES) {
CopyMem (
MacHeaderPtr,
snp->fill_hdr_buf,
snp->init_info.MediaHeaderLen
);
}
}
switch (snp->cdb.StatCode) {
case PXE_STATCODE_SUCCESS:
return EFI_SUCCESS;
@@ -211,32 +161,10 @@ pxe_transmit (
{
PXE_CPB_TRANSMIT *cpb;
EFI_STATUS Status;
struct s_v2p *v2p;
UINT64 TempData;
cpb = snp->cpb;
cpb->FrameAddr = (UINT64) (UINTN) BufferPtr;
cpb->DataLen = (UINT32) BufferLength;
TempData = (UINT64) (UINTN) BufferPtr;
if (snp->IsOldUndi && (TempData >= FOUR_GIGABYTES)) {
//
// we need to create a mapping now and give it to the undi when it calls
// the Virt2Phys on this address.
// this is a transmit, just map it for the device to READ
//
Status = add_v2p (
&v2p,
EfiPciIoOperationBusMasterRead,
BufferPtr,
BufferLength
);
if (Status != EFI_SUCCESS) {
return Status;
}
cpb->DataLen = (UINT32) v2p->bsize;
}
cpb->MediaheaderLen = 0;
cpb->reserved = 0;