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 2014 Garrett D'Amore <garrett@damore.org> 24 * 25 * Copyright (c) 1998 by Sun Microsystems, Inc. 26 * All rights reserved. 27 */ 28 29 #ifndef _SYS_SCSI_RESET_NOTIFY_H 30 #define _SYS_SCSI_RESET_NOTIFY_H 31 32 #include <sys/note.h> 33 #include <sys/scsi/scsi_types.h> 34 35 #ifdef __cplusplus 36 extern "C" { 37 #endif 38 39 /* 40 * SCSI Control Information for Reset Notification. 41 */ 42 43 /* 44 * adapter drivers use the following structure to record the notification 45 * requests from target drivers. 46 */ 47 struct scsi_reset_notify_entry { 48 struct scsi_address *ap; 49 void (*callback)(caddr_t); 50 caddr_t arg; 51 struct scsi_reset_notify_entry *next; 52 }; 53 54 #ifdef __lock_lint 55 _NOTE(SCHEME_PROTECTS_DATA("protected by lock passed as arg", 56 scsi_reset_notify_entry::ap 57 scsi_reset_notify_entry::callback 58 scsi_reset_notify_entry::arg 59 scsi_reset_notify_entry::next)) 60 #endif 61 62 #ifdef _KERNEL 63 extern int scsi_hba_reset_notify_setup(struct scsi_address *, int, 64 void (*)(caddr_t), caddr_t, kmutex_t *, 65 struct scsi_reset_notify_entry **); 66 extern void scsi_hba_reset_notify_tear_down( 67 struct scsi_reset_notify_entry *listp); 68 extern void scsi_hba_reset_notify_callback(kmutex_t *mutex, 69 struct scsi_reset_notify_entry **listp); 70 71 #endif /* _KERNEL */ 72 73 #ifdef __cplusplus 74 } 75 #endif 76 77 #endif /* _SYS_SCSI_RESET_NOTIFY_H */