From f514468cea92785403c4b40b3678e72d3a6b0e34 Mon Sep 17 00:00:00 2001 From: Olivier Martin Date: Thu, 10 Jan 2013 11:43:23 +0000 Subject: MdeModulePkg//ArpDxe: Retrieved SnpMode only after configuring Snp When Arp driver starts (with ArpDriverBindingStart()), its service will be created and the Mnp child configured (ArpService->Mnp->Configure() called in ArpCreateService()). It is only at this time the Snp protocol will be initialized (at the end of MnpStart()). So, a valid SnpMode could not be expected prior to ArpService->Mnp->Configure(). Signed-off-by: Olivier Martin --- MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c | 33 ++++++++++++----------- 1 file changed, 17 insertions(+), 16 deletions(-) mode change 100644 => 100755 MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c old mode 100644 new mode 100755 index 81ddd6263..5cf717f94 --- a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c +++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c @@ -102,22 +102,6 @@ ArpCreateService ( goto ERROR_EXIT; } - // - // Get the underlayer Snp mode data. - // - Status = ArpService->Mnp->GetModeData (ArpService->Mnp, NULL, &ArpService->SnpMode); - if ((Status != EFI_NOT_STARTED) && EFI_ERROR (Status)) { - goto ERROR_EXIT; - } - - if (ArpService->SnpMode.IfType != NET_IFTYPE_ETHERNET) { - // - // Only support the ethernet. - // - Status = EFI_UNSUPPORTED; - goto ERROR_EXIT; - } - // // Set the Mnp config parameters. // @@ -141,6 +125,23 @@ ArpCreateService ( } // + // Get the underlayer Snp mode data. Must do this after MNP configuration else some parameters + // (e.g. current address) may not be set + // + Status = ArpService->Mnp->GetModeData (ArpService->Mnp, NULL, &ArpService->SnpMode); + if ((Status != EFI_NOT_STARTED) && EFI_ERROR (Status)) { + goto ERROR_EXIT; + } + + if (ArpService->SnpMode.IfType != NET_IFTYPE_ETHERNET) { + // + // Only support the ethernet. + // + Status = EFI_UNSUPPORTED; + goto ERROR_EXIT; + } + + // // Create the event used in the RxToken. // Status = gBS->CreateEvent ( -- cgit v1.2.3