Home | History | Annotate | Line # | Download | only in mmcformat
      1 /* $NetBSD: uscsilib_machdep.h,v 1.1 2008/05/14 16:49:48 reinoud Exp $ */
      2 
      3 /*
      4  * Copyright (c) 2003, 2004, 2005, 2006, 2008 Reinoud Zandijk
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  *
     16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     17  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     18  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     19  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     20  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     21  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     25  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     26  *
     27  */
     28 
     29 #ifndef _USCSILIB_MACHDEP_H_
     30 #define _USCSILIB_MACHDEP_H_
     31 
     32 #ifndef _DEV_SCSIPI_SCSIPI_ALL_H_
     33 #	define SSD_KEY         0x0F
     34 #	define SSD_ILI         0x20
     35 #	define SSD_EOM         0x40
     36 #	define SSD_FILEMARK    0x80
     37 #	define SKEY_NO_SENSE           0x00
     38 #	define SKEY_RECOVERED_ERROR    0x01
     39 #	define SKEY_NOT_READY          0x02
     40 #	define SKEY_MEDIUM_ERROR       0x03
     41 #	define SKEY_HARDWARE_ERROR     0x04
     42 #	define SKEY_ILLEGAL_REQUEST    0x05
     43 #	define SKEY_UNIT_ATTENTION     0x06
     44 #	define SKEY_WRITE_PROTECT      0x07
     45 #	define SKEY_BLANK_CHECK        0x08
     46 #	define SKEY_VENDOR_UNIQUE      0x09
     47 #	define SKEY_COPY_ABORTED       0x0A
     48 #	define SKEY_ABORTED_COMMAND    0x0B
     49 #	define SKEY_EQUAL              0x0C
     50 #	define SKEY_VOLUME_OVERFLOW    0x0D
     51 #	define SKEY_MISCOMPARE         0x0E
     52 #	define SKEY_RESERVED           0x0F
     53 #endif
     54 
     55 
     56 #ifndef SCSI
     57 #	define SCSI_READCMD  0
     58 #	define SCSI_WRITECMD 0
     59 struct scsi_addr;
     60 int    scsilib_verbose;
     61 #endif
     62 
     63 
     64 #ifdef USCSI_SCSIPI
     65 #	include <sys/scsiio.h>
     66 #	define SCSI_READCMD   SCCMD_READ
     67 #	define SCSI_WRITECMD  SCCMD_WRITE
     68 #	define SCSI_NODATACMD SCCMD_WRITE
     69 #endif
     70 
     71 
     72 #ifdef USCSI_LINUX_SCSI
     73 #	include <scsi/sg.h>
     74 #	define SCSI_READCMD   SG_DXFER_FROM_DEV
     75 #	define SCSI_WRITECMD  SG_DXFER_TO_DEV
     76 #	define SCSI_NODATACMD SC_DXFER_NONE
     77 #endif
     78 
     79 
     80 #ifdef USCSI_FREEBSD_CAM
     81 #	include <camlib.h>
     82 #	include <cam/scsi/scsi_message.h>
     83 #	define SCSI_READCMD	1
     84 #	define SCSI_WRITECMD	2
     85 #	define SCSI_NODATACMD	0
     86 #endif
     87 
     88 
     89 #endif /* _USCSILIB_MACHDEP_H_ */
     90 
     91