xref: /titanic_44/usr/src/uts/common/sys/ibpart.h (revision 726fad2a65f16c200a03969c29cb5c86c2d427db)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
23  */
24 
25 #ifndef	_SYS_IBPART_H
26 #define	_SYS_IBPART_H
27 
28 #include <sys/types.h>
29 #include <sys/ib/ib_types.h>
30 #include <sys/dld_ioc.h>
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #define	IBD_CREATE_IBPART	IBPARTIOC(1)
37 #define	IBD_DELETE_IBPART	IBPARTIOC(2)
38 #define	IBD_INFO_IBPART	IBPARTIOC(3)
39 
40 #define	IBD_INFO_CMD_IBPART	1
41 #define	IBD_INFO_CMD_IBPORT	2
42 #define	IBD_INFO_CMD_PKEYTBLSZ	3
43 
44 typedef enum ibd_part_err_e {
45 	IBD_INVALID_PORT_INST = 1,
46 	IBD_PORT_IS_DOWN,
47 	IBD_PKEY_NOT_PRESENT,
48 	IBD_INVALID_PKEY,
49 	IBD_PARTITION_EXISTS,
50 	IBD_NO_HW_RESOURCE,
51 	IBD_INVALID_PKEY_TBL_SIZE
52 } ibd_part_err_t;
53 /*
54  * NOTE: If you change this structure make sure that alignments are correct
55  * for the proper operation of the ioctl in both the 32 and 64 bit modes.
56  */
57 typedef struct ibd_ioctl_s {
58 	int		ioc_info_cmd;
59 	datalink_id_t	ioc_linkid;
60 	int		ioc_port_inst;
61 	uint_t		ioc_portnum;
62 	ib_guid_t	ioc_hcaguid;
63 	ib_guid_t	ioc_portguid;
64 	int		ioc_status;
65 	uint32_t	align1;
66 } ibd_ioctl_t;
67 
68 /*
69  * NOTE: If you change this structure make sure that alignments are correct
70  * for the proper operation of the ioctl in both the 32 and 64 bit modes.
71  */
72 typedef struct ibpart_ioctl_s {
73 	ibd_ioctl_t	ibdioc;
74 	datalink_id_t	ioc_partid;
75 	boolean_t	ioc_force_create;
76 	ib_pkey_t	ioc_pkey;
77 	uint16_t	align1;
78 	uint32_t	align2;
79 } ibpart_ioctl_t;
80 
81 typedef struct ibpart_ioctl_s ibd_create_ioctl_t;
82 typedef struct ibpart_ioctl_s ibd_delete_ioctl_t;
83 
84 typedef struct ibport_ioctl_s {
85 	ibd_ioctl_t	ibdioc;
86 	uint_t		ioc_pkey_tbl_sz;
87 	ib_pkey_t	*ioc_pkeys;
88 } ibport_ioctl_t;
89 
90 #ifdef _SYSCALL32
91 typedef struct ibport_ioctl32_s {
92 	ibd_ioctl_t	ibdioc;
93 	uint_t		ioc_pkey_tbl_sz;
94 	caddr32_t	ioc_pkeys;
95 } ibport_ioctl32_t;
96 #endif
97 
98 #ifdef	__cplusplus
99 }
100 #endif
101 
102 #endif /* _SYS_IBPART_H */
103