[ofw] [PATCH v2] don't include initguid in interface headers

Fab Tillier ftillier at microsoft.com
Tue Jan 11 22:23:20 PST 2011


Updated based on Sean's comments, including adding the #ifdef DEFINE_GUID for all other interface files.

Signed-off-by: Fab Tillier <ftillier at microsoft.com>

Index: core/winverbs/kernel/wv_driver.c
===================================================================
--- core/winverbs/kernel/wv_driver.c	(revision 3068)
+++ core/winverbs/kernel/wv_driver.c	(working copy)
@@ -31,10 +31,8 @@
 #include <wdf.h>
 #include <wdmsec.h>
 #include <ntstatus.h>
-#include <initguid.h>
 
 #include "index_list.c"
-#include <rdma/verbs.h>
 #include "wv_driver.h"
 #include "wv_ioctl.h"
 #include "wv_provider.h"
@@ -45,6 +43,10 @@
 #include "wv_srq.h"
 #include "wv_qp.h"
 #include "wv_ep.h"
+
+#include <initguid.h>
+#include <rdma/verbs.h>
+#include <iba/ib_cm_ifc.h>
 
 WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WV_RDMA_DEVICE, WvRdmaDeviceGetContext)
 
Index: core/bus/kernel/bus_pnp.c
===================================================================
--- core/bus/kernel/bus_pnp.c	(revision 3068)
+++ core/bus/kernel/bus_pnp.c	(working copy)
@@ -44,12 +44,15 @@
 #include "bus_port_mgr.h"
 #include "bus_iou_mgr.h"
 #include "complib/cl_memory.h"
-#include <initguid.h>
-#include "iba/ib_ci_ifc.h"
-#include "iba/ib_cm_ifc.h"
 #include "al_cm_cep.h"
 #include "al_mgr.h"
 #include "bus_ev_log.h"
+
+#include <initguid.h>
+#include "rdma/verbs.h"
+#include "iba/ib_al_ifc.h"
+#include "iba/ib_ci_ifc.h"
+#include "iba/ib_cm_ifc.h"
 
 
 /* Interface names are generated by IoRegisterDeviceInterface. */
Index: inc/kernel/rdma/verbs.h
===================================================================
--- inc/kernel/rdma/verbs.h	(revision 3068)
+++ inc/kernel/rdma/verbs.h	(working copy)
@@ -27,12 +27,9 @@
  * SOFTWARE.
  */
 
-#pragma once
-
 #ifndef _VERBS_H_
 #define _VERBS_H_
 
-#include <initguid.h>
 #include <iba/ib_ci.h>
 
 static inline USHORT VerbsVersion(UINT8 Major, UINT8 Minor)
@@ -50,9 +47,6 @@ static inline UINT8 VerbsVersionMinor(US
 	return (UINT8) Version;
 }
 
-DEFINE_GUID(GUID_RDMA_INTERFACE_VERBS, 0xf0ebae86, 0xedb5, 0x4b40,
-			0xa1, 0xa, 0x44, 0xd5, 0xdb, 0x3b, 0x96, 0x4e);
-
 typedef struct _RDMA_INTERFACE_VERBS
 {
 	INTERFACE		InterfaceHeader;
@@ -61,3 +55,8 @@ typedef struct _RDMA_INTERFACE_VERBS
 }	RDMA_INTERFACE_VERBS;
 
 #endif // _VERBS_H_
+
+#ifdef DEFINE_GUID
+DEFINE_GUID(GUID_RDMA_INTERFACE_VERBS, 0xf0ebae86, 0xedb5, 0x4b40,
+			0xa1, 0xa, 0x44, 0xd5, 0xdb, 0x3b, 0x96, 0x4e);
+#endif // DEFINE_GUID
Index: inc/kernel/iba/ib_cm_ifc.h
===================================================================
--- inc/kernel/iba/ib_cm_ifc.h	(revision 3068)
+++ inc/kernel/iba/ib_cm_ifc.h	(working copy)
@@ -30,8 +30,6 @@
 #ifndef _ib_cm_ifc_h_
 #define _ib_cm_ifc_h_
 
-#include <initguid.h>
-#include <iba/ib_al_ifc.h>
 #include <iba/ib_types.h>
 #include <iba/ib_al.h>
 
@@ -304,10 +302,6 @@ static inline UINT8 IbaCmVersionMinor(US
 	return (UINT8) Version;
 }
 
-// {6A11D060-8957-49e6-BE2A-01EDF1BD22B3}
-DEFINE_GUID(GUID_INFINIBAND_INTERFACE_CM, 0x6a11d060, 0x8957, 0x49e6,
-			0xbe, 0x2a, 0x1, 0xed, 0xf1, 0xbd, 0x22, 0xb3);
-
 typedef struct _INFINIBAND_INTERFACE_CM
 {
 	INTERFACE			InterfaceHeader;
@@ -315,4 +309,11 @@ typedef struct _INFINIBAND_INTERFACE_CM
 
 }	INFINIBAND_INTERFACE_CM;
 
