[ofa-general] [PATCH 5/5] Move extern declarations for node description processing to a new header file.
Ira Weiny
weiny2 at llnl.gov
Fri Mar 21 15:51:25 PDT 2008
>From 93479e6cac589167f79f09d42900994e947c90f4 Mon Sep 17 00:00:00 2001
From: Ira K. Weiny <weiny2 at llnl.gov>
Date: Fri, 21 Mar 2008 15:23:16 -0700
Subject: [PATCH] Move extern declarations for node description processing to a new header file.
Signed-off-by: Ira K. Weiny <weiny2 at llnl.gov>
---
opensm/include/opensm/osm_node_desc.h | 54 +++++++++++++++++++++++++++++++++
opensm/opensm/osm_node_desc_rcv.c | 27 ++++++++++++++++
opensm/opensm/osm_node_info_rcv.c | 26 ----------------
opensm/opensm/osm_sm.c | 2 +-
opensm/opensm/osm_trap_rcv.c | 3 +-
5 files changed, 83 insertions(+), 29 deletions(-)
create mode 100644 opensm/include/opensm/osm_node_desc.h
diff --git a/opensm/include/opensm/osm_node_desc.h b/opensm/include/opensm/osm_node_desc.h
new file mode 100644
index 0000000..d86f6ba
--- /dev/null
+++ b/opensm/include/opensm/osm_node_desc.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2008 Lawrence Livermore National Security
+ *
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 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 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.
+ *
+ */
+
+#ifndef _OSM_NODE_DESC_H_
+#define _OSM_NODE_DESC_H_
+
+#include <opensm/osm_sm.h>
+#include <opensm/osm_port.h>
+
+#ifdef __cplusplus
+# define BEGIN_C_DECLS extern "C" {
+# define END_C_DECLS }
+#else /* !__cplusplus */
+# define BEGIN_C_DECLS
+# define END_C_DECLS
+#endif /* __cplusplus */
+
+BEGIN_C_DECLS
+
+void osm_nd_rcv_process(void *context, void *data);
+void osm_req_get_node_desc(osm_sm_t * sm, osm_physp_t *p_physp);
+
+END_C_DECLS
+#endif /* _OSM_NODE_DESC_H_ */
diff --git a/opensm/opensm/osm_node_desc_rcv.c b/opensm/opensm/osm_node_desc_rcv.c
index 4a22aab..a7266d5 100644
--- a/opensm/opensm/osm_node_desc_rcv.c
+++ b/opensm/opensm/osm_node_desc_rcv.c
@@ -134,3 +134,30 @@ void osm_nd_rcv_process(IN void *context, IN void *data)
CL_PLOCK_RELEASE(sm->p_lock);
OSM_LOG_EXIT(sm->p_log);
}
+
+/**********************************************************************
+ The plock must be held before calling this function.
+**********************************************************************/
+void
+osm_req_get_node_desc(IN osm_sm_t * sm,
+ osm_physp_t *p_physp)
+{
+ ib_api_status_t status = IB_SUCCESS;
+ osm_madw_context_t context;
+
+ OSM_LOG_ENTER(sm->p_log);
+
+ context.nd_context.node_guid =
+ osm_node_get_node_guid(osm_physp_get_node_ptr(p_physp));
+
+ status = osm_req_get(sm, osm_physp_get_dr_path_ptr(p_physp),
+ IB_MAD_ATTR_NODE_DESC,
+ 0, CL_DISP_MSGID_NONE, &context);
+ if (status != IB_SUCCESS)
+ OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0D03: "
+ "Failure initiating NodeDescription request (%s)\n",
+ ib_get_err_str(status));
+
+ OSM_LOG_EXIT(sm->p_log);
+}
+
diff --git a/opensm/opensm/osm_node_info_rcv.c b/opensm/opensm/osm_node_info_rcv.c
index 6818e05..9a3eb7b 100644
--- a/opensm/opensm/osm_node_info_rcv.c
+++ b/opensm/opensm/osm_node_info_rcv.c
@@ -306,32 +306,6 @@ __osm_ni_rcv_process_new_node(IN osm_sm_t * sm,
/**********************************************************************
The plock must be held before calling this function.
**********************************************************************/
-void
-osm_req_get_node_desc(IN osm_sm_t * sm,
- osm_physp_t *p_physp)
-{
- ib_api_status_t status = IB_SUCCESS;
- osm_madw_context_t context;
-
- OSM_LOG_ENTER(sm->p_log);
-
- context.nd_context.node_guid =
- osm_node_get_node_guid(osm_physp_get_node_ptr(p_physp));
-
- status = osm_req_get(sm, osm_physp_get_dr_path_ptr(p_physp),
- IB_MAD_ATTR_NODE_DESC,
- 0, CL_DISP_MSGID_NONE, &context);
- if (status != IB_SUCCESS)
- OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0D03: "
- "Failure initiating NodeDescription request (%s)\n",
- ib_get_err_str(status));
-
- OSM_LOG_EXIT(sm->p_log);
-}
-
-/**********************************************************************
- The plock must be held before calling this function.
-**********************************************************************/
static void
__osm_ni_rcv_get_node_desc(IN osm_sm_t * sm,
IN osm_node_t * const p_node,
diff --git a/opensm/opensm/osm_sm.c b/opensm/opensm/osm_sm.c
index 32525ba..69aafb4 100644
--- a/opensm/opensm/osm_sm.c
+++ b/opensm/opensm/osm_sm.c
@@ -64,12 +64,12 @@
#include <opensm/osm_mcm_info.h>
#include <opensm/osm_perfmgr.h>
#include <opensm/osm_opensm.h>
+#include <opensm/osm_node_desc.h>
#define OSM_SM_INITIAL_TID_VALUE 0x1233
extern void osm_lft_rcv_process(IN void *context, IN void *data);
extern void osm_mft_rcv_process(IN void *context, IN void *data);
-extern void osm_nd_rcv_process(IN void *context, IN void *data);
extern void osm_ni_rcv_process(IN void *context, IN void *data);
extern void osm_pkey_rcv_process(IN void *context, IN void *data);
extern void osm_pi_rcv_process(IN void *context, IN void *data);
diff --git a/opensm/opensm/osm_trap_rcv.c b/opensm/opensm/osm_trap_rcv.c
index bc8311d..6fcf406 100644
--- a/opensm/opensm/osm_trap_rcv.c
+++ b/opensm/opensm/osm_trap_rcv.c
@@ -60,8 +60,7 @@
#include <opensm/osm_subnet.h>
#include <opensm/osm_inform.h>
#include <opensm/osm_opensm.h>
-
-extern void osm_req_get_node_desc(IN osm_sm_t * sm, osm_physp_t *p_physp);
+#include <opensm/osm_node_desc.h>
/**********************************************************************
*
--
1.5.1
More information about the general
mailing list