53 OUT UINT32 *InterruptStatus OPTIONAL,
54 OUT VOID **TxBuf OPTIONAL
65 return EFI_INVALID_PARAMETER;
68 Dev = VIRTIO_NET_FROM_SNP (This);
69 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
70 switch (Dev->Snm.
State) {
71 case EfiSimpleNetworkStopped:
72 Status = EFI_NOT_STARTED;
74 case EfiSimpleNetworkStarted:
75 Status = EFI_DEVICE_ERROR;
87 Status = VIRTIO_CFG_READ (Dev, LinkStatus, &LinkStatus);
88 if (EFI_ERROR (Status)) {
93 (BOOLEAN)((LinkStatus & VIRTIO_NET_S_LINK_UP) != 0);
100 RxCurUsed = *Dev->RxRing.Used.Idx;
101 TxCurUsed = *Dev->TxRing.Used.Idx;
104 if (InterruptStatus !=
NULL) {
109 *InterruptStatus = 0;
110 if (Dev->RxLastUsed != RxCurUsed) {
111 *InterruptStatus |= EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT;
114 if (Dev->TxLastUsed != TxCurUsed) {
115 ASSERT (Dev->TxCurPending > 0);
116 *InterruptStatus |= EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT;
121 if (Dev->TxLastUsed == TxCurUsed) {
131 ASSERT (Dev->TxCurPending > 0);
132 ASSERT (Dev->TxCurPending <= Dev->TxMaxPending);
134 UsedElemIdx = Dev->TxLastUsed++ % Dev->TxRing.QueueSize;
135 DescIdx = Dev->TxRing.Used.UsedElem[UsedElemIdx].Id;
136 ASSERT (DescIdx < (UINT32)(2 * Dev->TxMaxPending - 1));
142 DeviceAddress = Dev->TxRing.Desc[DescIdx + 1].Addr;
147 Dev->TxFreeStack[--Dev->TxCurPending] = (UINT16)DescIdx;
158 if (EFI_ERROR (Status)) {
164 Status = EFI_DEVICE_ERROR;
173 gBS->RestoreTPL (OldTpl);
VOID EFIAPI MemoryFence(VOID)
EFI_STATUS EFIAPI VirtioNetGetStatus(IN EFI_SIMPLE_NETWORK_PROTOCOL *This, OUT UINT32 *InterruptStatus OPTIONAL, OUT VOID **TxBuf OPTIONAL)
EFI_STATUS EFIAPI VirtioNetUnmapTxBuf(IN VNET_DEV *Dev, OUT VOID **Buffer, IN EFI_PHYSICAL_ADDRESS DeviceAddress)
VOID EFIAPI Exit(IN EFI_STATUS Status)
UINT64 EFI_PHYSICAL_ADDRESS
BOOLEAN MediaPresentSupported