summaryrefslogtreecommitdiffstats
path: root/EmulatorPkg/EmuSnpDxe
diff options
context:
space:
mode:
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2012-01-11 19:00:26 +0000
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2012-01-11 19:00:26 +0000
commitf79fa76e9ccebb8cb680455e034f63035ae44412 (patch)
tree353d725492f4145664f23d79170e73ee05bb9b31 /EmulatorPkg/EmuSnpDxe
parenta7224eefeb3b7e51b82ecfd174553b91d6c2340e (diff)
downloadedk2-f79fa76e9ccebb8cb680455e034f63035ae44412.tar.gz
edk2-f79fa76e9ccebb8cb680455e034f63035ae44412.tar.bz2
edk2-f79fa76e9ccebb8cb680455e034f63035ae44412.zip
Fix bug in SNP driver where default values for SNP mode are not filled in. This causes ARP and other drivers to fail to bind as they don't think it is an ethernet connection. Mode structure is filled via lazy update, so defaults need some genericly valid info, not zero.
signed-off-by:andrewfish git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12926 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EmulatorPkg/EmuSnpDxe')
-rw-r--r--EmulatorPkg/EmuSnpDxe/EmuSnpDxe.c48
1 files changed, 38 insertions, 10 deletions
diff --git a/EmulatorPkg/EmuSnpDxe/EmuSnpDxe.c b/EmulatorPkg/EmuSnpDxe/EmuSnpDxe.c
index 7f8a643e8a..09d16fd8b6 100644
--- a/EmulatorPkg/EmuSnpDxe/EmuSnpDxe.c
+++ b/EmulatorPkg/EmuSnpDxe/EmuSnpDxe.c
@@ -42,7 +42,35 @@ EFI_SIMPLE_NETWORK_PROTOCOL gEmuSnpTemplate = {
NULL // Mode
};
-
+EFI_SIMPLE_NETWORK_MODE gEmuSnpModeTemplate = {
+ EfiSimpleNetworkStopped, // State
+ NET_ETHER_ADDR_LEN, // HwAddressSize
+ NET_ETHER_HEADER_SIZE, // MediaHeaderSize
+ 1500, // MaxPacketSize
+ 0, // NvRamSize
+ 0, // NvRamAccessSize
+ 0, // ReceiveFilterMask
+ 0, // ReceiveFilterSetting
+ MAX_MCAST_FILTER_CNT, // MaxMCastFilterCount
+ 0, // MCastFilterCount
+ {
+ { { 0 } }
+ }, // MCastFilter
+ {
+ { 0 }
+ }, // CurrentAddress
+ {
+ { 0 }
+ }, // BroadcastAddress
+ {
+ { 0 }
+ }, // PermanentAddress
+ NET_IFTYPE_ETHERNET, // IfType
+ FALSE, // MacAddressChangeable
+ FALSE, // MultipleTxSupported
+ FALSE, // MediaPresentSupported
+ TRUE // MediaPresent
+};
/**
@@ -586,14 +614,6 @@ EmuSnpDriverBindingSupported (
}
//
- // Make sure GUID is for a File System handle.
- //
- Status = EFI_UNSUPPORTED;
- if (CompareGuid (EmuIoThunk->Protocol, &gEmuSnpProtocolGuid)) {
- Status = EFI_SUCCESS;
- }
-
- //
// Close the I/O Abstraction(s) used to perform the supported test
//
gBS->CloseProtocol (
@@ -624,6 +644,14 @@ EmuSnpDriverBindingSupported (
}
//
+ // Make sure GUID is for a SNP handle.
+ //
+ Status = EFI_UNSUPPORTED;
+ if (CompareGuid (EmuIoThunk->Protocol, &gEmuSnpProtocolGuid)) {
+ Status = EFI_SUCCESS;
+ }
+
+ //
// Close protocol, don't use device path protocol in the Support() function
//
gBS->CloseProtocol (
@@ -715,6 +743,7 @@ EmuSnpDriverBindingStart (
}
CopyMem (&Private->Snp, &gEmuSnpTemplate, sizeof (EFI_SIMPLE_NETWORK_PROTOCOL));
+ CopyMem (&Private->Mode, &gEmuSnpModeTemplate, sizeof (EFI_SIMPLE_NETWORK_MODE));
Private->Signature = EMU_SNP_PRIVATE_DATA_SIGNATURE;
Private->IoThunk = EmuIoThunk;
@@ -944,7 +973,6 @@ InitializeEmuSnpDriver (
//
// Install the Driver Protocols
//
-
Status = EfiLibInstallDriverBindingComponentName2(
ImageHandle,
SystemTable,