diff options
author | Jiaxin Wu <jiaxin.wu@intel.com> | 2015-08-26 06:19:53 +0000 |
---|---|---|
committer | jiaxinwu <jiaxinwu@Edk2> | 2015-08-26 06:19:53 +0000 |
commit | 5ca29abe529794c1c2a2663378b0719e902c1077 (patch) | |
tree | 452a83c617b23f442f9c149318e7e7cb664b9f34 /NetworkPkg/HttpDxe/HttpDriver.c | |
parent | d36e65a045787319fe26b1a8c0b48c536f236ed6 (diff) | |
download | edk2-5ca29abe529794c1c2a2663378b0719e902c1077.tar.gz edk2-5ca29abe529794c1c2a2663378b0719e902c1077.tar.bz2 edk2-5ca29abe529794c1c2a2663378b0719e902c1077.zip |
NetworkPkg: Update HttpDxe driver to consume EFI_HTTP_UTILITIES_PROTOCOL
v2:
* Register a notification function to be executed for Http utilities protocol
in the drivers entry points.
Since we add EFI_HTTP_UTILITIES_PROTOCOL support, HttpDxe driver should
be updated to remove internal http utilities functions and consume this
protocol directly.
Cc: Ye Ting <ting.ye@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Samer El-Haj-Mahmoud <elhaj@hp.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18316 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg/HttpDxe/HttpDriver.c')
-rw-r--r-- | NetworkPkg/HttpDxe/HttpDriver.c | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/NetworkPkg/HttpDxe/HttpDriver.c b/NetworkPkg/HttpDxe/HttpDriver.c index 43f42e29bf..bd1d04e78c 100644 --- a/NetworkPkg/HttpDxe/HttpDriver.c +++ b/NetworkPkg/HttpDxe/HttpDriver.c @@ -15,6 +15,8 @@ #include "HttpDriver.h"
+EFI_HTTP_UTILITIES_PROTOCOL *mHttpUtilities = NULL;
+
///
/// Driver Binding Protocol instance
///
@@ -101,6 +103,35 @@ HttpCleanService ( }
/**
+ The event process routine when the http utilities protocol is installed
+ in the system.
+
+ @param[in] Event Not used.
+ @param[in] Context The pointer to the IP4 config2 instance data.
+
+**/
+VOID
+EFIAPI
+HttpUtilitiesInstalledCallback (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ gBS->LocateProtocol (
+ &gEfiHttpUtilitiesProtocolGuid,
+ NULL,
+ (VOID **) &mHttpUtilities
+ );
+
+ //
+ // Close the event if Http utilities protocol is loacted.
+ //
+ if (mHttpUtilities != NULL && Event != NULL) {
+ gBS->CloseEvent (Event);
+ }
+}
+
+/**
This is the declaration of an EFI image entry point. This entry point is
the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
both device drivers and bus drivers.
@@ -118,7 +149,28 @@ HttpDxeDriverEntryPoint ( IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
-{
+{
+ VOID *Registration;
+
+ gBS->LocateProtocol (
+ &gEfiHttpUtilitiesProtocolGuid,
+ NULL,
+ (VOID **) &mHttpUtilities
+ );
+
+ if (mHttpUtilities == NULL) {
+ //
+ // No Http utilities protocol, register a notify.
+ //
+ EfiCreateProtocolNotifyEvent (
+ &gEfiHttpUtilitiesProtocolGuid,
+ TPL_CALLBACK,
+ HttpUtilitiesInstalledCallback,
+ NULL,
+ &Registration
+ );
+ }
+
//
// Install UEFI Driver Model protocol(s).
//
|