/** @file\r
Implementation of Managed Network Protocol private services.\r
\r
-Copyright (c) 2005 - 2009, Intel Corporation.<BR>\r
+Copyright (c) 2005 - 2010, Intel Corporation.<BR>\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
of the BSD License which accompanies this distribution. The full\r
goto ERROR;\r
}\r
\r
+ //\r
+ // Create the timer for media detection.\r
+ //\r
+ Status = gBS->CreateEvent (\r
+ EVT_NOTIFY_SIGNAL | EVT_TIMER,\r
+ TPL_CALLBACK,\r
+ MnpCheckMediaStatus,\r
+ MnpDeviceData,\r
+ &MnpDeviceData->MediaDetectTimer\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((EFI_D_ERROR, "MnpInitializeDeviceData: CreateEvent for media detection failed.\n"));\r
+\r
+ goto ERROR;\r
+ }\r
+\r
//\r
// Create the timer for tx timeout check.\r
//\r
gBS->CloseEvent (MnpDeviceData->TimeoutCheckTimer);\r
}\r
\r
+ if (MnpDeviceData->MediaDetectTimer != NULL) {\r
+ gBS->CloseEvent (MnpDeviceData->MediaDetectTimer);\r
+ }\r
+\r
if (MnpDeviceData->PollTimer != NULL) {\r
gBS->CloseEvent (MnpDeviceData->PollTimer);\r
}\r
//\r
// Close the event.\r
//\r
- gBS->CloseEvent (&MnpDeviceData->TxTimeoutEvent);\r
- gBS->CloseEvent (&MnpDeviceData->TimeoutCheckTimer);\r
- gBS->CloseEvent (&MnpDeviceData->PollTimer);\r
+ gBS->CloseEvent (MnpDeviceData->TxTimeoutEvent);\r
+ gBS->CloseEvent (MnpDeviceData->TimeoutCheckTimer);\r
+ gBS->CloseEvent (MnpDeviceData->MediaDetectTimer);\r
+ gBS->CloseEvent (MnpDeviceData->PollTimer);\r
\r
//\r
// Free the tx buffer.\r
\r
goto ErrorExit;\r
}\r
+\r
+ //\r
+ // Start the media detection timer.\r
+ //\r
+ Status = gBS->SetTimer (\r
+ MnpDeviceData->MediaDetectTimer,\r
+ TimerPeriodic,\r
+ MNP_MEDIA_DETECT_INTERVAL\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG (\r
+ (EFI_D_ERROR,\r
+ "MnpStart, gBS->SetTimer for MediaDetectTimer %r.\n",\r
+ Status)\r
+ );\r
+\r
+ goto ErrorExit;\r
+ }\r
}\r
}\r
\r
//\r
Status = gBS->SetTimer (MnpDeviceData->TimeoutCheckTimer, TimerCancel, 0);\r
\r
+ //\r
+ // Cancel the media detect timer.\r
+ //\r
+ Status = gBS->SetTimer (MnpDeviceData->MediaDetectTimer, TimerCancel, 0);\r
+\r
//\r
// Stop the simple network.\r
//\r