19 EFI_SIMPLE_NETWORK_PROTOCOL_REVISION,
38 EfiSimpleNetworkStopped,
40 NET_ETHER_HEADER_SIZE,
86 Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
88 Status = Private->Io->Start (Private->Io);
109 Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
111 Status = Private->Io->Stop (Private->Io);
139 IN UINTN ExtraRxBufferSize OPTIONAL,
140 IN UINTN ExtraTxBufferSize OPTIONAL
146 Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
148 Status = Private->Io->Initialize (Private->Io, ExtraRxBufferSize, ExtraTxBufferSize);
168 IN BOOLEAN ExtendedVerification
174 Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
176 Status = Private->Io->Reset (Private->Io, ExtendedVerification);
198 Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
200 Status = Private->Io->Shutdown (Private->Io);
229 IN UINT32 EnableBits,
230 IN UINT32 DisableBits,
231 IN BOOLEAN ResetMcastFilter,
232 IN UINTN McastFilterCount OPTIONAL,
239 Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
241 Status = Private->Io->ReceiveFilters (
274 Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
276 Status = Private->Io->StationAddress (Private->Io, Reset, NewMacAddr);
311 Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
313 Status = Private->Io->Statistics (Private->Io, Reset, StatisticsSize, StatisticsTable);
348 Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
350 Status = Private->Io->MCastIpToMac (Private->Io, Ipv6, Ip, Mac);
374 IN BOOLEAN ReadOrWrite,
383 Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
385 Status = Private->Io->NvData (Private->Io, ReadOrWrite, Offset, BufferSize, Buffer);
414 OUT UINT32 *InterruptStatus,
421 Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
423 Status = Private->Io->GetStatus (Private->Io, InterruptStatus, TxBuffer);
466 IN UINT16 *Protocol OPTIONAL
472 Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
474 Status = Private->Io->Transmit (
525 OUT UINT16 *Protocol OPTIONAL
531 Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
533 Status = Private->Io->Receive (
575 if (RemainingDevicePath !=
NULL) {
582 return EFI_UNSUPPORTED;
590 Status =
gBS->OpenProtocol (
592 &gEmuIoThunkProtocolGuid,
593 (VOID **)&EmuIoThunk,
594 This->DriverBindingHandle,
596 EFI_OPEN_PROTOCOL_BY_DRIVER
598 if (EFI_ERROR (Status)) {
607 &gEmuIoThunkProtocolGuid,
608 This->DriverBindingHandle,
615 Status =
gBS->OpenProtocol (
617 &gEfiDevicePathProtocolGuid,
618 (VOID **)&ParentDevicePath,
619 This->DriverBindingHandle,
621 EFI_OPEN_PROTOCOL_BY_DRIVER
623 if (Status == EFI_ALREADY_STARTED) {
627 if (EFI_ERROR (Status)) {
634 Status = EFI_UNSUPPORTED;
635 if (
CompareGuid (EmuIoThunk->Protocol, &gEmuSnpProtocolGuid)) {
644 &gEfiDevicePathProtocolGuid,
645 This->DriverBindingHandle,
687 Status =
gBS->OpenProtocol (
689 &gEfiDevicePathProtocolGuid,
690 (VOID **)&ParentDevicePath,
691 This->DriverBindingHandle,
693 EFI_OPEN_PROTOCOL_BY_DRIVER
695 if (EFI_ERROR (Status) && Status) {
699 Status =
gBS->OpenProtocol (
701 &gEmuIoThunkProtocolGuid,
702 (VOID **)&EmuIoThunk,
703 This->DriverBindingHandle,
705 EFI_OPEN_PROTOCOL_BY_DRIVER
707 if (EFI_ERROR (Status)) {
711 if (!
CompareGuid (EmuIoThunk->Protocol, &gEmuSnpProtocolGuid)) {
712 return EFI_UNSUPPORTED;
715 Status = EmuIoThunk->Open (EmuIoThunk);
716 if (EFI_ERROR (Status)) {
724 if (Private ==
NULL) {
725 Status = EFI_OUT_OF_RESOURCES;
732 Private->Signature = EMU_SNP_PRIVATE_DATA_SIGNATURE;
733 Private->IoThunk = EmuIoThunk;
734 Private->Io = EmuIoThunk->Interface;
735 Private->EfiHandle = ControllerHandle;
736 Private->DeviceHandle =
NULL;
737 Private->Snp.
Mode = &Private->Mode;
738 Private->ControllerNameTable =
NULL;
740 Status = Private->Io->CreateMapping (Private->Io, &Private->Mode);
741 if (EFI_ERROR (Status)) {
763 if ( Private->DevicePath ==
NULL ) {
764 Status = EFI_OUT_OF_RESOURCES;
771 &Private->ControllerNameTable,
779 &Private->ControllerNameTable,
787 Status =
gBS->InstallMultipleProtocolInterfaces (
788 &Private->DeviceHandle,
789 &gEfiSimpleNetworkProtocolGuid,
791 &gEfiDevicePathProtocolGuid,
795 if (EFI_ERROR (Status)) {
802 Status =
gBS->OpenProtocol (
804 &gEmuIoThunkProtocolGuid,
805 (VOID **)&EmuIoThunk,
806 This->DriverBindingHandle,
807 Private->DeviceHandle,
808 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
812 if (EFI_ERROR (Status)) {
813 if (Private !=
NULL) {
817 if (ParentDevicePath !=
NULL) {
820 &gEfiDevicePathProtocolGuid,
821 This->DriverBindingHandle,
865 if (NumberOfChildren == 0) {
869 Status =
gBS->CloseProtocol (
871 &gEmuIoThunkProtocolGuid,
872 This->DriverBindingHandle,
876 Status =
gBS->CloseProtocol (
878 &gEfiDevicePathProtocolGuid,
879 This->DriverBindingHandle,
885 ASSERT (NumberOfChildren == 1);
890 Status =
gBS->OpenProtocol (
891 ChildHandleBuffer[0],
892 &gEfiSimpleNetworkProtocolGuid,
894 This->DriverBindingHandle,
896 EFI_OPEN_PROTOCOL_GET_PROTOCOL
898 if (EFI_ERROR (Status)) {
899 return EFI_DEVICE_ERROR;
902 Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (Snp);
903 ASSERT (Private->DeviceHandle == ChildHandleBuffer[0]);
904 ASSERT (Private->EfiHandle == ControllerHandle);
906 Status =
gBS->CloseProtocol (
908 &gEmuIoThunkProtocolGuid,
909 This->DriverBindingHandle,
910 Private->DeviceHandle
914 Status =
gBS->UninstallMultipleProtocolInterfaces (
915 Private->DeviceHandle,
916 &gEfiSimpleNetworkProtocolGuid,
918 &gEfiDevicePathProtocolGuid,
922 if (EFI_ERROR (Status)) {
925 &gEmuIoThunkProtocolGuid,
927 This->DriverBindingHandle,
928 Private->DeviceHandle,
929 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
932 Status = Private->IoThunk->Close (Private->IoThunk);
979 &gEmuSnpDriverBinding,
981 &gEmuSnpDriverComponentName,
982 &gEmuSnpDriverComponentName2
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define MESSAGING_DEVICE_PATH
UINT16 EFIAPI SetDevicePathNodeLength(IN OUT VOID *Node, IN UINTN Length)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI AppendDevicePathNode(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode OPTIONAL)
BOOLEAN EFIAPI IsDevicePathEnd(IN CONST VOID *Node)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS EFIAPI EmuSnpReceive(IN EFI_SIMPLE_NETWORK_PROTOCOL *This, OUT UINTN *HeaderSize OPTIONAL, IN OUT UINTN *BuffSize, OUT VOID *Buffer, OUT EFI_MAC_ADDRESS *SourceAddr OPTIONAL, OUT EFI_MAC_ADDRESS *DestinationAddr OPTIONAL, OUT UINT16 *Protocol OPTIONAL)
EFI_STATUS EFIAPI EmuSnpShutdown(IN EFI_SIMPLE_NETWORK_PROTOCOL *This)
EFI_STATUS EFIAPI EmuSnpGetStatus(IN EFI_SIMPLE_NETWORK_PROTOCOL *This, OUT UINT32 *InterruptStatus, OUT VOID **TxBuffer)
EFI_STATUS EFIAPI EmuSnpDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_STATUS EFIAPI EmuSnpReset(IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
EFI_STATUS EFIAPI EmuSnpTransmit(IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN UINTN HeaderSize, IN UINTN BufferSize, IN VOID *Buffer, IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL, IN EFI_MAC_ADDRESS *DestAddr OPTIONAL, IN UINT16 *Protocol OPTIONAL)
EFI_STATUS EFIAPI EmuSnpDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_STATUS EFIAPI EmuSnpStart(IN EFI_SIMPLE_NETWORK_PROTOCOL *This)
EFI_STATUS EFIAPI EmuSnpStatistics(IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN BOOLEAN Reset, IN OUT UINTN *StatisticsSize OPTIONAL, OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL)
EFI_STATUS EFIAPI EmuSnpStop(IN EFI_SIMPLE_NETWORK_PROTOCOL *This)
EFI_STATUS EFIAPI EmuSnpNvdata(IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN BOOLEAN ReadOrWrite, IN UINTN Offset, IN UINTN BufferSize, IN OUT VOID *Buffer)
EFI_STATUS EFIAPI EmuSnpDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
EFI_STATUS EFIAPI EmuSnpInitialize(IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN UINTN ExtraRxBufferSize OPTIONAL, IN UINTN ExtraTxBufferSize OPTIONAL)
EFI_STATUS EFIAPI EmuSnpMcastIptoMac(IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN BOOLEAN Ipv6, IN EFI_IP_ADDRESS *Ip, OUT EFI_MAC_ADDRESS *Mac)
EFI_STATUS EFIAPI EmuSnpStationAddress(IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN BOOLEAN Reset, IN EFI_MAC_ADDRESS *NewMacAddr OPTIONAL)
EFI_STATUS EFIAPI EmuSnpReceiveFilters(IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN UINT32 EnableBits, IN UINT32 DisableBits, IN BOOLEAN ResetMcastFilter, IN UINTN McastFilterCount OPTIONAL, IN EFI_MAC_ADDRESS *McastFilter OPTIONAL)
EFI_STATUS EFIAPI InitializeEmuSnpDriver(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
#define ASSERT_EFI_ERROR(StatusParameter)
EFI_STATUS EFIAPI AddUnicodeString2(IN CONST CHAR8 *Language, IN CONST CHAR8 *SupportedLanguages, IN OUT EFI_UNICODE_STRING_TABLE **UnicodeStringTable, IN CONST CHAR16 *UnicodeString, IN BOOLEAN Iso639Language)
EFI_STATUS EFIAPI EfiLibInstallDriverBindingComponentName2(IN CONST EFI_HANDLE ImageHandle, IN CONST EFI_SYSTEM_TABLE *SystemTable, IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE DriverBindingHandle, IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL)
EFI_STATUS EFIAPI FreeUnicodeStringTable(IN EFI_UNICODE_STRING_TABLE *UnicodeStringTable)
CHAR8 * SupportedLanguages
CHAR8 * SupportedLanguages
EFI_SIMPLE_NETWORK_MODE * Mode
CHAR16 * ConfigString
Only be valid after Open() is called.
EFI_MAC_ADDRESS CurrentAddress
EFI_MAC_ADDRESS MacAddress