interface.\r
\r
**/\r
-\r
EFI_STATUS\r
EFIAPI\r
VirtioNetGetStatus (\r
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
- OUT UINT32 *InterruptStatus OPTIONAL,\r
- OUT VOID **TxBuf OPTIONAL\r
+ IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
+ OUT UINT32 *InterruptStatus OPTIONAL,\r
+ OUT VOID **TxBuf OPTIONAL\r
)\r
{\r
- VNET_DEV *Dev;\r
- EFI_TPL OldTpl;\r
- EFI_STATUS Status;\r
- UINT16 RxCurUsed;\r
- UINT16 TxCurUsed;\r
- EFI_PHYSICAL_ADDRESS DeviceAddress;\r
+ VNET_DEV *Dev;\r
+ EFI_TPL OldTpl;\r
+ EFI_STATUS Status;\r
+ UINT16 RxCurUsed;\r
+ UINT16 TxCurUsed;\r
+ EFI_PHYSICAL_ADDRESS DeviceAddress;\r
\r
if (This == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- Dev = VIRTIO_NET_FROM_SNP (This);\r
+ Dev = VIRTIO_NET_FROM_SNP (This);\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
switch (Dev->Snm.State) {\r
- case EfiSimpleNetworkStopped:\r
- Status = EFI_NOT_STARTED;\r
- goto Exit;\r
- case EfiSimpleNetworkStarted:\r
- Status = EFI_DEVICE_ERROR;\r
- goto Exit;\r
- default:\r
- break;\r
+ case EfiSimpleNetworkStopped:\r
+ Status = EFI_NOT_STARTED;\r
+ goto Exit;\r
+ case EfiSimpleNetworkStarted:\r
+ Status = EFI_DEVICE_ERROR;\r
+ goto Exit;\r
+ default:\r
+ break;\r
}\r
\r
//\r
// update link status\r
//\r
if (Dev->Snm.MediaPresentSupported) {\r
- UINT16 LinkStatus;\r
+ UINT16 LinkStatus;\r
\r
Status = VIRTIO_CFG_READ (Dev, LinkStatus, &LinkStatus);\r
if (EFI_ERROR (Status)) {\r
goto Exit;\r
}\r
+\r
Dev->Snm.MediaPresent =\r
- (BOOLEAN) ((LinkStatus & VIRTIO_NET_S_LINK_UP) != 0);\r
+ (BOOLEAN)((LinkStatus & VIRTIO_NET_S_LINK_UP) != 0);\r
}\r
\r
//\r
if (Dev->RxLastUsed != RxCurUsed) {\r
*InterruptStatus |= EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT;\r
}\r
+\r
if (Dev->TxLastUsed != TxCurUsed) {\r
ASSERT (Dev->TxCurPending > 0);\r
*InterruptStatus |= EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT;\r
if (TxBuf != NULL) {\r
if (Dev->TxLastUsed == TxCurUsed) {\r
*TxBuf = NULL;\r
- }\r
- else {\r
- UINT16 UsedElemIdx;\r
- UINT32 DescIdx;\r
+ } else {\r
+ UINT16 UsedElemIdx;\r
+ UINT32 DescIdx;\r
\r
//\r
// fetch the first descriptor among those that the hypervisor reports\r
ASSERT (Dev->TxCurPending <= Dev->TxMaxPending);\r
\r
UsedElemIdx = Dev->TxLastUsed++ % Dev->TxRing.QueueSize;\r
- DescIdx = Dev->TxRing.Used.UsedElem[UsedElemIdx].Id;\r
- ASSERT (DescIdx < (UINT32) (2 * Dev->TxMaxPending - 1));\r
+ DescIdx = Dev->TxRing.Used.UsedElem[UsedElemIdx].Id;\r
+ ASSERT (DescIdx < (UINT32)(2 * Dev->TxMaxPending - 1));\r
\r
//\r
// get the device address that has been enqueued for the caller's\r
//\r
// now this descriptor can be used again to enqueue a transmit buffer\r
//\r
- Dev->TxFreeStack[--Dev->TxCurPending] = (UINT16) DescIdx;\r
+ Dev->TxFreeStack[--Dev->TxCurPending] = (UINT16)DescIdx;\r
\r
//\r
// Unmap the device address and perform the reverse mapping to find the\r