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 2008 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 #ifndef _SD_IO_H
  27 #define _SD_IO_H
  28 
  29 #ifdef __cplusplus
  30 extern "C" {
  31 #endif
  32 
  33 #define SGIO_MAX 254
  34 
  35 #define _SD_IO_NONE     0
  36 #define _SD_IO_INITIATE 1
  37 #define _SD_IO_DONE     2
  38 #define _SD_IO_FAILED   3
  39 #define _SD_IO_DISCARDED   4
  40 
  41 #define _SD_WRITER_NONE    0
  42 #define _SD_WRITER_CREATE  1
  43 #define _SD_WRITER_RUNNING 2
  44 
  45 #ifdef _KERNEL
  46 
  47 extern kcondvar_t _sd_flush_cv;
  48 /* secret flush toggle flag for testing */
  49 extern int _sdbc_flush_flag;            /* 0 ==> noflushing, 1 ==> flush */
  50 
  51 
  52 extern int _sdbc_flush_configure(void);
  53 extern void _sdbc_flush_deconfigure(void);
  54 extern void _sd_async_flclist(_sd_cctl_t *cclist, dev_t rdev);
  55 extern void _sd_enqueue_io_pending(int cd, _sd_cctl_t *cclist);
  56 extern void _sd_async_flcent(_sd_cctl_t *cc_ent, dev_t rdev);
  57 extern int _sd_process_failure(_sd_cctl_t *cc_ent);
  58 extern int cd_writer(int cd);
  59 extern void _sd_ccent_rd(_sd_cctl_t *cc_ent, uint_t wanted, buf_t *bp);
  60 extern int _sdbc_wait_pending(void);
  61 
  62 #endif /* _KERNEL */
  63 
  64 #ifdef __cplusplus
  65 }
  66 #endif
  67 
  68 #endif /* _SD_IO_H */