1/*
2 * Copyright (c) 2004-2008 Voltaire, Inc. All rights reserved.
3 * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.
4 * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
5 *
6 * This software is available to you under a choice of one of two
7 * licenses.  You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
11 *
12 *     Redistribution and use in source and binary forms, with or
13 *     without modification, are permitted provided that the following
14 *     conditions are met:
15 *
16 *      - Redistributions of source code must retain the above
17 *        copyright notice, this list of conditions and the following
18 *        disclaimer.
19 *
20 *      - Redistributions in binary form must reproduce the above
21 *        copyright notice, this list of conditions and the following
22 *        disclaimer in the documentation and/or other materials
23 *        provided with the distribution.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32 * SOFTWARE.
33 *
34 */
35
36/*
37 * Abstract:
38 * 	Basic OpenSM definitions and structures.
39 *	This object represents an OpenSM "base class".
40 *	This object is part of the OpenSM family of objects.
41 */
42
43#ifndef _OSM_BASE_H_
44#define _OSM_BASE_H_
45
46#if HAVE_CONFIG_H
47#  include <config.h>
48#endif				/* HAVE_CONFIG_H */
49
50#ifdef __WIN__
51#include <vendor/winosm_common.h>
52#define OSM_CDECL __cdecl
53#else
54#define OSM_CDECL
55#endif
56
57#include <complib/cl_types.h>
58
59#ifdef __cplusplus
60#  define BEGIN_C_DECLS extern "C" {
61#  define END_C_DECLS   }
62#else				/* !__cplusplus */
63#  define BEGIN_C_DECLS
64#  define END_C_DECLS
65#endif				/* __cplusplus */
66
67BEGIN_C_DECLS
68/****h* OpenSM/Constants
69* NAME
70*	Constants
71*
72* DESCRIPTION
73*	The following constants are used throughout the OpenSM.
74*
75* AUTHOR
76*	Steve King, Intel
77*
78*********/
79/****h* OpenSM/Base
80* NAME
81*	Base
82*
83* DESCRIPTION
84*	The Base object encapsulates basic information needed by the
85*	OpenSM to manage objects.  Each OpenSM object includes the
86*	Base object as the first member.
87*
88*	This object should be treated as opaque and should be
89*	manipulated only through the provided functions.
90*
91* AUTHOR
92*	Steve King, Intel
93*
94*********/
95/****s* OpenSM: Base/OSM_DEFAULT_M_KEY
96* NAME
97*	OSM_DEFAULT_M_KEY
98*
99* DESCRIPTION
100*	Managment key value used by the OpenSM.
101*
102* SYNOPSIS
103*/
104#define OSM_DEFAULT_M_KEY 0
105/********/
106/****s* OpenSM: Base/OSM_DEFAULT_SM_KEY
107* NAME
108*	OSM_DEFAULT_SM_KEY
109*
110* DESCRIPTION
111*	Subnet Manager key value used by the OpenSM.
112*
113* SYNOPSIS
114*/
115#define OSM_DEFAULT_SM_KEY CL_HTON64(1)
116/********/
117/****s* OpenSM: Base/OSM_DEFAULT_SA_KEY
118* NAME
119*	OSM_DEFAULT_SA_KEY
120*
121* DESCRIPTION
122*	Subnet Adminstration key value.
123*
124* SYNOPSIS
125*/
126#define OSM_DEFAULT_SA_KEY OSM_DEFAULT_SM_KEY
127/********/
128/****s* OpenSM: Base/OSM_DEFAULT_LMC
129* NAME
130*	OSM_DEFAULT_LMC
131*
132* DESCRIPTION
133*	Default LMC value used by the OpenSM.
134*
135* SYNOPSIS
136*/
137#define OSM_DEFAULT_LMC 0
138/********/
139/****s* OpenSM: Base/OSM_DEFAULT_MAX_OP_VLS
140* NAME
141*	OSM_DEFAULT_MAX_OP_VLS
142*
143* DESCRIPTION
144*	Default Maximal Operational VLs to be initialized on
145*  the link ports PortInfo by the OpenSM.
146*  Default value provides backward compatibility.
147*
148* SYNOPSIS
149*/
150#define OSM_DEFAULT_MAX_OP_VLS 5
151/********/
152/****s* OpenSM: Base/OSM_DEFAULT_SL
153* NAME
154*	OSM_DEFAULT_SL
155*
156* DESCRIPTION
157*	Default SL value used by the OpenSM.
158*
159* SYNOPSIS
160*/
161#define OSM_DEFAULT_SL 0
162/********/
163/****s* OpenSM: Base/OSM_DEFAULT_SM_PRIORITY
164* NAME
165*	OSM_DEFAULT_SM_PRIORITY
166*
167* DESCRIPTION
168*	Default SM priority value used by the OpenSM,
169*	as defined in the SMInfo attribute.  0 is the lowest priority.
170*
171* SYNOPSIS
172*/
173#define OSM_DEFAULT_SM_PRIORITY 0
174/********/
175/****d* OpenSM: Base/OSM_DEFAULT_TMP_DIR
176* NAME
177*	OSM_DEFAULT_TMP_DIR
178*
179* DESCRIPTION
180*	Specifies the default temporary directory for the log file,
181*  osm-subnet.lst, and other log files.
182*
183* SYNOPSIS
184*/
185#ifdef __WIN__
186#define OSM_DEFAULT_TMP_DIR GetOsmTempPath()
187#else
188#define OSM_DEFAULT_TMP_DIR "/var/log/"
189#endif
190/***********/
191/****d* OpenSM: Base/OSM_DEFAULT_CACHE_DIR
192* NAME
193*	OSM_DEFAULT_CACHE_DIR
194*
195* DESCRIPTION
196*	Specifies the default cache directory for the db files.
197*	Note that the directory must appear with "/" ("\\" for windows) at the end.
198*
199* SYNOPSIS
200*/
201#ifdef __WIN__
202#define OSM_DEFAULT_CACHE_DIR GetOsmCachePath()
203#else
204#define OSM_DEFAULT_CACHE_DIR "/var/cache/opensm/"
205#endif
206/***********/
207/****d* OpenSM: Base/OSM_DEFAULT_LOG_FILE
208* NAME
209*	OSM_DEFAULT_LOG_FILE
210*
211* DESCRIPTION
212*	Specifies the default log file name
213*
214* SYNOPSIS
215*/
216#ifdef __WIN__
217#define OSM_DEFAULT_LOG_FILE strcat(GetOsmTempPath(), "osm.log")
218#else
219#define OSM_DEFAULT_LOG_FILE "/var/log/opensm.log"
220#endif
221/***********/
222
223/****d* OpenSM: Base/OSM_DEFAULT_CONFIG_FILE
224* NAME
225*	OSM_DEFAULT_CONFIG_FILE
226*
227* DESCRIPTION
228*	Specifies the default OpenSM config file name
229*
230* SYNOPSIS
231*/
232#ifdef __WIN__
233#define OSM_DEFAULT_CONFIG_FILE strcat(GetOsmCachePath(), "opensm.conf")
234#elif defined(HAVE_DEFAULT_OPENSM_CONFIG_FILE)
235#define OSM_DEFAULT_CONFIG_FILE HAVE_DEFAULT_OPENSM_CONFIG_FILE
236#elif defined (OPENSM_CONFIG_DIR)
237#define OSM_DEFAULT_CONFIG_FILE OPENSM_CONFIG_DIR "/opensm.conf"
238#else
239#define OSM_DEFAULT_CONFIG_FILE "/etc/opensm/opensm.conf"
240#endif /* __WIN__ */
241/***********/
242
243/****d* OpenSM: Base/OSM_DEFAULT_PARTITION_CONFIG_FILE
244* NAME
245*	OSM_DEFAULT_PARTITION_CONFIG_FILE
246*
247* DESCRIPTION
248*	Specifies the default partition config file name
249*
250* SYNOPSIS
251*/
252#ifdef __WIN__
253#define OSM_DEFAULT_PARTITION_CONFIG_FILE strcat(GetOsmCachePath(), "osm-partitions.conf")
254#elif defined(HAVE_DEFAULT_PARTITION_CONFIG_FILE)
255#define OSM_DEFAULT_PARTITION_CONFIG_FILE HAVE_DEFAULT_PARTITION_CONFIG_FILE
256#elif defined(OPENSM_CONFIG_DIR)
257#define OSM_DEFAULT_PARTITION_CONFIG_FILE OPENSM_CONFIG_DIR "/partitions.conf"
258#else
259#define OSM_DEFAULT_PARTITION_CONFIG_FILE "/etc/opensm/partitions.conf"
260#endif /* __WIN__ */
261/***********/
262
263/****d* OpenSM: Base/OSM_DEFAULT_QOS_POLICY_FILE
264* NAME
265*	OSM_DEFAULT_QOS_POLICY_FILE
266*
267* DESCRIPTION
268*	Specifies the default QoS policy file name
269*
270* SYNOPSIS
271*/
272#ifdef __WIN__
273#define OSM_DEFAULT_QOS_POLICY_FILE strcat(GetOsmCachePath(), "osm-qos-policy.conf")
274#elif defined(HAVE_DEFAULT_QOS_POLICY_FILE)
275#define OSM_DEFAULT_QOS_POLICY_FILE HAVE_DEFAULT_QOS_POLICY_FILE
276#elif defined(OPENSM_CONFIG_DIR)
277#define OSM_DEFAULT_QOS_POLICY_FILE OPENSM_CONFIG_DIR "/qos-policy.conf"
278#else
279#define OSM_DEFAULT_QOS_POLICY_FILE "/etc/opensm/qos-policy.conf"
280#endif /* __WIN__ */
281/***********/
282
283/****d* OpenSM: Base/OSM_DEFAULT_PREFIX_ROUTES_FILE
284* NAME
285*	OSM_DEFAULT_PREFIX_ROUTES_FILE
286*
287* DESCRIPTION
288*	Specifies the default prefix routes file name
289*
290* SYNOPSIS
291*/
292#ifdef __WIN__
293#define OSM_DEFAULT_PREFIX_ROUTES_FILE strcat(GetOsmCachePath(), "osm-prefix-routes.conf")
294#elif defined(HAVE_DEFAULT_PREFIX_ROUTES_FILE)
295#define OSM_DEFAULT_PREFIX_ROUTES_FILE HAVE_DEFAULT_PREFIX_ROUTES_FILE
296#elif defined(OPENSM_CONFIG_DIR)
297#define OSM_DEFAULT_PREFIX_ROUTES_FILE OPENSM_CONFIG_DIR "/prefix-routes.conf"
298#else
299#define OSM_DEFAULT_PREFIX_ROUTES_FILE "/etc/opensm/prefix-routes.conf"
300#endif
301/***********/
302
303/****d* OpenSM: Base/OSM_DEFAULT_SWEEP_INTERVAL_SECS
304* NAME
305*	OSM_DEFAULT_SWEEP_INTERVAL_SECS
306*
307* DESCRIPTION
308*	Specifies the default number of seconds between subnet sweeps.
309*
310* SYNOPSIS
311*/
312#define OSM_DEFAULT_SWEEP_INTERVAL_SECS 10
313/***********/
314/****d* OpenSM: Base/OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC
315* NAME
316*	OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC
317*
318* DESCRIPTION
319*	Specifies the default transaction timeout in milliseconds.
320*
321* SYNOPSIS
322*/
323#define OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC 200
324/***********/
325/****d* OpenSM: Base/OSM_DEFAULT_SUBNET_TIMEOUT
326* NAME
327*	OSM_DEFAULT_SUBNET_TIMEOUT
328*
329* DESCRIPTION
330*	Specifies the default subnet timeout.
331*	timeout time = 4us * 2^timeout.
332*  We use here ~1sec.
333*
334* SYNOPSIS
335*/
336#define OSM_DEFAULT_SUBNET_TIMEOUT 0x12
337/***********/
338/****d* OpenSM: Base/OSM_DEFAULT_SWITCH_PACKET_LIFE
339* NAME
340*	OSM_DEFAULT_SWITCH_PACKET_LIFE
341*
342* DESCRIPTION
343*	Specifies the default max life time for a pcket on the switch.
344*	timeout time = 4us * 2^timeout.
345*  We use here the value of ~1sec
346*  A Value > 19dec disables this mechanism.
347*
348* SYNOPSIS
349*/
350#define OSM_DEFAULT_SWITCH_PACKET_LIFE 0x12
351/***********/
352/****d* OpenSM: Base/OSM_DEFAULT_HEAD_OF_QUEUE_LIFE
353* NAME
354*	OSM_DEFAULT_HEAD_OF_QUEUE_LIFE
355*
356* DESCRIPTION
357*	Sets the time a packet can live in the head of the VL Queue
358*  We use here the value of ~1sec
359*  A Value > 19dec disables this mechanism.
360*
361* SYNOPSIS
362*/
363#define OSM_DEFAULT_HEAD_OF_QUEUE_LIFE 0x12
364/***********/
365/****d* OpenSM: Base/OSM_DEFAULT_LEAF_HEAD_OF_QUEUE_LIFE
366* NAME
367*	OSM_DEFAULT_LEAF_HEAD_OF_QUEUE_LIFE
368*
369* DESCRIPTION
370*	Sets the time a packet can live in the head of the VL Queue
371*  of a port that drives a CA port.
372*  We use here the value of ~256msec
373*
374* SYNOPSIS
375*/
376#define OSM_DEFAULT_LEAF_HEAD_OF_QUEUE_LIFE 0x10
377/***********/
378/****d* OpenSM: Base/OSM_DEFAULT_VL_STALL_COUNT
379* NAME
380*	OSM_DEFAULT_LEAF_VL_COUNT
381*
382* DESCRIPTION
383*	Sets the number of consecutive head of queue life time drops that
384*  puts the VL into stalled state. In stalled state, the port is supposed
385*  to drop everything for 8*(head of queue lifetime)
386*
387* SYNOPSIS
388*/
389#define OSM_DEFAULT_VL_STALL_COUNT 0x7
390/***********/
391/****d* OpenSM: Base/OSM_DEFAULT_LEAF_VL_STALL_COUNT
392* NAME
393*	OSM_DEFAULT_LEAF_VL_STALL_COUNT
394*
395* DESCRIPTION
396*	Sets the number of consecutive head of queue life time drops that
397*  puts the VL into stalled state. In stalled state, the port is supposed
398*  to drop everything for 8*(head of queue lifetime). This value is for
399*  switch ports driving a CA port.
400*
401* SYNOPSIS
402*/
403#define OSM_DEFAULT_LEAF_VL_STALL_COUNT 0x7
404/***********/
405/****d* OpenSM: Base/OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT
406* NAME
407*	OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT
408*
409* DESCRIPTION
410*	Specifies the default timeout for ignoring same trap.
411*	timeout time = 5000000us
412*  We use here ~5sec.
413*
414* SYNOPSIS
415*/
416#define OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT 5000000
417/***********/
418/****d* OpenSM: Base/OSM_DEFAULT_UNHEALTHY_TIMEOUT
419* NAME
420*	OSM_DEFAULT_UNHEALTHY_TIMEOUT
421*
422* DESCRIPTION
423*	Specifies the default timeout for setting port as unhealthy.
424*	timeout time = 60000000us
425*  We use here ~60sec.
426*
427* SYNOPSIS
428*/
429#define OSM_DEFAULT_UNHEALTHY_TIMEOUT 60000000
430/***********/
431/****d* OpenSM: Base/OSM_DEFAULT_ERROR_THRESHOLD
432* NAME
433*	OSM_DEFAULT_ERROR_THRESHOLD
434*
435* DESCRIPTION
436*	Specifies default link error threshold to be set by SubnSet(PortInfo).
437*
438* SYNOPSIS
439*/
440#define OSM_DEFAULT_ERROR_THRESHOLD 0x08
441/***********/
442/****d* OpenSM: Base/OSM_DEFAULT_SMP_MAX_ON_WIRE
443* NAME
444*	OSM_DEFAULT_SMP_MAX_ON_WIRE
445*
446* DESCRIPTION
447*	Specifies the default number of VL15 SMP MADs allowed on
448*	the wire at any one time.
449*
450* SYNOPSIS
451*/
452#define OSM_DEFAULT_SMP_MAX_ON_WIRE 4
453/***********/
454/****d* OpenSM: Base/OSM_SM_DEFAULT_QP0_RCV_SIZE
455* NAME
456*	OSM_SM_DEFAULT_QP0_RCV_SIZE
457*
458* DESCRIPTION
459*	Specifies the default size (in MADs) of the QP0 receive queue
460*
461* SYNOPSIS
462*/
463#define OSM_SM_DEFAULT_QP0_RCV_SIZE 256
464/***********/
465/****d* OpenSM: Base/OSM_SM_DEFAULT_QP0_SEND_SIZE
466* NAME
467*	OSM_SM_DEFAULT_QP0_SEND_SIZE
468*
469* DESCRIPTION
470*	Specifies the default size (in MADs) of the QP0 send queue
471*
472* SYNOPSIS
473*/
474#define OSM_SM_DEFAULT_QP0_SEND_SIZE 256
475/***********/
476/****d* OpenSM: Base/OSM_SM_DEFAULT_QP1_RCV_SIZE
477* NAME
478*   OSM_SM_DEFAULT_QP1_RCV_SIZE
479*
480* DESCRIPTION
481*   Specifies the default size (in MADs) of the QP1 receive queue
482*
483* SYNOPSIS
484*/
485#define OSM_SM_DEFAULT_QP1_RCV_SIZE 256
486/***********/
487/****d* OpenSM: Base/OSM_SM_DEFAULT_QP1_SEND_SIZE
488* NAME
489*   OSM_SM_DEFAULT_QP1_SEND_SIZE
490*
491* DESCRIPTION
492*   Specifies the default size (in MADs) of the QP1 send queue
493*
494* SYNOPSIS
495*/
496#define OSM_SM_DEFAULT_QP1_SEND_SIZE 256
497/****d* OpenSM: Base/OSM_PM_DEFAULT_QP1_RCV_SIZE
498* NAME
499*   OSM_PM_DEFAULT_QP1_RCV_SIZE
500*
501* DESCRIPTION
502*   Specifies the default size (in MADs) of the QP1 receive queue
503*
504* SYNOPSIS
505*/
506#define OSM_PM_DEFAULT_QP1_RCV_SIZE 256
507/***********/
508/****d* OpenSM: Base/OSM_PM_DEFAULT_QP1_SEND_SIZE
509* NAME
510*   OSM_PM_DEFAULT_QP1_SEND_SIZE
511*
512* DESCRIPTION
513*   Specifies the default size (in MADs) of the QP1 send queue
514*
515* SYNOPSIS
516*/
517#define OSM_PM_DEFAULT_QP1_SEND_SIZE 256
518/****d* OpenSM: Base/OSM_SM_DEFAULT_POLLING_TIMEOUT_MILLISECS
519* NAME
520*   OSM_SM_DEFAULT_POLLING_TIMEOUT_MILLISECS
521*
522* DESCRIPTION
523*   Specifies the polling timeout (in miliseconds) - the timeout
524*   between one poll to another.
525*
526* SYNOPSIS
527*/
528#define OSM_SM_DEFAULT_POLLING_TIMEOUT_MILLISECS 10000
529/**********/
530/****d* OpenSM: Base/OSM_SM_DEFAULT_POLLING_RETRY_NUMBER
531* NAME
532*   OSM_SM_DEFAULT_POLLING_RETRY_NUMBER
533*
534* DESCRIPTION
535*   Specifies the number of polling retries before the SM goes back
536*   to DISCOVERY stage. So the default total time for handoff is 40 sec.
537*
538* SYNOPSIS
539*/
540#define OSM_SM_DEFAULT_POLLING_RETRY_NUMBER 4
541/**********/
542/****d* OpenSM: MC Member Record Receiver/OSM_DEFAULT_MGRP_MTU
543* Name
544*	OSM_DEFAULT_MGRP_MTU
545*
546* DESCRIPTION
547*	Default MTU used for new MGRP creation (2048 bytes)
548*  Note it includes the MTUSelector which is set to "Greater Than"
549*
550* SYNOPSIS
551*/
552#define OSM_DEFAULT_MGRP_MTU 0x04
553/***********/
554/****d* OpenSM: MC Member Record Receiver/OSM_DEFAULT_MGRP_RATE
555* Name
556*	OSM_DEFAULT_MGRP_RATE
557*
558* DESCRIPTION
559*	Default RATE used for new MGRP creation (10Gb/sec)
560*  Note it includes the RateSelector which is set to "Greater Than"
561*
562* SYNOPSIS
563*/
564#define OSM_DEFAULT_MGRP_RATE 0x03
565/***********/
566/****d* OpenSM: MC Member Record Receiver/OSM_DEFAULT_MGRP_SCOPE
567* Name
568*	OSM_DEFAULT_MGRP_SCOPE
569*
570* DESCRIPTION
571*	Default SCOPE used for new MGRP creation (link local)
572*
573* SYNOPSIS
574*/
575#define OSM_DEFAULT_MGRP_SCOPE IB_MC_SCOPE_LINK_LOCAL
576/***********/
577/****d* OpenSM: Base/OSM_DEFAULT_QOS_MAX_VLS
578 * Name
579 *       OSM_DEFAULT_QOS_MAX_VLS
580 *
581 * DESCRIPTION
582 *       Default Maximum VLs used by the OpenSM.
583 *
584 * SYNOPSIS
585 */
586#define OSM_DEFAULT_QOS_MAX_VLS 15
587/***********/
588/****d* OpenSM: Base/OSM_DEFAULT_QOS_HIGH_LIMIT
589 * Name
590 *       OSM_DEFAULT_QOS_HIGH_LIMIT
591 *
592 * DESCRIPTION
593 *       Default Limit of High Priority in VL Arbitration used by OpenSM.
594 *
595 * SYNOPSIS
596 */
597#define OSM_DEFAULT_QOS_HIGH_LIMIT 0
598/***********/
599/****d* OpenSM: Base/OSM_DEFAULT_QOS_VLARB_HIGH
600 * Name
601 *       OSM_DEFAULT_QOS_VLARB_HIGH
602 *
603 * DESCRIPTION
604 *       Default High Priority VL Arbitration table used by the OpenSM.
605 *
606 * SYNOPSIS
607 */
608#define OSM_DEFAULT_QOS_VLARB_HIGH "0:4,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0"
609/***********/
610/****d* OpenSM: Base/OSM_DEFAULT_QOS_VLARB_LOW
611 * Name
612 *       OSM_DEFAULT_QOS_VLARB_LOW
613 *
614 * DESCRIPTION
615 *       Default Low Priority VL Arbitration table used by the OpenSM.
616 *
617 * SYNOPSIS
618 */
619#define OSM_DEFAULT_QOS_VLARB_LOW "0:0,1:4,2:4,3:4,4:4,5:4,6:4,7:4,8:4,9:4,10:4,11:4,12:4,13:4,14:4"
620/***********/
621/****d* OpenSM: Base/OSM_DEFAULT_QOS_SL2VL
622 * Name
623 *       OSM_DEFAULT_QOS_SL2VL
624 *
625 * DESCRIPTION
626 *       Default QoS SL2VL Mapping Table used by the OpenSM.
627 *
628 * SYNOPSIS
629 */
630#define OSM_DEFAULT_QOS_SL2VL "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,7"
631/***********/
632/****d* OpenSM: Base/OSM_NO_PATH
633* NAME
634*	OSM_NO_PATH
635*
636* DESCRIPTION
637*	Value indicating there is no path to the given LID.
638*
639* SYNOPSIS
640*/
641#define OSM_NO_PATH			0xFF
642/**********/
643/****d* OpenSM: Base/OSM_NODE_DESC_UNKNOWN
644* NAME
645*	OSM_NODE_DESC_UNKNOWN
646*
647* DESCRIPTION
648*	Value indicating the Node Description is not set and is "unknown"
649*
650* SYNOPSIS
651*/
652#define OSM_NODE_DESC_UNKNOWN "<unknown>"
653/**********/
654/****d* OpenSM: Base/osm_thread_state_t
655* NAME
656*	osm_thread_state_t
657*
658* DESCRIPTION
659*	Enumerates the possible states of worker threads, such
660*	as the subnet sweeper.
661*
662* SYNOPSIS
663*/
664typedef enum _osm_thread_state {
665	OSM_THREAD_STATE_NONE = 0,
666	OSM_THREAD_STATE_INIT,
667	OSM_THREAD_STATE_RUN,
668	OSM_THREAD_STATE_EXIT
669} osm_thread_state_t;
670/***********/
671
672/*
673 * OSM_CAP are from Table 117 and C15-0.1.7 Table 186
674 */
675
676/****d* OpenSM: Base/OSM_CAP_IS_TRAP_SUP
677* Name
678*	OSM_CAP_IS_SUBN_TRAP_SUP
679*
680* DESCRIPTION
681*	Management class generates Trap() MADs
682*
683* SYNOPSIS
684*/
685#define OSM_CAP_IS_SUBN_TRAP_SUP (1 << 0)
686/***********/
687
688/****d* OpenSM: Base/OSM_CAP_IS_GET_SET_NOTICE_SUP
689* Name
690*	OSM_CAP_IS_GET_SET_NOTICE_SUP
691*
692* DESCRIPTION
693*       Management class supports Get/Set(Notice)
694*
695* SYNOPSIS
696*/
697#define OSM_CAP_IS_SUBN_GET_SET_NOTICE_SUP (1 << 1)
698/***********/
699
700/****d* OpenSM: Base/OSM_CAP_IS_SUBN_OPT_RECS_SUP
701* Name
702*	OSM_CAP_IS_SUBN_OPT_RECS_SUP
703*
704* DESCRIPTION
705*	Support all optional attributes except:
706*  MCMemberRecord, TraceRecord, MultiPathRecord
707*
708* SYNOPSIS
709*/
710#define OSM_CAP_IS_SUBN_OPT_RECS_SUP (1 << 8)
711/***********/
712
713/****d* OpenSM: Base/OSM_CAP_IS_UD_MCAST_SUP
714* Name
715*	OSM_CAP_IS_UD_MCAST_SUP
716*
717* DESCRIPTION
718*	Multicast is supported
719*
720* SYNOPSIS
721*/
722#define OSM_CAP_IS_UD_MCAST_SUP (1 << 9)
723/***********/
724
725/****d* OpenSM: Base/OSM_CAP_IS_MULTIPATH_SUP
726* Name
727*	OSM_CAP_IS_MULTIPATH_SUP
728*
729* DESCRIPTION
730*	MultiPathRecord and TraceRecord are supported
731*
732* SYNOPSIS
733*/
734#define OSM_CAP_IS_MULTIPATH_SUP (1 << 10)
735/***********/
736
737/****d* OpenSM: Base/OSM_CAP_IS_REINIT_SUP
738* Name
739*	OSM_CAP_IS_REINIT_SUP
740*
741* DESCRIPTION
742*	SM/SA supports re-initialization supported
743*
744* SYNOPSIS
745*/
746#define OSM_CAP_IS_REINIT_SUP (1 << 11)
747/***********/
748
749/****d* OpenSM: Base/OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED
750* Name
751*	OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED
752*
753* DESCRIPTION
754*	SM/SA supports enhanced SA PortInfoRecord searches per 1.2 Errata:
755*  ClassPortInfo:CapabilityMask.IsPortInfoCapMaskMatchSupported is 1,
756*  then the AttributeModifier of the SubnAdmGet() and SubnAdmGetTable()
757*  methods affects the matching behavior on the PortInfo:CapabilityMask
758*  component. If the high-order bit (bit 31) of the AttributeModifier
759*  is set to 1, matching on the CapabilityMask component will not be an
760*  exact bitwise match as described in <ref to 15.4.4>.  Instead,
761*  matching will only be performed on those bits which are set to 1 in
762*  the PortInfo:CapabilityMask embedded in the query.
763*
764* SYNOPSIS
765*/
766#define OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED (1 << 13)
767/***********/
768
769/****d* OpenSM: Base/OSM_CAP2_IS_QOS_SUPPORTED
770* Name
771*	OSM_CAP2_IS_QOS_SUPPORTED
772*
773* DESCRIPTION
774*	QoS is supported
775*
776* SYNOPSIS
777*/
778#define OSM_CAP2_IS_QOS_SUPPORTED (1 << 1)
779/***********/
780
781/****d* OpenSM: Base/osm_signal_t
782* NAME
783*	osm_signal_t
784*
785* DESCRIPTION
786*	Enumerates the possible signal codes used by the OSM managers
787*	This cannot be an enum type, since conversion to and from
788*	integral types is necessary when passing signals through
789*	the dispatcher.
790*
791* SYNOPSIS
792*/
793#define OSM_SIGNAL_NONE				0
794#define OSM_SIGNAL_SWEEP			1
795#define OSM_SIGNAL_IDLE_TIME_PROCESS_REQUEST	2
796#define OSM_SIGNAL_PERFMGR_SWEEP		3
797#define OSM_SIGNAL_MAX				3
798
799/* status values for sweep managers - can be removed later */
800#define OSM_SIGNAL_DONE		16
801#define OSM_SIGNAL_DONE_PENDING	17
802
803typedef unsigned int osm_signal_t;
804/***********/
805
806/****d* OpenSM: Base/osm_sm_signal_t
807* NAME
808*	osm_sm_signal_t
809*
810* DESCRIPTION
811*	Enumerates the possible signals used by the OSM_SM_MGR
812*
813* SYNOPSIS
814*/
815typedef enum _osm_sm_signal {
816	OSM_SM_SIGNAL_NONE = 0,
817	OSM_SM_SIGNAL_DISCOVERY_COMPLETED,
818	OSM_SM_SIGNAL_POLLING_TIMEOUT,
819	OSM_SM_SIGNAL_DISCOVER,
820	OSM_SM_SIGNAL_DISABLE,
821	OSM_SM_SIGNAL_HANDOVER,
822	OSM_SM_SIGNAL_HANDOVER_SENT,
823	OSM_SM_SIGNAL_ACKNOWLEDGE,
824	OSM_SM_SIGNAL_STANDBY,
825	OSM_SM_SIGNAL_MASTER_OR_HIGHER_SM_DETECTED,
826	OSM_SM_SIGNAL_WAIT_FOR_HANDOVER,
827	OSM_SM_SIGNAL_MAX
828} osm_sm_signal_t;
829/***********/
830
831/****d* OpenSM/osm_mcast_req_type_t
832* NAME
833*	osm_mcast_req_type_t
834*
835* DESCRIPTION
836*	Enumerates the possible signals used by the OSM_MCAST_REQUEST
837*
838* SYNOPSIS
839*/
840typedef enum _osm_mcast_req_type {
841	OSM_MCAST_REQ_TYPE_CREATE,
842	OSM_MCAST_REQ_TYPE_JOIN,
843	OSM_MCAST_REQ_TYPE_LEAVE,
844	OSM_MCAST_REQ_TYPE_SUBNET_CHANGE
845} osm_mcast_req_type_t;
846/***********/
847
848/****s* OpenSM: Base/MAX_GUID_FILE_LINE_LENGTH
849* NAME
850*	MAX_GUID_FILE_LINE_LENGTH
851*
852* DESCRIPTION
853*	The maximum line number when reading guid file
854*
855* SYNOPSIS
856*/
857#define MAX_GUID_FILE_LINE_LENGTH 120
858/**********/
859
860/****s* OpenSM: Base/VendorOUIs
861* NAME
862*	VendorOUIs
863*
864* DESCRIPTION
865*	Known device vendor ID and GUID OUIs
866*
867* SYNOPSIS
868*/
869#define OSM_VENDOR_ID_INTEL         0x00D0B7
870#define OSM_VENDOR_ID_MELLANOX      0x0002C9
871#define OSM_VENDOR_ID_REDSWITCH     0x000617
872#define OSM_VENDOR_ID_SILVERSTORM   0x00066A
873#define OSM_VENDOR_ID_TOPSPIN       0x0005AD
874#define OSM_VENDOR_ID_FUJITSU       0x00E000
875#define OSM_VENDOR_ID_FUJITSU2      0x000B5D
876#define OSM_VENDOR_ID_VOLTAIRE      0x0008F1
877#define OSM_VENDOR_ID_YOTTAYOTTA    0x000453
878#define OSM_VENDOR_ID_PATHSCALE     0x001175
879#define OSM_VENDOR_ID_IBM           0x000255
880#define OSM_VENDOR_ID_DIVERGENET    0x00084E
881#define OSM_VENDOR_ID_FLEXTRONICS   0x000B8C
882#define OSM_VENDOR_ID_AGILENT       0x0030D3
883#define OSM_VENDOR_ID_OBSIDIAN      0x001777
884#define OSM_VENDOR_ID_BAYMICRO      0x000BC1
885#define OSM_VENDOR_ID_LSILOGIC      0x00A0B8
886#define OSM_VENDOR_ID_DDN           0x0001FF
887#define OSM_VENDOR_ID_PANTA         0x001393
888#define OSM_VENDOR_ID_HP            0x001708
889#define OSM_VENDOR_ID_RIOWORKS      0x005045
890#define OSM_VENDOR_ID_SUN           0x0003BA
891#define OSM_VENDOR_ID_3LEAFNTWKS    0x0016A1
892#define OSM_VENDOR_ID_XSIGO         0x001397
893#define OSM_VENDOR_ID_HP2           0x0018FE
894
895/**********/
896
897END_C_DECLS
898#endif				/* _OSM_BASE_H_ */
899