-#endif // _ib_cm_ifc_h_
\ No newline at end of file
+#endif // _ib_cm_ifc_h_
+
+
+#ifdef DEFINE_GUID
+// {6A11D060-8957-49e6-BE2A-01EDF1BD22B3}
+DEFINE_GUID(GUID_INFINIBAND_INTERFACE_CM, 0x6a11d060, 0x8957, 0x49e6,
+			0xbe, 0x2a, 0x1, 0xed, 0xf1, 0xbd, 0x22, 0xb3);
+#endif // DEFINE_GUID
Index: inc/kernel/iba/ioc_ifc.h
===================================================================
--- inc/kernel/iba/ioc_ifc.h	(revision 3068)
+++ inc/kernel/iba/ioc_ifc.h	(working copy)
@@ -91,6 +91,8 @@ typedef struct _ioc_ifc_data
  * on purpose so that it can be instantiated only once where it is actually
  * needed.  See the DDK docs section "Using GUIDs in Drivers" for more info.
  */
+#ifdef DEFINE_GUID
 /* {20883ACD-57F3-4da3-AD03-73D0178ACAE9} */
 DEFINE_GUID(GUID_IOC_INTERFACE_DATA, 
 0x20883acd, 0x57f3, 0x4da3, 0xad, 0x3, 0x73, 0xd0, 0x17, 0x8a, 0xca, 0xe9);
+#endif // DEFINE_GUID
Index: inc/kernel/iba/iou_ifc.h
===================================================================
--- inc/kernel/iba/iou_ifc.h	(revision 3068)
+++ inc/kernel/iba/iou_ifc.h	(working copy)
@@ -98,6 +98,8 @@ typedef struct _iou_ifc_data
  * on purpose so that it can be instantiated only once where it is actually
  * needed.  See the DDK docs section "Using GUIDs in Drivers" for more info.
  */
+#ifdef DEFINE_GUID
 /* {C78F0228-E564-4d46-8A4B-295030414C1A} */
 DEFINE_GUID(GUID_IOU_INTERFACE_DATA, 
 0xc78f0228, 0xe564, 0x4d46, 0x8a, 0x4b, 0x29, 0x50, 0x30, 0x41, 0x4c, 0x1a);
+#endif // DEFINE_GUID
Index: inc/kernel/iba/ipoib_ifc.h
===================================================================
--- inc/kernel/iba/ipoib_ifc.h	(revision 3068)
+++ inc/kernel/iba/ipoib_ifc.h	(working copy)
@@ -107,6 +107,8 @@ typedef struct _ipoib_ifc_data
  * on purpose so that it can be instantiated only once where it is actually
  * needed.  See the DDK docs section "Using GUIDs in Drivers" for more info.
  */
+#ifdef DEFINE_GUID
 /* {B40DDB48-5710-487a-B812-6DAF56C7F423} */
 DEFINE_GUID(GUID_IPOIB_INTERFACE_DATA, 
 0xb40ddb48, 0x5710, 0x487a, 0xb8, 0x12, 0x6d, 0xaf, 0x56, 0xc7, 0xf4, 0x23);
+#endif // DEFINE_GUID
Index: inc/kernel/iba/ib_ci_ifc.h
===================================================================
--- inc/kernel/iba/ib_ci_ifc.h	(revision 3068)
+++ inc/kernel/iba/ib_ci_ifc.h	(working copy)
@@ -131,6 +131,8 @@ typedef struct _ib_ci_ifc
  * on purpose so that it can be instantiated only once where it is actually
  * needed.  See the DDK docs section "Using GUIDs in Drivers" for more info.
  */
+#ifdef DEFINE_GUID
 /* {9B617D6B-65AB-4fe5-9601-555271F7534D} */
 DEFINE_GUID(GUID_IB_CI_INTERFACE, 
 0x9b617d6b, 0x65ab, 0x4fe5, 0x96, 0x1, 0x55, 0x52, 0x71, 0xf7, 0x53, 0x4d);
+#endif // DEFINE_GUID
Index: inc/kernel/iba/ib_al_ifc.h
===================================================================
--- inc/kernel/iba/ib_al_ifc.h	(revision 3068)
+++ inc/kernel/iba/ib_al_ifc.h	(working copy)
@@ -775,6 +775,8 @@ typedef struct _ib_al_ifc
  * on purpose so that it can be instantiated only once where it is actually
  * needed.  See the DDK docs section "Using GUIDs in Drivers" for more info.
  */
+#ifdef DEFINE_GUID
 // {96234E89-496F-4dfb-AA90-FCE82BCEC8A8}
 DEFINE_GUID(GUID_IB_AL_INTERFACE, 
 0x96234e89, 0x496f, 0x4dfb, 0xaa, 0x90, 0xfc, 0xe8, 0x2b, 0xce, 0xc8, 0xa8);
+#endif // DEFINE_GUID
Index: hw/mthca/kernel/hca_pnp.c
===================================================================
--- hw/mthca/kernel/hca_pnp.c	(revision 3068)
+++ hw/mthca/kernel/hca_pnp.c	(working copy)
@@ -12,7 +12,6 @@
 
 #include "hca_driver.h"
 #include "mthca_dev.h"
-#include <rdma\verbs.h>
 
 #if defined(EVENT_TRACING)
 #ifdef offsetof
@@ -22,6 +21,7 @@
 #endif
 #include "mthca.h"
 #include <initguid.h>
+#include <rdma\verbs.h>
 #include <wdmguid.h>
 
 extern const char *mthca_version;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ifc_guid.v2.patch
Type: application/octet-stream
Size: 7074 bytes
Desc: ifc_guid.v2.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20110112/c035f4e0/attachment.obj>


More information about the ofw mailing list