xref: /titanic_44/usr/src/uts/sun4v/sys/dr_io.h (revision a60349c89adffc0902b2353230891d8e7f2b24d9)
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 /*
23  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _DR_IO_H
28 #define	_DR_IO_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * VIO DR Control Protocol
34  */
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /*
41  * Values of 'msg_type' element of the request message
42  */
43 #define	DR_VIO_CONFIGURE	0x494f43	/* 'IOC' */
44 #define	DR_VIO_UNCONFIGURE	0x494f55	/* 'IOU' */
45 #define	DR_VIO_FORCE_UNCONFIG	0x494f46	/* 'IOF' */
46 #define	DR_VIO_STATUS		0x494f53	/* 'IOS' */
47 
48 /*
49  * VIO DR Request
50  */
51 typedef struct {
52 	uint64_t	req_num;
53 	uint64_t	dev_id;
54 	uint32_t	msg_type;
55 	char		name[1];
56 } dr_vio_req_t;
57 
58 /*
59  * Values of 'result' element of the response message
60  */
61 #define	DR_VIO_RES_OK			0x0
62 #define	DR_VIO_RES_FAILURE		0x1
63 #define	DR_VIO_RES_BLOCKED		0x2
64 #define	DR_VIO_RES_NOT_IN_MD		0x3
65 
66 /*
67  * Values of 'status' element of the response message
68  */
69 #define	DR_VIO_STAT_NOT_PRESENT		0x0
70 #define	DR_VIO_STAT_UNCONFIGURED	0x1
71 #define	DR_VIO_STAT_CONFIGURED		0x2
72 
73 /*
74  * VIO DR Response
75  */
76 typedef struct {
77 	uint64_t	req_num;
78 	uint32_t	result;
79 	uint32_t	status;
80 	char		reason[1];
81 } dr_vio_res_t;
82 
83 #define	DR_VIO_DS_ID		"dr-vio"
84 #define	DR_VIO_MAXREASONLEN	1024
85 
86 #ifdef __cplusplus
87 }
88 #endif
89 
90 #endif /* _DR_IO_H */
91