TianoCore EDK2 master
|
#include "Snp.h"
Go to the source code of this file.
Functions | |
VOID EFIAPI | SnpUndi32CallbackBlock (IN UINT64 UniqueId, IN UINT32 Enable) |
VOID EFIAPI | SnpUndi32CallbackDelay (IN UINT64 UniqueId, IN UINT64 MicroSeconds) |
VOID EFIAPI | SnpUndi32CallbackMemio (IN UINT64 UniqueId, IN UINT8 ReadOrWrite, IN UINT8 NumBytes, IN UINT64 MemOrPortAddr, IN OUT UINT64 BufferPtr) |
VOID EFIAPI | SnpUndi32CallbackMap (IN UINT64 UniqueId, IN UINT64 CpuAddr, IN UINT32 NumBytes, IN UINT32 Direction, IN OUT UINT64 DeviceAddrPtr) |
VOID EFIAPI | SnpUndi32CallbackUnmap (IN UINT64 UniqueId, IN UINT64 CpuAddr, IN UINT32 NumBytes, IN UINT32 Direction, IN UINT64 DeviceAddr) |
VOID EFIAPI | SnpUndi32CallbackSync (IN UINT64 UniqueId, IN UINT64 CpuAddr, IN UINT32 NumBytes, IN UINT32 Direction, IN UINT64 DeviceAddr) |
This file contains the callback routines for undi3.1. the callback routines for Undi3.1 have an extra parameter UniqueId which stores the interface context for the NIC that snp is trying to talk.
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Callback.c.
Acquire or release a lock of the exclusive access to a critical section of the code/data.
This is a callback routine supplied to UNDI3.1 at undi_start time. New callbacks for 3.1: there won't be a virtual2physical callback for UNDI 3.1 because undi3.1 uses the MemMap call to map the required address by itself!
UniqueId | This was supplied to UNDI at Undi_Start, SNP uses this to store Undi interface context (Undi does not read or write this variable). |
Enable | Non-zero indicates acquire; Zero indicates release. |
Definition at line 30 of file Callback.c.
Delay MicroSeconds of micro seconds.
This is a callback routine supplied to UNDI at undi_start time.
UniqueId | This was supplied to UNDI at Undi_Start, SNP uses this to store Undi interface context (Undi does not read or write this variable). |
MicroSeconds | Number of micro seconds to pause, usually multiple of 10. |
Definition at line 62 of file Callback.c.
VOID EFIAPI SnpUndi32CallbackMap | ( | IN UINT64 | UniqueId, |
IN UINT64 | CpuAddr, | ||
IN UINT32 | NumBytes, | ||
IN UINT32 | Direction, | ||
IN OUT UINT64 | DeviceAddrPtr | ||
) |
Map a CPU address to a device address.
This is a callback routine supplied to UNDI at undi_start time.
UniqueId | This was supplied to UNDI at Undi_Start, SNP uses this to store Undi interface context (Undi does not read or write this variable). |
CpuAddr | Virtual address to be mapped. |
NumBytes | Size of memory to be mapped. |
Direction | Direction of data flow for this memory's usage: cpu->device, device->cpu or both ways. |
DeviceAddrPtr | Pointer to return the mapped device address. |
Definition at line 199 of file Callback.c.
VOID EFIAPI SnpUndi32CallbackMemio | ( | IN UINT64 | UniqueId, |
IN UINT8 | ReadOrWrite, | ||
IN UINT8 | NumBytes, | ||
IN UINT64 | MemOrPortAddr, | ||
IN OUT UINT64 | BufferPtr | ||
) |
IO routine for UNDI3.1.
This is a callback routine supplied to UNDI at undi_start time.
UniqueId | This was supplied to UNDI at Undi_Start, SNP uses this to store Undi interface context (Undi does not read or write this variable). |
ReadOrWrite | Indicates read or write, IO or Memory. |
NumBytes | Number of bytes to read or write. |
MemOrPortAddr | IO or memory address to read from or write to. |
BufferPtr | Memory location to read into or that contains the bytes to write. |
Definition at line 89 of file Callback.c.
VOID EFIAPI SnpUndi32CallbackSync | ( | IN UINT64 | UniqueId, |
IN UINT64 | CpuAddr, | ||
IN UINT32 | NumBytes, | ||
IN UINT32 | Direction, | ||
IN UINT64 | DeviceAddr | ||
) |
Synchronize the virtual buffer contents with the mapped buffer contents.
This is a callback routine supplied to UNDI at undi_start time. The virtual and mapped buffers need not correspond to the same physical memory (especially if the virtual address is > 4GB). Depending on the direction for which the buffer is mapped, undi will need to synchronize their contents whenever it writes to/reads from the buffer using either the cpu address or the device address. EFI does not provide a sync call since virt=physical, we should just do the synchronization ourselves here.
UniqueId | This was supplied to UNDI at Undi_Start, SNP uses this to store Undi interface context (Undi does not read or write this variable). |
CpuAddr | Virtual address that was mapped. |
NumBytes | Size of memory mapped. |
Direction | Direction of data flow for this memory's usage: cpu->device, device->cpu or both ways. |
DeviceAddr | The mapped device address. |
Definition at line 348 of file Callback.c.
VOID EFIAPI SnpUndi32CallbackUnmap | ( | IN UINT64 | UniqueId, |
IN UINT64 | CpuAddr, | ||
IN UINT32 | NumBytes, | ||
IN UINT32 | Direction, | ||
IN UINT64 | DeviceAddr | ||
) |
Unmap an address that was previously mapped using map callback.
This is a callback routine supplied to UNDI at undi_start time.
UniqueId | This was supplied to UNDI at Undi_Start, SNP uses this to store. Undi interface context (Undi does not read or write this variable). |
CpuAddr | Virtual address that was mapped. |
NumBytes | Size of memory mapped. |
Direction | Direction of data flow for this memory's usage: cpu->device, device->cpu or both ways. |
DeviceAddr | The mapped device address. |
Definition at line 294 of file Callback.c.