xref: /illumos-gate/usr/src/uts/common/sys/ib/mgt/ibmf/ibmf_saa_utils.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_IB_MGT_IBMF_IBMF_SAA_UTILS_H
28 #define	_SYS_IB_MGT_IBMF_IBMF_SAA_UTILS_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #include <sys/ib/mgt/sa_recs.h>
37 
38 /*
39  * The defines, sizes, and functions used in ibmf_saa_utils.h are currently
40  * based on version 1.1 of the IB spec.  With each iteration of the
41  * spec this file and ibmf_saa_utils.c must be updated.
42  */
43 int
44 ibmf_saa_utils_pack_sa_hdr(ib_sa_hdr_t *sa_hdr, void **packed_class_hdr,
45     size_t *packed_class_hdr_len, int km_sleep_flag);
46 
47 int
48 ibmf_saa_utils_unpack_sa_hdr(void *packed_class_hdr,
49     size_t packed_class_hdr_len, ib_sa_hdr_t **sa_hdr, int km_sleep_flag);
50 
51 int
52 ibmf_saa_utils_unpack_payload(uchar_t *buf_payload, size_t buf_payload_length,
53     uint16_t attr_id, void **structs_payloadp, size_t *structs_payload_lengthp,
54     uint16_t attr_offset, boolean_t is_get_resp, int km_sleep_flag);
55 
56 int
57 ibmf_saa_utils_pack_payload(uchar_t *structs_payload, size_t
58     structs_payload_length, uint16_t attr_id, void **buf_payloadp,
59     size_t *buf_payload_lengthp, int km_sleep_flag);
60 
61 void
62 ibmf_saa_gid_trap_parse_buffer(uchar_t *buffer, sm_trap_64_t *sm_trap_64);
63 
64 void
65 ibmf_saa_capmask_chg_trap_parse_buffer(uchar_t *buffer,
66     sm_trap_144_t *sm_trap_144);
67 
68 void
69 ibmf_saa_sysimg_guid_chg_trap_parse_buffer(uchar_t *buffer,
70     sm_trap_145_t *sm_trap_145);
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif	/* _SYS_IB_MGT_IBMF_IBMF_SAA_UTILS_H */
77