1700 Add SCSI UNMAP support
[unleashed.git] / usr / src / uts / common / sys / ctfs.h
blobb46a517f2c01080082bfd9717fe19ad361da6b96
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _SYS_CTFS_H
27 #define _SYS_CTFS_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include <sys/contract.h>
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
38 * Location of the contract filesystem.
40 #define CTFS_ROOT "/system/contract"
43 * CTFS ioctl constants
45 #define CTFS_PREFIX ('c' << 24 | 't' << 16)
46 #define CTFS_IOC(x, y) (CTFS_PREFIX | (x) << 8 | (y))
49 * Control codes for messages written to template files.
51 #define CTFS_TMPL(x) CTFS_IOC('t', x)
52 #define CT_TACTIVATE CTFS_TMPL(0) /* Activate template */
53 #define CT_TCLEAR CTFS_TMPL(1) /* Clear active template */
54 #define CT_TCREATE CTFS_TMPL(2) /* Create contract from template */
55 #define CT_TSET CTFS_TMPL(3) /* Set parameter */
56 #define CT_TGET CTFS_TMPL(4) /* Get parameter */
59 * Control codes for messages written to ctl files.
61 #define CTFS_CTL(x) CTFS_IOC('c', x)
62 #define CT_CABANDON CTFS_CTL(0) /* Abandon contract */
63 #define CT_CACK CTFS_CTL(1) /* Ack a message */
64 #define CT_CQREQ CTFS_CTL(2) /* Request an additional quantum */
65 #define CT_CADOPT CTFS_CTL(3) /* Adopt a contract */
66 #define CT_CNEWCT CTFS_CTL(4) /* Define new contract */
67 #define CT_CNACK CTFS_CTL(5) /* nack a negotiation */
70 * Control codes for messages written to status files.
72 #define CTFS_STAT(x) CTFS_IOC('s', x)
73 #define CT_SSTATUS CTFS_STAT(0) /* Obtain contract status */
76 * Control codes for messages written to event endpoints.
78 #define CTFS_EVT(x) CTFS_IOC('e', x)
79 #define CT_ERESET CTFS_EVT(0) /* Reset event queue pointer */
80 #define CT_ERECV CTFS_EVT(1) /* Read next event */
81 #define CT_ECRECV CTFS_EVT(2) /* Read next critical event */
82 #define CT_ENEXT CTFS_EVT(3) /* Skip current event */
83 #define CT_ERELIABLE CTFS_EVT(4) /* Request reliable event receipt */
85 #ifdef __cplusplus
87 #endif
89 #endif /* _SYS_CTFS_H */