[ovs-dev] [PATCH 2/4] datapath-windows: Prepare base code for the forwarding extension.

Saurabh Shah ssaurabh at vmware.com
Tue Jun 24 00:34:57 UTC 2014


These are some minimal changes required to get the base code to work with our
forwarding extension. These changes are licensed under Apache License, Version
2.0.

Co-Authored-By: Eitan Eliahu <eliahue at vmware.com>
Signed-off-by: Eitan Eliahu <eliahue at vmware.com>
Co-Authored-By: Guolin Yang <gyang at vmware.com>
Signed-off-by: Guolin Yang <gyang at vmware.com>
Co-Authored-By: Linda Sun <lsun at vmware.com>
Signed-off-by: Linda Sun <lsun at vmware.com>
Co-Authored-By: Nithin Raju <nithin at vmware.com>
Signed-off-by: Nithin Raju <nithin at vmware.com>
Signed-off-by: Saurabh Shah <ssaurabh at vmware.com>
---
 datapath-windows/base/SxApi.h  |    4 ++--
 datapath-windows/base/SxBase.c |   18 ++++++------------
 datapath-windows/base/SxBase.h |    4 +++-
 3 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/datapath-windows/base/SxApi.h b/datapath-windows/base/SxApi.h
index 6ee52c9..8d564e0 100644
--- a/datapath-windows/base/SxApi.h
+++ b/datapath-windows/base/SxApi.h
@@ -61,7 +61,7 @@ Routine Description:
     An extension should allocate/initalize all global data in this function.
       
 Arguments:
-    NULL
+   sxDriverHandle - Filter driver handle.
     
 Return Value:
     NDIS_STATUS_SUCCESS succeeds driver entry.
@@ -70,7 +70,7 @@ Return Value:
    
 --*/
 NDIS_STATUS
-SxExtInitialize();
+SxExtInitialize(NDIS_HANDLE sxDriverHandle);
 
 
 /*++
diff --git a/datapath-windows/base/SxBase.c b/datapath-windows/base/SxBase.c
index 57fabd8..db8a478 100644
--- a/datapath-windows/base/SxBase.c
+++ b/datapath-windows/base/SxBase.c
@@ -60,15 +60,6 @@ DriverEntry(
 
     UNREFERENCED_PARAMETER(RegistryPath);
     
-    //
-    // Initialize extension specific data.
-    //
-    status = SxExtInitialize();
-    if (status != NDIS_STATUS_SUCCESS)
-    {
-        goto Cleanup;
-    }
-
     RtlInitUnicodeString(&serviceName, SxExtServiceName);
     RtlInitUnicodeString(&SxExtensionFriendlyName, SxExtFriendlyName);
     RtlInitUnicodeString(&SxExtensionGuid, SxExtUniqueName);
@@ -118,7 +109,12 @@ DriverEntry(
                                        &fChars,
                                        &SxDriverHandle);
 
-Cleanup:
+    //
+    // Initialize extension specific data.
+    //
+    if (status == NDIS_STATUS_SUCCESS) {
+        status = SxExtInitialize(SxDriverHandle);
+    }
 
     if (status != NDIS_STATUS_SUCCESS)
     {
@@ -129,8 +125,6 @@ Cleanup:
         }
 
         NdisFreeSpinLock(&SxExtensionListLock);
-        
-        SxExtUninitialize();
     }
 
     return status;
diff --git a/datapath-windows/base/SxBase.h b/datapath-windows/base/SxBase.h
index 98bcf01..0e208f5 100644
--- a/datapath-windows/base/SxBase.h
+++ b/datapath-windows/base/SxBase.h
@@ -15,6 +15,8 @@ Abstract:
 
 
 --*/
+#ifndef __SX_BASE_H_
+#define __SX_BASE_H_ 1
 
 extern NDIS_STRING SxExtensionFriendlyName;
 extern NDIS_STRING SxExtensionGuid;
@@ -165,4 +167,4 @@ extern ULONG SxDebugLevel;
 
 #endif
 
-
+#endif /* __SX_BASE_H_ */
-- 
1.7.9.5




More information about the dev mailing list