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
This commit is contained in:
andrewfish 2012-01-11 19:00:26 +00:00
parent a7224eefeb
commit f79fa76e9c
1 changed files with 38 additions and 10 deletions

View File

@ -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
};
/**
@ -585,14 +613,6 @@ EmuSnpDriverBindingSupported (
return Status;
}
//
// 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
//
@ -623,6 +643,14 @@ EmuSnpDriverBindingSupported (
return Status;
}
//
// 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
//
@ -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,