mirror of https://github.com/acidanthera/audk.git
Fixed the issue that IPv6 network stack assert infrequently – assert once every 300~400 PXE boots.
Signed-off-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ouyang Qian <qian.ouyang@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14422 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
7a1f59476d
commit
8fedfc04d9
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
The driver binding and service binding protocol for IP6 driver.
|
||||
|
||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
|
@ -412,39 +412,6 @@ Ip6CreateService (
|
|||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
// The timer expires every 100 (IP6_TIMER_INTERVAL_IN_MS) milliseconds.
|
||||
//
|
||||
Status = gBS->SetTimer (IpSb->FasterTimer, TimerPeriodic, TICKS_PER_MS * IP6_TIMER_INTERVAL_IN_MS);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
// The timer expires every 1000 (IP6_ONE_SECOND_IN_MS) milliseconds.
|
||||
//
|
||||
Status = gBS->SetTimer (IpSb->Timer, TimerPeriodic, TICKS_PER_MS * IP6_ONE_SECOND_IN_MS);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
|
||||
Status = gBS->CreateEvent (
|
||||
EVT_NOTIFY_SIGNAL,
|
||||
TPL_NOTIFY,
|
||||
Ip6OnFrameReceived,
|
||||
&IpSb->RecvRequest,
|
||||
&MnpToken->Event
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
Status = Ip6ReceiveFrame (Ip6AcceptFrame, IpSb);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
Status = NetLibGetMacString (IpSb->Controller, IpSb->Image, &IpSb->MacString);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
|
@ -461,6 +428,17 @@ Ip6CreateService (
|
|||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
Status = gBS->CreateEvent (
|
||||
EVT_NOTIFY_SIGNAL,
|
||||
TPL_NOTIFY,
|
||||
Ip6OnFrameReceived,
|
||||
&IpSb->RecvRequest,
|
||||
&MnpToken->Event
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
// If there is any manual address, set it.
|
||||
//
|
||||
|
@ -557,19 +535,52 @@ Ip6DriverBindingStart (
|
|||
NULL
|
||||
);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// ready to go: start the receiving and timer
|
||||
//
|
||||
Status = Ip6ReceiveFrame (Ip6AcceptFrame, IpSb);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
// The timer expires every 100 (IP6_TIMER_INTERVAL_IN_MS) milliseconds.
|
||||
//
|
||||
Status = gBS->SetTimer (
|
||||
IpSb->FasterTimer,
|
||||
TimerPeriodic,
|
||||
TICKS_PER_MS * IP6_TIMER_INTERVAL_IN_MS
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
// The timer expires every 1000 (IP6_ONE_SECOND_IN_MS) milliseconds.
|
||||
//
|
||||
Status = gBS->SetTimer (
|
||||
IpSb->Timer,
|
||||
TimerPeriodic,
|
||||
TICKS_PER_MS * IP6_ONE_SECOND_IN_MS
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
Ip6CleanService (IpSb);
|
||||
FreePool (IpSb);
|
||||
} else {
|
||||
//
|
||||
// Initialize the IP6 ID
|
||||
//
|
||||
mIp6Id = NET_RANDOM (NetRandomInitSeed ());
|
||||
|
||||
Ip6SetVariableData (IpSb);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
ON_ERROR:
|
||||
Ip6CleanService (IpSb);
|
||||
FreePool (IpSb);
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue