32 OUT UINT32 *InterruptStatusPtr,
33 IN BOOLEAN GetTransmittedBuf
37 UINT16 InterruptFlags;
47 if (GetTransmittedBuf) {
52 if (InterruptStatusPtr !=
NULL) {
56 if (Snp->MediaStatusSupported) {
64 Snp->Cdb.DBaddr = (UINT64)(
UINTN)Db;
66 Snp->Cdb.StatCode = PXE_STATCODE_INITIALIZE;
67 Snp->Cdb.StatFlags = PXE_STATFLAGS_INITIALIZE;
68 Snp->Cdb.IFnum = Snp->IfNum;
69 Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST;
74 DEBUG ((DEBUG_NET,
"\nSnp->undi.get_status() "));
76 (*Snp->IssueUndi32Command)((UINT64)(
UINTN)&Snp->Cdb);
81 "\nSnp->undi.get_status() %xh:%xh\n",
86 return EFI_DEVICE_ERROR;
92 if (InterruptStatusPtr !=
NULL) {
95 *InterruptStatusPtr = 0;
98 *InterruptStatusPtr |= EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT;
102 *InterruptStatusPtr |= EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT;
106 *InterruptStatusPtr |= EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT;
110 *InterruptStatusPtr |= EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT;
114 if (GetTransmittedBuf) {
121 if (Snp->RecycledTxBufCount == Snp->MaxRecycledTxBuf) {
125 if ((Snp->MaxRecycledTxBuf + SNP_TX_BUFFER_INCREASEMENT) >= SNP_MAX_TX_BUFFER_NUM) {
126 return EFI_DEVICE_ERROR;
129 Tmp =
AllocatePool (
sizeof (UINT64) * (Snp->MaxRecycledTxBuf + SNP_TX_BUFFER_INCREASEMENT));
131 return EFI_DEVICE_ERROR;
134 CopyMem (Tmp, Snp->RecycledTxBuf, sizeof (UINT64) * Snp->RecycledTxBufCount);
136 Snp->RecycledTxBuf = Tmp;
137 Snp->MaxRecycledTxBuf += SNP_TX_BUFFER_INCREASEMENT;
140 Snp->RecycledTxBuf[Snp->RecycledTxBufCount] = Db->
TxBuffer[Index];
141 Snp->RecycledTxBufCount++;
151 if (Snp->MediaStatusSupported) {
152 Snp->Snp.Mode->MediaPresent =
201 OUT UINT32 *InterruptStatus OPTIONAL,
202 OUT VOID **TxBuf OPTIONAL
210 return EFI_INVALID_PARAMETER;
213 if ((InterruptStatus ==
NULL) && (TxBuf ==
NULL)) {
214 return EFI_INVALID_PARAMETER;
217 Snp = EFI_SIMPLE_NETWORK_DEV_FROM_THIS (This);
219 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
222 return EFI_DEVICE_ERROR;
225 switch (Snp->Mode.
State) {
226 case EfiSimpleNetworkInitialized:
229 case EfiSimpleNetworkStopped:
230 Status = EFI_NOT_STARTED;
234 Status = EFI_DEVICE_ERROR;
238 if ((Snp->RecycledTxBufCount == 0) && (TxBuf !=
NULL)) {
248 if (Snp->RecycledTxBufCount == 0) {
251 Snp->RecycledTxBufCount--;
252 *TxBuf = (VOID *)(
UINTN)Snp->RecycledTxBuf[Snp->RecycledTxBufCount];
257 gBS->RestoreTPL (OldTpl);
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS PxeGetStatus(IN SNP_DRIVER *Snp, OUT UINT32 *InterruptStatusPtr, IN BOOLEAN GetTransmittedBuf)
EFI_STATUS EFIAPI SnpUndi32GetStatus(IN EFI_SIMPLE_NETWORK_PROTOCOL *This, OUT UINT32 *InterruptStatus OPTIONAL, OUT VOID **TxBuf OPTIONAL)
#define DEBUG(Expression)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
#define PXE_CPBSIZE_NOT_USED
zero
#define PXE_STATFLAGS_GET_STATUS_TRANSMIT
#define PXE_OPCODE_GET_STATUS
#define PXE_STATFLAGS_GET_STATUS_RECEIVE
#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA
#define PXE_STATFLAGS_GET_STATUS_SOFTWARE
#define PXE_OPFLAGS_GET_INTERRUPT_STATUS
#define MAX_XMIT_BUFFERS
recycling Q length for xmit_done.
#define PXE_OPFLAGS_GET_MEDIA_STATUS
#define PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS
#define PXE_CPBADDR_NOT_USED
zero
#define PXE_STATFLAGS_GET_STATUS_NO_TXBUFS_WRITTEN
#define PXE_STATFLAGS_GET_STATUS_INTERRUPT_MASK
/ UNDI MCast IP to MAC. / / No additional StatFlags.
#define PXE_STATCODE_SUCCESS
#define PXE_STATFLAGS_GET_STATUS_COMMAND
PXE_UINT64 TxBuffer[MAX_XMIT_BUFFERS]