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 (the "License").
6 * You may not use this file except in compliance with the License.
7 *
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.
12 *
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]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23 * Use is subject to license terms.
24 */
25
26#ifndef	_SYS_SCSI_SCSI_CTL_H
27#define	_SYS_SCSI_SCSI_CTL_H
28
29#include <sys/scsi/scsi_types.h>
30
31#ifdef	__cplusplus
32extern "C" {
33#endif
34
35/*
36 * SCSI Control Information
37 *
38 * Defines for stating level of reset.
39 * RESET_ALL, RESET_TARGET, and RESET_LUN defined for tran_reset (invoked
40 * by target/ioctl)
41 * RESET_BUS defined for tran_bus_reset (invoked by ioctl)
42 */
43#define	RESET_ALL	0	/* reset SCSI bus, host adapter, everything */
44#define	RESET_TARGET	1	/* reset SCSI target */
45#define	RESET_BUS	2	/* reset SCSI bus only */
46#define	RESET_LUN	3	/* reset SCSI logical unit */
47
48/*
49 * Defines for scsi_reset_notify flag, to register or cancel
50 * the notification of external and internal SCSI bus resets.
51 */
52#define	SCSI_RESET_NOTIFY	0x01	/* register the reset notification */
53#define	SCSI_RESET_CANCEL	0x02	/* cancel the reset notification */
54
55/*
56 * Define for scsi_get_name string length.
57 * This is needed because MAXNAMELEN is not part of DDI.
58 */
59#define	SCSI_MAXNAMELEN		MAXNAMELEN
60
61/*
62 * Property for customizing hotplug procedure
63 */
64#define	SCSI_NO_QUIESCE	"scsi-no-quiesce"
65
66#ifdef	_KERNEL
67
68/*
69 * Kernel function declarations
70 */
71
72/*
73 * Capabilities functions
74 */
75int	scsi_ifgetcap(struct scsi_address *ap, char *cap, int whom);
76int	scsi_ifsetcap(struct scsi_address *ap, char *cap, int value, int whom);
77
78/*
79 * Abort and Reset functions
80 */
81int	scsi_abort(struct scsi_address *ap, struct scsi_pkt *pkt);
82int	scsi_reset(struct scsi_address *ap, int level);
83int	scsi_reset_notify(struct scsi_address *ap, int flag,
84	    void (*callback)(caddr_t), caddr_t arg);
85int	scsi_clear_task_set(struct scsi_address *ap);
86int	scsi_terminate_task(struct scsi_address *ap, struct scsi_pkt *pkt);
87
88/*
89 * Other functions
90 */
91int	scsi_clear_aca(struct scsi_address *ap);
92int	scsi_ua_get_reportdev(struct scsi_device *sd, char *ba, int len);
93int	scsi_ua_get(struct scsi_device *sd, char *ua, int len);
94#endif	/* _KERNEL */
95
96#ifdef	__cplusplus
97}
98#endif
99
100#endif	/* _SYS_SCSI_SCSI_CTL_H */
101