xref: /illumos-gate/usr/src/uts/sun/sys/dada/dada_resource.h (revision e5803b76927480e8f9b67b22201c484ccf4c2bcf)
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 (c) 1996, by Sun Microsystem, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef	_SYS_DADA_DADA_RESOURCE_H
28 #define	_SYS_DADA_DADA_RESOURCE_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/dada/dada_types.h>
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 /*
39  * DCD Resource Function Declarations
40  */
41 
42 /*
43  * Defines for stating preferences in resource allocation
44  */
45 
46 #define	NULL_FUNC	((int (*)())0)
47 #define	SLEEP_FUNC	((int (*)())1)
48 
49 #ifdef _KERNEL
50 /*
51  * defines for the flags to scsi_init_pkt()
52  */
53 #define	PKT_CONSISTENT		0x0001	/* This is an 'iopb' packet */
54 #define	PKT_DMA_PARTIAL		0x040000 /* Partial xfer Ok */
55 
56 
57 /*
58  * Old PKT_CONSITENT value for binary compatibility with x86 2.1
59  */
60 #define	PKT_CONSISTENT_OLD		0x001000
61 
62 /*
63  * Kernel function declarations
64  */
65 
66 #ifdef	__STDC__
67 extern struct buf *dcd_alloc_consistent_buf(struct dcd_address *,
68 	struct buf *, size_t, uint_t, int (*)(caddr_t), caddr_t);
69 
70 extern struct dcd_pkt *dcd_init_pkt(struct dcd_address *,
71 	struct dcd_pkt *, struct buf *, int, int, int, int,
72 	int (*)(caddr_t), caddr_t);
73 
74 extern void dcd_destroy_pkt(struct dcd_pkt *);
75 
76 extern void dcd_free_consistent_buf(struct buf *);
77 
78 extern struct dcd_pkt *dcd_resalloc(struct dcd_address *, int,
79 	int, ataopaque_t, int (*)());
80 
81 extern struct dcd_pkt *dcd_pktalloc(struct dcd_address *, int, int,
82 	int (*)());
83 
84 extern void dcd_dmafree(struct dcd_pkt *);
85 
86 extern void dcd_sync_pkt(struct dcd_pkt *);
87 extern void dcd_resfree(struct dcd_pkt *);
88 
89 #else	/* __STDC__ */
90 extern struct dcd_pkt *dcd_init_pkt();
91 extern void dcd_destroy_pkt();
92 extern struct buf *dcd_alloc_consistent_buf();
93 extern void	dcd_free_consistent_buf();
94 extern struct dcd_pkt *dcd_resalloc();
95 extern struct dcd_pkt *dcd_pktalloc();
96 extren struct dcd_pkt dcd_dmaget();
97 extern void  	dcd_resfree();
98 extern void	dcd_dmafree();
99 extern void	dcd_sync_pkt();
100 #endif	/* __STDC__ */
101 
102 #endif	/* _KERNEL */
103 
104 #ifdef	__cplusplus
105 }
106 #endif
107 
108 #endif	/* _SYS_DADA_DADA_RESOURCE_H */
109