xref: /freebsd/contrib/ofed/opensm/include/opensm/osm_sm.h (revision 87181516ef48be852d5e5fee53c6e0dbfc62f21e)
1 /*
2  * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
3  * Copyright (c) 2002-2011 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  * 	Declaration of osm_sm_t.
39  *	This object represents an IBA subnet.
40  *	This object is part of the OpenSM family of objects.
41  */
42 
43 #ifndef _OSM_SM_H_
44 #define _OSM_SM_H_
45 
46 #include <iba/ib_types.h>
47 #include <complib/cl_passivelock.h>
48 #include <complib/cl_event.h>
49 #include <complib/cl_thread.h>
50 #include <complib/cl_dispatcher.h>
51 #include <complib/cl_event_wheel.h>
52 #include <vendor/osm_vendor_api.h>
53 #include <opensm/osm_stats.h>
54 #include <opensm/osm_subnet.h>
55 #include <opensm/osm_vl15intf.h>
56 #include <opensm/osm_mad_pool.h>
57 #include <opensm/osm_log.h>
58 #include <opensm/osm_sm_mad_ctrl.h>
59 #include <opensm/osm_lid_mgr.h>
60 #include <opensm/osm_ucast_mgr.h>
61 #include <opensm/osm_port.h>
62 #include <opensm/osm_db.h>
63 #include <opensm/osm_remote_sm.h>
64 #include <opensm/osm_multicast.h>
65 
66 #ifdef __cplusplus
67 #  define BEGIN_C_DECLS extern "C" {
68 #  define END_C_DECLS   }
69 #else				/* !__cplusplus */
70 #  define BEGIN_C_DECLS
71 #  define END_C_DECLS
72 #endif				/* __cplusplus */
73 
74 BEGIN_C_DECLS
75 /****h* OpenSM/SM
76 * NAME
77 *	SM
78 *
79 * DESCRIPTION
80 *	The SM object encapsulates the information needed by the
81 *	OpenSM to instantiate a subnet manager.  The OpenSM allocates
82 *	one SM object per subnet manager.
83 *
84 *	The SM object is thread safe.
85 *
86 *	This object should be treated as opaque and should
87 *	be manipulated only through the provided functions.
88 *
89 * AUTHOR
90 *	Steve King, Intel
91 *
92 *********/
93 /****s* OpenSM: SM/osm_sm_t
94 * NAME
95 *  osm_sm_t
96 *
97 * DESCRIPTION
98 *  Subnet Manager structure.
99 *
100 *  This object should be treated as opaque and should
101 *  be manipulated only through the provided functions.
102 *
103 * SYNOPSIS
104 */
105 typedef struct osm_sm {
106 	osm_thread_state_t thread_state;
107 	unsigned signal_mask;
108 	cl_spinlock_t signal_lock;
109 	cl_spinlock_t state_lock;
110 	cl_event_t signal_event;
111 	cl_event_t subnet_up_event;
112 	cl_timer_t sweep_timer;
113 	cl_timer_t polling_timer;
114 	cl_event_wheel_t trap_aging_tracker;
115 	cl_thread_t sweeper;
116 	unsigned master_sm_found;
117 	uint32_t retry_number;
118 	ib_net64_t master_sm_guid;
119 	ib_net64_t polling_sm_guid;
120 	osm_subn_t *p_subn;
121 	osm_db_t *p_db;
122 	osm_vendor_t *p_vendor;
123 	osm_log_t *p_log;
124 	osm_mad_pool_t *p_mad_pool;
125 	osm_vl15_t *p_vl15;
126 	cl_dispatcher_t *p_disp;
127 	cl_plock_t *p_lock;
128 	atomic32_t sm_trans_id;
129 	uint16_t mlids_init_max;
130 	unsigned mlids_req_max;
131 	uint8_t *mlids_req;
132 	osm_sm_mad_ctrl_t mad_ctrl;
133 	osm_lid_mgr_t lid_mgr;
134 	osm_ucast_mgr_t ucast_mgr;
135 	cl_disp_reg_handle_t sweep_fail_disp_h;
136 	cl_disp_reg_handle_t ni_disp_h;
137 	cl_disp_reg_handle_t pi_disp_h;
138 	cl_disp_reg_handle_t gi_disp_h;
139 	cl_disp_reg_handle_t nd_disp_h;
140 	cl_disp_reg_handle_t si_disp_h;
141 	cl_disp_reg_handle_t lft_disp_h;
142 	cl_disp_reg_handle_t mft_disp_h;
143 	cl_disp_reg_handle_t sm_info_disp_h;
144 	cl_disp_reg_handle_t trap_disp_h;
145 	cl_disp_reg_handle_t slvl_disp_h;
146 	cl_disp_reg_handle_t vla_disp_h;
147 	cl_disp_reg_handle_t pkey_disp_h;
148 	cl_disp_reg_handle_t mlnx_epi_disp_h;
149 } osm_sm_t;
150 /*
151 * FIELDS
152 *	p_subn
153 *		Pointer to the Subnet object for this subnet.
154 *
155 *	p_db
156 *		Pointer to the database (persistency) object
157 *
158 *	p_vendor
159 *		Pointer to the vendor specific interfaces object.
160 *
161 *	p_log
162 *		Pointer to the log object.
163 *
164 *	p_mad_pool
165 *		Pointer to the MAD pool.
166 *
167 *	p_vl15
168 *		Pointer to the VL15 interface.
169 *
170 *	mad_ctrl
171 *		MAD Controller.
172 *
173 *	p_disp
174 *		Pointer to the Dispatcher.
175 *
176 *	p_lock
177 *		Pointer to the serializing lock.
178 *
179 * SEE ALSO
180 *	SM object
181 *********/
182 
183 /****f* OpenSM: SM/osm_sm_construct
184 * NAME
185 *	osm_sm_construct
186 *
187 * DESCRIPTION
188 *	This function constructs an SM object.
189 *
190 * SYNOPSIS
191 */
192 void osm_sm_construct(IN osm_sm_t * p_sm);
193 /*
194 * PARAMETERS
195 *	p_sm
196 *		[in] Pointer to a SM object to construct.
197 *
198 * RETURN VALUE
199 *	This function does not return a value.
200 *
201 * NOTES
202 *	Allows calling osm_sm_init, osm_sm_destroy
203 *
204 *	Calling osm_sm_construct is a prerequisite to calling any other
205 *	method except osm_sm_init.
206 *
207 * SEE ALSO
208 *	SM object, osm_sm_init, osm_sm_destroy
209 *********/
210 
211 /****f* OpenSM: SM/osm_sm_shutdown
212 * NAME
213 *	osm_sm_shutdown
214 *
215 * DESCRIPTION
216 *	The osm_sm_shutdown function shutdowns an SM, stopping the sweeper
217 *	and unregistering all messages from the dispatcher
218 *
219 * SYNOPSIS
220 */
221 void osm_sm_shutdown(IN osm_sm_t * p_sm);
222 /*
223 * PARAMETERS
224 *	p_sm
225 *		[in] Pointer to a SM object to shutdown.
226 *
227 * RETURN VALUE
228 *	This function does not return a value.
229 *
230 * SEE ALSO
231 *	SM object, osm_sm_construct, osm_sm_init
232 *********/
233 
234 /****f* OpenSM: SM/osm_sm_destroy
235 * NAME
236 *	osm_sm_destroy
237 *
238 * DESCRIPTION
239 *	The osm_sm_destroy function destroys an SM, releasing
240 *	all resources.
241 *
242 * SYNOPSIS
243 */
244 void osm_sm_destroy(IN osm_sm_t * p_sm);
245 /*
246 * PARAMETERS
247 *	p_sm
248 *		[in] Pointer to a SM object to destroy.
249 *
250 * RETURN VALUE
251 *	This function does not return a value.
252 *
253 * NOTES
254 *	Performs any necessary cleanup of the specified SM object.
255 *	Further operations should not be attempted on the destroyed object.
256 *	This function should only be called after a call to osm_sm_construct or
257 *	osm_sm_init.
258 *
259 * SEE ALSO
260 *	SM object, osm_sm_construct, osm_sm_init
261 *********/
262 
263 /****f* OpenSM: SM/osm_sm_init
264 * NAME
265 *	osm_sm_init
266 *
267 * DESCRIPTION
268 *	The osm_sm_init function initializes a SM object for use.
269 *
270 * SYNOPSIS
271 */
272 ib_api_status_t osm_sm_init(IN osm_sm_t * p_sm, IN osm_subn_t * p_subn,
273 			    IN osm_db_t * p_db, IN osm_vendor_t * p_vendor,
274 			    IN osm_mad_pool_t * p_mad_pool,
275 			    IN osm_vl15_t * p_vl15, IN osm_log_t * p_log,
276 			    IN osm_stats_t * p_stats,
277 			    IN cl_dispatcher_t * p_disp, IN cl_plock_t * p_lock);
278 /*
279 * PARAMETERS
280 *	p_sm
281 *		[in] Pointer to an osm_sm_t object to initialize.
282 *
283 *	p_subn
284 *		[in] Pointer to the Subnet object for this subnet.
285 *
286 *	p_vendor
287 *		[in] Pointer to the vendor specific interfaces object.
288 *
289 *	p_mad_pool
290 *		[in] Pointer to the MAD pool.
291 *
292 *	p_vl15
293 *		[in] Pointer to the VL15 interface.
294 *
295 *	p_log
296 *		[in] Pointer to the log object.
297 *
298 *	p_stats
299 *		[in] Pointer to the statistics object.
300 *
301 *	p_disp
302 *		[in] Pointer to the OpenSM central Dispatcher.
303 *
304 *	p_lock
305 *		[in] Pointer to the OpenSM serializing lock.
306 *
307 * RETURN VALUES
308 *	IB_SUCCESS if the SM object was initialized successfully.
309 *
310 * NOTES
311 *	Allows calling other SM methods.
312 *
313 * SEE ALSO
314 *	SM object, osm_sm_construct, osm_sm_destroy
315 *********/
316 
317 /****f* OpenSM: SM/osm_sm_signal
318 * NAME
319 *	osm_sm_signal
320 *
321 * DESCRIPTION
322 *	Signal event to SM
323 *
324 * SYNOPSIS
325 */
326 void osm_sm_signal(IN osm_sm_t * p_sm, osm_signal_t signal);
327 /*
328 * PARAMETERS
329 *	p_sm
330 *		[in] Pointer to an osm_sm_t object.
331 *
332 *	signal
333 *		[in] sm signal number.
334 *
335 * NOTES
336 *
337 * SEE ALSO
338 *	SM object
339 *********/
340 
341 /****f* OpenSM: SM/osm_sm_sweep
342 * NAME
343 *	osm_sm_sweep
344 *
345 * DESCRIPTION
346 *	Initiates a subnet sweep.
347 *
348 * SYNOPSIS
349 */
350 void osm_sm_sweep(IN osm_sm_t * p_sm);
351 /*
352 * PARAMETERS
353 *	p_sm
354 *		[in] Pointer to an osm_sm_t object.
355 *
356 * RETURN VALUES
357 *	IB_SUCCESS if the sweep completed successfully.
358 *
359 * NOTES
360 *
361 * SEE ALSO
362 *	SM object
363 *********/
364 
365 /****f* OpenSM: SM/osm_sm_bind
366 * NAME
367 *	osm_sm_bind
368 *
369 * DESCRIPTION
370 *	Binds the sm object to a port guid.
371 *
372 * SYNOPSIS
373 */
374 ib_api_status_t osm_sm_bind(IN osm_sm_t * p_sm, IN ib_net64_t port_guid);
375 /*
376 * PARAMETERS
377 *	p_sm
378 *		[in] Pointer to an osm_sm_t object to bind.
379 *
380 *	port_guid
381 *		[in] Local port GUID with which to bind.
382 *
383 *
384 * RETURN VALUES
385 *	None
386 *
387 * NOTES
388 *	A given SM object can only be bound to one port at a time.
389 *
390 * SEE ALSO
391 *********/
392 
393 /****f* OpenSM: SM/osm_req_get
394 * NAME
395 *	osm_req_get
396 *
397 * DESCRIPTION
398 *	Starts the process to transmit a directed route request for
399 *	the attribute.
400 *
401 * SYNOPSIS
402 */
403 ib_api_status_t osm_req_get(IN osm_sm_t * sm, IN const osm_dr_path_t * p_path,
404 			    IN ib_net16_t attr_id, IN ib_net32_t attr_mod,
405 			    IN boolean_t find_mkey, ib_net64_t m_key,
406 			    IN cl_disp_msgid_t err_msg,
407 			    IN const osm_madw_context_t * p_context);
408 /*
409 * PARAMETERS
410 *	sm
411 *		[in] Pointer to an osm_sm_t object.
412 *
413 *	p_path
414 *		[in] Pointer to the directed route path to the node
415 *		from which to retrieve the attribute.
416 *
417 *	attr_id
418 *		[in] Attribute ID to request.
419 *
420 *	attr_mod
421 *		[in] Attribute modifier for this request.
422 *
423 *	find_mkey
424 *		[in] Flag to indicate whether the M_Key should be looked up for
425 *		     this MAD.
426 * 	m_key
427 * 		[in] M_Key value to be send with this MAD. Applied, only when
428 * 		     find_mkey is FALSE.
429 *
430 *	err_msg
431 *		[in] Message id with which to post this MAD if an error occurs.
432 *
433 *	p_context
434 *		[in] Mad wrapper context structure to be copied into the wrapper
435 *		context, and thus visible to the recipient of the response.
436 *
437 * RETURN VALUES
438 *	IB_SUCCESS if the request was successful.
439 *
440 * NOTES
441 *	This function asynchronously requests the specified attribute.
442 *	The response from the node will be routed through the Dispatcher
443 *	to the appropriate receive controller object.
444 *********/
445 
446 /****f* OpenSM: SM/osm_send_req_mad
447 * NAME
448 *       osm_send_req_mad
449 *
450 * DESCRIPTION
451 *	Starts the process to transmit a preallocated/predefined directed route
452 *	Set() request.
453 *
454 * SYNOPSIS
455 */
456 void osm_send_req_mad(IN osm_sm_t * sm, IN osm_madw_t *p_madw);
457 /*
458 * PARAMETERS
459 *	sm
460 *		[in] Pointer to an osm_sm_t object.
461 *	p_madw
462 *		[in] Pointer to a preallocated MAD buffer
463 *
464 *********/
465 
466 /***f* OpenSM: SM/osm_prepare_req_set
467 * NAME
468 *	osm_prepare_req_set
469 *
470 * DESCRIPTION
471 *	Preallocate and fill a directed route Set() MAD w/o sending it.
472 *
473 * SYNOPSIS
474 */
475 osm_madw_t *osm_prepare_req_set(IN osm_sm_t * sm, IN const osm_dr_path_t * p_path,
476 				IN const uint8_t * p_payload,
477 				IN size_t payload_size, IN ib_net16_t attr_id,
478 				IN ib_net32_t attr_mod, IN boolean_t find_mkey,
479 				IN ib_net64_t m_key, IN cl_disp_msgid_t err_msg,
480 				IN const osm_madw_context_t * p_context);
481 /*
482 * PARAMETERS
483 *	sm
484 *		[in] Pointer to an osm_sm_t object.
485 *
486 *	p_path
487 *		[in] Pointer to the directed route path of the recipient.
488 *
489 *	p_payload
490 *		[in] Pointer to the SMP payload to send.
491 *
492 *	payload_size
493 *		[in] The size of the payload to be copied to the SMP data field.
494 *
495 *	attr_id
496 *		[in] Attribute ID to request.
497 *
498 *	attr_mod
499 *		[in] Attribute modifier for this request.
500 *
501 *	find_mkey
502 *		[in] Flag to indicate whether the M_Key should be looked up for
503 *		     this MAD.
504 * 	m_key
505 * 		[in] M_Key value to be send with this MAD. Applied, only when
506 * 		     find_mkey is FALSE.
507 *
508 *	err_msg
509 *		[in] Message id with which to post this MAD if an error occurs.
510 *
511 *	p_context
512 *		[in] Mad wrapper context structure to be copied into the wrapper
513 *		     context, and thus visible to the recipient of the response.
514 *
515 * RETURN VALUES
516 *	Pointer the MAD buffer in case of success and NULL in case of failure.
517 *
518 *********/
519 
520 /****f* OpenSM: SM/osm_req_set
521 * NAME
522 *	osm_req_set
523 *
524 * DESCRIPTION
525 *	Starts the process to transmit a directed route Set() request.
526 *
527 * SYNOPSIS
528 */
529 ib_api_status_t osm_req_set(IN osm_sm_t * sm, IN const osm_dr_path_t * p_path,
530 			    IN const uint8_t * p_payload,
531 			    IN size_t payload_size, IN ib_net16_t attr_id,
532 			    IN ib_net32_t attr_mod, IN boolean_t find_mkey,
533 			    IN ib_net64_t m_key, IN cl_disp_msgid_t err_msg,
534 			    IN const osm_madw_context_t * p_context);
535 /*
536 * PARAMETERS
537 *	sm
538 *		[in] Pointer to an osm_sm_t object.
539 *
540 *	p_path
541 *		[in] Pointer to the directed route path of the recipient.
542 *
543 *	p_payload
544 *		[in] Pointer to the SMP payload to send.
545 *
546 *	payload_size
547 *		[in] The size of the payload to be copied to the SMP data field.
548 *
549 *	attr_id
550 *		[in] Attribute ID to request.
551 *
552 *	attr_mod
553 *		[in] Attribute modifier for this request.
554 *
555 *	find_mkey
556 *		[in] Flag to indicate whether the M_Key should be looked up for
557 *		     this MAD.
558 *
559 * 	m_key
560 * 		[in] M_Key value to be send with this MAD. Applied, only when
561 * 		     find_mkey is FALSE.
562 *
563 *	err_msg
564 *		[in] Message id with which to post this MAD if an error occurs.
565 *
566 *	p_context
567 *		[in] Mad wrapper context structure to be copied into the wrapper
568 *		context, and thus visible to the recipient of the response.
569 *
570 * RETURN VALUES
571 *	IB_SUCCESS if the request was successful.
572 *
573 * NOTES
574 *	This function asynchronously requests the specified attribute.
575 *	The response from the node will be routed through the Dispatcher
576 *	to the appropriate receive controller object.
577 *********/
578 /****f* OpenSM: SM/osm_resp_send
579 * NAME
580 *	osm_resp_send
581 *
582 * DESCRIPTION
583 *	Starts the process to transmit a directed route response.
584 *
585 * SYNOPSIS
586 */
587 ib_api_status_t osm_resp_send(IN osm_sm_t * sm,
588 			      IN const osm_madw_t * p_req_madw,
589 			      IN ib_net16_t status,
590 			      IN const uint8_t * p_payload);
591 /*
592 * PARAMETERS
593 *	p_resp
594 *		[in] Pointer to an osm_resp_t object.
595 *
596 *	p_madw
597 *		[in] Pointer to the MAD Wrapper object for the requesting MAD
598 *		to which this response is generated.
599 *
600 *	status
601 *		[in] Status for this response.
602 *
603 *	p_payload
604 *		[in] Pointer to the payload of the response MAD.
605 *
606 * RETURN VALUES
607 *	IB_SUCCESS if the response was successful.
608 *
609 *********/
610 
611 /****f* OpenSM: SM/osm_sm_reroute_mlid
612 * NAME
613 *	osm_sm_reroute_mlid
614 *
615 * DESCRIPTION
616 *	Requests (schedules) MLID rerouting
617 *
618 * SYNOPSIS
619 */
620 void osm_sm_reroute_mlid(osm_sm_t * sm, ib_net16_t mlid);
621 
622 /*
623 * PARAMETERS
624 *	sm
625 *		[in] Pointer to an osm_sm_t object.
626 *
627 *	mlid
628 *		[in] MLID value
629 *
630 * RETURN VALUES
631 *	None
632 *
633 * NOTES
634 *
635 * SEE ALSO
636 *********/
637 
638 /****f* OpenSM: OpenSM/osm_sm_wait_for_subnet_up
639 * NAME
640 *	osm_sm_wait_for_subnet_up
641 *
642 * DESCRIPTION
643 *	Blocks the calling thread until the subnet is up.
644 *
645 * SYNOPSIS
646 */
osm_sm_wait_for_subnet_up(IN osm_sm_t * p_sm,IN uint32_t wait_us,IN boolean_t interruptible)647 static inline cl_status_t osm_sm_wait_for_subnet_up(IN osm_sm_t * p_sm,
648 						    IN uint32_t wait_us,
649 						    IN boolean_t interruptible)
650 {
651 	return cl_event_wait_on(&p_sm->subnet_up_event, wait_us, interruptible);
652 }
653 
654 /*
655 * PARAMETERS
656 *	p_sm
657 *		[in] Pointer to an osm_sm_t object.
658 *
659 *	wait_us
660 *		[in] Number of microseconds to wait.
661 *
662 *	interruptible
663 *		[in] Indicates whether the wait operation can be interrupted
664 *		by external signals.
665 *
666 * RETURN VALUES
667 *	CL_SUCCESS if the wait operation succeeded in response to the event
668 *	being set.
669 *
670 *	CL_TIMEOUT if the specified time period elapses.
671 *
672 *	CL_NOT_DONE if the wait was interrupted by an external signal.
673 *
674 *	CL_ERROR if the wait operation failed.
675 *
676 * NOTES
677 *
678 * SEE ALSO
679 *********/
680 
681 /****f* OpenSM: State Manager/osm_sm_is_greater_than
682 * NAME
683 *	osm_sm_is_greater_than
684 *
685 * DESCRIPTION
686 *	Compares two SM's (14.4.1.2)
687 *
688 * SYNOPSIS
689 */
osm_sm_is_greater_than(IN uint8_t l_priority,IN ib_net64_t l_guid,IN uint8_t r_priority,IN ib_net64_t r_guid)690 static inline boolean_t osm_sm_is_greater_than(IN uint8_t l_priority,
691 					       IN ib_net64_t l_guid,
692 					       IN uint8_t r_priority,
693 					       IN ib_net64_t r_guid)
694 {
695 	return (l_priority > r_priority
696 		|| (l_priority == r_priority
697 		    && cl_ntoh64(l_guid) < cl_ntoh64(r_guid)));
698 }
699 
700 /*
701 * PARAMETERS
702 *	l_priority
703 *		[in] Priority of the SM on the "left"
704 *
705 *	l_guid
706 *		[in] GUID of the SM on the "left"
707 *
708 *	r_priority
709 *		[in] Priority of the SM on the "right"
710 *
711 *	r_guid
712 *		[in] GUID of the SM on the "right"
713 *
714 * RETURN VALUES
715 *	Return TRUE if an sm with l_priority and l_guid is higher than an sm
716 *	with r_priority and r_guid, return FALSE otherwise.
717 *
718 * NOTES
719 *
720 * SEE ALSO
721 *	State Manager
722 *********/
723 
724 /****f* OpenSM: SM State Manager/osm_sm_state_mgr_process
725 * NAME
726 *	osm_sm_state_mgr_process
727 *
728 * DESCRIPTION
729 *	Processes and maintains the states of the SM.
730 *
731 * SYNOPSIS
732 */
733 ib_api_status_t osm_sm_state_mgr_process(IN osm_sm_t *sm,
734 					 IN osm_sm_signal_t signal);
735 /*
736 * PARAMETERS
737 *	sm
738 *		[in] Pointer to an osm_sm_t object.
739 *
740 *	signal
741 *		[in] Signal to the state SM engine.
742 *
743 * RETURN VALUES
744 *	None.
745 *
746 * NOTES
747 *
748 * SEE ALSO
749 *	State Manager
750 *********/
751 
752 /****f* OpenSM: SM State Manager/osm_sm_state_mgr_signal_master_is_alive
753 * NAME
754 *	osm_sm_state_mgr_signal_master_is_alive
755 *
756 * DESCRIPTION
757 *	Signals that the remote Master SM is alive.
758 *	Need to clear the retry_number variable.
759 *
760 * SYNOPSIS
761 */
762 void osm_sm_state_mgr_signal_master_is_alive(IN osm_sm_t *sm);
763 /*
764 * PARAMETERS
765 *	sm
766 *		[in] Pointer to an osm_sm_t object.
767 *
768 * RETURN VALUES
769 *	None.
770 *
771 * NOTES
772 *
773 * SEE ALSO
774 *	State Manager
775 *********/
776 
777 /****f* OpenSM: SM State Manager/osm_sm_state_mgr_check_legality
778 * NAME
779 *	osm_sm_state_mgr_check_legality
780 *
781 * DESCRIPTION
782 *	Checks the legality of the signal received, according to the
783 *  current state of the SM state machine.
784 *
785 * SYNOPSIS
786 */
787 ib_api_status_t osm_sm_state_mgr_check_legality(IN osm_sm_t *sm,
788 						IN osm_sm_signal_t signal);
789 /*
790 * PARAMETERS
791 *	sm
792 *		[in] Pointer to an osm_sm_t object.
793 *
794 *	signal
795 *		[in] Signal to the state SM engine.
796 *
797 * RETURN VALUES
798 *	None.
799 *
800 * NOTES
801 *
802 * SEE ALSO
803 *	State Manager
804 *********/
805 
806 void osm_report_sm_state(osm_sm_t *sm);
807 
808 /****f* OpenSM: SM State Manager/osm_send_trap144
809 * NAME
810 *	osm_send_trap144
811 *
812 * DESCRIPTION
813 *	Send trap 144 to the master SM.
814 *
815 * SYNOPSIS
816 */
817 int osm_send_trap144(osm_sm_t *sm, ib_net16_t local);
818 /*
819 * PARAMETERS
820 *	sm
821 *		[in] Pointer to an osm_sm_t object.
822 *
823 *	local
824 *		[in] OtherLocalChanges mask in network byte order.
825 *
826 * RETURN VALUES
827 *	0 on success, non-zero value otherwise.
828 *
829 *********/
830 
831 void osm_set_sm_priority(osm_sm_t *sm, uint8_t priority);
832 
833 END_C_DECLS
834 #endif				/* _OSM_SM_H_ */
835