[ofw] [PATCH 7/?] Don't include initguid.h in verbs interface header
Fab Tillier
ftillier at microsoft.com
Mon Jun 18 19:20:55 PDT 2012
Let users init the GUIDs as necessary, so that they don't get initialized multiple times.
Signed-off-by: Fab Tillier <ftillier at microsoft.com>
Index: core/bus/kernel/bus_pnp.c
===================================================================
--- core/bus/kernel/bus_pnp.c (revision 3414)
+++ core/bus/kernel/bus_pnp.c (working copy)
@@ -42,13 +42,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 "al_cm_cep.h"
#include "al_mgr.h"
#include "bus_ev_log.h"
#include "al_proxy.h"
+#include <initguid.h>
+#include "rdma/verbs.h"
+#include "iba/ib_ci_ifc.h"
+#include "iba/ib_cm_ifc.h"
/* Interface names are generated by IoRegisterDeviceInterface. */
static UNICODE_STRING al_ifc_name;
@@ -1334,7 +1336,7 @@
BUS_ENTER( BUS_DBG_PNP );
- if( p_io_stack->Parameters.QueryInterface.Version != IbaCmVersion(1, 0) )
+ if( p_io_stack->Parameters.QueryInterface.Version != INFINIBAND_INTERFACE_CM_VERSION )
{
BUS_TRACE_EXIT( BUS_DBG_PNP, ("Incorrect interface version (%d)\n",
p_io_stack->Parameters.QueryInterface.Version ) );
@@ -1353,7 +1355,7 @@
p_ifc = (INFINIBAND_INTERFACE_CM*)p_io_stack->Parameters.QueryInterface.Interface;
p_ifc->InterfaceHeader.Size = sizeof(INFINIBAND_INTERFACE_CM);
- p_ifc->InterfaceHeader.Version = IbaCmVersion(1, 0);
+ p_ifc->InterfaceHeader.Version = INFINIBAND_INTERFACE_CM_VERSION;
p_ifc->InterfaceHeader.Context = p_dev_obj;
p_ifc->InterfaceHeader.InterfaceReference = al_ref_cm_ifc;
p_ifc->InterfaceHeader.InterfaceDereference = al_deref_cm_ifc;
@@ -1382,7 +1384,7 @@
*p_action = IrpSkip;
BUS_EXIT( BUS_DBG_PNP );
- return STATUS_SUCCESS;;
+ return STATUS_SUCCESS;
}
#pragma alloc_text( PAGED , fdo_query_interface )
Index: hw/mthca/kernel/hca_pnp.c
===================================================================
--- hw/mthca/kernel/hca_pnp.c (revision 3414)
+++ 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
@@ -23,6 +22,7 @@
#include "mthca.h"
#include <initguid.h>
#include <wdmguid.h>
+#include <rdma\verbs.h>
extern const char *mthca_version;
hca_dev_ext_t *g_ext = NULL;
Index: inc/kernel/rdma/verbs.h
===================================================================
--- inc/kernel/rdma/verbs.h (revision 3414)
+++ inc/kernel/rdma/verbs.h (working copy)
@@ -19,19 +19,17 @@
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AWV
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* 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 +48,6 @@
}
#define RDMA_INTERFACE_VERBS_VERSION VerbsVersion(VERBS_MAJOR_VER, VERBS_MINOR_VER)
-
-DEFINE_GUID(GUID_RDMA_INTERFACE_VERBS, 0xf0ebae86, 0xedb5, 0x4b40,
- 0xa1, 0xa, 0x44, 0xd5, 0xdb, 0x3b, 0x96, 0x4e);
typedef struct _RDMA_INTERFACE_VERBS
{
@@ -69,10 +66,6 @@
IN PDEVICE_OBJECT p_pdo // mlx4_hca client PDO
);
-// {D6C1C27E-765C-4c6b-92C2-B4066FEA1992}
-DEFINE_GUID(GUID_RDMA_INTERFACE_VERBS_EX, 0xd6c1c27e, 0x765c, 0x4c6b,
- 0x92, 0xc2, 0xb4, 0x6, 0x6f, 0xea, 0x19, 0x92);
-
typedef struct _RDMA_INTERFACE_VERBS_EX
{
INTERFACE InterfaceHeader;
@@ -87,11 +80,6 @@
// Interface, intended for notifications
//
-// {A027188D-564D-4d4e-825A-6AEC19774BAB}
-DEFINE_GUID(MLX4_BUS_NOTIFY_GUID,
-0xa027188d, 0x564d, 0x4d4e, 0x82, 0x5a, 0x6a, 0xec, 0x19, 0x77, 0x4b, 0xab);
-
-
typedef VOID (*MLX4_NOTIFY) (PVOID ifc_ctx, ULONG type, PVOID p_data, PCHAR str);
typedef struct _MLX4_BUS_NOTIFY_INTERFACE{
@@ -102,3 +90,16 @@
#endif // _VERBS_H_
+#ifdef DEFINE_GUID
+DEFINE_GUID(GUID_RDMA_INTERFACE_VERBS, 0xf0ebae86, 0xedb5, 0x4b40,
+ 0xa1, 0xa, 0x44, 0xd5, 0xdb, 0x3b, 0x96, 0x4e);
+
+// {D6C1C27E-765C-4c6b-92C2-B4066FEA1992}
+DEFINE_GUID(GUID_RDMA_INTERFACE_VERBS_EX, 0xd6c1c27e, 0x765c, 0x4c6b,
+ 0x92, 0xc2, 0xb4, 0x6, 0x6f, 0xea, 0x19, 0x92);
+
+// {A027188D-564D-4d4e-825A-6AEC19774BAB}
+DEFINE_GUID(MLX4_BUS_NOTIFY_GUID,
+0xa027188d, 0x564d, 0x4d4e, 0x82, 0x5a, 0x6a, 0xec, 0x19, 0x77, 0x4b, 0xab);
+
+#endif // DEFINE_GUID
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7.verbs_guid.patch
Type: application/octet-stream
Size: 4721 bytes
Desc: 7.verbs_guid.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20120619/62725da1/attachment.obj>
More information about the ofw
mailing list