9815 Want basic AHCI enclosure services
[unleashed.git] / usr / src / uts / common / sys / suntpi.h
blobfc96b7563854a68ba223cfedf77faa2b57a023e3
1 /*
2 * CDDL HEADER START
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.
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.
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]
20 * CDDL HEADER END
23 * Copyright (c) 1990-1998 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #ifndef _SYS_SUNTPI_H
28 #define _SYS_SUNTPI_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <sys/types.h>
33 #include <sys/ksynch.h>
34 #include <sys/stream.h>
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
40 #ifdef _KERNEL
43 * Persistent information about the capabilities of transport providers.
44 * This structure is for the internal use of sockfs and timod. Because
45 * bitfield operations are not atomic, the lock must be used to avoid
46 * inconsistencies.
48 typedef struct tpi_provinfo {
49 struct tpi_provinfo *tpi_next;
50 void *tpi_key;
51 size_t tpi_keylen;
52 kmutex_t tpi_lock;
53 uint32_t tpi_capability : 2,
54 tpi_myname : 2,
55 tpi_peername : 2,
56 _tpi_unused : 26;
57 } tpi_provinfo_t;
60 * Possible values for the above 2-bitfields. A capability is either
61 * supported, unsupported or unknown.
63 #define PI_DONTKNOW 0
64 #define PI_NO 1
65 #define PI_YES 2
67 extern void tpi_init(void);
68 extern tpi_provinfo_t *tpi_findprov(queue_t *);
70 #define PI_PROVLOCK(tp) mutex_enter(&(tp)->tpi_lock)
71 #define PI_PROVUNLOCK(tp) mutex_exit(&(tp)->tpi_lock)
73 extern mblk_t *tpi_ack_alloc(mblk_t *, size_t, uchar_t, t_scalar_t);
75 #endif /* _KERNEL */
77 #ifdef __cplusplus
79 #endif
81 #endif /* _SYS_SUNTPI_H */