xref: /onnv-gate/usr/src/uts/common/sys/dktp/gda.h (revision 7563:84ec90ffc3f7)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7563SPrasad.Singamsetty@Sun.COM  * Common Development and Distribution License (the "License").
6*7563SPrasad.Singamsetty@Sun.COM  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
21*7563SPrasad.Singamsetty@Sun.COM 
220Sstevel@tonic-gate /*
23*7563SPrasad.Singamsetty@Sun.COM  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef _SYS_DKTP_GDA_H
280Sstevel@tonic-gate #define	_SYS_DKTP_GDA_H
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #ifdef	__cplusplus
310Sstevel@tonic-gate extern "C" {
320Sstevel@tonic-gate #endif
330Sstevel@tonic-gate 
340Sstevel@tonic-gate #define	GDA_RTYCNT	3
350Sstevel@tonic-gate 
360Sstevel@tonic-gate #define	GDA_BP_PKT(bp)	((struct cmpkt *)(bp)->av_back)
370Sstevel@tonic-gate 
380Sstevel@tonic-gate #ifdef  _KERNEL
390Sstevel@tonic-gate 
400Sstevel@tonic-gate extern void 	gda_inqfill(char *p, int l, char *s);
410Sstevel@tonic-gate /*PRINTFLIKE4*/
420Sstevel@tonic-gate extern void	gda_log(dev_info_t *, char *, uint_t, const char *, ...)
430Sstevel@tonic-gate 	__KPRINTFLIKE(4);
440Sstevel@tonic-gate extern void	gda_errmsg(struct scsi_device *, struct cmpkt *, char *,
45*7563SPrasad.Singamsetty@Sun.COM 			int, daddr_t, daddr_t, char **, char **);
460Sstevel@tonic-gate extern struct 	cmpkt *gda_pktprep(opaque_t objp, struct cmpkt *in_pktp,
470Sstevel@tonic-gate 			opaque_t dmatoken, int (*func)(caddr_t), caddr_t arg);
480Sstevel@tonic-gate extern void	gda_free(opaque_t objp, struct cmpkt *pktp, struct buf *bp);
490Sstevel@tonic-gate 
500Sstevel@tonic-gate #endif  /* _KERNEL */
510Sstevel@tonic-gate 
520Sstevel@tonic-gate #define	GDA_GETGEOM_HEAD(X) (((X) >> 16) & 0xff)
530Sstevel@tonic-gate #define	GDA_GETGEOM_SEC(X)  ((X) & 0xff)
540Sstevel@tonic-gate #define	GDA_SETGEOM(hd, sec) (((hd) << 16) | (sec))
550Sstevel@tonic-gate 
560Sstevel@tonic-gate #define	GDA_KMFLAG(callback) (((callback) == DDI_DMA_SLEEP) ? \
570Sstevel@tonic-gate 				KM_SLEEP: KM_NOSLEEP)
580Sstevel@tonic-gate 
590Sstevel@tonic-gate #define	GDA_ALL			0
600Sstevel@tonic-gate #define	GDA_UNKNOWN		1
610Sstevel@tonic-gate #define	GDA_INFORMATIONAL	2
620Sstevel@tonic-gate #define	GDA_RECOVERED		3
630Sstevel@tonic-gate #define	GDA_RETRYABLE		4
640Sstevel@tonic-gate #define	GDA_FATAL		5
650Sstevel@tonic-gate 
660Sstevel@tonic-gate #ifdef	__cplusplus
670Sstevel@tonic-gate }
680Sstevel@tonic-gate #endif
690Sstevel@tonic-gate 
700Sstevel@tonic-gate #endif	/* _SYS_DKTP_GDA_H */
71