[openib-general] [PATCH] opensm: cleanup unused osm_req_ctrl
Sasha Khapyorsky
sashak at voltaire.com
Wed Jan 24 14:19:37 PST 2007
This cleanups unused osm_req_ctrl stuff and corresponded objects.
Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
osm/include/Makefile.am | 1 -
osm/include/opensm/osm_msgdef.h | 16 +---
osm/include/opensm/osm_req_ctrl.h | 228 -------------------------------------
osm/include/opensm/osm_sm.h | 5 -
osm/opensm/Makefile.am | 2 +-
osm/opensm/osm_helper.c | 2 +-
osm/opensm/osm_req_ctrl.c | 136 ----------------------
osm/opensm/osm_sm.c | 6 -
8 files changed, 3 insertions(+), 393 deletions(-)
delete mode 100644 osm/include/opensm/osm_req_ctrl.h
delete mode 100644 osm/opensm/osm_req_ctrl.c
diff --git a/osm/include/Makefile.am b/osm/include/Makefile.am
index b49cf21..5a186ff 100644
--- a/osm/include/Makefile.am
+++ b/osm/include/Makefile.am
@@ -71,7 +71,6 @@ EXTRA_DIST = \
$(srcdir)/opensm/osm_pkey.h \
$(srcdir)/opensm/osm_pkey_mgr.h \
$(srcdir)/opensm/osm_sa_mad_ctrl.h \
- $(srcdir)/opensm/osm_req_ctrl.h \
$(srcdir)/opensm/osm_sa_link_record.h \
$(srcdir)/opensm/osm_mcm_port.h \
$(srcdir)/opensm/osm_log.h \
diff --git a/osm/include/opensm/osm_msgdef.h b/osm/include/opensm/osm_msgdef.h
index 87c943f..a90e3b9 100644
--- a/osm/include/opensm/osm_msgdef.h
+++ b/osm/include/opensm/osm_msgdef.h
@@ -77,20 +77,6 @@ BEGIN_C_DECLS
*
*********/
-/****s* OpenSM: Dispatcher Messages/OSM_MSG_REQ
-* NAME
-* OSM_MSG_REQ
-*
-* DESCRIPTION
-* Initiates a QP0 attribute request.
-*
-* NOTES
-* Sent by: osm_sm_t
-* Received by: osm_req_ctrl_t
-* Delivery notice: yes
-*
-***********/
-
/****s* OpenSM: Dispatcher Messages/OSM_MSG_MAD_NODE_INFO
* NAME
* OSM_MSG_MAD_NODE_INFO
@@ -166,7 +152,7 @@ BEGIN_C_DECLS
***********/
enum
{
- OSM_MSG_REQ = 0,
+ OSM_MSG_NONE = 0,
OSM_MSG_MAD_NODE_INFO,
OSM_MSG_MAD_PORT_INFO,
OSM_MSG_MAD_SWITCH_INFO,
diff --git a/osm/include/opensm/osm_req_ctrl.h b/osm/include/opensm/osm_req_ctrl.h
deleted file mode 100644
index 7823823..0000000
--- a/osm/include/opensm/osm_req_ctrl.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
- * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
- *
- * 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.
- *
- */
-
-/*
- * Abstract:
- * Declaration of osm_req_ctrl_t.
- * This object represents a controller that calls the
- * generic requester object to retrieve attributes from a node.
- * This object is part of the OpenSM family of objects.
- *
- * Environment:
- * Linux User Mode
- *
- * $Revision: 1.4 $
- */
-
-#ifndef _OSM_REQ_CTRL_H_
-#define _OSM_REQ_CTRL_H_
-
-#include <opensm/osm_base.h>
-#include <complib/cl_dispatcher.h>
-#include <opensm/osm_log.h>
-#include <opensm/osm_req.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
-
-/****h* OpenSM/Generic Request Controller
-* NAME
-* Generic Request Controller
-*
-* DESCRIPTION
-* The Generic Request Controller object encapsulates the information
-* needed to request an attribute from a node.
-*
-* The Generic Request Controller object is thread safe.
-*
-* This object should be treated as opaque and should be
-* manipulated only through the provided functions.
-*
-* AUTHOR
-* Steve King, Intel
-*
-*********/
-
-/****s* OpenSM: Generic Request Controller/osm_req_ctrl_t
-* NAME
-* osm_req_ctrl_t
-*
-* DESCRIPTION
-* Generic Request Controller structure.
-*
-* This object should be treated as opaque and should
-* be manipulated only through the provided functions.
-*
-* SYNOPSIS
-*/
-typedef struct _osm_req_ctrl
-{
- osm_req_t *p_req;
- osm_log_t *p_log;
- cl_dispatcher_t *p_disp;
- cl_disp_reg_handle_t h_disp;
-
-} osm_req_ctrl_t;
-/*
-* FIELDS
-* p_log
-* Pointer to the log object.
-*
-* p_disp
-* Pointer to the Dispatcher.
-*
-* h_disp
-* Handle returned from dispatcher registration.
-*
-* SEE ALSO
-* Generic Request Controller object
-*********/
-
-/****f* OpenSM: Generic Request Controller/osm_req_ctrl_construct
-* NAME
-* osm_req_ctrl_construct
-*
-* DESCRIPTION
-* This function constructs a Generic Request Controller object.
-*
-* SYNOPSIS
-*/
-void
-osm_req_ctrl_construct(
- IN osm_req_ctrl_t* const p_ctrl );
-/*
-* PARAMETERS
-* p_ctrl
-* [in] Pointer to a Generic Request Controller object to construct.
-*
-* RETURN VALUE
-* This function does not return a value.
-*
-* NOTES
-* Allows calling osm_req_ctrl_init, and osm_req_ctrl_destroy.
-*
-* Calling osm_req_ctrl_construct is a prerequisite to calling any other
-* method except osm_req_ctrl_init.
-*
-* SEE ALSO
-* Generic Request Controller object, osm_req_ctrl_init,
-* osm_req_ctrl_destroy
-*********/
-
-/****f* OpenSM: Generic Request Controller/osm_req_ctrl_destroy
-* NAME
-* osm_req_ctrl_destroy
-*
-* DESCRIPTION
-* The osm_req_ctrl_destroy function destroys the object, releasing
-* all resources.
-*
-* SYNOPSIS
-*/
-void
-osm_req_ctrl_destroy(
- IN osm_req_ctrl_t* const p_ctrl );
-/*
-* PARAMETERS
-* p_ctrl
-* [in] Pointer to the object to destroy.
-*
-* RETURN VALUE
-* This function does not return a value.
-*
-* NOTES
-* Performs any necessary cleanup of the specified
-* Generic Request Controller object.
-* Further operations should not be attempted on the destroyed object.
-* This function should only be called after a call to
-* osm_req_ctrl_construct or osm_req_ctrl_init.
-*
-* SEE ALSO
-* Generic Request Controller object, osm_req_ctrl_construct,
-* osm_req_ctrl_init
-*********/
-
-/****f* OpenSM: Generic Request Controller/osm_req_ctrl_init
-* NAME
-* osm_req_ctrl_init
-*
-* DESCRIPTION
-* The osm_req_ctrl_init function initializes a
-* Generic Request Controller object for use.
-*
-* SYNOPSIS
-*/
-ib_api_status_t
-osm_req_ctrl_init(
- IN osm_req_ctrl_t* const p_ctrl,
- IN osm_req_t* const p_req,
- IN osm_log_t* const p_log,
- IN cl_dispatcher_t* const p_disp );
-/*
-* PARAMETERS
-* p_ctrl
-* [in] Pointer to an osm_req_ctrl_t object to initialize.
-*
-* p_req
-* [in] Pointer to a Generic Requester object.
-*
-* p_log
-* [in] Pointer to the log object.
-*
-* p_disp
-* [in] Pointer to the OpenSM central Dispatcher.
-*
-* RETURN VALUES
-* CL_SUCCESS if the Generic Request Controller object was initialized
-* successfully.
-*
-* NOTES
-* Allows calling other Generic Request Controller methods.
-*
-* SEE ALSO
-* Generic Request Controller object, osm_req_ctrl_construct,
-* Generic Requester object, osm_req_ctrl_destroy
-*********/
-
-END_C_DECLS
-
-#endif /* _OSM_REQ_CTRL_H_ */
diff --git a/osm/include/opensm/osm_sm.h b/osm/include/opensm/osm_sm.h
index a3894d8..7f22d58 100644
--- a/osm/include/opensm/osm_sm.h
+++ b/osm/include/opensm/osm_sm.h
@@ -61,7 +61,6 @@
#include <opensm/osm_req.h>
#include <opensm/osm_resp.h>
#include <opensm/osm_log.h>
-#include <opensm/osm_req_ctrl.h>
#include <opensm/osm_node_info_rcv.h>
#include <opensm/osm_port_info_rcv.h>
#include <opensm/osm_sw_info_rcv.h>
@@ -142,7 +141,6 @@ typedef struct _osm_sm
cl_plock_t *p_lock;
atomic32_t sm_trans_id;
osm_req_t req;
- osm_req_ctrl_t req_ctrl;
osm_resp_t resp;
osm_ni_rcv_t ni_rcv;
osm_pi_rcv_t pi_rcv;
@@ -200,9 +198,6 @@ typedef struct _osm_sm
* req
* Generic MAD attribute requester.
*
-* req_ctrl
-* Controller for the generic requester.
-*
* resp
* MAD attribute responder.
*
diff --git a/osm/opensm/Makefile.am b/osm/opensm/Makefile.am
index b03a206..0e9ac67 100644
--- a/osm/opensm/Makefile.am
+++ b/osm/opensm/Makefile.am
@@ -37,7 +37,7 @@ opensm_SOURCES = main.c osm_console.c osm_db_files.c \
osm_node_desc_rcv.c osm_node_info_rcv.c \
osm_opensm.c osm_pkey.c osm_pkey_mgr.c osm_pkey_rcv.c \
osm_port.c osm_port_info_rcv.c \
- osm_remote_sm.c osm_req.c osm_req_ctrl.c \
+ osm_remote_sm.c osm_req.c \
osm_resp.c osm_sa.c osm_sa_class_port_info.c \
osm_sa_informinfo.c osm_sa_lft_record.c osm_sa_mft_record.c \
osm_sa_link_record.c osm_sa_mad_ctrl.c \
diff --git a/osm/opensm/osm_helper.c b/osm/opensm/osm_helper.c
index 50a3413..e2a3e8a 100644
--- a/osm/opensm/osm_helper.c
+++ b/osm/opensm/osm_helper.c
@@ -2258,7 +2258,7 @@ osm_get_sm_signal_str(
static const char* const __osm_disp_msg_str[] =
{
- "OSM_MSG_REQ",
+ "OSM_MSG_NONE",
"OSM_MSG_MAD_NODE_INFO",
"OSM_MSG_MAD_PORT_INFO,",
"OSM_MSG_MAD_SWITCH_INFO",
diff --git a/osm/opensm/osm_req_ctrl.c b/osm/opensm/osm_req_ctrl.c
deleted file mode 100644
index 6eb7cf0..0000000
--- a/osm/opensm/osm_req_ctrl.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
- * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
- *
- * 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.
- *
- */
-
-
-/*
- * Abstract:
- * Implementation of osm_req_ctrl_t.
- * This object represents the request controller object.
- * This object is part of the opensm family of objects.
- *
- * Environment:
- * Linux User Mode
- *
- * $Revision: 1.5 $
- */
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
-
-#include <string.h>
-#include <iba/ib_types.h>
-#include <opensm/osm_req_ctrl.h>
-#include <opensm/osm_req.h>
-#include <opensm/osm_madw.h>
-#include <opensm/osm_attrib_req.h>
-#include <opensm/osm_log.h>
-#include <opensm/osm_msgdef.h>
-
-/**********************************************************************
- **********************************************************************/
-void
-__osm_req_ctrl_disp_callback(
- IN void *context,
- IN void *p_data )
-{
- /* ignore return status when invoked via the dispatcher */
- osm_req_get( ((osm_req_ctrl_t*)context)->p_req,
- (&((osm_attrib_req_t*)p_data)->path),
- ((osm_attrib_req_t*)p_data)->attrib_id,
- ((osm_attrib_req_t*)p_data)->attrib_mod,
- ((osm_attrib_req_t*)p_data)->err_msg,
- (&((osm_attrib_req_t*)p_data)->context) );
-}
-
-/**********************************************************************
- **********************************************************************/
-void
-osm_req_ctrl_construct(
- IN osm_req_ctrl_t* const p_ctrl )
-{
- memset( p_ctrl, 0, sizeof(*p_ctrl) );
- p_ctrl->h_disp = CL_DISP_INVALID_HANDLE;
-}
-
-/**********************************************************************
- **********************************************************************/
-void
-osm_req_ctrl_destroy(
- IN osm_req_ctrl_t* const p_ctrl )
-{
- CL_ASSERT( p_ctrl );
- cl_disp_unregister( p_ctrl->h_disp );
-}
-
-/**********************************************************************
- **********************************************************************/
-ib_api_status_t
-osm_req_ctrl_init(
- IN osm_req_ctrl_t* const p_ctrl,
- IN osm_req_t* const p_req,
- IN osm_log_t* const p_log,
- IN cl_dispatcher_t* const p_disp )
-{
- ib_api_status_t status = IB_SUCCESS;
-
- OSM_LOG_ENTER( p_log, osm_req_ctrl_init );
-
- osm_req_ctrl_construct( p_ctrl );
- p_ctrl->p_log = p_log;
-
- p_ctrl->p_disp = p_disp;
- p_ctrl->p_req = p_req;
-
- p_ctrl->h_disp = cl_disp_register(
- p_disp,
- OSM_MSG_REQ,
- __osm_req_ctrl_disp_callback,
- p_ctrl );
-
- if( p_ctrl->h_disp == CL_DISP_INVALID_HANDLE )
- {
- osm_log( p_log, OSM_LOG_ERROR,
- "osm_req_ctrl_init: ERR 1202: "
- "Dispatcher registration failed\n" );
- status = IB_INSUFFICIENT_RESOURCES;
- goto Exit;
- }
-
- Exit:
- OSM_LOG_EXIT( p_log );
- return( status );
-}
-
diff --git a/osm/opensm/osm_sm.c b/osm/opensm/osm_sm.c
index a2b531f..dfe01a4 100644
--- a/osm/opensm/osm_sm.c
+++ b/osm/opensm/osm_sm.c
@@ -137,7 +137,6 @@ osm_sm_construct(
cl_event_construct( &p_sm->subnet_up_event );
cl_thread_construct( &p_sm->sweeper );
osm_req_construct( &p_sm->req );
- osm_req_ctrl_construct( &p_sm->req_ctrl );
osm_resp_construct( &p_sm->resp );
osm_ni_rcv_construct( &p_sm->ni_rcv );
osm_pi_rcv_construct( &p_sm->pi_rcv );
@@ -195,7 +194,6 @@ osm_sm_shutdown(
* dispatcher are complete.
*/
osm_sm_mad_ctrl_destroy( &p_sm->mad_ctrl );
- osm_req_ctrl_destroy( &p_sm->req_ctrl );
cl_disp_unregister(p_sm->ni_disp_h);
cl_disp_unregister(p_sm->pi_disp_h);
cl_disp_unregister(p_sm->si_disp_h);
@@ -298,10 +296,6 @@ osm_sm_init(
if( status != IB_SUCCESS )
goto Exit;
- status = osm_req_ctrl_init( &p_sm->req_ctrl, &p_sm->req, p_log, p_disp );
- if( status != IB_SUCCESS )
- goto Exit;
-
status = osm_resp_init( &p_sm->resp, p_mad_pool, p_vl15, p_subn, p_log );
if( status != IB_SUCCESS )
goto Exit;
--
1.5.0.rc2.g11a3
More information about the general
mailing list