xref: /titanic_51/usr/src/uts/common/sys/scsi/scsi_ctl.h (revision 4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*4c06356bSdh142964  * Common Development and Distribution License (the "License").
6*4c06356bSdh142964  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*4c06356bSdh142964  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_SYS_SCSI_SCSI_CTL_H
277c478bd9Sstevel@tonic-gate #define	_SYS_SCSI_SCSI_CTL_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #include <sys/scsi/scsi_types.h>
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
327c478bd9Sstevel@tonic-gate extern "C" {
337c478bd9Sstevel@tonic-gate #endif
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate /*
367c478bd9Sstevel@tonic-gate  * SCSI Control Information
377c478bd9Sstevel@tonic-gate  *
387c478bd9Sstevel@tonic-gate  * Defines for stating level of reset.
397c478bd9Sstevel@tonic-gate  * RESET_ALL, RESET_TARGET, and RESET_LUN defined for tran_reset (invoked
407c478bd9Sstevel@tonic-gate  * by target/ioctl)
417c478bd9Sstevel@tonic-gate  * RESET_BUS defined for tran_bus_reset (invoked by ioctl)
427c478bd9Sstevel@tonic-gate  */
437c478bd9Sstevel@tonic-gate #define	RESET_ALL	0	/* reset SCSI bus, host adapter, everything */
447c478bd9Sstevel@tonic-gate #define	RESET_TARGET	1	/* reset SCSI target */
457c478bd9Sstevel@tonic-gate #define	RESET_BUS	2	/* reset SCSI bus only */
467c478bd9Sstevel@tonic-gate #define	RESET_LUN	3	/* reset SCSI logical unit */
477c478bd9Sstevel@tonic-gate 
487c478bd9Sstevel@tonic-gate /*
497c478bd9Sstevel@tonic-gate  * Defines for scsi_reset_notify flag, to register or cancel
507c478bd9Sstevel@tonic-gate  * the notification of external and internal SCSI bus resets.
517c478bd9Sstevel@tonic-gate  */
527c478bd9Sstevel@tonic-gate #define	SCSI_RESET_NOTIFY	0x01	/* register the reset notification */
537c478bd9Sstevel@tonic-gate #define	SCSI_RESET_CANCEL	0x02	/* cancel the reset notification */
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate /*
567c478bd9Sstevel@tonic-gate  * Define for scsi_get_name string length.
577c478bd9Sstevel@tonic-gate  * This is needed because MAXNAMELEN is not part of DDI.
587c478bd9Sstevel@tonic-gate  */
597c478bd9Sstevel@tonic-gate #define	SCSI_MAXNAMELEN		MAXNAMELEN
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate /*
627c478bd9Sstevel@tonic-gate  * Property for customizing hotplug procedure
637c478bd9Sstevel@tonic-gate  */
647c478bd9Sstevel@tonic-gate #define	SCSI_NO_QUIESCE	"scsi-no-quiesce"
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
677c478bd9Sstevel@tonic-gate 
687c478bd9Sstevel@tonic-gate /*
697c478bd9Sstevel@tonic-gate  * Kernel function declarations
707c478bd9Sstevel@tonic-gate  */
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate /*
737c478bd9Sstevel@tonic-gate  * Capabilities functions
747c478bd9Sstevel@tonic-gate  */
751e32c0dcScth int	scsi_ifgetcap(struct scsi_address *ap, char *cap, int whom);
761e32c0dcScth int	scsi_ifsetcap(struct scsi_address *ap, char *cap, int value, int whom);
777c478bd9Sstevel@tonic-gate 
787c478bd9Sstevel@tonic-gate /*
797c478bd9Sstevel@tonic-gate  * Abort and Reset functions
807c478bd9Sstevel@tonic-gate  */
811e32c0dcScth int	scsi_abort(struct scsi_address *ap, struct scsi_pkt *pkt);
821e32c0dcScth int	scsi_reset(struct scsi_address *ap, int level);
831e32c0dcScth int	scsi_reset_notify(struct scsi_address *ap, int flag,
847c478bd9Sstevel@tonic-gate 	    void (*callback)(caddr_t), caddr_t arg);
851e32c0dcScth int	scsi_clear_task_set(struct scsi_address *ap);
861e32c0dcScth int	scsi_terminate_task(struct scsi_address *ap, struct scsi_pkt *pkt);
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate /*
897c478bd9Sstevel@tonic-gate  * Other functions
907c478bd9Sstevel@tonic-gate  */
911e32c0dcScth int	scsi_clear_aca(struct scsi_address *ap);
92*4c06356bSdh142964 int	scsi_ua_get_reportdev(struct scsi_device *sd, char *ba, int len);
93*4c06356bSdh142964 int	scsi_ua_get(struct scsi_device *sd, char *ua, int len);
947c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
957c478bd9Sstevel@tonic-gate 
967c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
977c478bd9Sstevel@tonic-gate }
987c478bd9Sstevel@tonic-gate #endif
997c478bd9Sstevel@tonic-gate 
1007c478bd9Sstevel@tonic-gate #endif	/* _SYS_SCSI_SCSI_CTL_H */
101