Hi Olivier,
This patch is only required because of your patch - without your patch this change is not required, and the changes to the Lan9X* files are sufficient to fix the network driver initialization problems that were present in the 2014.01 release.
I do not think that your proposed patch is correct. All the fields in the snpmode structure are supposed to be discovered during driver initialization, which in the case of the lan9xxx drivers, this is the driver entry point. The "mediapresent" value which the comment refers to may not reflect actual media state if the GetStatus() call returns an error, but that is OK. The rest of the values in the structure are valid at that point - the NULL check is sufficient.
Thanks, Roy
On Mon, Feb 24, 2014 at 10:00 AM, Olivier Martin olivier.martin@arm.com wrote:
Hi Roy, I have just pinged the MdeModulePkg maintainer for the MnpDxe patch I sent 7 months ago. If I am lucky my patch might get some consideration from the maintainer and get merged...
Have a look at the EDK2 mailing-list, you might have a chance to get your change after mine. Your patch looks correct, but I am not the maintainer of this package.
Thanks, Olivier
-----Original Message----- From: Roy Franz [mailto:roy.franz@linaro.org] Sent: 07 February 2014 04:53 To: linaro-uefi@lists.linaro.org; Olivier Martin Cc: Roy Franz Subject: [PATCH 1/3] Mnp Error handling
Change MnpGetModeData() handling of return status from SnpStatus to not consider EFI_NOT_STARTED an error, similar to how Ip4ConfigDriverBindingStart() handles it.
Without this change, Ip4ConfigDriverBindingStart() considers the Mnp->GetModeData successful even though the SnpMode parameter is unchanged, and is full of unitialized stack data.
If this change is not correct, then other error handling changes need to be made in Ip4ConfigDriverBindingStart() so that uninitialized data from the stack is not used.
Signed-off-by: Roy Franz roy.franz@linaro.org Contributed-under: TianoCore Contribution Agreement 1.0
MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c index 795f063..c628991 100644 --- a/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c +++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c @@ -80,7 +80,7 @@ MnpGetModeData ( // will be updated to reflect any change of media status // Status = Snp->GetStatus (Snp, &InterruptStatus, NULL);
- if (!EFI_ERROR (Status)) {
- if (!EFI_ERROR (Status) || (Status == EFI_NOT_STARTED)) { CopyMem (SnpModeData, Snp->Mode, sizeof (*SnpModeData)); } }
-- 1.7.10.4