/** @file\r
Implementation of Mtftp drivers.\r
\r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
MtftpSb->ChildrenNum = 0;\r
InitializeListHead (&MtftpSb->Children);\r
\r
- MtftpSb->Timer = NULL;\r
- MtftpSb->TimerToGetMap = NULL;\r
- MtftpSb->Controller = Controller;\r
- MtftpSb->Image = Image;\r
- MtftpSb->ConnectUdp = NULL;\r
+ MtftpSb->Timer = NULL;\r
+ MtftpSb->TimerNotifyLevel = NULL;\r
+ MtftpSb->TimerToGetMap = NULL;\r
+ MtftpSb->Controller = Controller;\r
+ MtftpSb->Image = Image;\r
+ MtftpSb->ConnectUdp = NULL;\r
\r
//\r
// Create the timer and a udp to be notified when UDP is uninstalled\r
MtftpSb,\r
&MtftpSb->Timer\r
);\r
+ if (EFI_ERROR (Status)) {\r
+ FreePool (MtftpSb);\r
+ return Status;\r
+ }\r
\r
+ Status = gBS->CreateEvent (\r
+ EVT_NOTIFY_SIGNAL | EVT_TIMER,\r
+ TPL_NOTIFY,\r
+ Mtftp4OnTimerTickNotifyLevel,\r
+ MtftpSb,\r
+ &MtftpSb->TimerNotifyLevel\r
+ );\r
if (EFI_ERROR (Status)) {\r
+ gBS->CloseEvent (MtftpSb->Timer);\r
FreePool (MtftpSb);\r
return Status;\r
}\r
&MtftpSb->TimerToGetMap\r
);\r
if (EFI_ERROR (Status)) {\r
+ gBS->CloseEvent (MtftpSb->TimerNotifyLevel);\r
gBS->CloseEvent (MtftpSb->Timer);\r
FreePool (MtftpSb);\r
return Status;\r
\r
if (MtftpSb->ConnectUdp == NULL) {\r
gBS->CloseEvent (MtftpSb->TimerToGetMap);\r
+ gBS->CloseEvent (MtftpSb->TimerNotifyLevel);\r
gBS->CloseEvent (MtftpSb->Timer);\r
FreePool (MtftpSb);\r
return EFI_DEVICE_ERROR;\r
{\r
UdpIoFreeIo (MtftpSb->ConnectUdp);\r
gBS->CloseEvent (MtftpSb->TimerToGetMap);\r
+ gBS->CloseEvent (MtftpSb->TimerNotifyLevel);\r
gBS->CloseEvent (MtftpSb->Timer);\r
}\r
\r
goto ON_ERROR;\r
}\r
\r
+ Status = gBS->SetTimer (MtftpSb->TimerNotifyLevel, TimerPeriodic, TICKS_PER_SECOND);\r
+\r
+ if (EFI_ERROR (Status)) {\r
+ goto ON_ERROR;\r
+ }\r
+\r
//\r
// Install the Mtftp4ServiceBinding Protocol onto Controller\r
//\r
\r
/**\r
Callback function which provided by user to remove one node in NetDestroyLinkList process.\r
- \r
+\r
@param[in] Entry The entry to be removed.\r
@param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.\r
\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
Mtftp4DestroyChildEntryInHandleBuffer (\r
IN LIST_ENTRY *Entry,\r
IN VOID *Context\r
-)\r
+ )\r
{\r
MTFTP4_PROTOCOL *Instance;\r
EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding;\r
&gEfiUdp4ProtocolGuid,\r
gMtftp4DriverBinding.DriverBindingHandle,\r
ChildHandle\r
- ); \r
+ );\r
}\r
\r
//\r