xref: /titanic_41/usr/src/uts/common/sys/scsi/scsi_watch.h (revision 8eea8e29cc4374d1ee24c25a07f45af132db3499)
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-1998 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef	_SYS_SCSI_SCSI_WATCH_H
28 #define	_SYS_SCSI_SCSI_WATCH_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 struct scsi_watch_result {
37 	struct scsi_status		*statusp;
38 	struct scsi_extended_sense	*sensep;
39 	uchar_t				actual_sense_length;
40 	struct scsi_pkt			*pkt;
41 };
42 
43 /*
44  * 120 seconds is a *very* reasonable amount of time for most slow devices
45  */
46 #define	SCSI_WATCH_IO_TIME	120
47 
48 /*
49  * values to pass in "flags" arg for scsi_watch_request_terminate()
50  */
51 #define	SCSI_WATCH_TERMINATE_WAIT	0x0
52 #define	SCSI_WATCH_TERMINATE_NOWAIT	0x1
53 
54 #define	SCSI_WATCH_TERMINATE_SUCCESS	0x0
55 #define	SCSI_WATCH_TERMINATE_FAIL	0x1
56 
57 void scsi_watch_init();
58 void scsi_watch_fini();
59 
60 #ifdef	__STDC__
61 
62 opaque_t scsi_watch_request_submit(struct scsi_device *devp,
63     int interval, int sense_length, int (*callback)(), caddr_t cb_arg);
64 int scsi_watch_request_terminate(opaque_t token, int flags);
65 void scsi_watch_resume(opaque_t token);
66 void scsi_watch_suspend(opaque_t token);
67 
68 #else	/* __STDC__ */
69 
70 opaque_t scsi_watch_request_submit();
71 void scsi_watch_request_terminate();
72 void scsi_watch_resume();
73 void scsi_watch_suspend();
74 
75 #endif	/* __STDC__ */
76 
77 #ifdef	__cplusplus
78 }
79 #endif
80 
81 #endif	/* _SYS_SCSI_SCSI_WATCH_H */
82