[OpenSM] patches for saquery porting - 3 of 6:
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 4 Feb 2009 15:20:41 +0000 (15:20 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 4 Feb 2009 15:20:41 +0000 (15:20 +0000)
change osm_base.h
Signed off by: stan.smith@intel.com

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1927 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/opensm/user/include/opensm/osm_base.h

index cc054b3..58644e8 100644 (file)
-/*
- * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.
- * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
- *
- * This software is available to you under 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.
- *
- * $Id$
- */
-
-
-/*
- * Abstract:
- *     Basic OpenSM definitions and structures.
- *     This object represents an OpenSM "base class".
- *     This object is part of the OpenSM family of objects.
- *
- * Environment:
- *     Linux User Mode
- *
- * $Revision: 1.15 $
- */
-
-#ifndef _OSM_BASE_H_
-#define _OSM_BASE_H_
-
-#ifdef __WIN__
-#include <vendor/winosm_common.h>
-#define OSM_CDECL __cdecl
-#else
-#define OSM_CDECL
-#endif
-
-#include <complib/cl_types.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/Constants
-* NAME
-*      Constants
-*
-* DESCRIPTION
-*      The following constants are used throughout the OpenSM.
-*
-* AUTHOR
-*      Steve King, Intel
-*
-*********/
-
-/****h* OpenSM/Base
-* NAME
-*      Base
-*
-* DESCRIPTION
-*      The Base object encapsulates basic information needed by the
-*      OpenSM to manage objects.  Each OpenSM object includes the
-*      Base object as the first member.
-*
-*      This object should be treated as opaque and should be
-*      manipulated only through the provided functions.
-*
-* AUTHOR
-*      Steve King, Intel
-*
-*********/
-
-/****s* OpenSM: Base/OSM_DEFAULT_M_KEY
-* NAME
-*      OSM_DEFAULT_M_KEY
-*
-* DESCRIPTION
-*      Managment key value used by the OpenSM.
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_M_KEY 0
-/********/
-
-/****s* OpenSM: Base/OSM_DEFAULT_SM_KEY
-* NAME
-*      OSM_DEFAULT_SM_KEY
-*
-* DESCRIPTION
-*      Subnet Manager key value used by the OpenSM.
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_SM_KEY 1
-/********/
-
-/****s* OpenSM: Base/OSM_DEFAULT_LMC
-* NAME
-*      OSM_DEFAULT_LMC
-*
-* DESCRIPTION
-*      Default LMC value used by the OpenSM.
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_LMC 0
-/********/
-
-/****s* OpenSM: Base/OSM_DEFAULT_MAX_OP_VLS
-* NAME
-*      OSM_DEFAULT_MAX_OP_VLS
-*
-* DESCRIPTION
-*      Default Maximal Operational VLs to be initialized on 
-*  the link ports PortInfo by the OpenSM.
-*  Default value provides backward compatibility.
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_MAX_OP_VLS 5
-/********/
-
-/****s* OpenSM: Base/OSM_DEFAULT_SL
-* NAME
-*      OSM_DEFAULT_SL
-*
-* DESCRIPTION
-*      Default SL value used by the OpenSM.
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_SL 0
-/********/
-
-/****s* OpenSM: Base/OSM_DEFAULT_SM_PRIORITY
-* NAME
-*      OSM_DEFAULT_SM_PRIORITY
-*
-* DESCRIPTION
-*      Default SM priority value used by the OpenSM,
-*      as defined in the SMInfo attribute.  0 is the lowest priority.
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_SM_PRIORITY 1
-/********/
-
-/****d* OpenSM: Base/OSM_DEFAULT_TMP_DIR
-* NAME
-*      OSM_DEFAULT_TMP_DIR
-*
-* DESCRIPTION
-*      Specifies the default temporary directory for the log file,
-*  osm-subnet.lst, and other log files.
-*
-* SYNOPSIS
-*/
-#ifdef __WIN__
-#define OSM_DEFAULT_TMP_DIR GetOsmTempPath()
-#else
-#define OSM_DEFAULT_TMP_DIR "/var/log/"
-#endif
-/***********/
-
-/****d* OpenSM: Base/OSM_DEFAULT_CACHE_DIR
-* NAME
-*      OSM_DEFAULT_CACHE_DIR
-*
-* DESCRIPTION
-*      Specifies the default cache directory for the db files.
-*      Note that the directory must appear with "/" ("\\" for windows) at the end.
-*
-* SYNOPSIS
-*/
-#ifdef __WIN__
-#define OSM_DEFAULT_CACHE_DIR GetOsmCachePath()
-#else
-#define OSM_DEFAULT_CACHE_DIR "/var/cache/osm/"
-#endif
-/***********/
-
-/****d* OpenSM: Base/OSM_DEFAULT_LOG_FILE
-* NAME
-*      OSM_DEFAULT_LOG_FILE
-*
-* DESCRIPTION
-*      Specifies the default log file name
-*
-* SYNOPSIS
-*/
-#ifdef __WIN__
-#define OSM_DEFAULT_LOG_FILE strcat(GetOsmTempPath(), "osm.log")
-#else
-#define OSM_DEFAULT_LOG_FILE "/var/log/osm.log"
-#endif
-/***********/
-
-/****d* OpenSM: Base/OSM_DEFAULT_PARTITION_CONFIG_FILE
-* NAME
-*      OSM_DEFAULT_PARTITION_CONFIG_FILE
-*
-* DESCRIPTION
-*      Specifies the default partition config file name
-*
-* SYNOPSIS
-*/
-#ifdef __WIN__
-#define OSM_DEFAULT_PARTITION_CONFIG_FILE strcat(GetOsmCachePath(), "osm-partitions.conf")
-#else
-#define OSM_DEFAULT_PARTITION_CONFIG_FILE "/etc/osm-partitions.conf"
-#endif
-/***********/
-
-/****d* OpenSM: Base/OSM_DEFAULT_SWEEP_INTERVAL_SECS
-* NAME
-*      OSM_DEFAULT_SWEEP_INTERVAL_SECS
-*
-* DESCRIPTION
-*      Specifies the default number of seconds between subnet sweeps.
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_SWEEP_INTERVAL_SECS 10
-/***********/
-
-/****d* OpenSM: Base/OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC
-* NAME
-*      OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC
-*
-* DESCRIPTION
-*      Specifies the default transaction timeout in milliseconds.
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC 200
-/***********/
-
-/****d* OpenSM: Base/OSM_DEFAULT_SUBNET_TIMEOUT
-* NAME
-*      OSM_DEFAULT_SUBNET_TIMEOUT
-*
-* DESCRIPTION
-*      Specifies the default transaction timeout.
-*      timeout time = 4us * 2^timeout.
-*  We use here ~1sec.
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_SUBNET_TIMEOUT 0x12
-/***********/
-
-/****d* OpenSM: Base/OSM_DEFAULT_SWITCH_PACKET_LIFE
-* NAME
-*      OSM_DEFAULT_SWITCH_PACKET_LIFE
-*
-* DESCRIPTION
-*      Specifies the default max life time for a pcket on the switch.
-*      timeout time = 4us * 2^timeout.
-*  We use here the value of ~1sec
-*  A Value > 19dec disables this mechanism.
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_SWITCH_PACKET_LIFE 0x12
-/***********/
-
-/****d* OpenSM: Base/OSM_DEFAULT_HEAD_OF_QUEUE_LIFE
-* NAME
-*      OSM_DEFAULT_HEAD_OF_QUEUE_LIFE
-*
-* DESCRIPTION
-*      Sets the time a packet can live in the head of the VL Queue
-*  We use here the value of ~1sec
-*  A Value > 19dec disables this mechanism.
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_HEAD_OF_QUEUE_LIFE 0x12
-/***********/
-
-/****d* OpenSM: Base/OSM_DEFAULT_LEAF_HEAD_OF_QUEUE_LIFE
-* NAME
-*      OSM_DEFAULT_LEAF_HEAD_OF_QUEUE_LIFE
-*
-* DESCRIPTION
-*      Sets the time a packet can live in the head of the VL Queue
-*  of a port that drives a CA port.
-*  We use here the value of ~130usec
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_LEAF_HEAD_OF_QUEUE_LIFE 0xC
-/***********/
-
-/****d* OpenSM: Base/OSM_DEFAULT_VL_STALL_COUNT
-* NAME
-*      OSM_DEFAULT_LEAF_VL_COUNT
-*
-* DESCRIPTION
-*      Sets the number of consecutive head of queue life time drops that 
-*  puts the VL into stalled state. In stalled state, the port is supposed
-*  to drop everything for 8*(head of queue lifetime) 
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_VL_STALL_COUNT 0x7
-/***********/
-
-/****d* OpenSM: Base/OSM_DEFAULT_LEAF_VL_STALL_COUNT
-* NAME
-*      OSM_DEFAULT_LEAF_VL_STALL_COUNT
-*
-* DESCRIPTION
-*      Sets the number of consecutive head of queue life time drops that 
-*  puts the VL into stalled state. In stalled state, the port is supposed
-*  to drop everything for 8*(head of queue lifetime). This value is for
-*  switch ports driving a CA port.
-*  We use the value of 1 here - so any drop due to HOQ means stalling the VL
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_LEAF_VL_STALL_COUNT 0x1
-/***********/
-
-/****d* OpenSM: Base/OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT
-* NAME
-*      OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT
-*
-* DESCRIPTION
-*      Specifies the default timeout for ignoring same trap.
-*      timeout time = 5000000us
-*  We use here ~5sec.
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT 5000000
-/***********/
-
-/****d* OpenSM: Base/OSM_DEFAULT_UNHEALTHY_TIMEOUT
-* NAME
-*      OSM_DEFAULT_UNHEALTHY_TIMEOUT
-*
-* DESCRIPTION
-*      Specifies the default timeout for setting port as unhealthy.
-*      timeout time = 60000000us
-*  We use here ~60sec.
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_UNHEALTHY_TIMEOUT 60000000
-/***********/
-
-/****d* OpenSM: Base/OSM_DEFAULT_ERROR_THRESHOLD
-* NAME
-*      OSM_DEFAULT_ERROR_THRESHOLD
-*
-* DESCRIPTION
-*      Specifies default link error threshold to be set by SubnMgt(Set.PortInfo).
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_ERROR_THRESHOLD 0x08
-/***********/
-
-/****d* OpenSM: Base/OSM_DEFAULT_SMP_MAX_ON_WIRE
-* NAME
-*      OSM_DEFAULT_SMP_MAX_ON_WIRE
-*
-* DESCRIPTION
-*      Specifies the default number of VL15 SMP MADs allowed on 
-*      the wire at any one time.
-*
-* SYNOPSIS
-*/
-#define OSM_DEFAULT_SMP_MAX_ON_WIRE 4
-/***********/
-
-/****d* OpenSM: Base/OSM_SM_DEFAULT_QP0_RCV_SIZE
-* NAME
-*      OSM_SM_DEFAULT_QP0_RCV_SIZE
-*
-* DESCRIPTION
-*      Specifies the default size (in MADs) of the QP0 receive queue
-*
-* SYNOPSIS
-*/
-#define OSM_SM_DEFAULT_QP0_RCV_SIZE 256
-/***********/
-
-/****d* OpenSM: Base/OSM_SM_DEFAULT_QP0_SEND_SIZE
-* NAME
-*      OSM_SM_DEFAULT_QP0_SEND_SIZE
-*
-* DESCRIPTION
-*      Specifies the default size (in MADs) of the QP0 send queue
-*
-* SYNOPSIS
-*/
-#define OSM_SM_DEFAULT_QP0_SEND_SIZE 256
-/***********/
-
-/****d* OpenSM: Base/OSM_SM_DEFAULT_QP1_RCV_SIZE
-* NAME
-*   OSM_SM_DEFAULT_QP1_RCV_SIZE
-*
-* DESCRIPTION
-*   Specifies the default size (in MADs) of the QP1 receive queue
-*
-* SYNOPSIS
-*/
-#define OSM_SM_DEFAULT_QP1_RCV_SIZE 256
-/***********/
-
-/****d* OpenSM: Base/OSM_SM_DEFAULT_QP1_SEND_SIZE
-* NAME
-*   OSM_SM_DEFAULT_QP1_SEND_SIZE
-*
-* DESCRIPTION
-*   Specifies the default size (in MADs) of the QP1 send queue
-*
-* SYNOPSIS
-*/
-#define OSM_SM_DEFAULT_QP1_SEND_SIZE 256
-
-
-/****d* OpenSM: Base/OSM_SM_DEFAULT_POLLING_TIMEOUT_MILLISECS
-* NAME
-*   OSM_SM_DEFAULT_POLLING_TIMEOUT_MILLISECS
-*
-* DESCRIPTION
-*   Specifies the polling timeout (in miliseconds) - the timeout
-*   between one poll to another.
-*
-* SYNOPSIS
-*/
-#define OSM_SM_DEFAULT_POLLING_TIMEOUT_MILLISECS 10000
-/**********/
-
-/****d* OpenSM: Base/OSM_SM_DEFAULT_POLLING_RETRY_NUMBER
-* NAME
-*   OSM_SM_DEFAULT_POLLING_RETRY_NUMBER
-*
-* DESCRIPTION
-*   Specifies the number of polling retries before the SM goes back
-*   to DISCOVERY stage. So the default total time for handoff is 40 sec.
-*
-* SYNOPSIS
-*/
-#define OSM_SM_DEFAULT_POLLING_RETRY_NUMBER 4
-/**********/
-
-/****d* OpenSM: Base/OSM_NO_PATH
-* NAME
-*      OSM_NO_PATH
-*
-* DESCRIPTION
-*      Value indicating there is no path to the given LID.
-*
-* SYNOPSIS
-*/
-#define OSM_NO_PATH                    0xFF
-/**********/
-
-/****d* OpenSM: Base/osm_thread_state_t
-* NAME
-*      osm_thread_state_t
-*
-* DESCRIPTION
-*      Enumerates the possible states of worker threads, such
-*      as the subnet sweeper.
-*
-* SYNOPSIS
-*/
-typedef enum _osm_thread_state
-{
-       OSM_THREAD_STATE_NONE = 0,
-       OSM_THREAD_STATE_INIT,
-       OSM_THREAD_STATE_RUN,
-       OSM_THREAD_STATE_EXIT
-
-} osm_thread_state_t;
-/***********/
-
-/*
- * OSM_CAP are from Table 117 and C15-0.1.7 Table 186
- */
-
-/****d* OpenSM: Base/OSM_CAP_IS_TRAP_SUP
-* Name
-*      OSM_CAP_IS_SUBN_TRAP_SUP
-*
-* DESCRIPTION
-*      Management class generates Trap() MADs
-*
-* SYNOPSIS
-*/
-#define OSM_CAP_IS_SUBN_TRAP_SUP (1 << 0)
-/***********/
-
-/****d* OpenSM: Base/OSM_CAP_IS_GET_SET_NOTICE_SUP
-* Name
-*      OSM_CAP_IS_GET_SET_NOTICE_SUP
-*
-* DESCRIPTION
-*       Management class supports Get/Set(Notice)
-*
-* SYNOPSIS
-*/
-#define OSM_CAP_IS_SUBN_GET_SET_NOTICE_SUP (1 << 1)
-/***********/
-
-/****d* OpenSM: Base/OSM_CAP_IS_SUBN_OPT_RECS_SUP
-* Name
-*      OSM_CAP_IS_SUBN_OPT_RECS_SUP
-*
-* DESCRIPTION
-*      Support all optional attributes except:
-*  MCMemberRecord, TraceRecord, MultiPathRecord
-*
-* SYNOPSIS
-*/
-#define OSM_CAP_IS_SUBN_OPT_RECS_SUP (1 << 8)
-/***********/
-
-/****d* OpenSM: Base/OSM_CAP_IS_UD_MCAST_SUP
-* Name
-*      OSM_CAP_IS_UD_MCAST_SUP
-*
-* DESCRIPTION
-*      Multicast is supported 
-*
-* SYNOPSIS
-*/
-#define OSM_CAP_IS_UD_MCAST_SUP (1 << 9)
-/***********/
-
-/****d* OpenSM: Base/OSM_CAP_IS_MULTIPATH_SUP
-* Name
-*      OSM_CAP_IS_MULTIPATH_SUP
-*
-* DESCRIPTION
-*      MultiPathRecord and TraceRecord are supported
-*
-* SYNOPSIS
-*/
-#define OSM_CAP_IS_MULTIPATH_SUP (1 << 10)
-/***********/
-
-/****d* OpenSM: Base/OSM_CAP_IS_REINIT_SUP
-* Name
-*      OSM_CAP_IS_REINIT_SUP
-*
-* DESCRIPTION
-*      SM/SA supports re-initialization supported
-*
-* SYNOPSIS
-*/
-#define OSM_CAP_IS_REINIT_SUP (1 << 11)
-/***********/
-
-/****d* OpenSM: Base/OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED
-* Name
-*      OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED
-*
-* DESCRIPTION
-*      SM/SA supports enhanced SA PortInfoRecord searches per 1.2 Errata:
-*  ClassPortInfo:CapabilityMask.IsPortInfoCapMaskMatchSupported is 1, 
-*  then the AttributeModifier of the SubnAdmGet() and SubnAdmGetTable() 
-*  methods affects the matching behavior on the PortInfo:CapabilityMask 
-*  component. If the high-order bit (bit 31) of the AttributeModifier 
-*  is set to 1, matching on the CapabilityMask component will not be an 
-*  exact bitwise match as described in <ref to 15.4.4>.  Instead, 
-*  matching will only be performed on those bits which are set to 1 in 
-*  the PortInfo:CapabilityMask embedded in the query. 
-*
-* SYNOPSIS
-*/
-#define OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED (1 << 13)
-/***********/
-
-/****d* OpenSM: Base/osm_sm_state_t
-* NAME
-*      osm_sm_state_t
-*
-* DESCRIPTION
-*      Enumerates the possible states of the SM object.
-*
-* SYNOPSIS
-*/
-typedef enum _osm_sm_state
-{
-       OSM_SM_STATE_NO_STATE = 0,
-       OSM_SM_STATE_INIT,
-       OSM_SM_STATE_IDLE,
-       OSM_SM_STATE_SWEEP_LIGHT,
-       OSM_SM_STATE_SWEEP_LIGHT_WAIT,
-       OSM_SM_STATE_SWEEP_HEAVY_SELF,
-       OSM_SM_STATE_SWEEP_HEAVY_SUBNET,
-       OSM_SM_STATE_SET_SM_UCAST_LID,
-       OSM_SM_STATE_SET_SM_UCAST_LID_WAIT,
-       OSM_SM_STATE_SET_SM_UCAST_LID_DONE,
-       OSM_SM_STATE_SET_SUBNET_UCAST_LIDS,
-       OSM_SM_STATE_SET_SUBNET_UCAST_LIDS_WAIT,
-       OSM_SM_STATE_SET_SUBNET_UCAST_LIDS_DONE,
-       OSM_SM_STATE_SET_UCAST_TABLES,
-       OSM_SM_STATE_SET_UCAST_TABLES_WAIT,
-       OSM_SM_STATE_SET_UCAST_TABLES_DONE,
-       OSM_SM_STATE_SET_MCAST_TABLES,
-       OSM_SM_STATE_SET_MCAST_TABLES_WAIT,
-       OSM_SM_STATE_SET_MCAST_TABLES_DONE,
-       OSM_SM_STATE_SET_LINK_PORTS,
-       OSM_SM_STATE_SET_LINK_PORTS_WAIT,
-       OSM_SM_STATE_SET_LINK_PORTS_DONE,
-       OSM_SM_STATE_SET_ARMED,
-       OSM_SM_STATE_SET_ARMED_WAIT,
-       OSM_SM_STATE_SET_ARMED_DONE,
-       OSM_SM_STATE_SET_ACTIVE,
-       OSM_SM_STATE_SET_ACTIVE_WAIT,
-       OSM_SM_STATE_LOST_NEGOTIATION,
-       OSM_SM_STATE_STANDBY,
-       OSM_SM_STATE_SUBNET_UP,
-       OSM_SM_STATE_PROCESS_REQUEST,
-       OSM_SM_STATE_PROCESS_REQUEST_WAIT,
-       OSM_SM_STATE_PROCESS_REQUEST_DONE,
-       OSM_SM_STATE_MASTER_OR_HIGHER_SM_DETECTED,
-       OSM_SM_STATE_SET_PKEY,
-       OSM_SM_STATE_SET_PKEY_WAIT,
-       OSM_SM_STATE_SET_PKEY_DONE,
-       OSM_SM_STATE_MAX
-} osm_sm_state_t;
-/***********/
-
-/****d* OpenSM: Base/osm_signal_t
-* NAME
-*      osm_signal_t
-*
-* DESCRIPTION
-*      Enumerates the possible signal codes used by the OSM managers
-*      This cannot be an enum type, since conversion to and from
-*      integral types is necessary when passing signals through
-*      the dispatcher.
-*
-* SYNOPSIS
-*/
-#define OSM_SIGNAL_NONE                                                        0
-#define OSM_SIGNAL_SWEEP                                               1
-#define OSM_SIGNAL_CHANGE_DETECTED                             2
-#define OSM_SIGNAL_NO_PENDING_TRANSACTIONS             3
-#define OSM_SIGNAL_DONE                                                        4
-#define OSM_SIGNAL_DONE_PENDING                                        5
-#define OSM_SIGNAL_LOST_SM_NEGOTIATION                 6
-#define OSM_SIGNAL_LIGHT_SWEEP_FAIL                            7
-#define OSM_SIGNAL_IDLE_TIME_PROCESS                   8
-#define OSM_SIGNAL_IDLE_TIME_PROCESS_REQUEST   9
-#define OSM_SIGNAL_MASTER_OR_HIGHER_SM_DETECTED                10
-#define OSM_SIGNAL_EXIT_STBY                11
-#define OSM_SIGNAL_MAX                                                 12
-
-typedef uintn_t osm_signal_t;
-/***********/
-
-/****d* OpenSM: Base/osm_state_mgr_mode_t
-* NAME
-*       osm_state_mgr_mode_t
-*
-* DESCRIPTION
-*      Enumerates the possible state progressing codes used by the OSM 
-*      state manager.
-*
-* SYNOPSIS
-*/
-typedef enum _osm_state_mgr_mode
-{
-  OSM_STATE_STEP_CONTINUOUS = 0,
-  OSM_STATE_STEP_TAKE_ONE,
-  OSM_STATE_STEP_BREAK
-} osm_state_mgr_mode_t;
-/*
-* OSM_STATE_STEP_CONTINUOUS 
-*    normal automatic progress mode
-*
-* OSM_STATE_STEP_TAKE_ONE 
-*    Do one step 
-*
-* OSM_STATE_STEP_BREAK
-*    Stop before taking next step (the while loop in the state 
-*    manager automatically change to this state).
-*
-**********/
-
-/****d* OpenSM: Base/osm_sm_signal_t
-* NAME
-*      osm_sm_signal_t
-*
-* DESCRIPTION
-*      Enumerates the possible signals used by the OSM_SM_MGR
-*
-* SYNOPSIS
-*/
-typedef enum _osm_sm_signal
-{
-  OSM_SM_SIGNAL_INIT = 0,
-  OSM_SM_SIGNAL_DISCOVERY_COMPLETED,
-  OSM_SM_SIGNAL_POLLING_TIMEOUT,
-  OSM_SM_SIGNAL_DISCOVER,
-  OSM_SM_SIGNAL_DISABLE,
-  OSM_SM_SIGNAL_HANDOVER,
-  OSM_SM_SIGNAL_HANDOVER_SENT,
-  OSM_SM_SIGNAL_ACKNOWLEDGE,
-  OSM_SM_SIGNAL_STANDBY,
-  OSM_SM_SIGNAL_MASTER_OR_HIGHER_SM_DETECTED,
-  OSM_SM_SIGNAL_MASTER_OR_HIGHER_SM_DETECTED_DONE,
-  OSM_SM_SIGNAL_WAIT_FOR_HANDOVER,
-  OSM_SM_SIGNAL_MAX
-
-} osm_sm_signal_t;
-/***********/
-
-/****d* OpenSM/osm_mcast_req_type_t
-* NAME
-*      osm_mcast_req_type_t
-*
-* DESCRIPTION
-*      Enumerates the possible signals used by the OSM_MCAST_REQUEST
-*
-* SYNOPSIS
-*/
-typedef enum _osm_mcast_req_type
-{
-  OSM_MCAST_REQ_TYPE_CREATE,
-  OSM_MCAST_REQ_TYPE_JOIN,
-  OSM_MCAST_REQ_TYPE_LEAVE,
-  OSM_MCAST_REQ_TYPE_SUBNET_CHANGE
-
-}      osm_mcast_req_type_t;
-/***********/
-
-/****s* OpenSM: Base/MAX_UPDN_GUID_FILE_LINE_LENGTH
-* NAME
-*      MAX_UPDN_GUID_FILE_LINE_LENGTH
-*
-* DESCRIPTION
-*      The maximum line number when reading updn guid file
-*
-* SYNOPSIS
-*/
-#define MAX_UPDN_GUID_FILE_LINE_LENGTH 120
-/**********/
-
-/****s* OpenSM: Base/VendorOUIs
-* NAME
-*      VendorOUIs
-*
-* DESCRIPTION
-*      Known device vendor ID and GUID OUIs
-*
-* SYNOPSIS
-*/
-#define OSM_VENDOR_ID_INTEL         0x00D0B7
-#define OSM_VENDOR_ID_MELLANOX      0x0002C9
-#define OSM_VENDOR_ID_REDSWITCH     0x000617
-#define OSM_VENDOR_ID_SILVERSTORM   0x00066A
-#define OSM_VENDOR_ID_TOPSPIN       0x0005AD
-#define OSM_VENDOR_ID_FUJITSU       0x00E000
-#define OSM_VENDOR_ID_FUJITSU2      0x000B5D
-#define OSM_VENDOR_ID_VOLTAIRE      0x0008F1
-#define OSM_VENDOR_ID_YOTTAYOTTA    0x000453
-#define OSM_VENDOR_ID_PATHSCALE     0x001175
-#define OSM_VENDOR_ID_IBM           0x000255
-#define OSM_VENDOR_ID_DIVERGENET    0x00084E
-#define OSM_VENDOR_ID_FLEXTRONICS   0x000B8C
-#define OSM_VENDOR_ID_AGILENT       0x0030D3
-#define OSM_VENDOR_ID_OBSIDIAN      0x001777
-#define OSM_VENDOR_ID_BAYMICRO      0x000BC1
-#define OSM_VENDOR_ID_LSILOGIC      0x00A0B8
-#define OSM_VENDOR_ID_DDN           0x0001FF
-#define OSM_VENDOR_ID_PANTA         0x001393
-#define OSM_VENDOR_ID_HP            0x001708
-#define OSM_VENDOR_ID_RIOWORKS      0x005045
-
-/**********/
-
-END_C_DECLS
-
-#endif /* _OSM_BASE_H_ */
-
+/*\r
+ * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.\r
+ * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.\r
+ * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.\r
+ *\r
+ * This software is available to you under the OpenIB.org BSD license\r
+ * below:\r
+ *\r
+ *     Redistribution and use in source and binary forms, with or\r
+ *     without modification, are permitted provided that the following\r
+ *     conditions are met:\r
+ *\r
+ *      - Redistributions of source code must retain the above\r
+ *        copyright notice, this list of conditions and the following\r
+ *        disclaimer.\r
+ *\r
+ *      - Redistributions in binary form must reproduce the above\r
+ *        copyright notice, this list of conditions and the following\r
+ *        disclaimer in the documentation and/or other materials\r
+ *        provided with the distribution.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+ * SOFTWARE.\r
+ *\r
+ * $Id$\r
+ */\r
+\r
+\r
+/*\r
+ * Abstract:\r
+ *     Basic OpenSM definitions and structures.\r
+ *     This object represents an OpenSM "base class".\r
+ *     This object is part of the OpenSM family of objects.\r
+ *\r
+ * Environment:\r
+ *     Linux User Mode\r
+ *\r
+ * $Revision: 1.15 $\r
+ */\r
+\r
+#ifndef _OSM_BASE_H_\r
+#define _OSM_BASE_H_\r
+\r
+#ifdef __WIN__\r
+#include <vendor/winosm_common.h>\r
+#define OSM_CDECL __cdecl\r
+#else\r
+#define OSM_CDECL\r
+#endif\r
+\r
+#include <complib/cl_types.h>\r
+\r
+#ifdef __cplusplus\r
+#  define BEGIN_C_DECLS extern "C" {\r
+#  define END_C_DECLS   }\r
+#else /* !__cplusplus */\r
+#  define BEGIN_C_DECLS\r
+#  define END_C_DECLS\r
+#endif /* __cplusplus */\r
+\r
+BEGIN_C_DECLS\r
+\r
+/****h* OpenSM/Constants\r
+* NAME\r
+*      Constants\r
+*\r
+* DESCRIPTION\r
+*      The following constants are used throughout the OpenSM.\r
+*\r
+* AUTHOR\r
+*      Steve King, Intel\r
+*\r
+*********/\r
+\r
+/****h* OpenSM/Base\r
+* NAME\r
+*      Base\r
+*\r
+* DESCRIPTION\r
+*      The Base object encapsulates basic information needed by the\r
+*      OpenSM to manage objects.  Each OpenSM object includes the\r
+*      Base object as the first member.\r
+*\r
+*      This object should be treated as opaque and should be\r
+*      manipulated only through the provided functions.\r
+*\r
+* AUTHOR\r
+*      Steve King, Intel\r
+*\r
+*********/\r
+\r
+/****s* OpenSM: Base/OSM_DEFAULT_M_KEY\r
+* NAME\r
+*      OSM_DEFAULT_M_KEY\r
+*\r
+* DESCRIPTION\r
+*      Managment key value used by the OpenSM.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_M_KEY 0\r
+/********/\r
+\r
+/****s* OpenSM: Base/OSM_DEFAULT_SM_KEY\r
+* NAME\r
+*      OSM_DEFAULT_SM_KEY\r
+*\r
+* DESCRIPTION\r
+*      Subnet Manager key value used by the OpenSM.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_SM_KEY 1\r
+/********/\r
+\r
+/****s* OpenSM: Base/OSM_DEFAULT_SA_KEY\r
+* NAME\r
+*       OSM_DEFAULT_SA_KEY\r
+*\r
+* DESCRIPTION\r
+*       Subnet Adminstration key value.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_SA_KEY OSM_DEFAULT_SM_KEY\r
+/********/\r
+\r
+/****s* OpenSM: Base/OSM_DEFAULT_LMC\r
+* NAME\r
+*      OSM_DEFAULT_LMC\r
+*\r
+* DESCRIPTION\r
+*      Default LMC value used by the OpenSM.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_LMC 0\r
+/********/\r
+\r
+/****s* OpenSM: Base/OSM_DEFAULT_MAX_OP_VLS\r
+* NAME\r
+*      OSM_DEFAULT_MAX_OP_VLS\r
+*\r
+* DESCRIPTION\r
+*      Default Maximal Operational VLs to be initialized on \r
+*  the link ports PortInfo by the OpenSM.\r
+*  Default value provides backward compatibility.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_MAX_OP_VLS 5\r
+/********/\r
+\r
+/****s* OpenSM: Base/OSM_DEFAULT_SL\r
+* NAME\r
+*      OSM_DEFAULT_SL\r
+*\r
+* DESCRIPTION\r
+*      Default SL value used by the OpenSM.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_SL 0\r
+/********/\r
+\r
+/****s* OpenSM: Base/OSM_DEFAULT_SM_PRIORITY\r
+* NAME\r
+*      OSM_DEFAULT_SM_PRIORITY\r
+*\r
+* DESCRIPTION\r
+*      Default SM priority value used by the OpenSM,\r
+*      as defined in the SMInfo attribute.  0 is the lowest priority.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_SM_PRIORITY 1\r
+/********/\r
+\r
+/****d* OpenSM: Base/OSM_DEFAULT_TMP_DIR\r
+* NAME\r
+*      OSM_DEFAULT_TMP_DIR\r
+*\r
+* DESCRIPTION\r
+*      Specifies the default temporary directory for the log file,\r
+*  osm-subnet.lst, and other log files.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#ifdef __WIN__\r
+#define OSM_DEFAULT_TMP_DIR GetOsmTempPath()\r
+#else\r
+#define OSM_DEFAULT_TMP_DIR "/var/log/"\r
+#endif\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_DEFAULT_CACHE_DIR\r
+* NAME\r
+*      OSM_DEFAULT_CACHE_DIR\r
+*\r
+* DESCRIPTION\r
+*      Specifies the default cache directory for the db files.\r
+*      Note that the directory must appear with "/" ("\\" for windows) at the end.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#ifdef __WIN__\r
+#define OSM_DEFAULT_CACHE_DIR GetOsmCachePath()\r
+#else\r
+#define OSM_DEFAULT_CACHE_DIR "/var/cache/osm/"\r
+#endif\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_DEFAULT_LOG_FILE\r
+* NAME\r
+*      OSM_DEFAULT_LOG_FILE\r
+*\r
+* DESCRIPTION\r
+*      Specifies the default log file name\r
+*\r
+* SYNOPSIS\r
+*/\r
+#ifdef __WIN__\r
+#define OSM_DEFAULT_LOG_FILE strcat(GetOsmTempPath(), "osm.log")\r
+#else\r
+#define OSM_DEFAULT_LOG_FILE "/var/log/osm.log"\r
+#endif\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_DEFAULT_PARTITION_CONFIG_FILE\r
+* NAME\r
+*      OSM_DEFAULT_PARTITION_CONFIG_FILE\r
+*\r
+* DESCRIPTION\r
+*      Specifies the default partition config file name\r
+*\r
+* SYNOPSIS\r
+*/\r
+#ifdef __WIN__\r
+#define OSM_DEFAULT_PARTITION_CONFIG_FILE strcat(GetOsmCachePath(), "osm-partitions.conf")\r
+#else\r
+#define OSM_DEFAULT_PARTITION_CONFIG_FILE "/etc/osm-partitions.conf"\r
+#endif\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_DEFAULT_SWEEP_INTERVAL_SECS\r
+* NAME\r
+*      OSM_DEFAULT_SWEEP_INTERVAL_SECS\r
+*\r
+* DESCRIPTION\r
+*      Specifies the default number of seconds between subnet sweeps.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_SWEEP_INTERVAL_SECS 10\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC\r
+* NAME\r
+*      OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC\r
+*\r
+* DESCRIPTION\r
+*      Specifies the default transaction timeout in milliseconds.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC 200\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_DEFAULT_SUBNET_TIMEOUT\r
+* NAME\r
+*      OSM_DEFAULT_SUBNET_TIMEOUT\r
+*\r
+* DESCRIPTION\r
+*      Specifies the default transaction timeout.\r
+*      timeout time = 4us * 2^timeout.\r
+*  We use here ~1sec.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_SUBNET_TIMEOUT 0x12\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_DEFAULT_SWITCH_PACKET_LIFE\r
+* NAME\r
+*      OSM_DEFAULT_SWITCH_PACKET_LIFE\r
+*\r
+* DESCRIPTION\r
+*      Specifies the default max life time for a pcket on the switch.\r
+*      timeout time = 4us * 2^timeout.\r
+*  We use here the value of ~1sec\r
+*  A Value > 19dec disables this mechanism.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_SWITCH_PACKET_LIFE 0x12\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_DEFAULT_HEAD_OF_QUEUE_LIFE\r
+* NAME\r
+*      OSM_DEFAULT_HEAD_OF_QUEUE_LIFE\r
+*\r
+* DESCRIPTION\r
+*      Sets the time a packet can live in the head of the VL Queue\r
+*  We use here the value of ~1sec\r
+*  A Value > 19dec disables this mechanism.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_HEAD_OF_QUEUE_LIFE 0x12\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_DEFAULT_LEAF_HEAD_OF_QUEUE_LIFE\r
+* NAME\r
+*      OSM_DEFAULT_LEAF_HEAD_OF_QUEUE_LIFE\r
+*\r
+* DESCRIPTION\r
+*      Sets the time a packet can live in the head of the VL Queue\r
+*  of a port that drives a CA port.\r
+*  We use here the value of ~130usec\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_LEAF_HEAD_OF_QUEUE_LIFE 0xC\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_DEFAULT_VL_STALL_COUNT\r
+* NAME\r
+*      OSM_DEFAULT_LEAF_VL_COUNT\r
+*\r
+* DESCRIPTION\r
+*      Sets the number of consecutive head of queue life time drops that \r
+*  puts the VL into stalled state. In stalled state, the port is supposed\r
+*  to drop everything for 8*(head of queue lifetime) \r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_VL_STALL_COUNT 0x7\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_DEFAULT_LEAF_VL_STALL_COUNT\r
+* NAME\r
+*      OSM_DEFAULT_LEAF_VL_STALL_COUNT\r
+*\r
+* DESCRIPTION\r
+*      Sets the number of consecutive head of queue life time drops that \r
+*  puts the VL into stalled state. In stalled state, the port is supposed\r
+*  to drop everything for 8*(head of queue lifetime). This value is for\r
+*  switch ports driving a CA port.\r
+*  We use the value of 1 here - so any drop due to HOQ means stalling the VL\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_LEAF_VL_STALL_COUNT 0x1\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT\r
+* NAME\r
+*      OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT\r
+*\r
+* DESCRIPTION\r
+*      Specifies the default timeout for ignoring same trap.\r
+*      timeout time = 5000000us\r
+*  We use here ~5sec.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT 5000000\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_DEFAULT_UNHEALTHY_TIMEOUT\r
+* NAME\r
+*      OSM_DEFAULT_UNHEALTHY_TIMEOUT\r
+*\r
+* DESCRIPTION\r
+*      Specifies the default timeout for setting port as unhealthy.\r
+*      timeout time = 60000000us\r
+*  We use here ~60sec.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_UNHEALTHY_TIMEOUT 60000000\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_DEFAULT_ERROR_THRESHOLD\r
+* NAME\r
+*      OSM_DEFAULT_ERROR_THRESHOLD\r
+*\r
+* DESCRIPTION\r
+*      Specifies default link error threshold to be set by SubnMgt(Set.PortInfo).\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_ERROR_THRESHOLD 0x08\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_DEFAULT_SMP_MAX_ON_WIRE\r
+* NAME\r
+*      OSM_DEFAULT_SMP_MAX_ON_WIRE\r
+*\r
+* DESCRIPTION\r
+*      Specifies the default number of VL15 SMP MADs allowed on \r
+*      the wire at any one time.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_DEFAULT_SMP_MAX_ON_WIRE 4\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_SM_DEFAULT_QP0_RCV_SIZE\r
+* NAME\r
+*      OSM_SM_DEFAULT_QP0_RCV_SIZE\r
+*\r
+* DESCRIPTION\r
+*      Specifies the default size (in MADs) of the QP0 receive queue\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_SM_DEFAULT_QP0_RCV_SIZE 256\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_SM_DEFAULT_QP0_SEND_SIZE\r
+* NAME\r
+*      OSM_SM_DEFAULT_QP0_SEND_SIZE\r
+*\r
+* DESCRIPTION\r
+*      Specifies the default size (in MADs) of the QP0 send queue\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_SM_DEFAULT_QP0_SEND_SIZE 256\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_SM_DEFAULT_QP1_RCV_SIZE\r
+* NAME\r
+*   OSM_SM_DEFAULT_QP1_RCV_SIZE\r
+*\r
+* DESCRIPTION\r
+*   Specifies the default size (in MADs) of the QP1 receive queue\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_SM_DEFAULT_QP1_RCV_SIZE 256\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_SM_DEFAULT_QP1_SEND_SIZE\r
+* NAME\r
+*   OSM_SM_DEFAULT_QP1_SEND_SIZE\r
+*\r
+* DESCRIPTION\r
+*   Specifies the default size (in MADs) of the QP1 send queue\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_SM_DEFAULT_QP1_SEND_SIZE 256\r
+\r
+\r
+/****d* OpenSM: Base/OSM_SM_DEFAULT_POLLING_TIMEOUT_MILLISECS\r
+* NAME\r
+*   OSM_SM_DEFAULT_POLLING_TIMEOUT_MILLISECS\r
+*\r
+* DESCRIPTION\r
+*   Specifies the polling timeout (in miliseconds) - the timeout\r
+*   between one poll to another.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_SM_DEFAULT_POLLING_TIMEOUT_MILLISECS 10000\r
+/**********/\r
+\r
+/****d* OpenSM: Base/OSM_SM_DEFAULT_POLLING_RETRY_NUMBER\r
+* NAME\r
+*   OSM_SM_DEFAULT_POLLING_RETRY_NUMBER\r
+*\r
+* DESCRIPTION\r
+*   Specifies the number of polling retries before the SM goes back\r
+*   to DISCOVERY stage. So the default total time for handoff is 40 sec.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_SM_DEFAULT_POLLING_RETRY_NUMBER 4\r
+/**********/\r
+\r
+/****d* OpenSM: Base/OSM_NO_PATH\r
+* NAME\r
+*      OSM_NO_PATH\r
+*\r
+* DESCRIPTION\r
+*      Value indicating there is no path to the given LID.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_NO_PATH                    0xFF\r
+/**********/\r
+\r
+/****d* OpenSM: Base/osm_thread_state_t\r
+* NAME\r
+*      osm_thread_state_t\r
+*\r
+* DESCRIPTION\r
+*      Enumerates the possible states of worker threads, such\r
+*      as the subnet sweeper.\r
+*\r
+* SYNOPSIS\r
+*/\r
+typedef enum _osm_thread_state\r
+{\r
+       OSM_THREAD_STATE_NONE = 0,\r
+       OSM_THREAD_STATE_INIT,\r
+       OSM_THREAD_STATE_RUN,\r
+       OSM_THREAD_STATE_EXIT\r
+\r
+} osm_thread_state_t;\r
+/***********/\r
+\r
+/*\r
+ * OSM_CAP are from Table 117 and C15-0.1.7 Table 186\r
+ */\r
+\r
+/****d* OpenSM: Base/OSM_CAP_IS_TRAP_SUP\r
+* Name\r
+*      OSM_CAP_IS_SUBN_TRAP_SUP\r
+*\r
+* DESCRIPTION\r
+*      Management class generates Trap() MADs\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_CAP_IS_SUBN_TRAP_SUP (1 << 0)\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_CAP_IS_GET_SET_NOTICE_SUP\r
+* Name\r
+*      OSM_CAP_IS_GET_SET_NOTICE_SUP\r
+*\r
+* DESCRIPTION\r
+*       Management class supports Get/Set(Notice)\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_CAP_IS_SUBN_GET_SET_NOTICE_SUP (1 << 1)\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_CAP_IS_SUBN_OPT_RECS_SUP\r
+* Name\r
+*      OSM_CAP_IS_SUBN_OPT_RECS_SUP\r
+*\r
+* DESCRIPTION\r
+*      Support all optional attributes except:\r
+*  MCMemberRecord, TraceRecord, MultiPathRecord\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_CAP_IS_SUBN_OPT_RECS_SUP (1 << 8)\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_CAP_IS_UD_MCAST_SUP\r
+* Name\r
+*      OSM_CAP_IS_UD_MCAST_SUP\r
+*\r
+* DESCRIPTION\r
+*      Multicast is supported \r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_CAP_IS_UD_MCAST_SUP (1 << 9)\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_CAP_IS_MULTIPATH_SUP\r
+* Name\r
+*      OSM_CAP_IS_MULTIPATH_SUP\r
+*\r
+* DESCRIPTION\r
+*      MultiPathRecord and TraceRecord are supported\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_CAP_IS_MULTIPATH_SUP (1 << 10)\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_CAP_IS_REINIT_SUP\r
+* Name\r
+*      OSM_CAP_IS_REINIT_SUP\r
+*\r
+* DESCRIPTION\r
+*      SM/SA supports re-initialization supported\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_CAP_IS_REINIT_SUP (1 << 11)\r
+/***********/\r
+\r
+/****d* OpenSM: Base/OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED\r
+* Name\r
+*      OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED\r
+*\r
+* DESCRIPTION\r
+*      SM/SA supports enhanced SA PortInfoRecord searches per 1.2 Errata:\r
+*  ClassPortInfo:CapabilityMask.IsPortInfoCapMaskMatchSupported is 1, \r
+*  then the AttributeModifier of the SubnAdmGet() and SubnAdmGetTable() \r
+*  methods affects the matching behavior on the PortInfo:CapabilityMask \r
+*  component. If the high-order bit (bit 31) of the AttributeModifier \r
+*  is set to 1, matching on the CapabilityMask component will not be an \r
+*  exact bitwise match as described in <ref to 15.4.4>.  Instead, \r
+*  matching will only be performed on those bits which are set to 1 in \r
+*  the PortInfo:CapabilityMask embedded in the query. \r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED (1 << 13)\r
+/***********/\r
+\r
+/****d* OpenSM: Base/osm_sm_state_t\r
+* NAME\r
+*      osm_sm_state_t\r
+*\r
+* DESCRIPTION\r
+*      Enumerates the possible states of the SM object.\r
+*\r
+* SYNOPSIS\r
+*/\r
+typedef enum _osm_sm_state\r
+{\r
+       OSM_SM_STATE_NO_STATE = 0,\r
+       OSM_SM_STATE_INIT,\r
+       OSM_SM_STATE_IDLE,\r
+       OSM_SM_STATE_SWEEP_LIGHT,\r
+       OSM_SM_STATE_SWEEP_LIGHT_WAIT,\r
+       OSM_SM_STATE_SWEEP_HEAVY_SELF,\r
+       OSM_SM_STATE_SWEEP_HEAVY_SUBNET,\r
+       OSM_SM_STATE_SET_SM_UCAST_LID,\r
+       OSM_SM_STATE_SET_SM_UCAST_LID_WAIT,\r
+       OSM_SM_STATE_SET_SM_UCAST_LID_DONE,\r
+       OSM_SM_STATE_SET_SUBNET_UCAST_LIDS,\r
+       OSM_SM_STATE_SET_SUBNET_UCAST_LIDS_WAIT,\r
+       OSM_SM_STATE_SET_SUBNET_UCAST_LIDS_DONE,\r
+       OSM_SM_STATE_SET_UCAST_TABLES,\r
+       OSM_SM_STATE_SET_UCAST_TABLES_WAIT,\r
+       OSM_SM_STATE_SET_UCAST_TABLES_DONE,\r
+       OSM_SM_STATE_SET_MCAST_TABLES,\r
+       OSM_SM_STATE_SET_MCAST_TABLES_WAIT,\r
+       OSM_SM_STATE_SET_MCAST_TABLES_DONE,\r
+       OSM_SM_STATE_SET_LINK_PORTS,\r
+       OSM_SM_STATE_SET_LINK_PORTS_WAIT,\r
+       OSM_SM_STATE_SET_LINK_PORTS_DONE,\r
+       OSM_SM_STATE_SET_ARMED,\r
+       OSM_SM_STATE_SET_ARMED_WAIT,\r
+       OSM_SM_STATE_SET_ARMED_DONE,\r
+       OSM_SM_STATE_SET_ACTIVE,\r
+       OSM_SM_STATE_SET_ACTIVE_WAIT,\r
+       OSM_SM_STATE_LOST_NEGOTIATION,\r
+       OSM_SM_STATE_STANDBY,\r
+       OSM_SM_STATE_SUBNET_UP,\r
+       OSM_SM_STATE_PROCESS_REQUEST,\r
+       OSM_SM_STATE_PROCESS_REQUEST_WAIT,\r
+       OSM_SM_STATE_PROCESS_REQUEST_DONE,\r
+       OSM_SM_STATE_MASTER_OR_HIGHER_SM_DETECTED,\r
+       OSM_SM_STATE_SET_PKEY,\r
+       OSM_SM_STATE_SET_PKEY_WAIT,\r
+       OSM_SM_STATE_SET_PKEY_DONE,\r
+       OSM_SM_STATE_MAX\r
+} osm_sm_state_t;\r
+/***********/\r
+\r
+/****d* OpenSM: Base/osm_signal_t\r
+* NAME\r
+*      osm_signal_t\r
+*\r
+* DESCRIPTION\r
+*      Enumerates the possible signal codes used by the OSM managers\r
+*      This cannot be an enum type, since conversion to and from\r
+*      integral types is necessary when passing signals through\r
+*      the dispatcher.\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_SIGNAL_NONE                                                        0\r
+#define OSM_SIGNAL_SWEEP                                               1\r
+#define OSM_SIGNAL_CHANGE_DETECTED                             2\r
+#define OSM_SIGNAL_NO_PENDING_TRANSACTIONS             3\r
+#define OSM_SIGNAL_DONE                                                        4\r
+#define OSM_SIGNAL_DONE_PENDING                                        5\r
+#define OSM_SIGNAL_LOST_SM_NEGOTIATION                 6\r
+#define OSM_SIGNAL_LIGHT_SWEEP_FAIL                            7\r
+#define OSM_SIGNAL_IDLE_TIME_PROCESS                   8\r
+#define OSM_SIGNAL_IDLE_TIME_PROCESS_REQUEST   9\r
+#define OSM_SIGNAL_MASTER_OR_HIGHER_SM_DETECTED                10\r
+#define OSM_SIGNAL_EXIT_STBY                11\r
+#define OSM_SIGNAL_MAX                                                 12\r
+\r
+typedef uintn_t osm_signal_t;\r
+/***********/\r
+\r
+/****d* OpenSM: Base/osm_state_mgr_mode_t\r
+* NAME\r
+*       osm_state_mgr_mode_t\r
+*\r
+* DESCRIPTION\r
+*      Enumerates the possible state progressing codes used by the OSM \r
+*      state manager.\r
+*\r
+* SYNOPSIS\r
+*/\r
+typedef enum _osm_state_mgr_mode\r
+{\r
+  OSM_STATE_STEP_CONTINUOUS = 0,\r
+  OSM_STATE_STEP_TAKE_ONE,\r
+  OSM_STATE_STEP_BREAK\r
+} osm_state_mgr_mode_t;\r
+/*\r
+* OSM_STATE_STEP_CONTINUOUS \r
+*    normal automatic progress mode\r
+*\r
+* OSM_STATE_STEP_TAKE_ONE \r
+*    Do one step \r
+*\r
+* OSM_STATE_STEP_BREAK\r
+*    Stop before taking next step (the while loop in the state \r
+*    manager automatically change to this state).\r
+*\r
+**********/\r
+\r
+/****d* OpenSM: Base/osm_sm_signal_t\r
+* NAME\r
+*      osm_sm_signal_t\r
+*\r
+* DESCRIPTION\r
+*      Enumerates the possible signals used by the OSM_SM_MGR\r
+*\r
+* SYNOPSIS\r
+*/\r
+typedef enum _osm_sm_signal\r
+{\r
+  OSM_SM_SIGNAL_INIT = 0,\r
+  OSM_SM_SIGNAL_DISCOVERY_COMPLETED,\r
+  OSM_SM_SIGNAL_POLLING_TIMEOUT,\r
+  OSM_SM_SIGNAL_DISCOVER,\r
+  OSM_SM_SIGNAL_DISABLE,\r
+  OSM_SM_SIGNAL_HANDOVER,\r
+  OSM_SM_SIGNAL_HANDOVER_SENT,\r
+  OSM_SM_SIGNAL_ACKNOWLEDGE,\r
+  OSM_SM_SIGNAL_STANDBY,\r
+  OSM_SM_SIGNAL_MASTER_OR_HIGHER_SM_DETECTED,\r
+  OSM_SM_SIGNAL_MASTER_OR_HIGHER_SM_DETECTED_DONE,\r
+  OSM_SM_SIGNAL_WAIT_FOR_HANDOVER,\r
+  OSM_SM_SIGNAL_MAX\r
+\r
+} osm_sm_signal_t;\r
+/***********/\r
+\r
+/****d* OpenSM/osm_mcast_req_type_t\r
+* NAME\r
+*      osm_mcast_req_type_t\r
+*\r
+* DESCRIPTION\r
+*      Enumerates the possible signals used by the OSM_MCAST_REQUEST\r
+*\r
+* SYNOPSIS\r
+*/\r
+typedef enum _osm_mcast_req_type\r
+{\r
+  OSM_MCAST_REQ_TYPE_CREATE,\r
+  OSM_MCAST_REQ_TYPE_JOIN,\r
+  OSM_MCAST_REQ_TYPE_LEAVE,\r
+  OSM_MCAST_REQ_TYPE_SUBNET_CHANGE\r
+\r
+}      osm_mcast_req_type_t;\r
+/***********/\r
+\r
+/****s* OpenSM: Base/MAX_UPDN_GUID_FILE_LINE_LENGTH\r
+* NAME\r
+*      MAX_UPDN_GUID_FILE_LINE_LENGTH\r
+*\r
+* DESCRIPTION\r
+*      The maximum line number when reading updn guid file\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define MAX_UPDN_GUID_FILE_LINE_LENGTH 120\r
+/**********/\r
+\r
+/****s* OpenSM: Base/VendorOUIs\r
+* NAME\r
+*      VendorOUIs\r
+*\r
+* DESCRIPTION\r
+*      Known device vendor ID and GUID OUIs\r
+*\r
+* SYNOPSIS\r
+*/\r
+#define OSM_VENDOR_ID_INTEL         0x00D0B7\r
+#define OSM_VENDOR_ID_MELLANOX      0x0002C9\r
+#define OSM_VENDOR_ID_REDSWITCH     0x000617\r
+#define OSM_VENDOR_ID_SILVERSTORM   0x00066A\r
+#define OSM_VENDOR_ID_TOPSPIN       0x0005AD\r
+#define OSM_VENDOR_ID_FUJITSU       0x00E000\r
+#define OSM_VENDOR_ID_FUJITSU2      0x000B5D\r
+#define OSM_VENDOR_ID_VOLTAIRE      0x0008F1\r
+#define OSM_VENDOR_ID_YOTTAYOTTA    0x000453\r
+#define OSM_VENDOR_ID_PATHSCALE     0x001175\r
+#define OSM_VENDOR_ID_IBM           0x000255\r
+#define OSM_VENDOR_ID_DIVERGENET    0x00084E\r
+#define OSM_VENDOR_ID_FLEXTRONICS   0x000B8C\r
+#define OSM_VENDOR_ID_AGILENT       0x0030D3\r
+#define OSM_VENDOR_ID_OBSIDIAN      0x001777\r
+#define OSM_VENDOR_ID_BAYMICRO      0x000BC1\r
+#define OSM_VENDOR_ID_LSILOGIC      0x00A0B8\r
+#define OSM_VENDOR_ID_DDN           0x0001FF\r
+#define OSM_VENDOR_ID_PANTA         0x001393\r
+#define OSM_VENDOR_ID_HP            0x001708\r
+#define OSM_VENDOR_ID_RIOWORKS      0x005045\r
+\r
+/**********/\r
+\r
+END_C_DECLS\r
+\r
+#endif /* _OSM_BASE_H_ */\r
+\r